@coveo/quantic 3.25.0 → 3.25.1-pre.1b995035ea
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.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +10 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +12 -10
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +11 -9
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +9 -7
- package/package.json +2 -2
|
@@ -14,21 +14,21 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var m=r.next();return a=m.done,m},e:function(m){f=!0,i=m},f:function(){try{a||r.return==null||r.return()}finally{if(f)throw i}}}}function ki(){return ki=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Af(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},ki.apply(null,arguments)}function er(e){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},er(e)}function Cf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oi(e,t)}function tc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tc=function(){return!!e})()}function bf(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sf(e)}function Oi(e,t){return Oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oi(e,t)}function Af(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=er(e))!==null;);return e}function wf(e,t,r,n){var o=ki(er(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function xf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rf(e){var t=xf(e,"string");return typeof t=="symbol"?t:t+""}function Ef(e,t){if(e){if(typeof e=="string")return Js(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Js(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function If(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function Pf(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var ec=function(){function e(){Di(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Mi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var h=i[f];try{h.callback.call(n,r)}catch(y){Promise.resolve().then(function(){throw y})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},f=0,m=i.length;f<m;f++)a();return!r.defaultPrevented}}}])}(),qi=function(e){function t(){var r;return Di(this,t),r=vf(this,t),r.listeners||ec.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return Cf(t,e),Mi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),wf(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new qn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new qn;function i(){o.abort(this.reason),a()}function a(){var h=Zs(n),y;try{for(h.s();!(y=h.n()).done;){var S=y.value;S.removeEventListener("abort",i)}}catch(g){h.e(g)}finally{h.f()}}var f=Zs(n),m;try{for(f.s();!(m=f.n()).done;){var p=m.value;if(p.aborted){o.abort(p.reason);break}else p.addEventListener("abort",i)}}catch(h){f.e(h)}finally{f.f()}return o.signal}}])}(ec),qn=function(){function e(){Di(this,e),Object.defineProperty(this,"signal",{value:new qi,writable:!0,configurable:!0})}return Mi(e,[{key:"abort",value:function(r){var n=Pf(r),o=If(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(qn.prototype[Symbol.toStringTag]="AbortController",qi.prototype[Symbol.toStringTag]="AbortSignal");function Tf(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Ff(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,f=a===void 0?!1:a;if(!Tf({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:f}))return{fetch:r,Request:m};var m=o;(m&&!m.prototype.hasOwnProperty("signal")||f)&&(m=function(S,g){var v;g&&g.signal&&(v=g.signal,delete g.signal);var R=new o(S,g);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},m.prototype=o.prototype);var p=r,h=function(S,g){var v=m&&m.prototype.isPrototypeOf(S)?S.signal:g?g.signal:void 0;if(v){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(v.aborted)return Promise.reject(R);var P=new Promise(function(x,T){v.addEventListener("abort",function(){return T(R)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([P,p(S,g)])}return p(S,g)};return{fetch:h,Request:m}}zr.AbortController=qn;zr.AbortSignal=qi;zr.abortableFetch=Ff});var rc,s,b,l=Hr(()=>{"use strict";rc=Qe(Ni(),1),s=Qe(Ni(),1),{fetch:b}=(0,rc.abortableFetch)({fetch})});function Wr(e){if(Lf.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function _i(e){return e.replace(Uf,"")}function Gr(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!Bf(r))return!1}return!0}function Bf(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function oc(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var kf,uc,Of,lc,Df,Mf,qf,Nf,_f,Vf,jf,Lf,nc,Uf,tr,Vi,ic,ac,sc,cc,A,pc=Hr(()=>{"use strict";d();c();l();u();kf=Object.create,uc=Object.defineProperty,Of=Object.getOwnPropertyDescriptor,lc=Object.getOwnPropertyNames,Df=Object.getPrototypeOf,Mf=Object.prototype.hasOwnProperty,qf=(e,t)=>function(){return t||(0,e[lc(e)[0]])((t={exports:{}}).exports,t),t.exports},Nf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lc(t))!Mf.call(e,o)&&o!==r&&uc(e,o,{get:()=>t[o],enumerable:!(n=Of(t,o))||n.enumerable});return e},_f=(e,t,r)=>(r=e!=null?kf(Df(e)):{},Nf(t||!e||!e.__esModule?uc(r,"default",{value:e,enumerable:!0}):r,e)),Vf=qf({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(m){return typeof m=="string"&&!!m.trim()}function o(m,p){var h=m.split(";").filter(n),y=h.shift(),S=i(y),g=S.name,v=S.value;p=p?Object.assign({},r,p):r;try{v=p.decodeValues?decodeURIComponent(v):v}catch(P){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",P)}var R={name:g,value:v};return h.forEach(function(P){var x=P.split("="),T=x.shift().trimLeft().toLowerCase(),w=x.join("=");T==="expires"?R.expires=new Date(w):T==="max-age"?R.maxAge=parseInt(w,10):T==="secure"?R.secure=!0:T==="httponly"?R.httpOnly=!0:T==="samesite"?R.sameSite=w:R[T]=w}),R}function i(m){var p="",h="",y=m.split("=");return y.length>1?(p=y.shift(),h=y.join("=")):h=m,{name:p,value:h}}function a(m,p){if(p=p?Object.assign({},r,p):r,!m)return p.map?{}:[];if(m.headers)if(typeof m.headers.getSetCookie=="function")m=m.headers.getSetCookie();else if(m.headers["set-cookie"])m=m.headers["set-cookie"];else{var h=m.headers[Object.keys(m.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!h&&m.headers.cookie&&!p.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),m=h}if(Array.isArray(m)||(m=[m]),p=p?Object.assign({},r,p):r,p.map){var y={};return m.filter(n).reduce(function(S,g){var v=o(g,p);return S[v.name]=v,S},y)}else return m.filter(n).map(function(S){return o(S,p)})}function f(m){if(Array.isArray(m))return m;if(typeof m!="string")return[];var p=[],h=0,y,S,g,v,R;function P(){for(;h<m.length&&/\s/.test(m.charAt(h));)h+=1;return h<m.length}function x(){return S=m.charAt(h),S!=="="&&S!==";"&&S!==","}for(;h<m.length;){for(y=h,R=!1;P();)if(S=m.charAt(h),S===","){for(g=h,h+=1,P(),v=h;h<m.length&&x();)h+=1;h<m.length&&m.charAt(h)==="="?(R=!0,h=v,p.push(m.substring(y,g)),y=h):h=g+1}else h+=1;(!R||h>=m.length)&&p.push(m.substring(y,m.length))}return p}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=f}}),jf=_f(Vf()),Lf=/[^a-z0-9\-#$%&'*+.^_`|~]/i;nc=[`
|
|
19
|
-
`,"\r","\t"," "],Uf=new RegExp(`(^[${nc.join("")}]|$[${nc.join("")}])`,"g");tr=Symbol("normalizedHeaders"),Vi=Symbol("rawHeaderNames"),ic=", ",A=class dc{constructor(t){this[ac]={},this[sc]=new Map,this[cc]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof dc||typeof C.Headers<"u"&&t instanceof C.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(ic):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(ic):n)})}[(ac=tr,sc=Vi,cc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[tr]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Gr(t))throw new TypeError(`Invalid header name "${t}"`);return this[tr].hasOwnProperty(Wr(t))}get(t){if(!Gr(t))throw TypeError(`Invalid header name "${t}"`);return this[tr][Wr(t)]??null}set(t,r){if(!Gr(t)||!oc(r))return;let n=Wr(t),o=_i(r);this[tr][n]=_i(o),this[Vi].set(n,t)}append(t,r){if(!Gr(t)||!oc(r))return;let n=Wr(t),o=_i(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Gr(t)||!this.has(t))return;let r=Wr(t);delete this[tr][r],this[Vi].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,jf.splitCookiesString)(t)}}});var d=Hr(()=>{"use strict";pc()});var wc=Se(Jr=>{"use strict";d();c();l();u();var Ln=Jr&&Jr.__assign||function(){return Ln=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},Ln.apply(this,arguments)};Object.defineProperty(Jr,"__esModule",{value:!0});var rm={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function nm(e){var t=Ln(Ln({},rm),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Jr.getSanitizedOptions=nm});var xc=Se(Bi=>{"use strict";d();c();l();u();Object.defineProperty(Bi,"__esModule",{value:!0});function om(e){var t=Math.random()*e;return Math.round(t)}Bi.fullJitter=om});var Rc=Se(Qi=>{"use strict";d();c();l();u();Object.defineProperty(Qi,"__esModule",{value:!0});function im(e){return e}Qi.noJitter=im});var Ec=Se($i=>{"use strict";d();c();l();u();Object.defineProperty($i,"__esModule",{value:!0});var am=xc(),sm=Rc();function cm(e){switch(e.jitter){case"full":return am.fullJitter;case"none":default:return sm.noJitter}}$i.JitterFactory=cm});var zi=Se(Hi=>{"use strict";d();c();l();u();Object.defineProperty(Hi,"__esModule",{value:!0});var um=Ec(),lm=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=um.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}();Hi.Delay=lm});var Ic=Se(nt=>{"use strict";d();c();l();u();var dm=nt&&nt.__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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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)}}(),pm=nt&&nt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(h){try{p(n.next(h))}catch(y){a(y)}}function m(h){try{p(n.throw(h))}catch(y){a(y)}}function p(h){h.done?i(h.value):o(h.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},fm=nt&&nt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(h){return m([p,h])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(h){p=[6,h],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(nt,"__esModule",{value:!0});var mm=zi(),gm=function(e){dm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return pm(this,void 0,void 0,function(){return fm(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}(mm.Delay);nt.SkipFirstDelay=gm});var Pc=Se(Xr=>{"use strict";d();c();l();u();var hm=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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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(Xr,"__esModule",{value:!0});var ym=zi(),Sm=function(e){hm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ym.Delay);Xr.AlwaysDelay=Sm});var Tc=Se(Wi=>{"use strict";d();c();l();u();Object.defineProperty(Wi,"__esModule",{value:!0});var vm=Ic(),Cm=Pc();function bm(e,t){var r=Am(e);return r.setAttemptNumber(t),r}Wi.DelayFactory=bm;function Am(e){return e.delayFirstAttempt?new Cm.AlwaysDelay(e):new vm.SkipFirstDelay(e)}});var Fc=Se(Vt=>{"use strict";d();c();l();u();var Gi=Vt&&Vt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(h){try{p(n.next(h))}catch(y){a(y)}}function m(h){try{p(n.throw(h))}catch(y){a(y)}}function p(h){h.done?i(h.value):o(h.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},Ki=Vt&&Vt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(h){return m([p,h])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(h){p=[6,h],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(Vt,"__esModule",{value:!0});var wm=wc(),xm=Tc();function Rm(e,t){return t===void 0&&(t={}),Gi(this,void 0,void 0,function(){var r,n;return Ki(this,function(o){switch(o.label){case 0:return r=wm.getSanitizedOptions(t),n=new Em(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Vt.backOff=Rm;var Em=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Gi(this,void 0,void 0,function(){var t,r;return Ki(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 Gi(this,void 0,void 0,function(){var t;return Ki(this,function(r){switch(r.label){case 0:return t=xm.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Lo=Se((rs,ns)=>{"use strict";d();c();l();u();(function(e,t){typeof rs=="object"&&typeof ns<"u"?ns.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs=t()})(rs,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",f="day",m="week",p="month",h="quarter",y="year",S="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|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,P={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(U){var j=["th","st","nd","rd"],V=U%100;return"["+U+(j[(V-20)%10]||j[V]||j[0])+"]"}},x=function(U,j,V){var Q=String(U);return!Q||Q.length>=j?U:""+Array(j+1-Q.length).join(V)+U},T={s:x,z:function(U){var j=-U.utcOffset(),V=Math.abs(j),Q=Math.floor(V/60),L=V%60;return(j<=0?"+":"-")+x(Q,2,"0")+":"+x(L,2,"0")},m:function U(j,V){if(j.date()<V.date())return-U(V,j);var Q=12*(V.year()-j.year())+(V.month()-j.month()),L=j.clone().add(Q,p),z=V-L<0,W=j.clone().add(Q+(z?-1:1),p);return+(-(Q+(V-L)/(z?L-W:W-L))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:p,y,w:m,d:f,D:S,h:a,m:i,s:o,ms:n,Q:h}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},w="en",E={};E[w]=P;var N="$isDayjsObject",k=function(U){return U instanceof _||!(!U||!U[N])},I=function U(j,V,Q){var L;if(!j)return w;if(typeof j=="string"){var z=j.toLowerCase();E[z]&&(L=z),V&&(E[z]=V,L=z);var W=j.split("-");if(!L&&W.length>1)return U(W[0])}else{var Y=j.name;E[Y]=j,L=Y}return!Q&&L&&(w=L),L||!Q&&w},F=function(U,j){if(k(U))return U.clone();var V=typeof j=="object"?j:{};return V.date=U,V.args=arguments,new _(V)},O=T;O.l=I,O.i=k,O.w=function(U,j){return F(U,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var _=function(){function U(V){this.$L=I(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[N]=!0}var j=U.prototype;return j.parse=function(V){this.$d=function(Q){var L=Q.date,z=Q.utc;if(L===null)return new Date(NaN);if(O.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var W=L.match(v);if(W){var Y=W[2]-1||0,re=(W[7]||"0").substring(0,3);return z?new Date(Date.UTC(W[1],Y,W[3]||1,W[4]||0,W[5]||0,W[6]||0,re)):new Date(W[1],Y,W[3]||1,W[4]||0,W[5]||0,W[6]||0,re)}}return new Date(L)}(V),this.init()},j.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==g},j.isSame=function(V,Q){var L=F(V);return this.startOf(Q)<=L&&L<=this.endOf(Q)},j.isAfter=function(V,Q){return F(V)<this.startOf(Q)},j.isBefore=function(V,Q){return this.endOf(Q)<F(V)},j.$g=function(V,Q,L){return O.u(V)?this[Q]:this.set(L,V)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(V,Q){var L=this,z=!!O.u(Q)||Q,W=O.p(V),Y=function(ce,me){var ye=O.w(L.$u?Date.UTC(L.$y,me,ce):new Date(L.$y,me,ce),L);return z?ye:ye.endOf(f)},re=function(ce,me){return O.w(L.toDate()[ce].apply(L.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(me)),L)},se=this.$W,ee=this.$M,ne=this.$D,Z="set"+(this.$u?"UTC":"");switch(W){case y:return z?Y(1,0):Y(31,11);case p:return z?Y(1,ee):Y(0,ee+1);case m:var oe=this.$locale().weekStart||0,he=(se<oe?se+7:se)-oe;return Y(z?ne-he:ne+(6-he),ee);case f:case S:return re(Z+"Hours",0);case a:return re(Z+"Minutes",1);case i:return re(Z+"Seconds",2);case o:return re(Z+"Milliseconds",3);default:return this.clone()}},j.endOf=function(V){return this.startOf(V,!1)},j.$set=function(V,Q){var L,z=O.p(V),W="set"+(this.$u?"UTC":""),Y=(L={},L[f]=W+"Date",L[S]=W+"Date",L[p]=W+"Month",L[y]=W+"FullYear",L[a]=W+"Hours",L[i]=W+"Minutes",L[o]=W+"Seconds",L[n]=W+"Milliseconds",L)[z],re=z===f?this.$D+(Q-this.$W):Q;if(z===p||z===y){var se=this.clone().set(S,1);se.$d[Y](re),se.init(),this.$d=se.set(S,Math.min(this.$D,se.daysInMonth())).$d}else Y&&this.$d[Y](re);return this.init(),this},j.set=function(V,Q){return this.clone().$set(V,Q)},j.get=function(V){return this[O.p(V)]()},j.add=function(V,Q){var L,z=this;V=Number(V);var W=O.p(Q),Y=function(ee){var ne=F(z);return O.w(ne.date(ne.date()+Math.round(ee*V)),z)};if(W===p)return this.set(p,this.$M+V);if(W===y)return this.set(y,this.$y+V);if(W===f)return Y(1);if(W===m)return Y(7);var re=(L={},L[i]=t,L[a]=r,L[o]=e,L)[W]||1,se=this.$d.getTime()+V*re;return O.w(se,this)},j.subtract=function(V,Q){return this.add(-1*V,Q)},j.format=function(V){var Q=this,L=this.$locale();if(!this.isValid())return L.invalidDate||g;var z=V||"YYYY-MM-DDTHH:mm:ssZ",W=O.z(this),Y=this.$H,re=this.$m,se=this.$M,ee=L.weekdays,ne=L.months,Z=L.meridiem,oe=function(me,ye,Te,je){return me&&(me[ye]||me(Q,z))||Te[ye].slice(0,je)},he=function(me){return O.s(Y%12||12,me,"0")},ce=Z||function(me,ye,Te){var je=me<12?"AM":"PM";return Te?je.toLowerCase():je};return z.replace(R,function(me,ye){return ye||function(Te){switch(Te){case"YY":return String(Q.$y).slice(-2);case"YYYY":return O.s(Q.$y,4,"0");case"M":return se+1;case"MM":return O.s(se+1,2,"0");case"MMM":return oe(L.monthsShort,se,ne,3);case"MMMM":return oe(ne,se);case"D":return Q.$D;case"DD":return O.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return oe(L.weekdaysMin,Q.$W,ee,2);case"ddd":return oe(L.weekdaysShort,Q.$W,ee,3);case"dddd":return ee[Q.$W];case"H":return String(Y);case"HH":return O.s(Y,2,"0");case"h":return he(1);case"hh":return he(2);case"a":return ce(Y,re,!0);case"A":return ce(Y,re,!1);case"m":return String(re);case"mm":return O.s(re,2,"0");case"s":return String(Q.$s);case"ss":return O.s(Q.$s,2,"0");case"SSS":return O.s(Q.$ms,3,"0");case"Z":return W}return null}(me)||W.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(V,Q,L){var z,W=this,Y=O.p(Q),re=F(V),se=(re.utcOffset()-this.utcOffset())*t,ee=this-re,ne=function(){return O.m(W,re)};switch(Y){case y:z=ne()/12;break;case p:z=ne();break;case h:z=ne()/3;break;case m:z=(ee-se)/6048e5;break;case f:z=(ee-se)/864e5;break;case a:z=ee/r;break;case i:z=ee/t;break;case o:z=ee/e;break;default:z=ee}return L?z:O.a(z)},j.daysInMonth=function(){return this.endOf(p).$D},j.$locale=function(){return E[this.$L]},j.locale=function(V,Q){if(!V)return this.$L;var L=this.clone(),z=I(V,Q,!0);return z&&(L.$L=z),L},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},U}(),$=_.prototype;return F.prototype=$,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",f],["$M",p],["$y",y],["$D",S]].forEach(function(U){$[U[1]]=function(j){return this.$g(j,U[0],U[1])}}),F.extend=function(U,j){return U.$i||(U(j,_,F),U.$i=!0),F},F.locale=I,F.isDayjs=k,F.unix=function(U){return F(1e3*U)},F.en=E[w],F.Ls=E,F.p={},F})});var Ml=Se((os,is)=>{"use strict";d();c();l();u();(function(e,t){typeof os=="object"&&typeof is<"u"?is.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_quarterOfYear=t()})(os,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(f){return this.$utils().u(f)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(f-1))};var i=o.add;o.add=function(f,m){return f=Number(f),this.$utils().p(m)===t?this.add(3*f,e):i.bind(this)(f,m)};var a=o.startOf;o.startOf=function(f,m){var p=this.$utils(),h=!!p.u(m)||m;if(p.p(f)===t){var y=this.quarter()-1;return h?this.month(3*y).startOf(e).startOf("day"):this.month(3*y+2).endOf(e).endOf("day")}return a.bind(this)(f,m)}}})});var ql=Se((as,ss)=>{"use strict";d();c();l();u();(function(e,t){typeof as=="object"&&typeof ss<"u"?ss.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_customParseFormat=t()})(as,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?/,i=/\d*[^-_:/,()\s\d]+/,a={},f=function(v){return(v=+v)+(v>68?1900:2e3)},m=function(v){return function(R){this[v]=+R}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var P=R.match(/([+-]|\d\d)/g),x=60*P[1]+(+P[2]||0);return x===0?0:P[0]==="+"?-x:x}(v)}],h=function(v){var R=a[v];return R&&(R.indexOf?R:R.s.concat(R.f))},y=function(v,R){var P,x=a.meridiem;if(x){for(var T=1;T<=24;T+=1)if(v.indexOf(x(T,0,R))>-1){P=T>12;break}}else P=v===(R?"pm":"PM");return P},S={A:[i,function(v){this.afternoon=y(v,!1)}],a:[i,function(v){this.afternoon=y(v,!0)}],Q:[r,function(v){this.month=3*(v-1)+1}],S:[r,function(v){this.milliseconds=100*+v}],SS:[n,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,m("seconds")],ss:[o,m("seconds")],m:[o,m("minutes")],mm:[o,m("minutes")],H:[o,m("hours")],h:[o,m("hours")],HH:[o,m("hours")],hh:[o,m("hours")],D:[o,m("day")],DD:[n,m("day")],Do:[i,function(v){var R=a.ordinal,P=v.match(/\d+/);if(this.day=P[0],R)for(var x=1;x<=31;x+=1)R(x).replace(/\[|\]/g,"")===v&&(this.day=x)}],w:[o,m("week")],ww:[n,m("week")],M:[o,m("month")],MM:[n,m("month")],MMM:[i,function(v){var R=h("months"),P=(h("monthsShort")||R.map(function(x){return x.slice(0,3)})).indexOf(v)+1;if(P<1)throw new Error;this.month=P%12||P}],MMMM:[i,function(v){var R=h("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,m("year")],YY:[n,function(v){this.year=f(v)}],YYYY:[/\d{4}/,m("year")],Z:p,ZZ:p};function g(v){var R,P;R=v,P=a&&a.formats;for(var x=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(F,O,_){var $=_&&_.toUpperCase();return O||P[_]||e[_]||P[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,j,V){return j||V.slice(1)})})).match(t),T=x.length,w=0;w<T;w+=1){var E=x[w],N=S[E],k=N&&N[0],I=N&&N[1];x[w]=I?{regex:k,parser:I}:E.replace(/^\[|\]$/g,"")}return function(F){for(var O={},_=0,$=0;_<T;_+=1){var U=x[_];if(typeof U=="string")$+=U.length;else{var j=U.regex,V=U.parser,Q=F.slice($),L=j.exec(Q)[0];V.call(O,L),F=F.replace(L,"")}}return function(z){var W=z.afternoon;if(W!==void 0){var Y=z.hours;W?Y<12&&(z.hours+=12):Y===12&&(z.hours=0),delete z.afternoon}}(O),O}}return function(v,R,P){P.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(f=v.parseTwoDigitYear);var x=R.prototype,T=x.parse;x.parse=function(w){var E=w.date,N=w.utc,k=w.args;this.$u=N;var I=k[1];if(typeof I=="string"){var F=k[2]===!0,O=k[3]===!0,_=F||O,$=k[2];O&&($=k[2]),a=this.$locale(),!F&&$&&(a=P.Ls[$]),this.$d=function(Q,L,z,W){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*Q);var Y=g(L)(Q),re=Y.year,se=Y.month,ee=Y.day,ne=Y.hours,Z=Y.minutes,oe=Y.seconds,he=Y.milliseconds,ce=Y.zone,me=Y.week,ye=new Date,Te=ee||(re||se?1:ye.getDate()),je=re||ye.getFullYear(),ft=0;re&&!se||(ft=se>0?se-1:ye.getMonth());var Xt,Zt=ne||0,Qr=Z||0,Ti=oe||0,Fi=he||0;return ce?new Date(Date.UTC(je,ft,Te,Zt,Qr,Ti,Fi+60*ce.offset*1e3)):z?new Date(Date.UTC(je,ft,Te,Zt,Qr,Ti,Fi)):(Xt=new Date(je,ft,Te,Zt,Qr,Ti,Fi),me&&(Xt=W(Xt).week(me).toDate()),Xt)}catch{return new Date("")}}(E,I,N,P),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),_&&E!=this.format(I)&&(this.$d=new Date("")),a={}}else if(I instanceof Array)for(var U=I.length,j=1;j<=U;j+=1){k[1]=I[j-1];var V=P.apply(this,k);if(V.isValid()){this.$d=V.$d,this.$L=V.$L,this.init();break}j===U&&(this.$d=new Date(""))}else T.call(this,w)}}})});var Md=Se((Is,Ps)=>{"use strict";d();c();l();u();(function(e,t){typeof Is=="object"&&typeof Ps<"u"?Ps.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_timezone=t()})(Is,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(h,y,S){S===void 0&&(S={});var g=new Date(h),v=function(R,P){P===void 0&&(P={});var x=P.timeZoneName||"short",T=R+"|"+x,w=t[T];return w||(w=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:R,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),t[T]=w),w}(y,S);return v.formatToParts(g)},f=function(h,y){for(var S=a(h,y),g=[],v=0;v<S.length;v+=1){var R=S[v],P=R.type,x=R.value,T=e[P];T>=0&&(g[T]=parseInt(x,10))}var w=g[3],E=w===24?0:w,N=g[0]+"-"+g[1]+"-"+g[2]+" "+E+":"+g[4]+":"+g[5]+":000",k=+h;return(o.utc(N).valueOf()-(k-=k%1e3))/6e4},m=n.prototype;m.tz=function(h,y){h===void 0&&(h=i);var S,g=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:h}),P=Math.round((v-new Date(R))/1e3/60),x=15*-Math.round(v.getTimezoneOffset()/15)-P;if(!Number(x))S=this.utcOffset(0,y);else if(S=o(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),y){var T=S.utcOffset();S=S.add(g-T,"minute")}return S.$x.$timezone=h,S},m.offsetName=function(h){var y=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),y,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return S&&S.value};var p=m.startOf;m.startOf=function(h,y){if(!this.$x||!this.$x.$timezone)return p.call(this,h,y);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(S,h,y).tz(this.$x.$timezone,!0)},o.tz=function(h,y,S){var g=S&&y,v=S||y||i,R=f(+o(),v);if(typeof h!="string")return o(h).tz(v);var P=function(E,N,k){var I=E-60*N*1e3,F=f(I,k);if(N===F)return[I,N];var O=f(I-=60*(F-N)*1e3,k);return F===O?[I,F]:[E-60*Math.min(F,O)*1e3,Math.max(F,O)]}(o.utc(h,g).valueOf(),R,v),x=P[0],T=P[1],w=o(x).utcOffset(T);return w.$x.$timezone=v,w},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}})});var qd=Se((Ts,Fs)=>{"use strict";d();c();l();u();(function(e,t){typeof Ts=="object"&&typeof Fs<"u"?Fs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_utc=t()})(Ts,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var v={date:g,utc:!0,args:arguments};return new o(v)},a.utc=function(g){var v=i(this.toDate(),{locale:this.$L,utc:!0});return g?v.add(this.utcOffset(),e):v},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var f=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),f.call(this,g)};var m=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else m.call(this)};var p=a.utcOffset;a.utcOffset=function(g,v){var R=this.$utils().u;if(R(g))return this.$u?0:R(this.$offset)?p.call(this):this.$offset;if(typeof g=="string"&&(g=function(w){w===void 0&&(w="");var E=w.match(t);if(!E)return null;var N=(""+E[0]).match(r)||["-",0,0],k=N[0],I=60*+N[1]+ +N[2];return I===0?0:k==="+"?I:-I}(g),g===null))return this;var P=Math.abs(g)<=16?60*g:g,x=this;if(v)return x.$offset=P,x.$u=g===0,x;if(g!==0){var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(P+T,e)).$offset=P,x.$x.$localOffset=T}else x=this.utc();return x};var h=a.format;a.format=function(g){var v=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var y=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var S=a.diff;a.diff=function(g,v,R){if(g&&this.$u===g.$u)return S.call(this,g,v,R);var P=this.local(),x=i(g).local();return S.call(P,x,v,R)}}})});var Gd=Se((tL,Wd)=>{"use strict";d();c();l();u();function Ev(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Wd.exports=Iv;function Iv(e,t,r){var n=r&&r.stringify||Ev,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var f=1;f<i;f++)a[f]=n(t[f]);return a.join(" ")}if(typeof e!="string")return e;var m=t.length;if(m===0)return e;for(var p="",h=1-o,y=-1,S=e&&e.length||0,g=0;g<S;){if(e.charCodeAt(g)===37&&g+1<S){switch(y=y>-1?y:0,e.charCodeAt(g+1)){case 100:case 102:if(h>=m||t[h]==null)break;y<g&&(p+=e.slice(y,g)),p+=Number(t[h]),y=g+2,g++;break;case 105:if(h>=m||t[h]==null)break;y<g&&(p+=e.slice(y,g)),p+=Math.floor(Number(t[h])),y=g+2,g++;break;case 79:case 111:case 106:if(h>=m||t[h]===void 0)break;y<g&&(p+=e.slice(y,g));var v=typeof t[h];if(v==="string"){p+="'"+t[h]+"'",y=g+2,g++;break}if(v==="function"){p+=t[h].name||"<anonymous>",y=g+2,g++;break}p+=n(t[h]),y=g+2,g++;break;case 115:if(h>=m)break;y<g&&(p+=e.slice(y,g)),p+=String(t[h]),y=g+2,g++;break;case 37:y<g&&(p+=e.slice(y,g)),p+="%",y=g+2,g++,h--;break}++h}++g}return y===-1?e:(y<S&&(p+=e.slice(y)),p)}});var ep=Se((aL,ei)=>{"use strict";d();c();l();u();var Kd=Gd();ei.exports=pt;var Pn=Bv().console||{},Pv={mapHttpRequest:Zo,mapHttpResponse:Zo,wrapRequestSerializer:Os,wrapResponseSerializer:Os,wrapErrorSerializer:Os,req:Zo,res:Zo,err:Jd,errWithCause:Jd};function Et(e,t){return e==="silent"?1/0:t.levels.values[e]}var qs=Symbol("pino.logFuncs"),Ds=Symbol("pino.hierarchy"),Tv={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Yd(e,t){let r={logger:t,parent:e[Ds]};t[Ds]=r}function Fv(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Pn[o]||Pn[Tv[o]||"log"]||qr}),e[qs]=n}function kv(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function pt(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||Pn;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=kv(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),f=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&f.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let m=e.level||"info",p=Object.create(r);p.log||(p.log=qr),Fv(p,f,r),Yd({},p),Object.defineProperty(p,"levelVal",{get:y}),Object.defineProperty(p,"level",{get:S,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:f,timestamp:jv(e),messageKey:e.messageKey||"msg",onChild:e.onChild||qr};p.levels=Ov(e),p.level=m,p.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},p.setMaxListeners=p.getMaxListeners=p.emit=p.addListener=p.on=p.prependListener=p.once=p.prependOnceListener=p.removeListener=p.removeAllListeners=p.listeners=p.listenerCount=p.eventNames=p.write=p.flush=qr,p.serializers=n,p._serialize=o,p._stdErrSerialize=i,p.child=function(...R){return v.call(this,h,...R)},t&&(p._logEvent=Ms());function y(){return Et(this.level,this)}function S(){return this._level}function g(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Gt(this,h,p,"error"),Gt(this,h,p,"fatal"),Gt(this,h,p,"warn"),Gt(this,h,p,"info"),Gt(this,h,p,"debug"),Gt(this,h,p,"trace"),a.forEach(P=>{Gt(this,h,p,P)})}function v(R,P,x){if(!P)throw new Error("missing bindings for child Pino");x=x||{},o&&P.serializers&&(x.serializers=P.serializers);let T=x.serializers;if(o&&T){var w=Object.assign({},n,T),E=e.browser.serialize===!0?Object.keys(w):o;delete P.serializers,Ns([P],E,w,this._stdErrSerialize)}function N(I){this._childLevel=(I._childLevel|0)+1,this.bindings=P,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=Ms([].concat(I._logEvent.bindings,P)))}N.prototype=this;let k=new N(this);return Yd(this,k),k.child=function(...I){return v.call(this,R,...I)},k.level=x.level||this.level,R.onChild(k),k}return p}function Ov(e){let t=e.customLevels||{},r=Object.assign({},pt.levels.values,t),n=Object.assign({},pt.levels.labels,Dv(t));return{values:r,labels:n}}function Dv(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}pt.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"}};pt.stdSerializers=Pv;pt.stdTimeFunctions=Object.assign({},{nullTime:Xd,epochTime:Zd,unixTime:Lv,isoTime:Uv});function Mv(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Ds];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Gt(e,t,r,n){if(Object.defineProperty(e,n,{value:Et(e.level,r)>Et(n,r)?qr:r[qs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===qr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Et(i,r);if(Et(n,r)<a)return}e[n]=Nv(e,t,r,n);let o=Mv(e);o.length!==0&&(e[n]=qv(o,e[n]))}function qv(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Nv(e,t,r,n){return function(o){return function(){let a=t.timestamp(),f=new Array(arguments.length),m=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Pn?Pn:this;for(var p=0;p<f.length;p++)f[p]=arguments[p];var h=!1;if(t.serialize&&(Ns(f,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(m,..._v(this,n,f,a,t)):o.apply(m,f),t.transmit){let y=t.transmit.level||e._level,S=Et(y,r),g=Et(n,r);if(g<S)return;Vv(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:y,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Et(e._level,r)},f,h)}}}(e[qs][n])}function _v(e,t,r,n,o){let{level:i,log:a=y=>y}=o.formatters||{},f=r.slice(),m=f[0],p={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(p.time=n),i){let y=i(t,e.levels.values[t]);Object.assign(p,y)}else p.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(m!==null&&typeof m=="object")for(;h--&&typeof f[0]=="object";)Object.assign(p,f.shift());return[a(p),...f]}else{if(m!==null&&typeof m=="object"){for(;h--&&typeof f[0]=="object";)Object.assign(p,f.shift());m=f.length?Kd(f.shift(),f):void 0}else typeof m=="string"&&(m=Kd(f.shift(),f));return m!==void 0&&(p[o.messageKey]=m),[a(p)]}}function Ns(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=pt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function Vv(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,f=t.methodValue,m=t.val,p=e._logEvent.bindings;n||Ns(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return p.indexOf(h)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=f,o(a,e._logEvent,m),e._logEvent=Ms(p)}function Ms(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Jd(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 jv(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Xd:Zd}function Zo(){return{}}function Os(e){return e}function qr(){}function Xd(){return!1}function Zd(){return Date.now()}function Lv(){return Math.round(Date.now()/1e3)}function Uv(){return new Date(Date.now()).toISOString()}function Bv(){function e(t){return typeof t<"u"&&t}try{return typeof C<"u"?C:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),C)}catch{return e(self)||e(window)||e(this)||{}}}ei.exports.default=pt;ei.exports.pino=pt});var cb={};Ks(cb,{DefaultFieldsToInclude:()=>Vs,EcommerceDefaultFieldsToInclude:()=>pp,HighlightUtils:()=>Ui,MinimumFieldsToInclude:()=>li,ResultTemplatesHelpers:()=>Jl,buildContext:()=>rf,buildController:()=>_t,buildDictionaryFieldContext:()=>nf,buildInteractiveResult:()=>ef,buildRecommendationEngine:()=>sp,buildRecommendationList:()=>Xp,buildResultTemplatesManager:()=>af,getAnalyticsNextApiBaseUrl:()=>Un,getOrganizationEndpoint:()=>Pe,getSampleRecommendationEngineConfiguration:()=>_s,loadAdvancedSearchQueryActions:()=>Yv,loadClickAnalyticsActions:()=>sC,loadConfigurationActions:()=>Gv,loadContextActions:()=>Xv,loadDebugActions:()=>iC,loadDictionaryFieldContextActions:()=>Zv,loadFieldActions:()=>rC,loadPaginationActions:()=>Ws,loadPipelineActions:()=>nC,loadRecommendationActions:()=>aC,loadSearchConfigurationActions:()=>Kv,loadSearchHubActions:()=>oC});module.exports=ff(cb);d();c();l();u();var Ui={};Ks(Ui,{escape:()=>rr,getHighlightedSuggestion:()=>Yf,highlightString:()=>Kf});d();c();l();u();d();c();l();u();function Qf(e,t){let r=`
|
|
17
|
+
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var cf=Object.create;var $r=Object.defineProperty;var uf=Object.getOwnPropertyDescriptor;var lf=Object.getOwnPropertyNames;var df=Object.getPrototypeOf,pf=Object.prototype.hasOwnProperty;var ff=(e,t,r)=>t in e?$r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Hr=(e,t)=>()=>(e&&(t=e(e=0)),t);var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ys=(e,t)=>{for(var r in t)$r(e,r,{get:t[r],enumerable:!0})},Js=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lf(t))!pf.call(e,o)&&o!==r&&$r(e,o,{get:()=>t[o],enumerable:!(n=uf(t,o))||n.enumerable});return e};var Qe=(e,t,r)=>(r=e!=null?cf(df(e)):{},Js(t||!e||!e.__esModule?$r(r,"default",{value:e,enumerable:!0}):r,e)),mf=e=>Js($r({},"__esModule",{value:!0}),e);var de=(e,t,r)=>ff(e,typeof t!="symbol"?t+"":t,r);var C,c=Hr(()=>{"use strict";C=typeof globalThis<"u"?globalThis:window});function Mn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mn=function(t){return typeof t}:Mn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mn(e)}function yf(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=Sf.bind(this))}function Sf(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),gf(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):hf(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var gf,hf,u=Hr(()=>{"use strict";gf=function(t){return typeof t=="string"},hf=function(t){return t instanceof Blob};yf.call((typeof window>"u"?"undefined":Mn(window))==="object"?window:{})});var Ni=Se(zr=>{"use strict";d();c();l();u();Object.defineProperty(zr,"__esModule",{value:!0});function Xs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function vf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cf(e,t,r){return t=er(t),Af(e,rc()?Reflect.construct(t,r||[],er(e).constructor):t.apply(e,r))}function Di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ef(n.key),n)}}function Mi(e,t,r){return t&&Zs(e.prototype,t),r&&Zs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ec(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=If(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(m){throw m},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var m=r.next();return a=m.done,m},e:function(m){f=!0,i=m},f:function(){try{a||r.return==null||r.return()}finally{if(f)throw i}}}}function ki(){return ki=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=wf(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},ki.apply(null,arguments)}function er(e){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},er(e)}function bf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oi(e,t)}function rc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rc=function(){return!!e})()}function Af(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vf(e)}function Oi(e,t){return Oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oi(e,t)}function wf(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=er(e))!==null;);return e}function xf(e,t,r,n){var o=ki(er(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Rf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ef(e){var t=Rf(e,"string");return typeof t=="symbol"?t:t+""}function If(e,t){if(e){if(typeof e=="string")return Xs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Xs(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Pf(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function Tf(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var tc=function(){function e(){Di(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Mi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var h=i[f];try{h.callback.call(n,r)}catch(y){Promise.resolve().then(function(){throw y})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},f=0,m=i.length;f<m;f++)a();return!r.defaultPrevented}}}])}(),qi=function(e){function t(){var r;return Di(this,t),r=Cf(this,t),r.listeners||tc.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return bf(t,e),Mi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),xf(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new qn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new qn;function i(){o.abort(this.reason),a()}function a(){var h=ec(n),y;try{for(h.s();!(y=h.n()).done;){var S=y.value;S.removeEventListener("abort",i)}}catch(g){h.e(g)}finally{h.f()}}var f=ec(n),m;try{for(f.s();!(m=f.n()).done;){var p=m.value;if(p.aborted){o.abort(p.reason);break}else p.addEventListener("abort",i)}}catch(h){f.e(h)}finally{f.f()}return o.signal}}])}(tc),qn=function(){function e(){Di(this,e),Object.defineProperty(this,"signal",{value:new qi,writable:!0,configurable:!0})}return Mi(e,[{key:"abort",value:function(r){var n=Tf(r),o=Pf(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(qn.prototype[Symbol.toStringTag]="AbortController",qi.prototype[Symbol.toStringTag]="AbortSignal");function Ff(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function kf(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,f=a===void 0?!1:a;if(!Ff({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:f}))return{fetch:r,Request:m};var m=o;(m&&!m.prototype.hasOwnProperty("signal")||f)&&(m=function(S,g){var v;g&&g.signal&&(v=g.signal,delete g.signal);var R=new o(S,g);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},m.prototype=o.prototype);var p=r,h=function(S,g){var v=m&&m.prototype.isPrototypeOf(S)?S.signal:g?g.signal:void 0;if(v){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(v.aborted)return Promise.reject(R);var P=new Promise(function(x,T){v.addEventListener("abort",function(){return T(R)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([P,p(S,g)])}return p(S,g)};return{fetch:h,Request:m}}zr.AbortController=qn;zr.AbortSignal=qi;zr.abortableFetch=kf});var nc,s,b,l=Hr(()=>{"use strict";nc=Qe(Ni(),1),s=Qe(Ni(),1),{fetch:b}=(0,nc.abortableFetch)({fetch})});function Wr(e){if(Uf.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function _i(e){return e.replace(Bf,"")}function Gr(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!Qf(r))return!1}return!0}function Qf(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function ic(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Of,lc,Df,dc,Mf,qf,Nf,_f,Vf,jf,Lf,Uf,oc,Bf,tr,Vi,ac,sc,cc,uc,A,fc=Hr(()=>{"use strict";d();c();l();u();Of=Object.create,lc=Object.defineProperty,Df=Object.getOwnPropertyDescriptor,dc=Object.getOwnPropertyNames,Mf=Object.getPrototypeOf,qf=Object.prototype.hasOwnProperty,Nf=(e,t)=>function(){return t||(0,e[dc(e)[0]])((t={exports:{}}).exports,t),t.exports},_f=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of dc(t))!qf.call(e,o)&&o!==r&&lc(e,o,{get:()=>t[o],enumerable:!(n=Df(t,o))||n.enumerable});return e},Vf=(e,t,r)=>(r=e!=null?Of(Mf(e)):{},_f(t||!e||!e.__esModule?lc(r,"default",{value:e,enumerable:!0}):r,e)),jf=Nf({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(m){return typeof m=="string"&&!!m.trim()}function o(m,p){var h=m.split(";").filter(n),y=h.shift(),S=i(y),g=S.name,v=S.value;p=p?Object.assign({},r,p):r;try{v=p.decodeValues?decodeURIComponent(v):v}catch(P){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",P)}var R={name:g,value:v};return h.forEach(function(P){var x=P.split("="),T=x.shift().trimLeft().toLowerCase(),w=x.join("=");T==="expires"?R.expires=new Date(w):T==="max-age"?R.maxAge=parseInt(w,10):T==="secure"?R.secure=!0:T==="httponly"?R.httpOnly=!0:T==="samesite"?R.sameSite=w:R[T]=w}),R}function i(m){var p="",h="",y=m.split("=");return y.length>1?(p=y.shift(),h=y.join("=")):h=m,{name:p,value:h}}function a(m,p){if(p=p?Object.assign({},r,p):r,!m)return p.map?{}:[];if(m.headers)if(typeof m.headers.getSetCookie=="function")m=m.headers.getSetCookie();else if(m.headers["set-cookie"])m=m.headers["set-cookie"];else{var h=m.headers[Object.keys(m.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!h&&m.headers.cookie&&!p.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),m=h}if(Array.isArray(m)||(m=[m]),p=p?Object.assign({},r,p):r,p.map){var y={};return m.filter(n).reduce(function(S,g){var v=o(g,p);return S[v.name]=v,S},y)}else return m.filter(n).map(function(S){return o(S,p)})}function f(m){if(Array.isArray(m))return m;if(typeof m!="string")return[];var p=[],h=0,y,S,g,v,R;function P(){for(;h<m.length&&/\s/.test(m.charAt(h));)h+=1;return h<m.length}function x(){return S=m.charAt(h),S!=="="&&S!==";"&&S!==","}for(;h<m.length;){for(y=h,R=!1;P();)if(S=m.charAt(h),S===","){for(g=h,h+=1,P(),v=h;h<m.length&&x();)h+=1;h<m.length&&m.charAt(h)==="="?(R=!0,h=v,p.push(m.substring(y,g)),y=h):h=g+1}else h+=1;(!R||h>=m.length)&&p.push(m.substring(y,m.length))}return p}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=f}}),Lf=Vf(jf()),Uf=/[^a-z0-9\-#$%&'*+.^_`|~]/i;oc=[`
|
|
19
|
+
`,"\r","\t"," "],Bf=new RegExp(`(^[${oc.join("")}]|$[${oc.join("")}])`,"g");tr=Symbol("normalizedHeaders"),Vi=Symbol("rawHeaderNames"),ac=", ",A=class pc{constructor(t){this[sc]={},this[cc]=new Map,this[uc]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof pc||typeof C.Headers<"u"&&t instanceof C.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(ac):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(ac):n)})}[(sc=tr,cc=Vi,uc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[tr]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Gr(t))throw new TypeError(`Invalid header name "${t}"`);return this[tr].hasOwnProperty(Wr(t))}get(t){if(!Gr(t))throw TypeError(`Invalid header name "${t}"`);return this[tr][Wr(t)]??null}set(t,r){if(!Gr(t)||!ic(r))return;let n=Wr(t),o=_i(r);this[tr][n]=_i(o),this[Vi].set(n,t)}append(t,r){if(!Gr(t)||!ic(r))return;let n=Wr(t),o=_i(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Gr(t)||!this.has(t))return;let r=Wr(t);delete this[tr][r],this[Vi].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,Lf.splitCookiesString)(t)}}});var d=Hr(()=>{"use strict";fc()});var xc=Se(Jr=>{"use strict";d();c();l();u();var Ln=Jr&&Jr.__assign||function(){return Ln=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},Ln.apply(this,arguments)};Object.defineProperty(Jr,"__esModule",{value:!0});var nm={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function om(e){var t=Ln(Ln({},nm),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Jr.getSanitizedOptions=om});var Rc=Se(Bi=>{"use strict";d();c();l();u();Object.defineProperty(Bi,"__esModule",{value:!0});function im(e){var t=Math.random()*e;return Math.round(t)}Bi.fullJitter=im});var Ec=Se(Qi=>{"use strict";d();c();l();u();Object.defineProperty(Qi,"__esModule",{value:!0});function am(e){return e}Qi.noJitter=am});var Ic=Se($i=>{"use strict";d();c();l();u();Object.defineProperty($i,"__esModule",{value:!0});var sm=Rc(),cm=Ec();function um(e){switch(e.jitter){case"full":return sm.fullJitter;case"none":default:return cm.noJitter}}$i.JitterFactory=um});var zi=Se(Hi=>{"use strict";d();c();l();u();Object.defineProperty(Hi,"__esModule",{value:!0});var lm=Ic(),dm=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=lm.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}();Hi.Delay=dm});var Pc=Se(nt=>{"use strict";d();c();l();u();var pm=nt&&nt.__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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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)}}(),fm=nt&&nt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(h){try{p(n.next(h))}catch(y){a(y)}}function m(h){try{p(n.throw(h))}catch(y){a(y)}}function p(h){h.done?i(h.value):o(h.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},mm=nt&&nt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(h){return m([p,h])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(h){p=[6,h],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(nt,"__esModule",{value:!0});var gm=zi(),hm=function(e){pm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return fm(this,void 0,void 0,function(){return mm(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}(gm.Delay);nt.SkipFirstDelay=hm});var Tc=Se(Xr=>{"use strict";d();c();l();u();var ym=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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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(Xr,"__esModule",{value:!0});var Sm=zi(),vm=function(e){ym(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Sm.Delay);Xr.AlwaysDelay=vm});var Fc=Se(Wi=>{"use strict";d();c();l();u();Object.defineProperty(Wi,"__esModule",{value:!0});var Cm=Pc(),bm=Tc();function Am(e,t){var r=wm(e);return r.setAttemptNumber(t),r}Wi.DelayFactory=Am;function wm(e){return e.delayFirstAttempt?new bm.AlwaysDelay(e):new Cm.SkipFirstDelay(e)}});var kc=Se(Vt=>{"use strict";d();c();l();u();var Gi=Vt&&Vt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(h){try{p(n.next(h))}catch(y){a(y)}}function m(h){try{p(n.throw(h))}catch(y){a(y)}}function p(h){h.done?i(h.value):o(h.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},Ki=Vt&&Vt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(h){return m([p,h])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(h){p=[6,h],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(Vt,"__esModule",{value:!0});var xm=xc(),Rm=Fc();function Em(e,t){return t===void 0&&(t={}),Gi(this,void 0,void 0,function(){var r,n;return Ki(this,function(o){switch(o.label){case 0:return r=xm.getSanitizedOptions(t),n=new Im(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Vt.backOff=Em;var Im=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Gi(this,void 0,void 0,function(){var t,r;return Ki(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 Gi(this,void 0,void 0,function(){var t;return Ki(this,function(r){switch(r.label){case 0:return t=Rm.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Lo=Se((rs,ns)=>{"use strict";d();c();l();u();(function(e,t){typeof rs=="object"&&typeof ns<"u"?ns.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs=t()})(rs,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",f="day",m="week",p="month",h="quarter",y="year",S="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|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,P={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(U){var j=["th","st","nd","rd"],V=U%100;return"["+U+(j[(V-20)%10]||j[V]||j[0])+"]"}},x=function(U,j,V){var Q=String(U);return!Q||Q.length>=j?U:""+Array(j+1-Q.length).join(V)+U},T={s:x,z:function(U){var j=-U.utcOffset(),V=Math.abs(j),Q=Math.floor(V/60),L=V%60;return(j<=0?"+":"-")+x(Q,2,"0")+":"+x(L,2,"0")},m:function U(j,V){if(j.date()<V.date())return-U(V,j);var Q=12*(V.year()-j.year())+(V.month()-j.month()),L=j.clone().add(Q,p),z=V-L<0,W=j.clone().add(Q+(z?-1:1),p);return+(-(Q+(V-L)/(z?L-W:W-L))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:p,y,w:m,d:f,D:S,h:a,m:i,s:o,ms:n,Q:h}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},w="en",E={};E[w]=P;var N="$isDayjsObject",k=function(U){return U instanceof _||!(!U||!U[N])},I=function U(j,V,Q){var L;if(!j)return w;if(typeof j=="string"){var z=j.toLowerCase();E[z]&&(L=z),V&&(E[z]=V,L=z);var W=j.split("-");if(!L&&W.length>1)return U(W[0])}else{var Y=j.name;E[Y]=j,L=Y}return!Q&&L&&(w=L),L||!Q&&w},F=function(U,j){if(k(U))return U.clone();var V=typeof j=="object"?j:{};return V.date=U,V.args=arguments,new _(V)},O=T;O.l=I,O.i=k,O.w=function(U,j){return F(U,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var _=function(){function U(V){this.$L=I(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[N]=!0}var j=U.prototype;return j.parse=function(V){this.$d=function(Q){var L=Q.date,z=Q.utc;if(L===null)return new Date(NaN);if(O.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var W=L.match(v);if(W){var Y=W[2]-1||0,re=(W[7]||"0").substring(0,3);return z?new Date(Date.UTC(W[1],Y,W[3]||1,W[4]||0,W[5]||0,W[6]||0,re)):new Date(W[1],Y,W[3]||1,W[4]||0,W[5]||0,W[6]||0,re)}}return new Date(L)}(V),this.init()},j.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==g},j.isSame=function(V,Q){var L=F(V);return this.startOf(Q)<=L&&L<=this.endOf(Q)},j.isAfter=function(V,Q){return F(V)<this.startOf(Q)},j.isBefore=function(V,Q){return this.endOf(Q)<F(V)},j.$g=function(V,Q,L){return O.u(V)?this[Q]:this.set(L,V)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(V,Q){var L=this,z=!!O.u(Q)||Q,W=O.p(V),Y=function(ce,me){var ye=O.w(L.$u?Date.UTC(L.$y,me,ce):new Date(L.$y,me,ce),L);return z?ye:ye.endOf(f)},re=function(ce,me){return O.w(L.toDate()[ce].apply(L.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(me)),L)},se=this.$W,ee=this.$M,ne=this.$D,Z="set"+(this.$u?"UTC":"");switch(W){case y:return z?Y(1,0):Y(31,11);case p:return z?Y(1,ee):Y(0,ee+1);case m:var oe=this.$locale().weekStart||0,he=(se<oe?se+7:se)-oe;return Y(z?ne-he:ne+(6-he),ee);case f:case S:return re(Z+"Hours",0);case a:return re(Z+"Minutes",1);case i:return re(Z+"Seconds",2);case o:return re(Z+"Milliseconds",3);default:return this.clone()}},j.endOf=function(V){return this.startOf(V,!1)},j.$set=function(V,Q){var L,z=O.p(V),W="set"+(this.$u?"UTC":""),Y=(L={},L[f]=W+"Date",L[S]=W+"Date",L[p]=W+"Month",L[y]=W+"FullYear",L[a]=W+"Hours",L[i]=W+"Minutes",L[o]=W+"Seconds",L[n]=W+"Milliseconds",L)[z],re=z===f?this.$D+(Q-this.$W):Q;if(z===p||z===y){var se=this.clone().set(S,1);se.$d[Y](re),se.init(),this.$d=se.set(S,Math.min(this.$D,se.daysInMonth())).$d}else Y&&this.$d[Y](re);return this.init(),this},j.set=function(V,Q){return this.clone().$set(V,Q)},j.get=function(V){return this[O.p(V)]()},j.add=function(V,Q){var L,z=this;V=Number(V);var W=O.p(Q),Y=function(ee){var ne=F(z);return O.w(ne.date(ne.date()+Math.round(ee*V)),z)};if(W===p)return this.set(p,this.$M+V);if(W===y)return this.set(y,this.$y+V);if(W===f)return Y(1);if(W===m)return Y(7);var re=(L={},L[i]=t,L[a]=r,L[o]=e,L)[W]||1,se=this.$d.getTime()+V*re;return O.w(se,this)},j.subtract=function(V,Q){return this.add(-1*V,Q)},j.format=function(V){var Q=this,L=this.$locale();if(!this.isValid())return L.invalidDate||g;var z=V||"YYYY-MM-DDTHH:mm:ssZ",W=O.z(this),Y=this.$H,re=this.$m,se=this.$M,ee=L.weekdays,ne=L.months,Z=L.meridiem,oe=function(me,ye,Te,je){return me&&(me[ye]||me(Q,z))||Te[ye].slice(0,je)},he=function(me){return O.s(Y%12||12,me,"0")},ce=Z||function(me,ye,Te){var je=me<12?"AM":"PM";return Te?je.toLowerCase():je};return z.replace(R,function(me,ye){return ye||function(Te){switch(Te){case"YY":return String(Q.$y).slice(-2);case"YYYY":return O.s(Q.$y,4,"0");case"M":return se+1;case"MM":return O.s(se+1,2,"0");case"MMM":return oe(L.monthsShort,se,ne,3);case"MMMM":return oe(ne,se);case"D":return Q.$D;case"DD":return O.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return oe(L.weekdaysMin,Q.$W,ee,2);case"ddd":return oe(L.weekdaysShort,Q.$W,ee,3);case"dddd":return ee[Q.$W];case"H":return String(Y);case"HH":return O.s(Y,2,"0");case"h":return he(1);case"hh":return he(2);case"a":return ce(Y,re,!0);case"A":return ce(Y,re,!1);case"m":return String(re);case"mm":return O.s(re,2,"0");case"s":return String(Q.$s);case"ss":return O.s(Q.$s,2,"0");case"SSS":return O.s(Q.$ms,3,"0");case"Z":return W}return null}(me)||W.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(V,Q,L){var z,W=this,Y=O.p(Q),re=F(V),se=(re.utcOffset()-this.utcOffset())*t,ee=this-re,ne=function(){return O.m(W,re)};switch(Y){case y:z=ne()/12;break;case p:z=ne();break;case h:z=ne()/3;break;case m:z=(ee-se)/6048e5;break;case f:z=(ee-se)/864e5;break;case a:z=ee/r;break;case i:z=ee/t;break;case o:z=ee/e;break;default:z=ee}return L?z:O.a(z)},j.daysInMonth=function(){return this.endOf(p).$D},j.$locale=function(){return E[this.$L]},j.locale=function(V,Q){if(!V)return this.$L;var L=this.clone(),z=I(V,Q,!0);return z&&(L.$L=z),L},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},U}(),$=_.prototype;return F.prototype=$,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",f],["$M",p],["$y",y],["$D",S]].forEach(function(U){$[U[1]]=function(j){return this.$g(j,U[0],U[1])}}),F.extend=function(U,j){return U.$i||(U(j,_,F),U.$i=!0),F},F.locale=I,F.isDayjs=k,F.unix=function(U){return F(1e3*U)},F.en=E[w],F.Ls=E,F.p={},F})});var ql=Se((os,is)=>{"use strict";d();c();l();u();(function(e,t){typeof os=="object"&&typeof is<"u"?is.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_quarterOfYear=t()})(os,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(f){return this.$utils().u(f)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(f-1))};var i=o.add;o.add=function(f,m){return f=Number(f),this.$utils().p(m)===t?this.add(3*f,e):i.bind(this)(f,m)};var a=o.startOf;o.startOf=function(f,m){var p=this.$utils(),h=!!p.u(m)||m;if(p.p(f)===t){var y=this.quarter()-1;return h?this.month(3*y).startOf(e).startOf("day"):this.month(3*y+2).endOf(e).endOf("day")}return a.bind(this)(f,m)}}})});var Nl=Se((as,ss)=>{"use strict";d();c();l();u();(function(e,t){typeof as=="object"&&typeof ss<"u"?ss.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_customParseFormat=t()})(as,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?/,i=/\d*[^-_:/,()\s\d]+/,a={},f=function(v){return(v=+v)+(v>68?1900:2e3)},m=function(v){return function(R){this[v]=+R}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var P=R.match(/([+-]|\d\d)/g),x=60*P[1]+(+P[2]||0);return x===0?0:P[0]==="+"?-x:x}(v)}],h=function(v){var R=a[v];return R&&(R.indexOf?R:R.s.concat(R.f))},y=function(v,R){var P,x=a.meridiem;if(x){for(var T=1;T<=24;T+=1)if(v.indexOf(x(T,0,R))>-1){P=T>12;break}}else P=v===(R?"pm":"PM");return P},S={A:[i,function(v){this.afternoon=y(v,!1)}],a:[i,function(v){this.afternoon=y(v,!0)}],Q:[r,function(v){this.month=3*(v-1)+1}],S:[r,function(v){this.milliseconds=100*+v}],SS:[n,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,m("seconds")],ss:[o,m("seconds")],m:[o,m("minutes")],mm:[o,m("minutes")],H:[o,m("hours")],h:[o,m("hours")],HH:[o,m("hours")],hh:[o,m("hours")],D:[o,m("day")],DD:[n,m("day")],Do:[i,function(v){var R=a.ordinal,P=v.match(/\d+/);if(this.day=P[0],R)for(var x=1;x<=31;x+=1)R(x).replace(/\[|\]/g,"")===v&&(this.day=x)}],w:[o,m("week")],ww:[n,m("week")],M:[o,m("month")],MM:[n,m("month")],MMM:[i,function(v){var R=h("months"),P=(h("monthsShort")||R.map(function(x){return x.slice(0,3)})).indexOf(v)+1;if(P<1)throw new Error;this.month=P%12||P}],MMMM:[i,function(v){var R=h("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,m("year")],YY:[n,function(v){this.year=f(v)}],YYYY:[/\d{4}/,m("year")],Z:p,ZZ:p};function g(v){var R,P;R=v,P=a&&a.formats;for(var x=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(F,O,_){var $=_&&_.toUpperCase();return O||P[_]||e[_]||P[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,j,V){return j||V.slice(1)})})).match(t),T=x.length,w=0;w<T;w+=1){var E=x[w],N=S[E],k=N&&N[0],I=N&&N[1];x[w]=I?{regex:k,parser:I}:E.replace(/^\[|\]$/g,"")}return function(F){for(var O={},_=0,$=0;_<T;_+=1){var U=x[_];if(typeof U=="string")$+=U.length;else{var j=U.regex,V=U.parser,Q=F.slice($),L=j.exec(Q)[0];V.call(O,L),F=F.replace(L,"")}}return function(z){var W=z.afternoon;if(W!==void 0){var Y=z.hours;W?Y<12&&(z.hours+=12):Y===12&&(z.hours=0),delete z.afternoon}}(O),O}}return function(v,R,P){P.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(f=v.parseTwoDigitYear);var x=R.prototype,T=x.parse;x.parse=function(w){var E=w.date,N=w.utc,k=w.args;this.$u=N;var I=k[1];if(typeof I=="string"){var F=k[2]===!0,O=k[3]===!0,_=F||O,$=k[2];O&&($=k[2]),a=this.$locale(),!F&&$&&(a=P.Ls[$]),this.$d=function(Q,L,z,W){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*Q);var Y=g(L)(Q),re=Y.year,se=Y.month,ee=Y.day,ne=Y.hours,Z=Y.minutes,oe=Y.seconds,he=Y.milliseconds,ce=Y.zone,me=Y.week,ye=new Date,Te=ee||(re||se?1:ye.getDate()),je=re||ye.getFullYear(),ft=0;re&&!se||(ft=se>0?se-1:ye.getMonth());var Xt,Zt=ne||0,Qr=Z||0,Ti=oe||0,Fi=he||0;return ce?new Date(Date.UTC(je,ft,Te,Zt,Qr,Ti,Fi+60*ce.offset*1e3)):z?new Date(Date.UTC(je,ft,Te,Zt,Qr,Ti,Fi)):(Xt=new Date(je,ft,Te,Zt,Qr,Ti,Fi),me&&(Xt=W(Xt).week(me).toDate()),Xt)}catch{return new Date("")}}(E,I,N,P),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),_&&E!=this.format(I)&&(this.$d=new Date("")),a={}}else if(I instanceof Array)for(var U=I.length,j=1;j<=U;j+=1){k[1]=I[j-1];var V=P.apply(this,k);if(V.isValid()){this.$d=V.$d,this.$L=V.$L,this.init();break}j===U&&(this.$d=new Date(""))}else T.call(this,w)}}})});var qd=Se((Is,Ps)=>{"use strict";d();c();l();u();(function(e,t){typeof Is=="object"&&typeof Ps<"u"?Ps.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_timezone=t()})(Is,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(h,y,S){S===void 0&&(S={});var g=new Date(h),v=function(R,P){P===void 0&&(P={});var x=P.timeZoneName||"short",T=R+"|"+x,w=t[T];return w||(w=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:R,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),t[T]=w),w}(y,S);return v.formatToParts(g)},f=function(h,y){for(var S=a(h,y),g=[],v=0;v<S.length;v+=1){var R=S[v],P=R.type,x=R.value,T=e[P];T>=0&&(g[T]=parseInt(x,10))}var w=g[3],E=w===24?0:w,N=g[0]+"-"+g[1]+"-"+g[2]+" "+E+":"+g[4]+":"+g[5]+":000",k=+h;return(o.utc(N).valueOf()-(k-=k%1e3))/6e4},m=n.prototype;m.tz=function(h,y){h===void 0&&(h=i);var S,g=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:h}),P=Math.round((v-new Date(R))/1e3/60),x=15*-Math.round(v.getTimezoneOffset()/15)-P;if(!Number(x))S=this.utcOffset(0,y);else if(S=o(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),y){var T=S.utcOffset();S=S.add(g-T,"minute")}return S.$x.$timezone=h,S},m.offsetName=function(h){var y=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),y,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return S&&S.value};var p=m.startOf;m.startOf=function(h,y){if(!this.$x||!this.$x.$timezone)return p.call(this,h,y);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(S,h,y).tz(this.$x.$timezone,!0)},o.tz=function(h,y,S){var g=S&&y,v=S||y||i,R=f(+o(),v);if(typeof h!="string")return o(h).tz(v);var P=function(E,N,k){var I=E-60*N*1e3,F=f(I,k);if(N===F)return[I,N];var O=f(I-=60*(F-N)*1e3,k);return F===O?[I,F]:[E-60*Math.min(F,O)*1e3,Math.max(F,O)]}(o.utc(h,g).valueOf(),R,v),x=P[0],T=P[1],w=o(x).utcOffset(T);return w.$x.$timezone=v,w},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}})});var Nd=Se((Ts,Fs)=>{"use strict";d();c();l();u();(function(e,t){typeof Ts=="object"&&typeof Fs<"u"?Fs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof C<"u"?C:e||self).dayjs_plugin_utc=t()})(Ts,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var v={date:g,utc:!0,args:arguments};return new o(v)},a.utc=function(g){var v=i(this.toDate(),{locale:this.$L,utc:!0});return g?v.add(this.utcOffset(),e):v},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var f=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),f.call(this,g)};var m=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else m.call(this)};var p=a.utcOffset;a.utcOffset=function(g,v){var R=this.$utils().u;if(R(g))return this.$u?0:R(this.$offset)?p.call(this):this.$offset;if(typeof g=="string"&&(g=function(w){w===void 0&&(w="");var E=w.match(t);if(!E)return null;var N=(""+E[0]).match(r)||["-",0,0],k=N[0],I=60*+N[1]+ +N[2];return I===0?0:k==="+"?I:-I}(g),g===null))return this;var P=Math.abs(g)<=16?60*g:g,x=this;if(v)return x.$offset=P,x.$u=g===0,x;if(g!==0){var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(P+T,e)).$offset=P,x.$x.$localOffset=T}else x=this.utc();return x};var h=a.format;a.format=function(g){var v=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var y=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var S=a.diff;a.diff=function(g,v,R){if(g&&this.$u===g.$u)return S.call(this,g,v,R);var P=this.local(),x=i(g).local();return S.call(P,x,v,R)}}})});var Kd=Se((tL,Gd)=>{"use strict";d();c();l();u();function Iv(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Gd.exports=Pv;function Pv(e,t,r){var n=r&&r.stringify||Iv,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var f=1;f<i;f++)a[f]=n(t[f]);return a.join(" ")}if(typeof e!="string")return e;var m=t.length;if(m===0)return e;for(var p="",h=1-o,y=-1,S=e&&e.length||0,g=0;g<S;){if(e.charCodeAt(g)===37&&g+1<S){switch(y=y>-1?y:0,e.charCodeAt(g+1)){case 100:case 102:if(h>=m||t[h]==null)break;y<g&&(p+=e.slice(y,g)),p+=Number(t[h]),y=g+2,g++;break;case 105:if(h>=m||t[h]==null)break;y<g&&(p+=e.slice(y,g)),p+=Math.floor(Number(t[h])),y=g+2,g++;break;case 79:case 111:case 106:if(h>=m||t[h]===void 0)break;y<g&&(p+=e.slice(y,g));var v=typeof t[h];if(v==="string"){p+="'"+t[h]+"'",y=g+2,g++;break}if(v==="function"){p+=t[h].name||"<anonymous>",y=g+2,g++;break}p+=n(t[h]),y=g+2,g++;break;case 115:if(h>=m)break;y<g&&(p+=e.slice(y,g)),p+=String(t[h]),y=g+2,g++;break;case 37:y<g&&(p+=e.slice(y,g)),p+="%",y=g+2,g++,h--;break}++h}++g}return y===-1?e:(y<S&&(p+=e.slice(y)),p)}});var tp=Se((aL,ei)=>{"use strict";d();c();l();u();var Yd=Kd();ei.exports=pt;var Pn=Qv().console||{},Tv={mapHttpRequest:Zo,mapHttpResponse:Zo,wrapRequestSerializer:Os,wrapResponseSerializer:Os,wrapErrorSerializer:Os,req:Zo,res:Zo,err:Xd,errWithCause:Xd};function Et(e,t){return e==="silent"?1/0:t.levels.values[e]}var qs=Symbol("pino.logFuncs"),Ds=Symbol("pino.hierarchy"),Fv={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Jd(e,t){let r={logger:t,parent:e[Ds]};t[Ds]=r}function kv(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Pn[o]||Pn[Fv[o]||"log"]||qr}),e[qs]=n}function Ov(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function pt(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||Pn;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=Ov(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),f=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&f.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let m=e.level||"info",p=Object.create(r);p.log||(p.log=qr),kv(p,f,r),Jd({},p),Object.defineProperty(p,"levelVal",{get:y}),Object.defineProperty(p,"level",{get:S,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:f,timestamp:Lv(e),messageKey:e.messageKey||"msg",onChild:e.onChild||qr};p.levels=Dv(e),p.level=m,p.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},p.setMaxListeners=p.getMaxListeners=p.emit=p.addListener=p.on=p.prependListener=p.once=p.prependOnceListener=p.removeListener=p.removeAllListeners=p.listeners=p.listenerCount=p.eventNames=p.write=p.flush=qr,p.serializers=n,p._serialize=o,p._stdErrSerialize=i,p.child=function(...R){return v.call(this,h,...R)},t&&(p._logEvent=Ms());function y(){return Et(this.level,this)}function S(){return this._level}function g(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Gt(this,h,p,"error"),Gt(this,h,p,"fatal"),Gt(this,h,p,"warn"),Gt(this,h,p,"info"),Gt(this,h,p,"debug"),Gt(this,h,p,"trace"),a.forEach(P=>{Gt(this,h,p,P)})}function v(R,P,x){if(!P)throw new Error("missing bindings for child Pino");x=x||{},o&&P.serializers&&(x.serializers=P.serializers);let T=x.serializers;if(o&&T){var w=Object.assign({},n,T),E=e.browser.serialize===!0?Object.keys(w):o;delete P.serializers,Ns([P],E,w,this._stdErrSerialize)}function N(I){this._childLevel=(I._childLevel|0)+1,this.bindings=P,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=Ms([].concat(I._logEvent.bindings,P)))}N.prototype=this;let k=new N(this);return Jd(this,k),k.child=function(...I){return v.call(this,R,...I)},k.level=x.level||this.level,R.onChild(k),k}return p}function Dv(e){let t=e.customLevels||{},r=Object.assign({},pt.levels.values,t),n=Object.assign({},pt.levels.labels,Mv(t));return{values:r,labels:n}}function Mv(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}pt.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"}};pt.stdSerializers=Tv;pt.stdTimeFunctions=Object.assign({},{nullTime:Zd,epochTime:ep,unixTime:Uv,isoTime:Bv});function qv(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Ds];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Gt(e,t,r,n){if(Object.defineProperty(e,n,{value:Et(e.level,r)>Et(n,r)?qr:r[qs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===qr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Et(i,r);if(Et(n,r)<a)return}e[n]=_v(e,t,r,n);let o=qv(e);o.length!==0&&(e[n]=Nv(o,e[n]))}function Nv(e,t){return function(){return t.apply(this,[...e,...arguments])}}function _v(e,t,r,n){return function(o){return function(){let a=t.timestamp(),f=new Array(arguments.length),m=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Pn?Pn:this;for(var p=0;p<f.length;p++)f[p]=arguments[p];var h=!1;if(t.serialize&&(Ns(f,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(m,...Vv(this,n,f,a,t)):o.apply(m,f),t.transmit){let y=t.transmit.level||e._level,S=Et(y,r),g=Et(n,r);if(g<S)return;jv(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:y,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Et(e._level,r)},f,h)}}}(e[qs][n])}function Vv(e,t,r,n,o){let{level:i,log:a=y=>y}=o.formatters||{},f=r.slice(),m=f[0],p={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(p.time=n),i){let y=i(t,e.levels.values[t]);Object.assign(p,y)}else p.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(m!==null&&typeof m=="object")for(;h--&&typeof f[0]=="object";)Object.assign(p,f.shift());return[a(p),...f]}else{if(m!==null&&typeof m=="object"){for(;h--&&typeof f[0]=="object";)Object.assign(p,f.shift());m=f.length?Yd(f.shift(),f):void 0}else typeof m=="string"&&(m=Yd(f.shift(),f));return m!==void 0&&(p[o.messageKey]=m),[a(p)]}}function Ns(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=pt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function jv(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,f=t.methodValue,m=t.val,p=e._logEvent.bindings;n||Ns(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return p.indexOf(h)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=f,o(a,e._logEvent,m),e._logEvent=Ms(p)}function Ms(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Xd(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 Lv(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Zd:ep}function Zo(){return{}}function Os(e){return e}function qr(){}function Zd(){return!1}function ep(){return Date.now()}function Uv(){return Math.round(Date.now()/1e3)}function Bv(){return new Date(Date.now()).toISOString()}function Qv(){function e(t){return typeof t<"u"&&t}try{return typeof C<"u"?C:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),C)}catch{return e(self)||e(window)||e(this)||{}}}ei.exports.default=pt;ei.exports.pino=pt});var cb={};Ys(cb,{DefaultFieldsToInclude:()=>Vs,EcommerceDefaultFieldsToInclude:()=>fp,HighlightUtils:()=>Ui,MinimumFieldsToInclude:()=>li,ResultTemplatesHelpers:()=>Xl,buildContext:()=>nf,buildController:()=>_t,buildDictionaryFieldContext:()=>of,buildInteractiveResult:()=>tf,buildRecommendationEngine:()=>cp,buildRecommendationList:()=>Zp,buildResultTemplatesManager:()=>sf,getAnalyticsNextApiBaseUrl:()=>Un,getOrganizationEndpoint:()=>Pe,getSampleRecommendationEngineConfiguration:()=>_s,loadAdvancedSearchQueryActions:()=>Jv,loadClickAnalyticsActions:()=>cC,loadConfigurationActions:()=>Kv,loadContextActions:()=>Zv,loadDebugActions:()=>aC,loadDictionaryFieldContextActions:()=>eC,loadFieldActions:()=>nC,loadPaginationActions:()=>Gs,loadPipelineActions:()=>oC,loadRecommendationActions:()=>sC,loadSearchConfigurationActions:()=>Yv,loadSearchHubActions:()=>iC});module.exports=mf(cb);d();c();l();u();var Ui={};Ys(Ui,{escape:()=>rr,getHighlightedSuggestion:()=>Jf,highlightString:()=>Yf});d();c();l();u();d();c();l();u();function $f(e,t){let r=`
|
|
20
20
|
The following properties are invalid:
|
|
21
21
|
|
|
22
22
|
${e.join(`
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new Kr(r)}var Kr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw Qf(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&X(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function ve(e){return e===void 0}function $f(e){return e===null}function X(e){return ve(e)||$f(e)}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(Hf(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function Hf(e){return ve(e)||fc(e)}function fc(e){return typeof e=="number"&&!isNaN(e)}var te=class{constructor(e={}){de(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(zf(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function zf(e){return ve(e)||mc(e)}function mc(e){return typeof e=="boolean"}var Wf=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){de(this,"value");de(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ve(e))return null;if(!Nn(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Wf.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function Nn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!gc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=" "+i)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function gc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&X(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=" "+o)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return mc(e)||Nn(e)||fc(e)||gc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function hc(e){return Array.isArray(e)}var ji=class{constructor(e){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();function yc(e){return Array.isArray(e)}function _n(e){return e.trim()===""}var Gf=new Set(["1",1,"yes",!0]);function Sc(){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=>Gf.has(r))}function vc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Yr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Kf(e){if(_n(e.openingDelimiter)||_n(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||_n(e.content))return e.content;if(e.highlights.length===0)return rr(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,f=a+i.length;if(f>t)break;r+=rr(e.content.slice(n,a)),r+=e.openingDelimiter,r+=rr(e.content.slice(a,f)),r+=e.closingDelimiter,n=f}return n!==t&&(r+=rr(e.content.slice(n))),r}function Yf(e,t){return e=rr(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Li(n,t.notMatchDelimiters):o?Li(o,t.exactMatchDelimiters):i?Li(i,t.correctionDelimiters):r)}function Li(e,t){return t?t.open+e+t.close:e}function rr(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();d();c();l();u();var Vn=e=>e;d();c();l();u();var Cc=e=>e,bc=e=>e,Ac=e=>e;d();c();l();u();d();c();l();u();function jn(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function We(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:jn(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:jn(),extendedResults:{},searchAction:void 0}}d();c();l();u();function mt(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var gt=e=>{let{response:t}=e;return t.body?Jf(e):Xf(t)},Jf=e=>em(e)?tm(e):Zf(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Xf=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Zf(e){return e.body.statusCode!==void 0}function em(e){return e.body.exception!==void 0}var tm=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var Mc=Qe(Fc(),1);d();c();l();u();d();c();l();u();var Im="recommendation-internal-options",cw=Symbol.for(Im);var Ge=new Error("Failed to load reducers."),nr=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var jt=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function kc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Oc(e){return typeof e!="object"||!e?!1:Object.values(e).every(Pm)}function Pm(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Dc(e){return e===429}var $e=class e{static call(t){return _asyncToGenerator(function*(){let r=Tm(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,f=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield b(i,a);if(Dc(m.status))throw m;return m});return function f(){return _ref.apply(this,arguments)}}();try{let m=yield(0,Mc.backOff)(f,{retry:p=>{let h=p&&Dc(p.status);return h&&n.info("Platform retrying request"),h}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new nr;case 404:throw new jt(i,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new jt(i):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:f,...m}=t,p=Yr(m);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return p})()}};function Pe(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ht(e,t="prod"){return`${Pe(e,t)}/rest/search/v2`}function Un(e,t="prod"){return`${Pe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Tm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,f=e.method==="POST"||e.method==="PUT",m=Fm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(f&&{body:m}),signal:a}}function Fm(e,t){return t==="application/x-www-form-urlencoded"?Oc(e)?kc(e):"":JSON.stringify(e)}d();c();l();u();var yt=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new s.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();var Zr=class{constructor(t){de(this,"_basePath");de(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};d();c();l();u();function qc(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var ot=(e,t,r,n)=>{let o=new Zr(`${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 Nc=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield $e.call({...ot(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:mt(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=qc(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return km(a)?{success:a}:{error:gt({response:r,body:a})}});return function Nc(_x,_x2){return _ref2.apply(this,arguments)}}();function km(e){return typeof e=="string"}d();c();l();u();function Om(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Dm(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Bn(e,t){if(t&&e.name==="AbortError")return{error:Dm(e)};if(e instanceof jt)return{error:Om(e)};throw e}var Qn=class{constructor(t){this.options=t;de(this,"apiCallsQueues",{unknown:new yt,mainSearch:new yt,facetValues:new yt,foldingCollection:new yt,instantResults:new yt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json","/plan"),requestParams:mt(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Bn(r);let n=yield r.json();return qm(n)?{success:n}:{error:gt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:mt(t),..._this3.options});if(r instanceof Error)return Bn(r);let n=yield r.json(),o={response:r,body:n};return Mm(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:gt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(f=>$e.call({...ot(t,"POST","application/json",""),requestParams:mt(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:f??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Bn(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return _c(i)?(a.body=Vc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:gt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json","/facet"),requestParams:mt(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json",""),requestParams:mt(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(_c(n)){let o={response:r,body:n};return o.body=Vc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:gt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Nc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Nm(n)?{success:n}:{error:gt({response:r,body:n})}})()}},$n=e=>e.success!==void 0,ke=e=>e.error!==void 0;function _c(e){return e.results!==void 0}function Vc(e){let t=jn();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Mm(e){return e.completions!==void 0}function qm(e){return e.preprocessingOutput!==void 0}function Nm(e){return e.fields!==void 0}d();c();l();u();d();c();l();u();d();c();l();u();function Ce(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 _m=typeof Symbol=="function"&&Symbol.observable||"@@observable",jc=_m,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),Vm={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},Hn=Vm;function Ke(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 Ji(e,t,r){if(typeof e!="function")throw new Error(Ce(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ce(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ce(1));return r(Ji)(e,t)}let n=e,o=t,i=new Map,a=i,f=0,m=!1;function p(){a===i&&(a=new Map,i.forEach((P,x)=>{a.set(x,P)}))}function h(){if(m)throw new Error(Ce(3));return o}function y(P){if(typeof P!="function")throw new Error(Ce(4));if(m)throw new Error(Ce(5));let x=!0;p();let T=f++;return a.set(T,P),function(){if(x){if(m)throw new Error(Ce(6));x=!1,p(),a.delete(T),i=null}}}function S(P){if(!Ke(P))throw new Error(Ce(7));if(typeof P.type>"u")throw new Error(Ce(8));if(typeof P.type!="string")throw new Error(Ce(17));if(m)throw new Error(Ce(9));try{m=!0,o=n(o,P)}finally{m=!1}return(i=a).forEach(T=>{T()}),P}function g(P){if(typeof P!="function")throw new Error(Ce(10));n=P,S({type:Hn.REPLACE})}function v(){let P=y;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(Ce(11));function T(){let E=x;E.next&&E.next(h())}return T(),{unsubscribe:P(T)}},[jc](){return this}}}return S({type:Hn.INIT}),{dispatch:S,subscribe:y,getState:h,replaceReducer:g,[jc]:v}}function jm(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Hn.INIT})>"u")throw new Error(Ce(12));if(typeof r(void 0,{type:Hn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ce(13))})}function or(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let f=t[a];typeof e[f]=="function"&&(r[f]=e[f])}let n=Object.keys(r),o,i;try{jm(r)}catch(a){i=a}return function(f={},m){if(i)throw i;let p=!1,h={};for(let y=0;y<n.length;y++){let S=n[y],g=r[S],v=f[S],R=g(v,m);if(typeof R>"u"){let P=m&&m.type;throw new Error(Ce(14))}h[S]=R,p=p||R!==v}return p=p||n.length!==Object.keys(f).length,p?h:f}}function ir(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Lc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ce(15))},a={getState:o.getState,dispatch:(m,...p)=>i(m,...p)},f=e.map(m=>m(a));return i=ir(...f)(o.dispatch),{...o,dispatch:i}}}function zn(e){return Ke(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),en=Symbol.for("immer-draftable"),Oe=Symbol.for("immer-state");function be(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ut=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[Oe]}function De(e){return e?Hc(e)||Array.isArray(e)||!!e[en]||!!e.constructor?.[en]||an(e)||sn(e):!1}var Lm=Object.prototype.constructor.toString();function Hc(e){if(!e||typeof e!="object")return!1;let t=Ut(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)===Lm}function ca(e){return Ne(e)||be(15,e),e[Oe].base_}function tn(e,t){Bt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Bt(e){let t=e[Oe];return t?t.type_:Array.isArray(e)?1:an(e)?2:sn(e)?3:0}function rn(e,t){return Bt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return Bt(e)===2?e.get(t):e[t]}function zc(e,t,r){let n=Bt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Um(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function an(e){return e instanceof Map}function sn(e){return e instanceof Set}function Lt(e){return e.copy_||e.base_}function ta(e,t){if(an(e))return new Map(e);if(sn(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Hc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Oe];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],f=n[a];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(n[a]={configurable:!0,writable:!0,enumerable:f.enumerable,value:e[a]})}return Object.create(Ut(e),n)}else{let n=Ut(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Kn(e,t=!1){return Yn(e)||Ne(e)||!De(e)||(Bt(e)>1&&(e.set=e.add=e.clear=e.delete=Bm),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Kn(n,!0))),e}function Bm(){be(2)}function Yn(e){return Object.isFrozen(e)}var ra={};function Qt(e){let t=ra[e];return t||be(0,e),t}function Qm(e,t){ra[e]||(ra[e]=t)}var nn;function Wc(){return nn}function $m(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Uc(e,t){t&&(Qt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(Hm),e.drafts_=null}function oa(e){e===nn&&(nn=e.parent_)}function Bc(e){return nn=$m(nn,e)}function Hm(e){let t=e[Oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Oe].modified_&&(na(t),be(4)),De(e)&&(e=Wn(t,e),t.parent_||Gn(t,e)),t.patches_&&Qt("Patches").generateReplacementPatches_(r[Oe].base_,e,t.patches_,t.inversePatches_)):e=Wn(t,r,[]),na(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sa?e:void 0}function Wn(e,t,r){if(Yn(t))return t;let n=t[Oe];if(!n)return tn(t,(o,i)=>$c(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Gn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),tn(i,(f,m)=>$c(e,n,o,f,m,r,a)),Gn(e,o,!1),r&&e.patches_&&Qt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function $c(e,t,r,n,o,i,a){if(Ne(o)){let f=i&&t&&t.type_!==3&&!rn(t.assigned_,n)?i.concat(n):void 0,m=Wn(e,o,f);if(zc(r,n,m),Ne(m))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Yn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Wn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Gn(e,o)}}function Gn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kn(t,r)}function zm(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Wc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=ua;r&&(o=[n],i=on);let{revoke:a,proxy:f}=Proxy.revocable(o,i);return n.draft_=f,n.revoke_=a,f}var ua={get(e,t){if(t===Oe)return e;let r=Lt(e);if(!rn(r,t))return Wm(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Zi(e.base_,t)?(ea(e),e.copy_[t]=aa(n,e)):n},has(e,t){return t in Lt(e)},ownKeys(e){return Reflect.ownKeys(Lt(e))},set(e,t,r){let n=Gc(Lt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zi(Lt(e),t),i=o?.[Oe];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Um(r,o)&&(r!==void 0||rn(e.base_,t)))return!0;ea(e),ia(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 Zi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ea(e),ia(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Lt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){be(11)},getPrototypeOf(e){return Ut(e.base_)},setPrototypeOf(){be(12)}},on={};tn(ua,(e,t)=>{on[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});on.deleteProperty=function(e,t){return on.set.call(this,e,t,void 0)};on.set=function(e,t,r){return ua.set.call(this,e[0],t,r,e[0])};function Zi(e,t){let r=e[Oe];return(r?Lt(r):e)[t]}function Wm(e,t,r){let n=Gc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Gc(e,t){if(!(t in e))return;let r=Ut(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ut(r)}}function ia(e){e.modified_||(e.modified_=!0,e.parent_&&ia(e.parent_))}function ea(e){e.copy_||(e.copy_=ta(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Gm=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(m=i,...p){return a.produce(m,h=>r.call(this,h,...p))}}typeof r!="function"&&be(6),n!==void 0&&typeof n!="function"&&be(7);let o;if(De(t)){let i=Bc(this),a=aa(t,void 0),f=!0;try{o=r(a),f=!1}finally{f?na(i):oa(i)}return Uc(i,n),Qc(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sa&&(o=void 0),this.autoFreeze_&&Kn(o,!0),n){let i=[],a=[];Qt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else be(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...f)=>this.produceWithPatches(a,m=>t(m,...f));let n,o;return[this.produce(t,r,(a,f)=>{n=a,o=f}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||be(8),Ne(e)&&(e=Kc(e));let t=Bc(this),r=aa(e,void 0);return r[Oe].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[Oe];(!r||!r.isManual_)&&be(9);let{scope_:n}=r;return Uc(n,t),Qc(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=Qt("Patches").applyPatches_;return Ne(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=an(e)?Qt("MapSet").proxyMap_(e,t):sn(e)?Qt("MapSet").proxySet_(e,t):zm(e,t);return(t?t.scope_:Wc()).drafts_.push(r),r}function Kc(e){return Ne(e)||be(10,e),Yc(e)}function Yc(e){if(!De(e)||Yn(e))return e;let t=e[Oe],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ta(e,!0);return tn(r,(n,o)=>{zc(r,n,Yc(o))}),t&&(t.finalized_=!1),r}function Jc(){let t="replace",r="add",n="remove";function o(S,g,v,R){switch(S.type_){case 0:case 2:return a(S,g,v,R);case 1:return i(S,g,v,R);case 3:return f(S,g,v,R)}}function i(S,g,v,R){let{base_:P,assigned_:x}=S,T=S.copy_;T.length<P.length&&([P,T]=[T,P],[v,R]=[R,v]);for(let w=0;w<P.length;w++)if(x[w]&&T[w]!==P[w]){let E=g.concat([w]);v.push({op:t,path:E,value:y(T[w])}),R.push({op:t,path:E,value:y(P[w])})}for(let w=P.length;w<T.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:y(T[w])})}for(let w=T.length-1;P.length<=w;--w){let E=g.concat([w]);R.push({op:n,path:E})}}function a(S,g,v,R){let{base_:P,copy_:x}=S;tn(S.assigned_,(T,w)=>{let E=Xi(P,T),N=Xi(x,T),k=w?rn(P,T)?t:r:n;if(E===N&&k===t)return;let I=g.concat(T);v.push(k===n?{op:k,path:I}:{op:k,path:I,value:N}),R.push(k===r?{op:n,path:I}:k===n?{op:r,path:I,value:y(E)}:{op:t,path:I,value:y(E)})})}function f(S,g,v,R){let{base_:P,copy_:x}=S,T=0;P.forEach(w=>{if(!x.has(w)){let E=g.concat([T]);v.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}T++}),T=0,x.forEach(w=>{if(!P.has(w)){let E=g.concat([T]);v.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}T++})}function m(S,g,v,R){v.push({op:t,path:[],value:g===sa?void 0:g}),R.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:R,op:P}=v,x=S;for(let N=0;N<R.length-1;N++){let k=Bt(x),I=R[N];typeof I!="string"&&typeof I!="number"&&(I=""+I),(k===0||k===1)&&(I==="__proto__"||I==="constructor")&&be(19),typeof x=="function"&&I==="prototype"&&be(19),x=Xi(x,I),typeof x!="object"&&be(18,R.join("/"))}let T=Bt(x),w=h(v.value),E=R[R.length-1];switch(P){case t:switch(T){case 2:return x.set(E,w);case 3:be(16);default:return x[E]=w}case r:switch(T){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(T){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(v.value);default:return delete x[E]}default:be(17,P)}}),S}function h(S){if(!De(S))return S;if(Array.isArray(S))return S.map(h);if(an(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,h(R)]));if(sn(S))return new Set(Array.from(S).map(h));let g=Object.create(Ut(S));for(let v in S)g[v]=h(S[v]);return rn(S,en)&&(g[en]=S[en]),g}function y(S){return Ne(S)?h(S):S}Qm("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:m})}var _e=new Gm,it=_e.produce,Jn=_e.produceWithPatches.bind(_e),Ux=_e.setAutoFreeze.bind(_e),Bx=_e.setUseStrictShallowCopy.bind(_e),la=_e.applyPatches.bind(_e),Qx=_e.createDraft.bind(_e),$x=_e.finishDraft.bind(_e);d();c();l();u();function Km(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ym(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Jm(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 Xc=e=>Array.isArray(e)?e:[e];function Xm(e){let t=Array.isArray(e[0])?e[0]:e;return Jm(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Zm(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Jx=Symbol();var Xx=Object.getPrototypeOf({});var eg=class{constructor(e){this.value=e}deref(){return this.value}},tg=typeof WeakRef<"u"?WeakRef:eg,rg=0,Zc=1;function Xn(){return{s:rg,v:void 0,o:null,p:null}}function ar(e,t={}){let r=Xn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let f=r,{length:m}=arguments;for(let y=0,S=m;y<S;y++){let g=arguments[y];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=f.o;v===null&&(f.o=v=new WeakMap);let R=v.get(g);R===void 0?(f=Xn(),v.set(g,f)):f=R}else{let v=f.p;v===null&&(f.p=v=new Map);let R=v.get(g);R===void 0?(f=Xn(),v.set(g,f)):f=R}}let p=f,h;if(f.s===Zc)h=f.v;else if(h=e.apply(null,arguments),i++,n){let y=o?.deref?.()??o;y!=null&&n(y,h)&&(h=y,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new tg(h):h}return p.s=Zc,p.v=h,h}return a.clearCache=()=>{r=Xn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function eu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,f,m={},p=o.pop();typeof p=="object"&&(m=p,p=o.pop()),Km(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let h={...r,...m},{memoize:y,memoizeOptions:S=[],argsMemoize:g=ar,argsMemoizeOptions:v=[],devModeChecks:R={}}=h,P=Xc(S),x=Xc(v),T=Xm(o),w=y(function(){return i++,p.apply(null,arguments)},...P),E=!0,N=g(function(){a++;let I=Zm(T,arguments);return f=w.apply(null,I),f},...x);return Object.assign(N,{resultFunc:p,memoizedResultFunc:w,dependencies:T,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>f,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:y,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=eu(ar),ng=Object.assign((e,t=pe)=>{Ym(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,f,m)=>(a[r[m]]=f,a),{}))},{withTypes:()=>ng});d();c();l();u();function tu(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var ru=tu(),nu=tu;var og=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ir:ir.apply(null,arguments)},hR=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ig=e=>e&&typeof e.match=="function";function D(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(He(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=>zn(n)&&n.type===e,r}var cu=class cn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,cn.prototype)}static get[Symbol.species](){return cn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new cn(...t[0].concat(this)):new cn(...t.concat(this))}};function ou(e){return De(e)?it(e,()=>{}):e}function iu(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ag(e){return typeof e=="boolean"}var sg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new cu;return r&&(ag(r)?a.push(ru):a.push(nu(r.extraArgument))),a},un="RTK_autoBatch",cr=()=>e=>({payload:e,meta:{[un]:!0}}),au=e=>t=>{setTimeout(t,e)},cg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,f=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:au(10):e.type==="callback"?e.queueNotification:au(e.timeout),p=()=>{a=!1,i&&(i=!1,f.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let y=()=>o&&h(),S=n.subscribe(y);return f.add(h),()=>{S(),f.delete(h)}},dispatch(h){try{return o=!h?.meta?.[un],i=!o,i&&(a||(a=!0,m(p))),n.dispatch(h)}finally{o=!0}}})},ug=e=>function(r){let{autoBatch:n=!0}=r??{},o=new cu(e);return n&&o.push(cg(typeof n=="object"?n:void 0)),o};function uu(e){let t=sg(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Ke(r))f=or(r);else throw new Error(He(1));let m;typeof n=="function"?m=n(t):m=t();let p=ir;o&&(p=og({trace:!1,...(typeof o=="object"&&o)}));let h=Lc(...m),y=ug(h),S=typeof a=="function"?a(y):y(),g=p(...S);return Ji(f,i,g)}function lu(e){let t={},r=[],n,o={addCase(i,a){let f=typeof i=="string"?i:i.type;if(!f)throw new Error(He(28));if(f in t)throw new Error(He(29));return t[f]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function lg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=lu(t),i;if(lg(e))i=()=>ou(e());else{let f=ou(e);i=()=>f}function a(f=i(),m){let p=[r[m.type],...n.filter(({matcher:h})=>h(m)).map(({reducer:h})=>h)];return p.filter(h=>!!h).length===0&&(p=[o]),p.reduce((h,y)=>{if(y)if(Ne(h)){let g=y(h,m);return g===void 0?h:g}else{if(De(h))return it(h,S=>y(S,m));{let S=y(h,m);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},f)}return a.getInitialState=i,a}var du=(e,t)=>ig(e)?e.match(t):e(t);function Ye(...e){return t=>e.some(r=>du(r,t))}function sr(...e){return t=>e.every(r=>du(r,t))}function eo(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 ln(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function to(...e){return e.length===0?t=>eo(t,["pending"]):ln(e)?Ye(...e.map(t=>t.pending)):to()(e[0])}function $t(...e){return e.length===0?t=>eo(t,["rejected"]):ln(e)?Ye(...e.map(t=>t.rejected)):$t()(e[0])}function dn(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?sr($t(...e),t):ln(e)?sr($t(...e),t):dn()(e[0])}function at(...e){return e.length===0?t=>eo(t,["fulfilled"]):ln(e)?Ye(...e.map(t=>t.fulfilled)):at()(e[0])}function ro(...e){return e.length===0?t=>eo(t,["pending","fulfilled","rejected"]):ln(e)?Ye(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ro()(e[0])}var dg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",no=(e=21)=>{let t="",r=e;for(;r--;)t+=dg[Math.random()*64|0];return t},pg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},su=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},fg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of pg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ue=(()=>{function e(t,r,n){let o=D(t+"/fulfilled",(m,p,h,y)=>({payload:m,meta:{...(y||{}),arg:h,requestId:p,requestStatus:"fulfilled"}})),i=D(t+"/pending",(m,p,h)=>({payload:void 0,meta:{...(h||{}),arg:p,requestId:m,requestStatus:"pending"}})),a=D(t+"/rejected",(m,p,h,y,S)=>({payload:y,error:(n&&n.serializeError||fg)(m||"Rejected"),meta:{...(S||{}),arg:h,requestId:p,rejectedWithValue:!!y,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function f(m){return(p,h,y)=>{let S=n?.idGenerator?n.idGenerator(m):no(),g=new s.AbortController,v,R;function P(T){R=T,g.abort()}let x=_asyncToGenerator(function*(){let T;try{let E=n?.condition?.(m,{getState:h,extra:y});if(gg(E)&&(E=yield E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((k,I)=>{v=()=>{I({name:"AbortError",message:R||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,m,n?.getPendingMeta?.({requestId:S,arg:m},{getState:h,extra:y}))),T=yield Promise.race([N,Promise.resolve(r(m,{dispatch:p,getState:h,extra:y,requestId:S,signal:g.signal,abort:P,rejectWithValue:(k,I)=>new da(k,I),fulfillWithValue:(k,I)=>new su(k,I)})).then(k=>{if(k instanceof da)throw k;return k instanceof su?o(k.payload,S,m,k.meta):o(k,S,m)})])}catch(E){T=E instanceof da?a(null,S,m,E.payload,E.meta):a(E,S,m)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(T)&&T.meta.condition||p(T),T})();return Object.assign(x,{abort:P,requestId:S,arg:m,unwrap(){return x.then(mg)}})}}return Object.assign(f,{pending:i,rejected:a,fulfilled:o,settled:Ye(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function mg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function gg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pu=Symbol.for("rtk-slice-createasyncthunk"),bR={[pu]:ue};function hg(e,t){return`${e}/${t}`}function yg({creators:e}={}){let t=e?.asyncThunk?.[pu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(He(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(vg()):n.reducers)||{},f=Object.keys(a),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(T,w){let E=typeof T=="string"?T:T.type;if(!E)throw new Error(He(12));if(E in m.sliceCaseReducersByType)throw new Error(He(13));return m.sliceCaseReducersByType[E]=w,p},addMatcher(T,w){return m.sliceMatchers.push({matcher:T,reducer:w}),p},exposeAction(T,w){return m.actionCreators[T]=w,p},exposeCaseReducer(T,w){return m.sliceCaseReducersByName[T]=w,p}};f.forEach(T=>{let w=a[T],E={reducerName:T,type:hg(o,T),createNotation:typeof n.reducers=="function"};bg(w)?wg(E,w,p,t):Cg(E,w,p)});function h(){let[T={},w=[],E=void 0]=typeof n.extraReducers=="function"?lu(n.extraReducers):[n.extraReducers],N={...T,...m.sliceCaseReducersByType};return ge(n.initialState,k=>{for(let I in N)k.addCase(I,N[I]);for(let I of m.sliceMatchers)k.addMatcher(I.matcher,I.reducer);for(let I of w)k.addMatcher(I.matcher,I.reducer);E&&k.addDefaultCase(E)})}let y=T=>T,S=new Map,g;function v(T,w){return g||(g=h()),g(T,w)}function R(){return g||(g=h()),g.getInitialState()}function P(T,w=!1){function E(k){let I=k[T];return typeof I>"u"&&w&&(I=R()),I}function N(k=y){let I=iu(S,w,()=>new WeakMap);return iu(I,k,()=>{let F={};for(let[O,_]of Object.entries(n.selectors??{}))F[O]=Sg(_,k,R,w);return F})}return{reducerPath:T,getSelectors:N,get selectors(){return N(E)},selectSlice:E}}let x={name:o,reducer:v,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:R,...P(i),injectInto(T,{reducerPath:w,...E}={}){let N=w??i;return T.inject({reducerPath:N,reducer:v},E),{...x,...P(N,!0)}}};return x}}function Sg(e,t,r,n){function o(i,...a){let f=t(i);return typeof f>"u"&&n&&(f=r()),e(f,...a)}return o.unwrapped=e,o}var Ht=yg();function vg(){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 Cg({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Ag(n))throw new Error(He(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?D(e,a):D(e))}function bg(e){return e._reducerDefinitionType==="asyncThunk"}function Ag(e){return e._reducerDefinitionType==="reducerWithPrepare"}function wg({type:e,reducerName:t},r,n,o){if(!o)throw new Error(He(18));let{payloadCreator:i,fulfilled:a,pending:f,rejected:m,settled:p,options:h}=r,y=o(e,i,h);n.exposeAction(t,y),a&&n.addCase(y.fulfilled,a),f&&n.addCase(y.pending,f),m&&n.addCase(y.rejected,m),p&&n.addMatcher(y.settled,p),n.exposeCaseReducer(t,{fulfilled:a||Zn,pending:f||Zn,rejected:m||Zn,settled:p||Zn})}function Zn(){}var fu="listener",mu="completed",gu="cancelled",AR=`task-${gu}`,wR=`task-${mu}`,xR=`${fu}-${gu}`,RR=`${fu}-${mu}`;var{assign:hu}=Object;var pa="listenerMiddleware";var xg=hu(D(`${pa}/add`),{withTypes:()=>xg}),ER=D(`${pa}/removeAll`),Rg=hu(D(`${pa}/remove`),{withTypes:()=>Rg});var IR=Symbol.for("rtk-state-proxy-original");function He(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();var G=new H({required:!0,emptyAllowed:!1}),Ae=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),LR=new H({required:!1,emptyAllowed:!0}),oo=new ie({each:G,required:!0}),yu=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Su=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),UR=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),st=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Le=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Kr(o);return{payload:e}},B=(e,t)=>{try{return Le(e,t)}catch(r){return{payload:e,error:st(r)}}},vu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return bu(e,t,r,o,"Controller initialization error")},Cu=(e,t,r,n)=>{let o=`Check the options of ${n}`;return bu(e,t,r,o,"Controller initialization error")},bu=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var ur="3.27.1",Au=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ae,wu=()=>G,St=D("configuration/updateBasicConfiguration",e=>B(e,{accessToken:Ae,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ae})),Je=D("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ae,timezone:Ae,locale:Ae,authenticationProviders:new ie({required:!1,each:G})})),Eg={enabled:new te({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new te({default:!1}),deviceId:Ae,userDisplayName:Ae,documentLocation:Ae,trackingId:Su,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:Au.reduce((e,t)=>(e[t]=yu,e),{})})},lr=D("configuration/updateAnalyticsConfiguration",e=>B(e,Eg)),dr=D("configuration/analytics/disable"),pr=D("configuration/analytics/enable"),io=D("configuration/analytics/originlevel2",e=>B(e,{originLevel2:wu()})),ao=D("configuration/analytics/originlevel3",e=>B(e,{originLevel3:wu()}));d();c();l();u();d();c();l();u();d();c();l();u();var xu={q:new H,enableQuerySyntax:new te,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new te,sf:new K,tab:new H,af:new K};var vt=D("searchParameters/restore",e=>B(e,xu)),Ru=D("searchParameters/restoreTab",e=>B(e,G));d();c();l();u();var so=D("debug/enable"),co=D("debug/disable");d();c();l();u();var uo=()=>!1;var lo=ge(uo(),e=>{e.addCase(so,()=>!0).addCase(co,()=>!1).addCase(vt,(t,r)=>r.payload.debug??t)});d();c();l();u();var fr=D("pipeline/set",e=>B(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var Ig=D("history/undo"),Pg=D("history/redo"),Xe=D("history/snapshot"),ZE=ue("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Ig()),yield t(Me())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),eI=ue("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Pg()),yield t(Me())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Me=ue("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());d();c();l();u();var mr=()=>"";var gr=ge(mr(),e=>{e.addCase(fr,(t,r)=>r.payload).addCase(Me.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Je,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var hr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let f=window.location.hostname,m=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;m.test(f)||p.test(f)||f.indexOf(".")===-1?ma(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],ma(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ma(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Tg(){return typeof navigator<"u"}function Eu(){try{return typeof localStorage<"u"}catch{return!1}}function Iu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Pu(){return!!(Tg()&&navigator.cookieEnabled)}var Tu=null;function Fu(){return Tu||(Eu()?localStorage:Pu()?new ga:Iu()?sessionStorage:new ha)}var yr=class yr{getItem(t){return hr.get(`${yr.prefix}${t}`)}removeItem(t){hr.erase(`${yr.prefix}${t}`)}setItem(t,r,n){hr.set(`${yr.prefix}${t}`,r,n)}};de(yr,"prefix","coveo_");var ga=yr;var ha=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var po="__coveo.analytics.history",Fg=20,kg=1e3*60,Og=75,zt=class zt{constructor(t){de(this,"store");this.store=t||Fu()}static getInstance(t){return zt.instance||(zt.instance=new zt(t)),zt.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(po);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(po);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(po,JSON.stringify(t.slice(0,Fg)))}catch{}}clear(){try{this.store.removeItem(po)}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,Og)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>kg:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};de(zt,"instance",null);var ya=zt,Ze=ya;d();c();l();u();d();c();l();u();var Sr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ur}`));d();c();l();u();d();c();l();u();function ct(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 M(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(h){try{p(n.next(h))}catch(y){a(y)}}function m(h){try{p(n.throw(h))}catch(y){a(y)}}function p(h){h.done?i(h.value):o(h.value).then(f,m)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function Ca(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function vr(){return typeof document<"u"}function ba(){try{return typeof localStorage<"u"}catch{return!1}}function Dg(){try{return typeof sessionStorage<"u"}catch{return!1}}function $u(){return Da()&&navigator.cookieEnabled}var Mg=[ae.click,ae.custom,ae.search,ae.view],qg=(e,t)=>Mg.indexOf(e)!==-1?Object.assign({language:vr()?document.documentElement.lang:"unknown",userAgent:Da()?navigator.userAgent:"unknown"},t):t,fn=class e{static set(t,r,n){var o,i,a,f;n&&(i=new Date,i.setTime(i.getTime()+n)),f=window.location.hostname,f.indexOf(".")===-1?ku(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],ku(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ku(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Ng(){return ba()?localStorage:$u()?new mn:Dg()?sessionStorage:new br}var mn=class e{getItem(t){return fn.get(`${e.prefix}${t}`)}removeItem(t){fn.erase(`${e.prefix}${t}`)}setItem(t,r,n){fn.set(`${e.prefix}${t}`,r,n)}};mn.prefix="coveo_";var Aa=class{constructor(){this.cookieStorage=new mn}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)}},br=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fo="__coveo.analytics.history",_g=20,Vg=1e3*60,jg=75,ho=class{constructor(t){this.store=t||Ng()}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 M(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 M(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(fo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return M(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(fo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fo,JSON.stringify(t.slice(0,_g)))}catch{}}clear(){try{this.store.removeItem(fo)}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,jg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Vg:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Lg=(e,t)=>M(void 0,void 0,void 0,function*(){return e===ae.view?(yield Ug(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Ug=e=>M(void 0,void 0,void 0,function*(){let t=new ho,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),mo,Bg=new Uint8Array(16);function Qg(){if(!mo&&(mo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mo(Bg)}var $g=/^(?:[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 yo(e){return typeof e=="string"&&$g.test(e)}var xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));function Hu(e,t=0){return(xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]).toLowerCase()}function Hg(e){if(!yo(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 zg(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Wg="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Gg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Kg(e,t,r){function n(o,i,a,f){var m;if(typeof o=="string"&&(o=zg(o)),typeof i=="string"&&(i=Hg(i)),((m=i)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){f=f||0;for(let h=0;h<16;++h)a[f+h]=p[h];return a}return Hu(p)}try{n.name=e}catch{}return n.DNS=Wg,n.URL=Gg,n}var Yg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ou={randomUUID:Yg};function Wt(e,t,r){if(Ou.randomUUID&&!t&&!e)return Ou.randomUUID();e=e||{};let n=e.random||(e.rng||Qg)();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 Hu(n)}function Jg(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 Sa(e,t){return e<<t|e>>>32-t}function Xg(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let f=0;f<a.length;++f)e.push(a.charCodeAt(f))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let f=new Uint32Array(16);for(let m=0;m<16;++m)f[m]=e[a*64+m*4]<<24|e[a*64+m*4+1]<<16|e[a*64+m*4+2]<<8|e[a*64+m*4+3];i[a]=f}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let f=new Uint32Array(80);for(let g=0;g<16;++g)f[g]=i[a][g];for(let g=16;g<80;++g)f[g]=Sa(f[g-3]^f[g-8]^f[g-14]^f[g-16],1);let m=r[0],p=r[1],h=r[2],y=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),R=Sa(m,5)+Jg(v,p,h,y)+S+t[v]+f[g]>>>0;S=y,y=h,h=Sa(p,30)>>>0,p=m,m=R}r[0]=r[0]+m>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+S>>>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 Zg=Kg("v5",80,Xg),Du=Zg,zu="2.30.45",Mu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,pn={pageview:"pageview",event:"event"},So=class{constructor({client:t,uuidGenerator:r=Wt}){this.client=t,this.uuidGenerator=r}},wa=class extends So{constructor({client:t,uuidGenerator:r=Wt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Mu(window.location),this.lastReferrer=vr()?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:vr()?document.title:"",encoding:vr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===pn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===pn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===pn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===pn.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 Mu(window.location)}},Ct=class e{constructor(t,r){if(!yo(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return yo(i)?new e(i,Number.parseInt(o)*1e3):null}};Ct.cvo_cid="cvo_cid";Ct.expirationTime=120;var xa=class extends So{constructor({client:t,uuidGenerator:r=Wt}){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 M(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(Ct.cvo_cid,new Ct(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};xa.Id="link";var Be=Object.keys;function go(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Wu=192,qu=224,Nu=240;function eh(e){return(e&248)===Nu?4:(e&Nu)===qu?3:(e&qu)===Wu?2:1}function th(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&va)!=va)break;if(r-=3,(n&Wu)!=va){t-r>=eh(n)*3&&(r=t);break}}return e.substring(0,r)}var Ra={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"},rh=Be(Ra).map(e=>Ra[e]),nh=[...rh].join("|"),oh=new RegExp(`^(${nh}$)`),ih={svcAction:"svc_action",svcActionData:"svc_action_data"},ah=e=>Be(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ra[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),sh=e=>oh.test(e),ch=[sh],_u={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Vu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},vo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},uh=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},lh={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),vo),purchase:Object.assign(Object.assign({},Ee),vo),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},dh=Be(_u).map(e=>_u[e]),ph=Be(Vu).map(e=>Vu[e]),fh=Be(Ee).map(e=>Ee[e]),mh=Be(vo).map(e=>vo[e]),gh=Be(Ia).map(e=>Ia[e]),hh=Be(Ea).map(e=>Ea[e]),yh=[...dh,"custom"].join("|"),Sh=[...ph,"custom"].join("|"),Gu="(pr[0-9]+)",Ku="(il[0-9]+pi[0-9]+)",vh=new RegExp(`^${Gu}(${yh})$`),Ch=new RegExp(`^(${Ku}(${Sh}))|(il[0-9]+nm)$`),bh=new RegExp(`^(${fh.join("|")})$`),Ah=new RegExp(`^(${mh.join("|")})$`),wh=new RegExp(`^${Gu}custom$`),xh=new RegExp(`^${Ku}custom$`),Rh=new RegExp(`^(${[...uh,...gh,...hh].join("|")})$`),Eh=e=>vh.test(e),Ih=e=>Ch.test(e),Ph=e=>bh.test(e),Th=e=>Ah.test(e),Fh=e=>Rh.test(e),kh=[Ih,Eh,Ph,Th,Fh],Oh=[wh,xh],Dh={anonymizeIp:"aip"},Mh={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},qh={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Nh=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],_h=Object.assign(Object.assign(Object.assign(Object.assign({},Dh),Mh),qh),Nh.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Pa=Object.assign(Object.assign({},_h),ih),Vh=e=>{let t=!!e.action&&lh[e.action]||{};return Be(e).reduce((r,n)=>{let o=t[n]||Pa[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},jh=Be(Pa).map(e=>Pa[e]),Lh=e=>jh.indexOf(e)!==-1,Uh=e=>e==="custom",Bh=e=>[...kh,...ch,Lh,Uh].some(t=>t(e)),Qh=e=>Be(e).reduce((t,r)=>{let n=$h(r);return n?Object.assign(Object.assign({},t),Hh(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),$h=e=>{let t;return[...Oh].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Hh=(e,t)=>Be(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Ta=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:f}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),m=this.encodeForEventType(t,f),p=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return M(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:f,body:m}=a;o=f||t;try{i=JSON.parse(m)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return M(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ae.click,ae.custom,ae.search,ae.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}},Fa=class{sendEvent(t,r){return M(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){return Promise.resolve()})}},ju=C.fetch,Co=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",f={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},f),i?yield i(f,"analyticsFetch"):{}),{url:p}=m,h=ct(m,["url"]),y;try{y=yield ju(p,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(y.ok){let S=yield y.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield ju(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return M(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"})}},ka=class{constructor(t,r){ba()&&$u()?this.storage=new Aa:ba()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new br),this.client=new Co(t),this.beaconClient=new Ta(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Oa=class{constructor(t,r){this.storage=r||new br,this.client=new Co(t)}getClientDependingOnEventType(t){return this.client}},bo=class{constructor(){this.storage=new br,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},zh="xx",Wh=e=>e?.startsWith(zh)||!1,Gh=`
|
|
26
|
+
`;return new Kr(r)}var Kr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw $f(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&X(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function ve(e){return e===void 0}function Hf(e){return e===null}function X(e){return ve(e)||Hf(e)}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(zf(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function zf(e){return ve(e)||mc(e)}function mc(e){return typeof e=="number"&&!isNaN(e)}var te=class{constructor(e={}){de(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(Wf(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Wf(e){return ve(e)||gc(e)}function gc(e){return typeof e=="boolean"}var Gf=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){de(this,"value");de(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ve(e))return null;if(!Nn(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Gf.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function Nn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!hc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=" "+i)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function hc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&X(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=" "+o)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return gc(e)||Nn(e)||mc(e)||hc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function yc(e){return Array.isArray(e)}var ji=class{constructor(e){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();function Sc(e){return Array.isArray(e)}function _n(e){return e.trim()===""}var Kf=new Set(["1",1,"yes",!0]);function vc(){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=>Kf.has(r))}function Cc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Yr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Yf(e){if(_n(e.openingDelimiter)||_n(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||_n(e.content))return e.content;if(e.highlights.length===0)return rr(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,f=a+i.length;if(f>t)break;r+=rr(e.content.slice(n,a)),r+=e.openingDelimiter,r+=rr(e.content.slice(a,f)),r+=e.closingDelimiter,n=f}return n!==t&&(r+=rr(e.content.slice(n))),r}function Jf(e,t){return e=rr(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Li(n,t.notMatchDelimiters):o?Li(o,t.exactMatchDelimiters):i?Li(i,t.correctionDelimiters):r)}function Li(e,t){return t?t.open+e+t.close:e}function rr(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();d();c();l();u();var Vn=e=>e;d();c();l();u();var bc=e=>e,Ac=e=>e,wc=e=>e;d();c();l();u();d();c();l();u();function jn(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function We(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:jn(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:jn(),extendedResults:{},searchAction:void 0}}d();c();l();u();function mt(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var gt=e=>{let{response:t}=e;return t.body?Xf(e):Zf(t)},Xf=e=>tm(e)?rm(e):em(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Zf=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function em(e){return e.body.statusCode!==void 0}function tm(e){return e.body.exception!==void 0}var rm=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var qc=Qe(kc(),1);d();c();l();u();d();c();l();u();var Pm="recommendation-internal-options",cw=Symbol.for(Pm);var Ge=new Error("Failed to load reducers."),nr=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var jt=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function Oc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Dc(e){return typeof e!="object"||!e?!1:Object.values(e).every(Tm)}function Tm(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Mc(e){return e===429}var $e=class e{static call(t){return _asyncToGenerator(function*(){let r=Fm(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,f=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield b(i,a);if(Mc(m.status))throw m;return m});return function f(){return _ref.apply(this,arguments)}}();try{let m=yield(0,qc.backOff)(f,{retry:p=>{let h=p&&Mc(p.status);return h&&n.info("Platform retrying request"),h}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new nr;case 404:throw new jt(i,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new jt(i):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:f,...m}=t,p=Yr(m);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return p})()}};function Pe(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ht(e,t="prod"){return`${Pe(e,t)}/rest/search/v2`}function Un(e,t="prod"){return`${Pe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Fm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,f=e.method==="POST"||e.method==="PUT",m=km(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(f&&{body:m}),signal:a}}function km(e,t){return t==="application/x-www-form-urlencoded"?Dc(e)?Oc(e):"":JSON.stringify(e)}d();c();l();u();var yt=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new s.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();var Zr=class{constructor(t){de(this,"_basePath");de(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};d();c();l();u();function Nc(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var ot=(e,t,r,n)=>{let o=new Zr(`${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 _c=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield $e.call({...ot(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:mt(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Nc(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Om(a)?{success:a}:{error:gt({response:r,body:a})}});return function _c(_x,_x2){return _ref2.apply(this,arguments)}}();function Om(e){return typeof e=="string"}d();c();l();u();function Dm(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Mm(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Bn(e,t){if(t&&e.name==="AbortError")return{error:Mm(e)};if(e instanceof jt)return{error:Dm(e)};throw e}var Qn=class{constructor(t){this.options=t;de(this,"apiCallsQueues",{unknown:new yt,mainSearch:new yt,facetValues:new yt,foldingCollection:new yt,instantResults:new yt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json","/plan"),requestParams:mt(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Bn(r);let n=yield r.json();return Nm(n)?{success:n}:{error:gt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:mt(t),..._this3.options});if(r instanceof Error)return Bn(r);let n=yield r.json(),o={response:r,body:n};return qm(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:gt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(f=>$e.call({...ot(t,"POST","application/json",""),requestParams:mt(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:f??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Bn(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return Vc(i)?(a.body=jc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:gt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json","/facet"),requestParams:mt(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"POST","application/json",""),requestParams:mt(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Vc(n)){let o={response:r,body:n};return o.body=jc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:gt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return _c(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield $e.call({...ot(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return _m(n)?{success:n}:{error:gt({response:r,body:n})}})()}},$n=e=>e.success!==void 0,ke=e=>e.error!==void 0;function Vc(e){return e.results!==void 0}function jc(e){let t=jn();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function qm(e){return e.completions!==void 0}function Nm(e){return e.preprocessingOutput!==void 0}function _m(e){return e.fields!==void 0}d();c();l();u();d();c();l();u();d();c();l();u();function Ce(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 Vm=typeof Symbol=="function"&&Symbol.observable||"@@observable",Lc=Vm,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),jm={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},Hn=jm;function Ke(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 Ji(e,t,r){if(typeof e!="function")throw new Error(Ce(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ce(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ce(1));return r(Ji)(e,t)}let n=e,o=t,i=new Map,a=i,f=0,m=!1;function p(){a===i&&(a=new Map,i.forEach((P,x)=>{a.set(x,P)}))}function h(){if(m)throw new Error(Ce(3));return o}function y(P){if(typeof P!="function")throw new Error(Ce(4));if(m)throw new Error(Ce(5));let x=!0;p();let T=f++;return a.set(T,P),function(){if(x){if(m)throw new Error(Ce(6));x=!1,p(),a.delete(T),i=null}}}function S(P){if(!Ke(P))throw new Error(Ce(7));if(typeof P.type>"u")throw new Error(Ce(8));if(typeof P.type!="string")throw new Error(Ce(17));if(m)throw new Error(Ce(9));try{m=!0,o=n(o,P)}finally{m=!1}return(i=a).forEach(T=>{T()}),P}function g(P){if(typeof P!="function")throw new Error(Ce(10));n=P,S({type:Hn.REPLACE})}function v(){let P=y;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(Ce(11));function T(){let E=x;E.next&&E.next(h())}return T(),{unsubscribe:P(T)}},[Lc](){return this}}}return S({type:Hn.INIT}),{dispatch:S,subscribe:y,getState:h,replaceReducer:g,[Lc]:v}}function Lm(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Hn.INIT})>"u")throw new Error(Ce(12));if(typeof r(void 0,{type:Hn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ce(13))})}function or(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let f=t[a];typeof e[f]=="function"&&(r[f]=e[f])}let n=Object.keys(r),o,i;try{Lm(r)}catch(a){i=a}return function(f={},m){if(i)throw i;let p=!1,h={};for(let y=0;y<n.length;y++){let S=n[y],g=r[S],v=f[S],R=g(v,m);if(typeof R>"u"){let P=m&&m.type;throw new Error(Ce(14))}h[S]=R,p=p||R!==v}return p=p||n.length!==Object.keys(f).length,p?h:f}}function ir(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Uc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ce(15))},a={getState:o.getState,dispatch:(m,...p)=>i(m,...p)},f=e.map(m=>m(a));return i=ir(...f)(o.dispatch),{...o,dispatch:i}}}function zn(e){return Ke(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),en=Symbol.for("immer-draftable"),Oe=Symbol.for("immer-state");function be(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ut=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[Oe]}function De(e){return e?zc(e)||Array.isArray(e)||!!e[en]||!!e.constructor?.[en]||an(e)||sn(e):!1}var Um=Object.prototype.constructor.toString();function zc(e){if(!e||typeof e!="object")return!1;let t=Ut(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)===Um}function ca(e){return Ne(e)||be(15,e),e[Oe].base_}function tn(e,t){Bt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Bt(e){let t=e[Oe];return t?t.type_:Array.isArray(e)?1:an(e)?2:sn(e)?3:0}function rn(e,t){return Bt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return Bt(e)===2?e.get(t):e[t]}function Wc(e,t,r){let n=Bt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Bm(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function an(e){return e instanceof Map}function sn(e){return e instanceof Set}function Lt(e){return e.copy_||e.base_}function ta(e,t){if(an(e))return new Map(e);if(sn(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=zc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Oe];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],f=n[a];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(n[a]={configurable:!0,writable:!0,enumerable:f.enumerable,value:e[a]})}return Object.create(Ut(e),n)}else{let n=Ut(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Kn(e,t=!1){return Yn(e)||Ne(e)||!De(e)||(Bt(e)>1&&(e.set=e.add=e.clear=e.delete=Qm),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Kn(n,!0))),e}function Qm(){be(2)}function Yn(e){return Object.isFrozen(e)}var ra={};function Qt(e){let t=ra[e];return t||be(0,e),t}function $m(e,t){ra[e]||(ra[e]=t)}var nn;function Gc(){return nn}function Hm(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Bc(e,t){t&&(Qt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(zm),e.drafts_=null}function oa(e){e===nn&&(nn=e.parent_)}function Qc(e){return nn=Hm(nn,e)}function zm(e){let t=e[Oe];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $c(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Oe].modified_&&(na(t),be(4)),De(e)&&(e=Wn(t,e),t.parent_||Gn(t,e)),t.patches_&&Qt("Patches").generateReplacementPatches_(r[Oe].base_,e,t.patches_,t.inversePatches_)):e=Wn(t,r,[]),na(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sa?e:void 0}function Wn(e,t,r){if(Yn(t))return t;let n=t[Oe];if(!n)return tn(t,(o,i)=>Hc(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Gn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),tn(i,(f,m)=>Hc(e,n,o,f,m,r,a)),Gn(e,o,!1),r&&e.patches_&&Qt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Hc(e,t,r,n,o,i,a){if(Ne(o)){let f=i&&t&&t.type_!==3&&!rn(t.assigned_,n)?i.concat(n):void 0,m=Wn(e,o,f);if(Wc(r,n,m),Ne(m))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Yn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Wn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Gn(e,o)}}function Gn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kn(t,r)}function Wm(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Gc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=ua;r&&(o=[n],i=on);let{revoke:a,proxy:f}=Proxy.revocable(o,i);return n.draft_=f,n.revoke_=a,f}var ua={get(e,t){if(t===Oe)return e;let r=Lt(e);if(!rn(r,t))return Gm(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Zi(e.base_,t)?(ea(e),e.copy_[t]=aa(n,e)):n},has(e,t){return t in Lt(e)},ownKeys(e){return Reflect.ownKeys(Lt(e))},set(e,t,r){let n=Kc(Lt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zi(Lt(e),t),i=o?.[Oe];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Bm(r,o)&&(r!==void 0||rn(e.base_,t)))return!0;ea(e),ia(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 Zi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ea(e),ia(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Lt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){be(11)},getPrototypeOf(e){return Ut(e.base_)},setPrototypeOf(){be(12)}},on={};tn(ua,(e,t)=>{on[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});on.deleteProperty=function(e,t){return on.set.call(this,e,t,void 0)};on.set=function(e,t,r){return ua.set.call(this,e[0],t,r,e[0])};function Zi(e,t){let r=e[Oe];return(r?Lt(r):e)[t]}function Gm(e,t,r){let n=Kc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Kc(e,t){if(!(t in e))return;let r=Ut(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ut(r)}}function ia(e){e.modified_||(e.modified_=!0,e.parent_&&ia(e.parent_))}function ea(e){e.copy_||(e.copy_=ta(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Km=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(m=i,...p){return a.produce(m,h=>r.call(this,h,...p))}}typeof r!="function"&&be(6),n!==void 0&&typeof n!="function"&&be(7);let o;if(De(t)){let i=Qc(this),a=aa(t,void 0),f=!0;try{o=r(a),f=!1}finally{f?na(i):oa(i)}return Bc(i,n),$c(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sa&&(o=void 0),this.autoFreeze_&&Kn(o,!0),n){let i=[],a=[];Qt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else be(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...f)=>this.produceWithPatches(a,m=>t(m,...f));let n,o;return[this.produce(t,r,(a,f)=>{n=a,o=f}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||be(8),Ne(e)&&(e=Yc(e));let t=Qc(this),r=aa(e,void 0);return r[Oe].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[Oe];(!r||!r.isManual_)&&be(9);let{scope_:n}=r;return Bc(n,t),$c(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=Qt("Patches").applyPatches_;return Ne(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=an(e)?Qt("MapSet").proxyMap_(e,t):sn(e)?Qt("MapSet").proxySet_(e,t):Wm(e,t);return(t?t.scope_:Gc()).drafts_.push(r),r}function Yc(e){return Ne(e)||be(10,e),Jc(e)}function Jc(e){if(!De(e)||Yn(e))return e;let t=e[Oe],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ta(e,!0);return tn(r,(n,o)=>{Wc(r,n,Jc(o))}),t&&(t.finalized_=!1),r}function Xc(){let t="replace",r="add",n="remove";function o(S,g,v,R){switch(S.type_){case 0:case 2:return a(S,g,v,R);case 1:return i(S,g,v,R);case 3:return f(S,g,v,R)}}function i(S,g,v,R){let{base_:P,assigned_:x}=S,T=S.copy_;T.length<P.length&&([P,T]=[T,P],[v,R]=[R,v]);for(let w=0;w<P.length;w++)if(x[w]&&T[w]!==P[w]){let E=g.concat([w]);v.push({op:t,path:E,value:y(T[w])}),R.push({op:t,path:E,value:y(P[w])})}for(let w=P.length;w<T.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:y(T[w])})}for(let w=T.length-1;P.length<=w;--w){let E=g.concat([w]);R.push({op:n,path:E})}}function a(S,g,v,R){let{base_:P,copy_:x}=S;tn(S.assigned_,(T,w)=>{let E=Xi(P,T),N=Xi(x,T),k=w?rn(P,T)?t:r:n;if(E===N&&k===t)return;let I=g.concat(T);v.push(k===n?{op:k,path:I}:{op:k,path:I,value:N}),R.push(k===r?{op:n,path:I}:k===n?{op:r,path:I,value:y(E)}:{op:t,path:I,value:y(E)})})}function f(S,g,v,R){let{base_:P,copy_:x}=S,T=0;P.forEach(w=>{if(!x.has(w)){let E=g.concat([T]);v.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}T++}),T=0,x.forEach(w=>{if(!P.has(w)){let E=g.concat([T]);v.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}T++})}function m(S,g,v,R){v.push({op:t,path:[],value:g===sa?void 0:g}),R.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:R,op:P}=v,x=S;for(let N=0;N<R.length-1;N++){let k=Bt(x),I=R[N];typeof I!="string"&&typeof I!="number"&&(I=""+I),(k===0||k===1)&&(I==="__proto__"||I==="constructor")&&be(19),typeof x=="function"&&I==="prototype"&&be(19),x=Xi(x,I),typeof x!="object"&&be(18,R.join("/"))}let T=Bt(x),w=h(v.value),E=R[R.length-1];switch(P){case t:switch(T){case 2:return x.set(E,w);case 3:be(16);default:return x[E]=w}case r:switch(T){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(T){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(v.value);default:return delete x[E]}default:be(17,P)}}),S}function h(S){if(!De(S))return S;if(Array.isArray(S))return S.map(h);if(an(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,h(R)]));if(sn(S))return new Set(Array.from(S).map(h));let g=Object.create(Ut(S));for(let v in S)g[v]=h(S[v]);return rn(S,en)&&(g[en]=S[en]),g}function y(S){return Ne(S)?h(S):S}$m("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:m})}var _e=new Km,it=_e.produce,Jn=_e.produceWithPatches.bind(_e),Ux=_e.setAutoFreeze.bind(_e),Bx=_e.setUseStrictShallowCopy.bind(_e),la=_e.applyPatches.bind(_e),Qx=_e.createDraft.bind(_e),$x=_e.finishDraft.bind(_e);d();c();l();u();function Ym(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Jm(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Xm(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 Zc=e=>Array.isArray(e)?e:[e];function Zm(e){let t=Array.isArray(e[0])?e[0]:e;return Xm(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function eg(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Jx=Symbol();var Xx=Object.getPrototypeOf({});var tg=class{constructor(e){this.value=e}deref(){return this.value}},rg=typeof WeakRef<"u"?WeakRef:tg,ng=0,eu=1;function Xn(){return{s:ng,v:void 0,o:null,p:null}}function ar(e,t={}){let r=Xn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let f=r,{length:m}=arguments;for(let y=0,S=m;y<S;y++){let g=arguments[y];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=f.o;v===null&&(f.o=v=new WeakMap);let R=v.get(g);R===void 0?(f=Xn(),v.set(g,f)):f=R}else{let v=f.p;v===null&&(f.p=v=new Map);let R=v.get(g);R===void 0?(f=Xn(),v.set(g,f)):f=R}}let p=f,h;if(f.s===eu)h=f.v;else if(h=e.apply(null,arguments),i++,n){let y=o?.deref?.()??o;y!=null&&n(y,h)&&(h=y,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new rg(h):h}return p.s=eu,p.v=h,h}return a.clearCache=()=>{r=Xn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function tu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,f,m={},p=o.pop();typeof p=="object"&&(m=p,p=o.pop()),Ym(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let h={...r,...m},{memoize:y,memoizeOptions:S=[],argsMemoize:g=ar,argsMemoizeOptions:v=[],devModeChecks:R={}}=h,P=Zc(S),x=Zc(v),T=Zm(o),w=y(function(){return i++,p.apply(null,arguments)},...P),E=!0,N=g(function(){a++;let I=eg(T,arguments);return f=w.apply(null,I),f},...x);return Object.assign(N,{resultFunc:p,memoizedResultFunc:w,dependencies:T,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>f,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:y,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=tu(ar),og=Object.assign((e,t=pe)=>{Jm(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,f,m)=>(a[r[m]]=f,a),{}))},{withTypes:()=>og});d();c();l();u();function ru(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var nu=ru(),ou=ru;var ig=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ir:ir.apply(null,arguments)},hR=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ag=e=>e&&typeof e.match=="function";function D(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(He(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=>zn(n)&&n.type===e,r}var uu=class cn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,cn.prototype)}static get[Symbol.species](){return cn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new cn(...t[0].concat(this)):new cn(...t.concat(this))}};function iu(e){return De(e)?it(e,()=>{}):e}function au(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function sg(e){return typeof e=="boolean"}var cg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new uu;return r&&(sg(r)?a.push(nu):a.push(ou(r.extraArgument))),a},un="RTK_autoBatch",cr=()=>e=>({payload:e,meta:{[un]:!0}}),su=e=>t=>{setTimeout(t,e)},ug=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,f=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:su(10):e.type==="callback"?e.queueNotification:su(e.timeout),p=()=>{a=!1,i&&(i=!1,f.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let y=()=>o&&h(),S=n.subscribe(y);return f.add(h),()=>{S(),f.delete(h)}},dispatch(h){try{return o=!h?.meta?.[un],i=!o,i&&(a||(a=!0,m(p))),n.dispatch(h)}finally{o=!0}}})},lg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new uu(e);return n&&o.push(ug(typeof n=="object"?n:void 0)),o};function lu(e){let t=cg(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Ke(r))f=or(r);else throw new Error(He(1));let m;typeof n=="function"?m=n(t):m=t();let p=ir;o&&(p=ig({trace:!1,...(typeof o=="object"&&o)}));let h=Uc(...m),y=lg(h),S=typeof a=="function"?a(y):y(),g=p(...S);return Ji(f,i,g)}function du(e){let t={},r=[],n,o={addCase(i,a){let f=typeof i=="string"?i:i.type;if(!f)throw new Error(He(28));if(f in t)throw new Error(He(29));return t[f]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function dg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=du(t),i;if(dg(e))i=()=>iu(e());else{let f=iu(e);i=()=>f}function a(f=i(),m){let p=[r[m.type],...n.filter(({matcher:h})=>h(m)).map(({reducer:h})=>h)];return p.filter(h=>!!h).length===0&&(p=[o]),p.reduce((h,y)=>{if(y)if(Ne(h)){let g=y(h,m);return g===void 0?h:g}else{if(De(h))return it(h,S=>y(S,m));{let S=y(h,m);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},f)}return a.getInitialState=i,a}var pu=(e,t)=>ag(e)?e.match(t):e(t);function Ye(...e){return t=>e.some(r=>pu(r,t))}function sr(...e){return t=>e.every(r=>pu(r,t))}function eo(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 ln(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function to(...e){return e.length===0?t=>eo(t,["pending"]):ln(e)?Ye(...e.map(t=>t.pending)):to()(e[0])}function $t(...e){return e.length===0?t=>eo(t,["rejected"]):ln(e)?Ye(...e.map(t=>t.rejected)):$t()(e[0])}function dn(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?sr($t(...e),t):ln(e)?sr($t(...e),t):dn()(e[0])}function at(...e){return e.length===0?t=>eo(t,["fulfilled"]):ln(e)?Ye(...e.map(t=>t.fulfilled)):at()(e[0])}function ro(...e){return e.length===0?t=>eo(t,["pending","fulfilled","rejected"]):ln(e)?Ye(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ro()(e[0])}var pg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",no=(e=21)=>{let t="",r=e;for(;r--;)t+=pg[Math.random()*64|0];return t},fg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},cu=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},mg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of fg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ue=(()=>{function e(t,r,n){let o=D(t+"/fulfilled",(m,p,h,y)=>({payload:m,meta:{...(y||{}),arg:h,requestId:p,requestStatus:"fulfilled"}})),i=D(t+"/pending",(m,p,h)=>({payload:void 0,meta:{...(h||{}),arg:p,requestId:m,requestStatus:"pending"}})),a=D(t+"/rejected",(m,p,h,y,S)=>({payload:y,error:(n&&n.serializeError||mg)(m||"Rejected"),meta:{...(S||{}),arg:h,requestId:p,rejectedWithValue:!!y,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function f(m){return(p,h,y)=>{let S=n?.idGenerator?n.idGenerator(m):no(),g=new s.AbortController,v,R;function P(T){R=T,g.abort()}let x=_asyncToGenerator(function*(){let T;try{let E=n?.condition?.(m,{getState:h,extra:y});if(hg(E)&&(E=yield E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((k,I)=>{v=()=>{I({name:"AbortError",message:R||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,m,n?.getPendingMeta?.({requestId:S,arg:m},{getState:h,extra:y}))),T=yield Promise.race([N,Promise.resolve(r(m,{dispatch:p,getState:h,extra:y,requestId:S,signal:g.signal,abort:P,rejectWithValue:(k,I)=>new da(k,I),fulfillWithValue:(k,I)=>new cu(k,I)})).then(k=>{if(k instanceof da)throw k;return k instanceof cu?o(k.payload,S,m,k.meta):o(k,S,m)})])}catch(E){T=E instanceof da?a(null,S,m,E.payload,E.meta):a(E,S,m)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(T)&&T.meta.condition||p(T),T})();return Object.assign(x,{abort:P,requestId:S,arg:m,unwrap(){return x.then(gg)}})}}return Object.assign(f,{pending:i,rejected:a,fulfilled:o,settled:Ye(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function gg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function hg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var fu=Symbol.for("rtk-slice-createasyncthunk"),bR={[fu]:ue};function yg(e,t){return`${e}/${t}`}function Sg({creators:e}={}){let t=e?.asyncThunk?.[fu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(He(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Cg()):n.reducers)||{},f=Object.keys(a),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(T,w){let E=typeof T=="string"?T:T.type;if(!E)throw new Error(He(12));if(E in m.sliceCaseReducersByType)throw new Error(He(13));return m.sliceCaseReducersByType[E]=w,p},addMatcher(T,w){return m.sliceMatchers.push({matcher:T,reducer:w}),p},exposeAction(T,w){return m.actionCreators[T]=w,p},exposeCaseReducer(T,w){return m.sliceCaseReducersByName[T]=w,p}};f.forEach(T=>{let w=a[T],E={reducerName:T,type:yg(o,T),createNotation:typeof n.reducers=="function"};Ag(w)?xg(E,w,p,t):bg(E,w,p)});function h(){let[T={},w=[],E=void 0]=typeof n.extraReducers=="function"?du(n.extraReducers):[n.extraReducers],N={...T,...m.sliceCaseReducersByType};return ge(n.initialState,k=>{for(let I in N)k.addCase(I,N[I]);for(let I of m.sliceMatchers)k.addMatcher(I.matcher,I.reducer);for(let I of w)k.addMatcher(I.matcher,I.reducer);E&&k.addDefaultCase(E)})}let y=T=>T,S=new Map,g;function v(T,w){return g||(g=h()),g(T,w)}function R(){return g||(g=h()),g.getInitialState()}function P(T,w=!1){function E(k){let I=k[T];return typeof I>"u"&&w&&(I=R()),I}function N(k=y){let I=au(S,w,()=>new WeakMap);return au(I,k,()=>{let F={};for(let[O,_]of Object.entries(n.selectors??{}))F[O]=vg(_,k,R,w);return F})}return{reducerPath:T,getSelectors:N,get selectors(){return N(E)},selectSlice:E}}let x={name:o,reducer:v,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:R,...P(i),injectInto(T,{reducerPath:w,...E}={}){let N=w??i;return T.inject({reducerPath:N,reducer:v},E),{...x,...P(N,!0)}}};return x}}function vg(e,t,r,n){function o(i,...a){let f=t(i);return typeof f>"u"&&n&&(f=r()),e(f,...a)}return o.unwrapped=e,o}var Ht=Sg();function Cg(){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 bg({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!wg(n))throw new Error(He(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?D(e,a):D(e))}function Ag(e){return e._reducerDefinitionType==="asyncThunk"}function wg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function xg({type:e,reducerName:t},r,n,o){if(!o)throw new Error(He(18));let{payloadCreator:i,fulfilled:a,pending:f,rejected:m,settled:p,options:h}=r,y=o(e,i,h);n.exposeAction(t,y),a&&n.addCase(y.fulfilled,a),f&&n.addCase(y.pending,f),m&&n.addCase(y.rejected,m),p&&n.addMatcher(y.settled,p),n.exposeCaseReducer(t,{fulfilled:a||Zn,pending:f||Zn,rejected:m||Zn,settled:p||Zn})}function Zn(){}var mu="listener",gu="completed",hu="cancelled",AR=`task-${hu}`,wR=`task-${gu}`,xR=`${mu}-${hu}`,RR=`${mu}-${gu}`;var{assign:yu}=Object;var pa="listenerMiddleware";var Rg=yu(D(`${pa}/add`),{withTypes:()=>Rg}),ER=D(`${pa}/removeAll`),Eg=yu(D(`${pa}/remove`),{withTypes:()=>Eg});var IR=Symbol.for("rtk-state-proxy-original");function He(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();var G=new H({required:!0,emptyAllowed:!1}),Ae=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),LR=new H({required:!1,emptyAllowed:!0}),oo=new ie({each:G,required:!0}),Su=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),vu=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),UR=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),st=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Le=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Kr(o);return{payload:e}},B=(e,t)=>{try{return Le(e,t)}catch(r){return{payload:e,error:st(r)}}},Cu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Au(e,t,r,o,"Controller initialization error")},bu=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Au(e,t,r,o,"Controller initialization error")},Au=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var ur="3.27.2-pre.1b995035ea",wu=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ae,xu=()=>G,St=D("configuration/updateBasicConfiguration",e=>B(e,{accessToken:Ae,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ae})),Je=D("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ae,timezone:Ae,locale:Ae,authenticationProviders:new ie({required:!1,each:G})})),Ig={enabled:new te({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new te({default:!1}),deviceId:Ae,userDisplayName:Ae,documentLocation:Ae,trackingId:vu,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:wu.reduce((e,t)=>(e[t]=Su,e),{})})},lr=D("configuration/updateAnalyticsConfiguration",e=>B(e,Ig)),dr=D("configuration/analytics/disable"),pr=D("configuration/analytics/enable"),io=D("configuration/analytics/originlevel2",e=>B(e,{originLevel2:xu()})),ao=D("configuration/analytics/originlevel3",e=>B(e,{originLevel3:xu()}));d();c();l();u();d();c();l();u();d();c();l();u();var Ru={q:new H,enableQuerySyntax:new te,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new te,sf:new K,tab:new H,af:new K};var vt=D("searchParameters/restore",e=>B(e,Ru)),Eu=D("searchParameters/restoreTab",e=>B(e,G));d();c();l();u();var so=D("debug/enable"),co=D("debug/disable");d();c();l();u();var uo=()=>!1;var lo=ge(uo(),e=>{e.addCase(so,()=>!0).addCase(co,()=>!1).addCase(vt,(t,r)=>r.payload.debug??t)});d();c();l();u();var fr=D("pipeline/set",e=>B(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var Pg=D("history/undo"),Tg=D("history/redo"),Xe=D("history/snapshot"),ZE=ue("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Pg()),yield t(Me())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),eI=ue("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Tg()),yield t(Me())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Me=ue("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());d();c();l();u();var mr=()=>"";var gr=ge(mr(),e=>{e.addCase(fr,(t,r)=>r.payload).addCase(Me.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Je,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var hr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let f=window.location.hostname,m=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;m.test(f)||p.test(f)||f.indexOf(".")===-1?ma(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],ma(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ma(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Fg(){return typeof navigator<"u"}function Iu(){try{return typeof localStorage<"u"}catch{return!1}}function Pu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Tu(){return!!(Fg()&&navigator.cookieEnabled)}var Fu=null;function ku(){return Fu||(Iu()?localStorage:Tu()?new ga:Pu()?sessionStorage:new ha)}var yr=class yr{getItem(t){return hr.get(`${yr.prefix}${t}`)}removeItem(t){hr.erase(`${yr.prefix}${t}`)}setItem(t,r,n){hr.set(`${yr.prefix}${t}`,r,n)}};de(yr,"prefix","coveo_");var ga=yr;var ha=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var po="__coveo.analytics.history",kg=20,Og=1e3*60,Dg=75,zt=class zt{constructor(t){de(this,"store");this.store=t||ku()}static getInstance(t){return zt.instance||(zt.instance=new zt(t)),zt.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(po);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(po);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(po,JSON.stringify(t.slice(0,kg)))}catch{}}clear(){try{this.store.removeItem(po)}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,Dg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Og:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};de(zt,"instance",null);var ya=zt,Ze=ya;d();c();l();u();d();c();l();u();var Sr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ur}`));d();c();l();u();d();c();l();u();function ct(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 M(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(h){try{p(n.next(h))}catch(y){a(y)}}function m(h){try{p(n.throw(h))}catch(y){a(y)}}function p(h){h.done?i(h.value):o(h.value).then(f,m)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function Ca(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function vr(){return typeof document<"u"}function ba(){try{return typeof localStorage<"u"}catch{return!1}}function Mg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Hu(){return Da()&&navigator.cookieEnabled}var qg=[ae.click,ae.custom,ae.search,ae.view],Ng=(e,t)=>qg.indexOf(e)!==-1?Object.assign({language:vr()?document.documentElement.lang:"unknown",userAgent:Da()?navigator.userAgent:"unknown"},t):t,fn=class e{static set(t,r,n){var o,i,a,f;n&&(i=new Date,i.setTime(i.getTime()+n)),f=window.location.hostname,f.indexOf(".")===-1?Ou(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],Ou(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Ou(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function _g(){return ba()?localStorage:Hu()?new mn:Mg()?sessionStorage:new br}var mn=class e{getItem(t){return fn.get(`${e.prefix}${t}`)}removeItem(t){fn.erase(`${e.prefix}${t}`)}setItem(t,r,n){fn.set(`${e.prefix}${t}`,r,n)}};mn.prefix="coveo_";var Aa=class{constructor(){this.cookieStorage=new mn}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)}},br=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fo="__coveo.analytics.history",Vg=20,jg=1e3*60,Lg=75,ho=class{constructor(t){this.store=t||_g()}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 M(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 M(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(fo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return M(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(fo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fo,JSON.stringify(t.slice(0,Vg)))}catch{}}clear(){try{this.store.removeItem(fo)}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,Lg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>jg:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Ug=(e,t)=>M(void 0,void 0,void 0,function*(){return e===ae.view?(yield Bg(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Bg=e=>M(void 0,void 0,void 0,function*(){let t=new ho,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),mo,Qg=new Uint8Array(16);function $g(){if(!mo&&(mo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mo(Qg)}var Hg=/^(?:[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 yo(e){return typeof e=="string"&&Hg.test(e)}var xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));function zu(e,t=0){return(xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]).toLowerCase()}function zg(e){if(!yo(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 Wg(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Gg="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Kg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Yg(e,t,r){function n(o,i,a,f){var m;if(typeof o=="string"&&(o=Wg(o)),typeof i=="string"&&(i=zg(i)),((m=i)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){f=f||0;for(let h=0;h<16;++h)a[f+h]=p[h];return a}return zu(p)}try{n.name=e}catch{}return n.DNS=Gg,n.URL=Kg,n}var Jg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Du={randomUUID:Jg};function Wt(e,t,r){if(Du.randomUUID&&!t&&!e)return Du.randomUUID();e=e||{};let n=e.random||(e.rng||$g)();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 zu(n)}function Xg(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 Sa(e,t){return e<<t|e>>>32-t}function Zg(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let f=0;f<a.length;++f)e.push(a.charCodeAt(f))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let f=new Uint32Array(16);for(let m=0;m<16;++m)f[m]=e[a*64+m*4]<<24|e[a*64+m*4+1]<<16|e[a*64+m*4+2]<<8|e[a*64+m*4+3];i[a]=f}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let f=new Uint32Array(80);for(let g=0;g<16;++g)f[g]=i[a][g];for(let g=16;g<80;++g)f[g]=Sa(f[g-3]^f[g-8]^f[g-14]^f[g-16],1);let m=r[0],p=r[1],h=r[2],y=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),R=Sa(m,5)+Xg(v,p,h,y)+S+t[v]+f[g]>>>0;S=y,y=h,h=Sa(p,30)>>>0,p=m,m=R}r[0]=r[0]+m>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+S>>>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 eh=Yg("v5",80,Zg),Mu=eh,Wu="2.30.45",qu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,pn={pageview:"pageview",event:"event"},So=class{constructor({client:t,uuidGenerator:r=Wt}){this.client=t,this.uuidGenerator=r}},wa=class extends So{constructor({client:t,uuidGenerator:r=Wt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=qu(window.location),this.lastReferrer=vr()?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:vr()?document.title:"",encoding:vr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===pn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===pn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===pn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===pn.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 qu(window.location)}},Ct=class e{constructor(t,r){if(!yo(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return yo(i)?new e(i,Number.parseInt(o)*1e3):null}};Ct.cvo_cid="cvo_cid";Ct.expirationTime=120;var xa=class extends So{constructor({client:t,uuidGenerator:r=Wt}){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 M(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(Ct.cvo_cid,new Ct(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};xa.Id="link";var Be=Object.keys;function go(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Gu=192,Nu=224,_u=240;function th(e){return(e&248)===_u?4:(e&_u)===Nu?3:(e&Nu)===Gu?2:1}function rh(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&va)!=va)break;if(r-=3,(n&Gu)!=va){t-r>=th(n)*3&&(r=t);break}}return e.substring(0,r)}var Ra={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"},nh=Be(Ra).map(e=>Ra[e]),oh=[...nh].join("|"),ih=new RegExp(`^(${oh}$)`),ah={svcAction:"svc_action",svcActionData:"svc_action_data"},sh=e=>Be(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ra[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),ch=e=>ih.test(e),uh=[ch],Vu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ju={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},vo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},lh=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},dh={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),vo),purchase:Object.assign(Object.assign({},Ee),vo),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},ph=Be(Vu).map(e=>Vu[e]),fh=Be(ju).map(e=>ju[e]),mh=Be(Ee).map(e=>Ee[e]),gh=Be(vo).map(e=>vo[e]),hh=Be(Ia).map(e=>Ia[e]),yh=Be(Ea).map(e=>Ea[e]),Sh=[...ph,"custom"].join("|"),vh=[...fh,"custom"].join("|"),Ku="(pr[0-9]+)",Yu="(il[0-9]+pi[0-9]+)",Ch=new RegExp(`^${Ku}(${Sh})$`),bh=new RegExp(`^(${Yu}(${vh}))|(il[0-9]+nm)$`),Ah=new RegExp(`^(${mh.join("|")})$`),wh=new RegExp(`^(${gh.join("|")})$`),xh=new RegExp(`^${Ku}custom$`),Rh=new RegExp(`^${Yu}custom$`),Eh=new RegExp(`^(${[...lh,...hh,...yh].join("|")})$`),Ih=e=>Ch.test(e),Ph=e=>bh.test(e),Th=e=>Ah.test(e),Fh=e=>wh.test(e),kh=e=>Eh.test(e),Oh=[Ph,Ih,Th,Fh,kh],Dh=[xh,Rh],Mh={anonymizeIp:"aip"},qh={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Nh={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},_h=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Vh=Object.assign(Object.assign(Object.assign(Object.assign({},Mh),qh),Nh),_h.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Pa=Object.assign(Object.assign({},Vh),ah),jh=e=>{let t=!!e.action&&dh[e.action]||{};return Be(e).reduce((r,n)=>{let o=t[n]||Pa[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Lh=Be(Pa).map(e=>Pa[e]),Uh=e=>Lh.indexOf(e)!==-1,Bh=e=>e==="custom",Qh=e=>[...Oh,...uh,Uh,Bh].some(t=>t(e)),$h=e=>Be(e).reduce((t,r)=>{let n=Hh(r);return n?Object.assign(Object.assign({},t),zh(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Hh=e=>{let t;return[...Dh].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},zh=(e,t)=>Be(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Ta=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:f}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),m=this.encodeForEventType(t,f),p=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return M(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:f,body:m}=a;o=f||t;try{i=JSON.parse(m)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return M(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ae.click,ae.custom,ae.search,ae.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}},Fa=class{sendEvent(t,r){return M(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){return Promise.resolve()})}},Lu=C.fetch,Co=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",f={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},f),i?yield i(f,"analyticsFetch"):{}),{url:p}=m,h=ct(m,["url"]),y;try{y=yield Lu(p,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(y.ok){let S=yield y.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Lu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return M(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"})}},ka=class{constructor(t,r){ba()&&Hu()?this.storage=new Aa:ba()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new br),this.client=new Co(t),this.beaconClient=new Ta(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Oa=class{constructor(t,r){this.storage=r||new br,this.client=new Co(t)}getClientDependingOnEventType(t){return this.client}},bo=class{constructor(){this.storage=new br,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},Wh="xx",Gh=e=>e?.startsWith(Wh)||!1,Kh=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
30
|
-
`;function Kh(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Yh=["1",1,"yes",!0];function Ao(){let e=[];return Ca()&&e.push(window.doNotTrack),Da()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Yh.indexOf(t)!==-1)}var Yu="v15",Ju={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function Jh(e=Ju.default,t=Yu,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Xh="38824e1f-37f5-42d3-8372-a4b8fa9df946",et=class{get defaultOptions(){return{endpoint:Ju.default,isCustomEndpoint:!1,token:"",version:Yu,beforeSendHooks:[],afterSendHooks:[]}}get version(){return zu}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Lg,qg].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Ao()?this.runtime=new bo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return Ca()&&vr()?new ka(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Kh()&&console.warn(Gh),new Oa(t))}get storage(){return this.runtime.storage}determineVisitorId(){return M(this,void 0,void 0,function*(){try{return Ca()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Wt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Wt()}})}getCurrentVisitorId(){return M(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return M(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return M(this,void 0,void 0,function*(){if(yo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Du(t,Du(r,Xh)))}})}getParameters(t,...r){return M(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return M(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Wt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Ao())return null;try{let r=new URL(t).searchParams.get(Ct.cvo_cid);if(r==null)return null;let n=Ct.fromString(r);return!n||!vr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return M(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>M(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>M(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((v,R)=>M(this,void 0,void 0,function*(){let P=yield v;return yield R(t,P)}),g)].reduce((g,v)=>M(this,void 0,void 0,function*(){let R=yield g;return yield v(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return M(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[y=>this.setTrackingIdIfTrackingIdNotPresent(y),y=>this.removeEmptyPayloadValues(y,t),y=>this.validateParams(y,t),y=>n?Vh(y):y,y=>n?this.removeUnknownParameters(y):y,y=>n?this.processCustomParameters(y):this.mapCustomParametersToCustomData(y)].reduce((y,S)=>M(this,void 0,void 0,function*(){let g=yield y;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return M(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>M(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(f=>f(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return M(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return M(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new ho().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=ct(t,["searchQueryUid"]);return M(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=ct(t,["searchQueryUid"]);return M(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=ct(t,["lastSearchQueryUid"]);return M(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return M(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return M(this,void 0,void 0,function*(){let r=yield(yield b(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return M(this,void 0,void 0,function*(){return yield(yield b(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Bh(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=ct(t,["custom"]),o={};r&&go(r)&&(o=this.lowercaseKeys(r));let i=Qh(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=ct(t,["custom"]);if(r&&go(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=ct(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=ct(t,["userId"]);return Wh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=ct(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&go(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&go(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?th(t,r):t}get baseUrl(){return Jh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},ut;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(ut||(ut={}));var q;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(q||(q={}));var Lu={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[q.queryError]:"errors",[q.queryErrorBack]:"errors",[q.queryErrorClear]:"errors",[q.queryErrorRetry]:"errors",[q.pagerNext]:"getMoreResults",[q.pagerPrevious]:"getMoreResults",[q.pagerNumber]:"getMoreResults",[q.pagerResize]:"getMoreResults",[q.pagerScrolling]:"getMoreResults",[q.facetSearch]:"facet",[q.facetShowLess]:"facet",[q.facetShowMore]:"facet",[q.recommendation]:"recommendation",[q.likeSmartSnippet]:"smartSnippet",[q.dislikeSmartSnippet]:"smartSnippet",[q.expandSmartSnippet]:"smartSnippet",[q.collapseSmartSnippet]:"smartSnippet",[q.openSmartSnippetFeedbackModal]:"smartSnippet",[q.closeSmartSnippetFeedbackModal]:"smartSnippet",[q.sendSmartSnippetReason]:"smartSnippet",[q.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.clearRecentQueries]:"recentQueries",[q.recentResultClick]:"recentlyClickedDocuments",[q.clearRecentResults]:"recentlyClickedDocuments",[q.showLessFoldedResults]:"folding",[q.caseDetach]:"case",[q.likeGeneratedAnswer]:"generatedAnswer",[q.dislikeGeneratedAnswer]:"generatedAnswer",[q.openGeneratedAnswerSource]:"generatedAnswer",[q.generatedAnswerStreamEnd]:"generatedAnswer",[q.generatedAnswerSourceHover]:"generatedAnswer",[q.generatedAnswerCopyToClipboard]:"generatedAnswer",[q.generatedAnswerHideAnswers]:"generatedAnswer",[q.generatedAnswerShowAnswers]:"generatedAnswer",[q.generatedAnswerExpand]:"generatedAnswer",[q.generatedAnswerCollapse]:"generatedAnswer",[q.generatedAnswerFeedbackSubmit]:"generatedAnswer",[q.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[ut.expandToFullUI]:"interface",[ut.openUserActions]:"User Actions",[ut.showPrecedingSessions]:"User Actions",[ut.showFollowingSessions]:"User Actions",[ut.clickViewedDocument]:"User Actions",[ut.clickPageView]:"User Actions",[ut.createArticle]:"createArticle"},Ar=class{constructor(){this.runtime=new bo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return zu}};function Zh(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function ey(e){return e.map(t=>t.replace(/;/g,""))}function Xu(e){let r=e.join(";");return r.length<=256?r:Xu(e.slice(1))}var Uu=e=>{let t=ey(e),r=Zh(t);return Xu(r)};function Bu(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Uu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Uu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var wo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Ao();this.coveoAnalyticsClient=n?new Ar:new et(t)}disable(){this.coveoAnalyticsClient=new Ar}enable(){this.coveoAnalyticsClient=new et(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(q.interfaceLoad)}logInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(q.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(q.recommendation)}logRecommendation(){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(q.recommendationOpen,t,r)}logRecommendationOpen(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(q.staticFilterClearAll,t)}logStaticFilterClearAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(q.staticFilterSelect,t)}logStaticFilterSelect(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(q.staticFilterDeselect,t)}logStaticFilterDeselect(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(q.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return M(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(q.interfaceChange,t)}logInterfaceChange(t){return M(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(q.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return M(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(q.didyoumeanClick)}logDidYouMeanClick(){return M(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(q.resultsSort,t)}logResultsSort(t){return M(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(q.searchboxSubmit)}logSearchboxSubmit(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(q.searchboxClear)}logSearchboxClear(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(q.searchboxAsYouType)}logSearchboxAsYouType(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(q.breadcrumbFacet,t)}logBreadcrumbFacet(t){return M(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(q.breadcrumbResetAll)}logBreadcrumbResetAll(){return M(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(q.documentQuickview,t,r)}logDocumentQuickview(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(q.documentOpen,t,r)}logDocumentOpen(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(q.omniboxAnalytics,Bu(t))}logOmniboxAnalytics(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(q.omniboxFromLink,Bu(t))}logOmniboxFromLink(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(q.searchFromLink)}logSearchFromLink(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(q.triggerNotify,t)}logTriggerNotify(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(q.triggerExecute,t)}logTriggerExecute(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(q.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(q.undoTriggerQuery,t)}logUndoTriggerQuery(t){return M(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(q.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(q.pagerResize,t)}logPagerResize(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(q.pagerNumber,t)}logPagerNumber(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(q.pagerNext,t)}logPagerNext(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(q.pagerPrevious,t)}logPagerPrevious(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(q.pagerScrolling)}logPagerScrolling(){return M(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(q.facetClearAll,t)}logFacetClearAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(q.facetSearch,t)}logFacetSearch(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(q.facetSelect,t)}logFacetSelect(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(q.facetDeselect,t)}logFacetDeselect(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(q.facetExclude,t)}logFacetExclude(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(q.facetUnexclude,t)}logFacetUnexclude(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(q.facetSelectAll,t)}logFacetSelectAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(q.facetUpdateSort,t)}logFacetUpdateSort(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(q.facetShowMore,t)}logFacetShowMore(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(q.facetShowLess,t)}logFacetShowLess(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(q.queryError,t)}logQueryError(t){return M(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorBack);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorBack)})}})}logQueryErrorBack(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorRetry);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorRetry)})}})}logQueryErrorRetry(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorClear);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorClear)})}})}logQueryErrorClear(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(q.likeSmartSnippet)}logLikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(q.dislikeSmartSnippet)}logDislikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(q.expandSmartSnippet)}logExpandSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(q.collapseSmartSnippet)}logCollapseSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return M(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(q.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(q.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(q.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(q.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(q.copyToClipboard,t,r)}logCopyToClipboard(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(q.recentQueryClick)}logRecentQueryClick(){return M(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(q.clearRecentQueries)}logClearRecentQueries(){return M(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(q.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(q.clearRecentResults)}logClearRecentResults(){return M(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(q.noResultsBack)}logNoResultsBack(){return M(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(q.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(q.showLessFoldedResults)}logShowLessFoldedResults(){return M(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r,n=Lu[t]){return M(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:n,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEvent(t,r,n=Lu[t]){return M(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return M(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({searchQueryUid:f})}})}logClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,o;return M(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return M(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof et?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(q.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(q.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(q.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return M(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(q.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(q.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(q.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(q.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(q.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(q.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(q.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(q.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(q.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return M(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(q.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},xo=Object.assign({},pn),Qu=Object.keys(xo).map(e=>xo[e]),Cr=class extends wa{constructor({client:t,uuidGenerator:r=Wt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>Qu.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Qu.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(xo.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(xo.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return ah(this.ticket)}};Cr.Id="svc";var Ro;(function(e){e.click="click",e.flowStart="flowStart"})(Ro||(Ro={}));var Ue;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(Ue||(Ue={}));var Eo;(function(e){e.quit="Quit",e.solved="Solved"})(Eo||(Eo={}));var Io=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Ao();this.coveoAnalyticsClient=o?new et(t):new Ar,this.svc=new Cr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ar,this.svc=new Cr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new et(this.options),this.svc=new Cr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Ue.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Ue.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Ue.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Ue.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Ue.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Ue.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Ue.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Ue.caseCancelled,{reason:Eo.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Ue.caseSolved,{reason:Eo.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Ue.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ro.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ro.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return M(this,void 0,void 0,function*(){let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof et?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){var i,a;return M(this,void 0,void 0,function*(){let f=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(f)})}};var Zu=e=>new et(e).getCurrentVisitorId(),gn=(e,t)=>typeof t=="function"?(...r)=>{let n=Yr(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,hn=(e,t)=>(...r)=>{let n=Yr(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Po(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function el(e){let{activeValue:t,ancestryMap:r}=ty(e);return t?ry(t,r):[]}function ty(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function ry(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var ny=(e,t)=>e.categoryFacetSet[t]?.request;var Na=(e,t)=>{let r=ny(e,t);return el(r?.currentValues??[])};d();c();l();u();function To(){return{}}d();c();l();u();function Fo(){return{}}d();c();l();u();function ko(){return{}}d();c();l();u();function Oo(){return{}}function _a(e){return{facetSet:e.facetSet??Oo(),categoryFacetSet:e.categoryFacetSet??To(),dateFacetSet:e.dateFacetSet??Fo(),numericFacetSet:e.numericFacetSet??ko(),automaticFacetSet:e.automaticFacetSet??Po()}}var Va=e=>{let t=[];return ay(e).forEach((r,n)=>{let o=my(e,r.facetId),i=py(r,n+1);if(iy(r)){if(!!!Na(e,r.facetId).length)return;t.push({...i,...ly(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,f)=>{if(a.state==="idle")return;let m=tl(a,f+1,o),p=oy(r)?rl(a):cy(a);t.push({...i,...m,...p})})}),sy(e).forEach((r,n)=>{let o=dy(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let f=tl(i,a+1,"specific"),m=rl(i);t.push({...o,...f,...m})})}),t},oy=e=>e.type==="specific",iy=e=>e.type==="hierarchical",ay=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),sy=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),tl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),cy=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),rl=e=>({displayValue:e.value,value:e.value}),uy=(e,t)=>Na(e,t).map(n=>n.value).join(";"),ly=(e,t)=>{let n=uy(e,t);return{value:n,valuePosition:1,displayValue:n}},dy=(e,t)=>({title:nl(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),py=(e,t)=>({title:nl(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),nl=(e,t)=>`${e}_${t}`,fy=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,my=(e,t)=>{let r=fy(e,t);return r?r.type:"specific"};d();c();l();u();var Ve=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var ol=(r=>(r.Ascending="ascending",r.Descending="descending",r))(ol||{}),il=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(il||{}),ja=e=>{if(hc(e))return e.map(t=>ja(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},al=()=>({by:"relevancy"});var ET=new K({values:{by:new ji({enum:il,required:!0}),order:new ji({enum:ol}),field:new H}});function Do(){return ja(al())}d();c();l();u();d();c();l();u();var wr=()=>"default";var gy=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},lt=class{constructor(t){this.getState=t;de(this,"state");this.state=t()}getLanguage(){return gy(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let f=`context_${i}`;o[f]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=ur),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||wr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var yn=class yn extends lt{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Va(_a(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||yn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||We().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||yn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=r.search?.response?.extendedResults?.generativeQuestionAnsweringId;return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Do()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest&&this.state.querySuggest[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,f=o.partialQueries[a]||"",m=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:f,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:m}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||Ve().q}get responseTime(){return this.state.search?.duration||We().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||We().response.totalCountFiltered}};de(yn,"fallbackPipelineName","default");var bt=yn,sl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new bt(t)})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??Pe(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,h=new wo({token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:gn(e,n),beforeSendHooks:[hn(e,r),(y,S)=>(e.info({...S,type:y,endpoint:f,token:a},"Analytics request"),S)]},o);return p||h.disable(),h},La=()=>{let t=Ze.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Mo=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Zu(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(La()&&{pageId:La()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Sr(e)})}}});return function Mo(_x9,_x0){return _ref7.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var xr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Sn=class extends lt{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ve().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||xr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||xr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||xr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var cl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function hy(e){return typeof e=="string"&&cl.test(e)}var Ua=hy;d();c();l();u();var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function ul(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}d();c();l();u();var Ba,yy=new Uint8Array(16);function Qa(){if(!Ba){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ba=crypto.getRandomValues.bind(crypto)}return Ba(yy)}d();c();l();u();d();c();l();u();var Sy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$a={randomUUID:Sy};function vy(e,t,r){if($a.randomUUID&&!t&&!e)return $a.randomUUID();e=e||{};let n=e.random??e.rng?.()??Qa();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return ul(n)}var Ha=vy;d();c();l();u();function ll(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Cy({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var dl="visitorId";function by(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(dl),o=n&&Ua(n)?n:t.generateUUID();return r.setItem(dl,o),o}}}var fl="1.2.1";function Ay(e){let{trackingId:t}=e;return{trackingId:t}}function wy(e){return(e.source||[]).concat([`relay@${fl}`])}function ml(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,f=Ay(t),m=n.getClientId();return Object.freeze({type:e,config:f,ts:Date.now(),source:wy(t),clientId:m,userAgent:a(),referrer:o(),location:i()})}function xy(e,t,r,n,o){return{...t,meta:ml(e,r,n,o)}}var Ry="*";function Ey(){let e=[];function t({type:m,callback:p}){return e.findIndex(h=>h.type===m&&h.callback===p)}function r(m,p){return m.type==="*"||p===m.type}function n(m){return t(m)<0&&e.push(m),()=>f(m.type,m.callback)}function o(m){e.forEach(p=>{if(r(p,m.meta.type))try{p.callback(m)}catch(h){console.error(h)}})}function i(m){if(m===Ry)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===m&&e.splice(p,1)}function a(m){let p=t(m);p>=0&&e.splice(p,1)}function f(m,p){p?a({type:m,callback:p}):i(m)}return{add:n,call:o,remove:f}}function pl({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function Iy(e){let t=pl(e);return{get:()=>t,update:r=>{t=pl({...t,...r})}}}var za=Py();function Py(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,f=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${f};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Ty(){return{getItem(e){return za.getItem(e)||localStorage.getItem(e)},removeItem(e){za.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),za.setItem(e,t,31556952e3)}}}function Fy(){let e=document.referrer;return e===""?null:e}function ky(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(ll().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:()=>Fy(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Ha(),storage:Ty()}}function Oy(){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 Dy(){return{getItem(){return null},removeItem(){},setItem(){}}}function My(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Dy()}}function qy(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=My();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&Ny()&&Oy()?ky():n}function Ny(){try{return typeof window=="object"}catch{return!1}}function _y(e){return{get:()=>Object.freeze(qy(e))}}function gl(e){let t=Iy(e),r=Ey(),n=_y(t),o=by(n);return{emit:(i,a)=>{let f=t.get(),m=n.get(),p=xy(i,a,f,m,o);return Cy({config:f,environment:m,event:p,listenerManager:r})},getMeta:i=>ml(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:fl}}var Rr=pe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Sr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a)=>gl({mode:i?"emit":"disabled",url:o??Un(e,t),token:r,trackingId:n??null,source:a}));d();c();l();u();var vn=class extends lt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},hl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new vn(t)})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??Pe(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,h=new Io({enableAnalytics:p,token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:gn(e,n),beforeSendHooks:[hn(e,r),(y,S)=>(e.info({...S,type:y,endpoint:f,token:a},"Analytics request"),S)]},o);return p||h.disable(),h};d();c();l();u();d();c();l();u();function yl(e,t){return{...new bt(t).getBaseMetadata(),actionCause:e,type:e}}function Vy(e){return Object.assign(e,{instantlyCallable:!0})}function jy(e,t){let r=i=>Vy(ue(e,i)),n=r(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(i,{getState:a,extra:f}){let{analyticsClientMiddleware:m,preprocessRequest:p,logger:h}=f;return yield(yield t({getState:a,analyticsClientMiddleware:m,preprocessRequest:p,logger:h})).log({state:a(),extra:f})});return function(_x1,_x10){return _ref8.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref9=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m}){let{description:p,log:h}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m});return{description:p,action:r(/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(y,{getState:S,extra:g}){return yield h({state:S(),extra:g})});return function(_x12,_x13){return _ref0.apply(this,arguments)}}())}});return function prepare(_x11){return _ref9.apply(this,arguments)}}()}),n}var Sl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return By(i)}return n},Ly=e=>e.configuration.analytics.analyticsMode==="legacy",Uy=e=>e.configuration.analytics.analyticsMode==="next",By=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=f=>new a(f)),jy(e,/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*({getState:f,analyticsClientMiddleware:m,preprocessRequest:p,logger:h}){let y=[],S={log:function(){var _ref10=_asyncToGenerator(function*({state:x}){for(let T of y)yield T(x)});return function log(_x15){return _ref10.apply(this,arguments)}}()},g=f(),v=i({getState:f,logger:h,analyticsClientMiddleware:m,preprocessRequest:p,provider:r(f)}),R=yield t(v,f());S.description=R?.description,y.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(x){Ly(x)&&(yield Qy(R,r,x,h,v.coveoAnalyticsClient))});return function(_x16){return _ref11.apply(this,arguments)}}());let{emit:P}=Rr(g);return y.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){if(Uy(x)&&o&&n){let T=n(x);yield Yy(P,o,T)}});return function(_x17){return _ref12.apply(this,arguments)}}()),S});return function(_x14){return _ref1.apply(this,arguments)}}()));function Qy(_x18,_x19,_x20,_x21,_x22){return _Qy.apply(this,arguments)}function _Qy(){_Qy=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _Qy.apply(this,arguments)}var $y=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref13=_asyncToGenerator(function*(i){r(n,o)});return function log(_x23){return _ref13.apply(this,arguments)}}()}),qe=Sl(sl,e=>e,bt),LO=Sl(hl,$y("caseAssist"),vn);var Wa=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return Hy(e,r,t)};function Hy(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:Gy(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:Ky(e),queryPipeline:r.pipeline||mr()}}var qo=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),vl={urihash:new H,sourcetype:new H,permanentid:new H},Cl={uniqueId:G,raw:new K({values:vl}),title:G,uri:G,clickUri:G,rankingModifier:new H({required:!1,emptyAllowed:!0})};function zy(e){return Object.assign({},...Object.keys(vl).map(t=>({[t]:e[t]})))}function Wy(e){return Object.assign({},...Object.keys(Cl).map(t=>({[t]:e[t]})),{raw:zy(e.raw)})}function Gy(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function Ky(e){let t=e.raw.source;return X(t)?"unknown":t}var Ga=e=>new Fe(Cl).validate(Wy(e));function Yy(_x24,_x25,_x26){return _Yy.apply(this,arguments)}function _Yy(){_Yy=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _Yy.apply(this,arguments)}d();c();l();u();var bl=()=>qe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Sn(e)),Al=()=>({actionCause:"recommendationInterfaceLoad"}),_o=e=>qe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ga(e),t.makeRecommendationOpen(Wa(e,r),qo(e))),__legacy__provider:t=>new Sn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Wa(e,t),n=qo(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var Er=D("recommendation/set",e=>B(e,{id:G})),At=ue("recommendation/get",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=new Date().getTime(),a=yield Jy(o),f=yield n.recommendations(a),m=new Date().getTime()-i;return ke(f)?r(f.error):{recommendations:f.success.results,analyticsAction:bl(),duration:m,searchUid:f.success.searchUid,splitTestRun:f.success.splitTestRun,pipeline:f.success.pipeline}});return function(_x27,_x28){return _ref14.apply(this,arguments)}}()),Jy=/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ht(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Ze.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield Xy(e,Al()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function Jy(_x29){return _ref15.apply(this,arguments)}}(),Xy=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Mo(e.configuration.analytics,r)});return function Xy(_x30,_x31){return _ref16.apply(this,arguments)}}();var Ir=ge(xr(),e=>{e.addCase(Er,(t,r)=>{t.id=r.payload.id}).addCase(At.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(At.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(At.pending,t=>{t.isLoading=!0})});d();c();l();u();var Pr=D("searchHub/set",e=>B(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();var Tr=ge(wr(),e=>{e.addCase(Pr,(t,r)=>r.payload).addCase(Me.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Je,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();var Ka=e=>({referrer:document.referrer,userAgent:navigator.userAgent,location:window.location.href,clientId:e}),Cn=()=>({referrer:null,userAgent:null,location:null,clientId:""});d();c();l();u();var Ya=pe(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Vo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:Sr(e)}});d();c();l();u();var wl=pe(e=>e.context,e=>e);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var bn=pe(e=>e.query,e=>e);var xl=e=>eS(e)?{answerAPIEnabled:!0,id:El(e).data?.answerId}:Zy(e)?{answerAPIEnabled:!1,id:e.search.response.extendedResults.generativeQuestionAnsweringId}:{answerAPIEnabled:!1,id:void 0},Zy=e=>"search"in e,eS=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),Rl=e=>e.generatedAnswer?.fieldsToIncludeInCitations,tS=pe(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t)),E0=pe(e=>bn(e)?.q,e=>e.search.requestId,(e,t)=>({q:e,requestId:t}));var jo=e=>qe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let{id:n,answerAPIEnabled:o}=xl(r),i=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({...(o?{answerAPIStreamId:n}:{generativeQuestionAnsweringId:n}),answerGenerated:e,answerTextIsEmpty:i}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:t.search?.response.searchUid||"",answerGenerated:e??!1})});d();c();l();u();var Il=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Pe(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Il(_x32){return _ref17.apply(this,arguments)}}();d();c();l();u();var Pl=["text/plain","text/markdown"];var Fr=new H({required:!0}),Fl=new H,kr=new te({required:!0}),rS={id:Fr,title:Fr,uri:Fr,permanentid:Fr,clickUri:Fl},kl=new H({required:!0,constrainTo:Pl}),uM=D("generatedAnswer/setIsVisible",e=>B(e,kr)),lM=D("generatedAnswer/setIsEnabled",e=>B(e,kr)),Xa=D("generatedAnswer/updateMessage",e=>B(e,{textDelta:Fr})),Za=D("generatedAnswer/updateCitations",e=>B(e,{citations:new ie({required:!0,each:new K({values:rS})})})),nS=D("generatedAnswer/updateError",e=>B(e,{message:Fl,code:new J({min:0})})),oS=D("generatedAnswer/resetAnswer"),dM=D("generatedAnswer/like"),pM=D("generatedAnswer/dislike"),fM=D("generatedAnswer/feedbackModal/open"),mM=D("generatedAnswer/expand"),gM=D("generatedAnswer/collapse"),hM=D("generatedAnswer/setId",e=>B(e,{id:new H({required:!0})})),yM=D("generatedAnswer/feedbackModal/close"),SM=D("generatedAnswer/sendFeedback"),Ja=D("generatedAnswer/setIsLoading",e=>B(e,kr)),Tl=D("generatedAnswer/setIsStreaming",e=>B(e,kr)),es=D("generatedAnswer/setAnswerContentFormat",e=>B(e,kl)),vM=D("generatedAnswer/updateResponseFormat",e=>B(e,{contentFormat:new ie({each:kl,default:["text/plain"]})})),CM=D("knowledge/updateAnswerConfigurationId",e=>B(e,Fr)),bM=D("generatedAnswer/registerFieldsToIncludeInCitations",e=>B(e,oo)),iS=D("generatedAnswer/setIsAnswerGenerated",e=>B(e,kr)),ts=D("generatedAnswer/setCannotAnswer",e=>B(e,kr)),AM=ue("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:f}=a,{setAbortControllerRef:m}=e,p=yield Il(r),h=(g,v)=>{switch(g){case"genqa.headerMessageType":{let R=JSON.parse(v);n(es(R.contentFormat));break}case"genqa.messageType":n(Xa(JSON.parse(v)));break;case"genqa.citationsType":n(Za(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,P=f.length!==0&&!R;n(ts(P)),n(Tl(!1)),n(iS(R)),n(jo(R));break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Ja(!0));let y=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:g=>{y(p)&&(n(Ja(!1)),g.payload&&g.payloadType&&h(g.payloadType,g.payload))},abort:g=>{y(p)&&n(nS(g))},close:()=>{y(p)&&n(Tl(!1))},resetAnswer:()=>{y(p)&&n(oS())}});S?m(S):n(Ja(!1))});return function(_x33,_x34){return _ref18.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Ol=pe(e=>e.pipeline,e=>e);d();c();l();u();var Dl=pe(e=>e.searchHub,e=>e);d();c();l();u();d();c();l();u();var An=Qe(Lo(),1),jl=Qe(Ml(),1);d();c();l();u();var Uo=Qe(Lo(),1),Nl=Qe(ql(),1);Uo.default.extend(Nl.default);var _l="YYYY/MM/DD@HH:mm:ss",aS="1401-01-01";function Or(e,t){let r=(0,Uo.default)(e,t);return!r.isValid()&&!t?(0,Uo.default)(e,_l):r}function Bo(e){return e.format(_l)}function Vl(e,t){let r=Or(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}cs(r)}function cs(e){if(e.isBefore(aS))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}An.default.extend(jl.default);var Ll=["past","now","next"],Ul=["minute","hour","day","week","month","quarter","year"],sS=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new H({required:!t,constrainTo:Ul}),period:new H({required:!0,constrainTo:Ll})}};function us(e){if(typeof e=="string"&&!wt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?zl(e):e;new Fe(sS(t.period)).validate(t);let r=Ql(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);cs(r)}function Bl(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Ql(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,An.default)().subtract(r,n);case"next":return(0,An.default)().add(r,n);case"now":return(0,An.default)()}}function wn(e){return Bo(Ql(zl(e)))}function $l(e){return e.toLocaleLowerCase().split("-")}function wt(e){let[t,r,n]=$l(e);if(t==="now")return!0;if(!Ll.includes(t)||!Ul.includes(n))return!1;let o=parseInt(r);return!(isNaN(o)||o<=0)}function Hl(e){return!!e&&typeof e=="object"&&"period"in e}function zl(e){let[t,r,n]=$l(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function Wl(e){return e.type==="dateRange"}function Gl(e){return`start${e}`}function Kl(e){return`end${e}`}var ls=()=>({dateFacetValueMap:{}});function cS(e,t,r){let n=e.start,o=e.end;return wt(n)&&(n=wn(n),r.dateFacetValueMap[t][Gl(n)]=e.start),wt(o)&&(o=wn(o),r.dateFacetValueMap[t][Kl(o)]=e.end),{...e,start:n,end:o}}function ds(e,t){if(Wl(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>cS(o,r,t))}}return e}function xt(e){let t=ls();return{request:{...e,facets:e.facets?.map(n=>ds(n,t))},mappings:t}}function uS(e,t,r){return{...e,start:r.dateFacetValueMap[t][Gl(e.start)]||e.start,end:r.dateFacetValueMap[t][Kl(e.end)]||e.end}}function lS(e,t){return e.facetId in t.dateFacetValueMap}function dS(e,t){return lS(e,t)?{...e,values:e.values.map(r=>uS(r,e.facetId,t))}:e}function Qo(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>dS(n,t))}}:e}d();c();l();u();d();c();l();u();var xn=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},pS=e=>t=>e.every(r=>!X(xn(t,r))),fS=e=>t=>e.every(r=>X(xn(t,r))),mS=(e,t)=>r=>{let n=Yl(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},gS=(e,t)=>r=>{let n=Yl(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Yl=(e,t)=>{let r=xn(t,e);return yc(r)?r:[r]},Jl={getResultProperty:xn,fieldsMustBeDefined:pS,fieldsMustNotBeDefined:fS,fieldMustMatch:mS,fieldMustNotMatch:gS};var Xl=pe(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var $o=pe(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));d();c();l();u();var ps=pe(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),Zl=pe(e=>e,e=>{let t=ps(e);return t&&e?e[t].expression:""});d();c();l();u();d();c();l();u();function Rt(e){return Object.values(e).map(t=>t.request)}function fs(e,t){let r={};e.forEach(i=>r[i.facetId]=i);let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function ed(e){return Rt(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ms={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function hS(e){return Rt(e).map(t=>{let r=ms[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function yS(e){return[...hS(e.facetSet??{}),...ed(e.numericFacetSet??{}),...ed(e.dateFacetSet??{}),...Rt(e.categoryFacetSet??{})]}function SS(e){return yS(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Ho(e){return fs(SS(e),e.facetOrder??[])}d();c();l();u();d();c();l();u();function rd(_x35,_x36){return _rd.apply(this,arguments)}function _rd(){_rd=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _rd.apply(this,arguments)}function nd(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=CS(t,a);let f=t.length,m=0;for(;r<f;){o&&(t[r]===10&&(m=++r),o=!1);let p=-1;for(;r<f&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(m,p),n),m=r,n=-1}m===f?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function od(e,t,r){let n=td(),o=new TextDecoder;return function(a,f){if(a.length===0)r?.(n),n=td();else if(f>0){let m=o.decode(a.subarray(0,f)),p=f+(a[f+1]===32?2:1),h=o.decode(a.subarray(p));switch(m){case"data":n.data=n.data?n.data+`
|
|
31
|
-
`+h:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":vS(h,n,t);break}}}}function vS(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function CS(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function td(){return{data:"",event:"",id:"",retry:void 0}}var gs="text/event-stream",bS=1e3,id="last-event-id";function ad(){return typeof window<"u"}function sd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:f,fetch:m,...p}){return new Promise((h,y)=>{let S={...r};S.accept||(S.accept=gs);let g;function v(){g?.abort(),document.hidden||E()}!f&&ad()&&document.addEventListener("visibilitychange",v);let R=bS,P;function x(){ad()&&document.removeEventListener("visibilitychange",v),clearTimeout(P),g?.abort()}t?.addEventListener("abort",()=>{x(),h()});let T=m??b,w=n??AS;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let N=yield T(e,{...p,headers:S,signal:g?.signal});yield w(N),yield rd(N.body,nd(od(k=>{k?S[id]=k:delete S[id]},k=>{R=k},o))),i?.(),x(),h()}catch(N){if(!g?.signal?.aborted)try{let k=a?.(N)??R;clearTimeout(P),P=setTimeout(E,k)}catch(k){x(),y(k)}}});return _E.apply(this,arguments)}E()})}function AS(e){let t=e.headers.get("content-type");if(!t?.startsWith(gs))throw new Error(`Expected content-type to be ${gs}, Actual: ${t}`)}d();c();l();u();d();c();l();u();function cd(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var ud=Ke;function bd(e,t){if(e===t||!(ud(e)&&ud(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=bd(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Dr(e){let t=0;for(let r in e)t++;return t}var ld=e=>[].concat(...e);function wS(e){return new RegExp("(^|:)//").test(e)}function xS(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Go(e){return e!=null}function RS(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var ES=e=>e.replace(/\/$/,""),IS=e=>e.replace(/^\//,"");function PS(e,t){if(!e)return t;if(!t)return e;if(wS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=ES(e),t=IS(t),`${e}${r}${t}`}function TS(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var dd=(...e)=>b(...e),FS=e=>e.status>=200&&e.status<=299,kS=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function pd(e){if(!Ke(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Ad({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:r=dd,paramsSerializer:n,isJsonContentType:o=kS,jsonContentType:i="application/json",jsonReplacer:a,timeout:f,responseHandler:m,validateStatus:p,...h}={}){return typeof b>"u"&&r===dd&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(S,g,v){let{getState:R,extra:P,endpoint:x,forced:T,type:w}=g,E,{url:N,headers:k=new A(h.headers),params:I=void 0,responseHandler:F=m??"json",validateStatus:O=p??FS,timeout:_=f,...$}=typeof S=="string"?{url:S}:S,U,j=g.signal;_&&(U=new s.AbortController,g.signal.addEventListener("abort",U.abort),j=U.signal);let V={...h,signal:j,...$};k=new A(pd(k)),V.headers=(yield t(k,{getState:R,arg:S,extra:P,endpoint:x,forced:T,type:w,extraOptions:v}))||k;let Q=Z=>typeof Z=="object"&&(Ke(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!V.headers.has("content-type")&&Q(V.body)&&V.headers.set("content-type",i),Q(V.body)&&o(V.headers)&&(V.body=JSON.stringify(V.body,a)),I){let Z=~N.indexOf("?")?"&":"?",oe=n?n(I):new URLSearchParams(pd(I));N+=Z+oe}N=PS(e,N);let L=new Request(N,V);E={request:new Request(N,V)};let W,Y=!1,re=U&&setTimeout(()=>{Y=!0,U.abort()},_);try{W=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{re&&clearTimeout(re),U?.signal.removeEventListener("abort",U.abort)}let se=W.clone();E.response=se;let ee,ne="";try{let Z;if(yield Promise.all([y(W,F).then(oe=>ee=oe,oe=>Z=oe),se.text().then(oe=>ne=oe,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:W.status,data:ne,error:String(Z)},meta:E}}return O(W,ee)?{data:ee,meta:E}:{error:{status:W.status,data:ee},meta:E}});return function(_x37,_x38,_x39){return _ref19.apply(this,arguments)}}());function y(_x40,_x41){return _y2.apply(this,arguments)}function _y2(){_y2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _y2.apply(this,arguments)}}var Mr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function OS(){return _OS.apply(this,arguments)}function _OS(){_OS=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _OS.apply(this,arguments)}function DS(e,t){throw Object.assign(new Mr({error:e,meta:t}),{throwImmediately:!0})}var fd={},MS=(e,t)=>(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(r,n,o){let i=[5,(t||fd).maxRetries,(o||fd).maxRetries].filter(h=>h!==void 0),[a]=i.slice(-1),m={maxRetries:a,backoff:OS,retryCondition:(h,y,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let h=yield e(r,n,o);if(h.error)throw new Mr(h);return h}catch(h){if(p++,h.throwImmediately){if(h instanceof Mr)return h.value;throw h}if(h instanceof Mr&&!m.retryCondition(h.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return h.value;yield m.backoff(p,m.maxRetries)}});return function(_x42,_x43,_x44){return _ref20.apply(this,arguments)}}()),wd=Object.assign(MS,{fail:DS}),Cs=D("__rtkq/focused"),xd=D("__rtkq/unfocused"),bs=D("__rtkq/online"),Rd=D("__rtkq/offline");function As(e){return e.type==="query"}function qS(e){return e.type==="mutation"}function ws(e){return e.type==="infinitequery"}function xs(e,t,r,n,o,i){return NS(e)?e(t,r,n,o).filter(Go).map(ys).map(i):Array.isArray(e)?e.map(ys).map(i):[]}function NS(e){return typeof e=="function"}function ys(e){return typeof e=="string"?{type:e}:e}function _S(e,t){return e.catch(t)}var En=Symbol("forceQueryFn"),Ss=e=>typeof e[En]=="function";function VS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,f=new Map,{unsubscribeQueryResult:m,removeMutationResult:p,updateSubscriptionOptions:h}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:T,buildInitiateMutation:w,getRunningQueryThunk:y,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:v};function y(E,N){return k=>{let I=i.endpointDefinitions[E],F=e({queryArgs:N,endpointDefinition:I,endpointName:E});return a.get(k)?.[F]}}function S(E,N){return k=>f.get(k)?.[N]}function g(){return E=>Object.values(a.get(E)||{}).filter(Go)}function v(){return E=>Object.values(f.get(E)||{}).filter(Go)}function R(E){}function P(E,N){let k=(I,{subscribe:F=!0,forceRefetch:O,subscriptionOptions:_,[En]:$,...U}={})=>(j,V)=>{let Q=e({queryArgs:I,endpointDefinition:N,endpointName:E}),L,z={...U,type:"query",subscribe:F,forceRefetch:O,subscriptionOptions:_,endpointName:E,originalArgs:I,queryCacheKey:Q,[En]:$};if(As(N))L=t(z);else{let{direction:ce,initialPageParam:me}=U;L=r({...z,direction:ce,initialPageParam:me})}let W=o.endpoints[E].select(I),Y=j(L),re=W(V());let{requestId:se,abort:ee}=Y,ne=re.requestId!==se,Z=a.get(j)?.[Q],oe=()=>W(V()),he=Object.assign($?Y.then(oe):ne&&!Z?Promise.resolve(re):Promise.all([Z,Y]).then(oe),{arg:I,requestId:se,subscriptionOptions:_,queryCacheKey:Q,abort:ee,unwrap(){return _asyncToGenerator(function*(){let ce=yield he;if(ce.isError)throw ce.error;return ce.data})()},refetch:()=>j(k(I,{subscribe:!1,forceRefetch:!0})),unsubscribe(){F&&j(m({queryCacheKey:Q,requestId:se}))},updateSubscriptionOptions(ce){he.subscriptionOptions=ce,j(h({endpointName:E,requestId:se,queryCacheKey:Q,options:ce}))}});if(!Z&&!ne&&!$){let ce=TS(a,j,{});ce[Q]=he,he.then(()=>{delete ce[Q],Dr(ce)||a.delete(j)})}return he};return k}function x(E,N){return P(E,N)}function T(E,N){return P(E,N)}function w(E){return(N,{track:k=!0,fixedCacheKey:I}={})=>(F,O)=>{let _=n({type:"mutation",endpointName:E,originalArgs:N,track:k,fixedCacheKey:I}),$=F(_);let{requestId:U,abort:j,unwrap:V}=$,Q=_S($.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{F(p({requestId:U,fixedCacheKey:I}))},z=Object.assign(Q,{arg:$.arg,requestId:U,abort:j,unwrap:V,reset:L}),W=f.get(F)||{};return f.set(F,W),W[U]=z,z.then(()=>{delete W[U],Dr(W)||f.delete(F)}),I&&(W[I]=z,z.then(()=>{W[I]===z&&(delete W[I],Dr(W)||f.delete(F))})),z}}}function jS(e){return e}var zo=(e={})=>({...e,[un]:!0});function LS({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let f=(F,O,_,$)=>(U,j)=>{let V=r[F],Q=n({queryArgs:O,endpointDefinition:V,endpointName:F});if(U(o.internalActions.queryResultPatched({queryCacheKey:Q,patches:_})),!$)return;let L=o.endpoints[F].select(O)(j()),z=xs(V.providesTags,L.data,void 0,O,{},i);U(o.internalActions.updateProvidedBy({queryCacheKey:Q,providedTags:z}))};function m(F,O,_=0){let $=[O,...F];return _&&$.length>_?$.slice(0,-1):$}function p(F,O,_=0){let $=[...F,O];return _&&$.length>_?$.slice(1):$}let h=(F,O,_,$=!0)=>(U,j)=>{let Q=o.endpoints[F].select(O)(j()),L={patches:[],inversePatches:[],undo:()=>U(o.util.patchQueryData(F,O,L.inversePatches,$))};if(Q.status==="uninitialized")return L;let z;if("data"in Q)if(De(Q.data)){let[W,Y,re]=Jn(Q.data,_);L.patches.push(...Y),L.inversePatches.push(...re),z=W}else z=_(Q.data),L.patches.push({op:"replace",path:[],value:z}),L.inversePatches.push({op:"replace",path:[],value:Q.data});return L.patches.length===0||U(o.util.patchQueryData(F,O,L.patches,$)),L},y=(F,O,_)=>$=>$(o.endpoints[F].initiate(O,{subscribe:!1,forceRefetch:!0,[En]:()=>({data:_})})),S=(F,O)=>F.query&&F[O]?F[O]:jS,g=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(F,{signal:O,abort:_,rejectWithValue:$,fulfillWithValue:U,dispatch:j,getState:V,extra:Q}){let L=r[F.endpointName];try{let z=S(L,"transformResponse"),W={signal:O,abort:_,dispatch:j,getState:V,extra:Q,endpoint:F.endpointName,type:F.type,forced:F.type==="query"?v(F,V()):void 0,queryCacheKey:F.type==="query"?F.queryCacheKey:void 0},Y=F.type==="query"?F[En]:void 0,re,se=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(ne,Z,oe,he){if(Z==null&&ne.pages.length)return Promise.resolve({data:ne});let ce={queryArg:F.originalArgs,pageParam:Z},me=yield ee(ce),ye=he?m:p;return{data:{pages:ye(ne.pages,me.data,oe),pageParams:ye(ne.pageParams,Z,oe)}}});return function se(_x47,_x48,_x49,_x50){return _ref22.apply(this,arguments)}}();function ee(_x51){return _ee.apply(this,arguments)}function _ee(){_ee=_asyncToGenerator(function*(ne){let Z,{extraOptions:oe}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(ne),W,oe):Z=yield L.queryFn(ne,W,oe,ce=>t(ce,W,oe)),typeof process<"u",Z.error)throw new Mr(Z.error,Z.meta);let he=yield z(Z.data,Z.meta,ne);return{...Z,data:he}});return _ee.apply(this,arguments)}if(F.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:ne}=L,{maxPages:Z=1/0}=ne,oe,he={pages:[],pageParams:[]},ce=a.selectQueryEntry(V(),F.queryCacheKey)?.data,ye=v(F,V())&&!F.direction||!ce?he:ce;if("direction"in F&&F.direction&&ye.pages.length){let Te=F.direction==="backward",ft=(Te?Ed:vs)(ne,ye);oe=yield se(ye,ft,Z,Te)}else{let{initialPageParam:Te=ne.initialPageParam}=F,je=ce?.pageParams??[],ft=je[0]??Te,Xt=je.length;oe=yield se(ye,ft,Z),Y&&(oe={data:oe.data.pages[0]});for(let Zt=1;Zt<Xt;Zt++){let Qr=vs(ne,oe.data);oe=yield se(oe.data,Qr,Z)}}re=oe}else re=yield ee(F.originalArgs);return U(re.data,zo({fulfilledTimeStamp:Date.now(),baseQueryMeta:re.meta}))}catch(z){let W=z;if(W instanceof Mr){let Y=S(L,"transformErrorResponse");try{return $(yield Y(W.value,W.meta,F.originalArgs),zo({baseQueryMeta:W.meta}))}catch(re){W=re}}throw typeof process<"u",console.error(W),W}});return function g(_x45,_x46){return _ref21.apply(this,arguments)}}();function v(F,O){let _=a.selectQueryEntry(O,F.queryCacheKey),$=a.selectConfig(O).refetchOnMountOrArgChange,U=_?.fulfilledTimeStamp,j=F.forceRefetch??(F.subscribe&&$);return j?j===!0||(Number(new Date)-Number(U))/1e3>=j:!1}let R=()=>ue(`${e}/executeQuery`,g,{getPendingMeta({arg:O}){let _=r[O.endpointName];return zo({startedTimeStamp:Date.now(),...(ws(_)?{direction:O.direction}:{})})},condition(O,{getState:_}){let $=_(),U=a.selectQueryEntry($,O.queryCacheKey),j=U?.fulfilledTimeStamp,V=O.originalArgs,Q=U?.originalArgs,L=r[O.endpointName],z=O.direction;return Ss(O)?!0:U?.status==="pending"?!1:v(O,$)||As(L)&&L?.forceRefetch?.({currentArg:V,previousArg:Q,endpointState:U,state:$})?!0:!(j&&!z)},dispatchConditionRejection:!0}),P=R(),x=R(),T=ue(`${e}/executeMutation`,g,{getPendingMeta(){return zo({startedTimeStamp:Date.now()})}}),w=F=>"force"in F,E=F=>"ifOlderThan"in F,N=(F,O,_)=>($,U)=>{let j=w(_)&&_.force,V=E(_)&&_.ifOlderThan,Q=(z=!0)=>{let W={forceRefetch:z,isPrefetch:!0};return o.endpoints[F].initiate(O,W)},L=o.endpoints[F].select(O)(U());if(j)$(Q());else if(V){let z=L?.fulfilledTimeStamp;if(!z){$(Q());return}(Number(new Date)-Number(new Date(z)))/1e3>=V&&$(Q())}else $(Q(!1))};function k(F){return O=>O?.meta?.arg?.endpointName===F}function I(F,O){return{matchPending:sr(to(F),k(O)),matchFulfilled:sr(at(F),k(O)),matchRejected:sr($t(F),k(O))}}return{queryThunk:P,mutationThunk:T,infiniteQueryThunk:x,prefetch:N,updateQueryData:h,upsertQueryData:y,patchQueryData:f,buildMatchThunkActions:I}}function vs(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Ed(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Id(e,t,r,n){return xs(r[e.meta.arg.endpointName][t],at(e)?e.payload:void 0,dn(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Wo(e,t,r){let n=e[t];n&&r(n)}function In(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function md(e,t,r){let n=e[In(t)];n&&r(n)}var Rn={};function US({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:f},assertTagType:m,config:p}){let h=D(`${e}/resetApiState`);function y(k,I,F,O){var _;k[_=I.queryCacheKey]??(k[_]={status:"uninitialized",endpointName:I.endpointName}),Wo(k,I.queryCacheKey,$=>{$.status="pending",$.requestId=F&&$.requestId?$.requestId:O.requestId,I.originalArgs!==void 0&&($.originalArgs=I.originalArgs),$.startedTimeStamp=O.startedTimeStamp;let U=o[O.arg.endpointName];ws(U)&&"direction"in I&&($.direction=I.direction)})}function S(k,I,F,O){Wo(k,I.arg.queryCacheKey,_=>{if(_.requestId!==I.requestId&&!O)return;let{merge:$}=o[I.arg.endpointName];if(_.status="fulfilled",$){if(_.data!==void 0){let{fulfilledTimeStamp:U,arg:j,baseQueryMeta:V,requestId:Q}=I,L=it(_.data,z=>$(z,F,{arg:j.originalArgs,baseQueryMeta:V,fulfilledTimeStamp:U,requestId:Q}));_.data=L}else _.data=F;}else _.data=o[I.arg.endpointName].structuralSharing??!0?bd(Ne(_.data)?ca(_.data):_.data,F):F;delete _.error,_.fulfilledTimeStamp=I.fulfilledTimeStamp})}let g=Ht({name:`${e}/queries`,initialState:Rn,reducers:{removeQueryResult:{reducer(k,{payload:{queryCacheKey:I}}){delete k[I]},prepare:cr()},cacheEntriesUpserted:{reducer(k,I){for(let F of I.payload){let{queryDescription:O,value:_}=F;y(k,O,!0,{arg:O,requestId:I.meta.requestId,startedTimeStamp:I.meta.timestamp}),S(k,{arg:O,requestId:I.meta.requestId,fulfilledTimeStamp:I.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:k=>({payload:k.map(O=>{let{endpointName:_,arg:$,value:U}=O,j=o[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:O.arg,queryCacheKey:n({queryArgs:$,endpointDefinition:j,endpointName:_})},value:U}}),meta:{[un]:!0,requestId:no(),timestamp:Date.now()}})},queryResultPatched:{reducer(k,{payload:{queryCacheKey:I,patches:F}}){Wo(k,I,O=>{O.data=la(O.data,F.concat())})},prepare:cr()}},extraReducers(k){k.addCase(t.pending,(I,{meta:F,meta:{arg:O}})=>{let _=Ss(O);y(I,O,_,F)}).addCase(t.fulfilled,(I,{meta:F,payload:O})=>{let _=Ss(F.arg);S(I,F,O,_)}).addCase(t.rejected,(I,{meta:{condition:F,arg:O,requestId:_},error:$,payload:U})=>{Wo(I,O.queryCacheKey,j=>{if(!F){if(j.requestId!==_)return;j.status="rejected",j.error=U??$}})}).addMatcher(f,(I,F)=>{let{queries:O}=a(F);for(let[_,$]of Object.entries(O))($?.status==="fulfilled"||$?.status==="rejected")&&(I[_]=$)})}}),v=Ht({name:`${e}/mutations`,initialState:Rn,reducers:{removeMutationResult:{reducer(k,{payload:I}){let F=In(I);F in k&&delete k[F]},prepare:cr()}},extraReducers(k){k.addCase(r.pending,(I,{meta:F,meta:{requestId:O,arg:_,startedTimeStamp:$}})=>{_.track&&(I[In(F)]={requestId:O,status:"pending",endpointName:_.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,(I,{payload:F,meta:O})=>{O.arg.track&&md(I,O,_=>{_.requestId===O.requestId&&(_.status="fulfilled",_.data=F,_.fulfilledTimeStamp=O.fulfilledTimeStamp)})}).addCase(r.rejected,(I,{payload:F,error:O,meta:_})=>{_.arg.track&&md(I,_,$=>{$.requestId===_.requestId&&($.status="rejected",$.error=F??O)})}).addMatcher(f,(I,F)=>{let{mutations:O}=a(F);for(let[_,$]of Object.entries(O))($?.status==="fulfilled"||$?.status==="rejected")&&_!==$?.requestId&&(I[_]=$)})}}),R=Ht({name:`${e}/invalidation`,initialState:Rn,reducers:{updateProvidedBy:{reducer(k,I){var _,$;let{queryCacheKey:F,providedTags:O}=I.payload;for(let U of Object.values(k))for(let j of Object.values(U)){let V=j.indexOf(F);V!==-1&&j.splice(V,1)}for(let{type:U,id:j}of O){let V=(_=k[U]??(k[U]={}))[$=j||"__internal_without_id"]??(_[$]=[]);V.includes(F)||V.push(F)}},prepare:cr()}},extraReducers(k){k.addCase(g.actions.removeQueryResult,(I,{payload:{queryCacheKey:F}})=>{for(let O of Object.values(I))for(let _ of Object.values(O)){let $=_.indexOf(F);$!==-1&&_.splice($,1)}}).addMatcher(f,(I,F)=>{var _,$;let{provided:O}=a(F);for(let[U,j]of Object.entries(O))for(let[V,Q]of Object.entries(j)){let L=(_=I[U]??(I[U]={}))[$=V||"__internal_without_id"]??(_[$]=[]);for(let z of Q)L.includes(z)||L.push(z)}}).addMatcher(Ye(at(t),dn(t)),(I,F)=>{let O=Id(F,"providesTags",o,m),{queryCacheKey:_}=F.meta.arg;R.caseReducers.updateProvidedBy(I,R.actions.updateProvidedBy({queryCacheKey:_,providedTags:O}))})}}),P=Ht({name:`${e}/subscriptions`,initialState:Rn,reducers:{updateSubscriptionOptions(k,I){},unsubscribeQueryResult(k,I){},internal_getRTKQSubscriptions(){}}}),x=Ht({name:`${e}/internalSubscriptions`,initialState:Rn,reducers:{subscriptionsUpdated:{reducer(k,I){return la(k,I.payload)},prepare:cr()}}}),T=Ht({name:`${e}/config`,initialState:{online:RS(),focused:xS(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(k,{payload:I}){k.middlewareRegistered=k.middlewareRegistered==="conflict"||i!==I?"conflict":!0}},extraReducers:k=>{k.addCase(bs,I=>{I.online=!0}).addCase(Rd,I=>{I.online=!1}).addCase(Cs,I=>{I.focused=!0}).addCase(xd,I=>{I.focused=!1}).addMatcher(f,I=>({...I}))}}),w=or({queries:g.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:x.reducer,config:T.reducer}),E=(k,I)=>w(h.match(I)?void 0:k,I),N={...T.actions,...g.actions,...P.actions,...x.actions,...v.actions,...R.actions,resetApiState:h};return{reducer:E,actions:N}}var hs=Symbol.for("RTKQ/skipToken"),Pd={status:"uninitialized"},gd=it(Pd,()=>{}),hd=it(Pd,()=>{});function BS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>gd,o=w=>hd;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:P,selectApiState:a,selectQueries:f,selectMutations:p,selectQueryEntry:m,selectConfig:h};function i(w){return{...w,...cd(w.status)}}function a(w){return w[t]}function f(w){return a(w)?.queries}function m(w,E){return f(w)?.[E]}function p(w){return a(w)?.mutations}function h(w){return a(w)?.config}function y(w,E,N){return k=>{if(k===hs)return r(n,N);let I=e({queryArgs:k,endpointDefinition:E,endpointName:w});return r(O=>m(O,I)??gd,N)}}function S(w,E){return y(w,E,i)}function g(w,E){let{infiniteQueryOptions:N}=E;function k(I){let F={...I,...cd(I.status)},{isLoading:O,isError:_,direction:$}=F,U=$==="forward",j=$==="backward";return{...F,hasNextPage:x(N,F.data),hasPreviousPage:T(N,F.data),isFetchingNextPage:O&&U,isFetchingPreviousPage:O&&j,isFetchNextPageError:_&&U,isFetchPreviousPageError:_&&j}}return y(w,E,k)}function v(){return w=>{let E;return typeof w=="object"?E=In(w)??hs:E=w,r(E===hs?o:I=>a(I)?.mutations?.[E]??hd,i)}}function R(w,E){let N=w[t],k=new Set;for(let I of E.filter(Go).map(ys)){let F=N.provided[I.type];if(!F)continue;let O=(I.id!==void 0?F[I.id]:ld(Object.values(F)))??[];for(let _ of O)k.add(_)}return ld(Array.from(k.values()).map(I=>{let F=N.queries[I];return F?[{queryCacheKey:I,endpointName:F.endpointName,originalArgs:F.originalArgs}]:[]}))}function P(w,E){return Object.values(f(w)).filter(N=>N?.endpointName===E&&N.status!=="uninitialized").map(N=>N.originalArgs)}function x(w,E){return E?vs(w,E)!=null:!1}function T(w,E){return!E||!w.getPreviousPageParam?!1:Ed(w,E)!=null}}var yd=WeakMap?new WeakMap:void 0,Sd=({endpointName:e,queryArgs:t})=>{let r="",n=yd?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Ke(a)?Object.keys(a).sort().reduce((f,m)=>(f[m]=a[m],f),{}):a,a));Ke(t)&&yd?.set(t,o),r=o}return`${e}(${r})`};function QS(...e){return function(r){let n=ar(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let h=Sd;if("serializeQueryArgs"in p.endpointDefinition){let y=p.endpointDefinition.serializeQueryArgs;h=S=>{let g=y(S);return typeof g=="string"?g:Sd({...S,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:no(),extractRehydrationInfo:n,hasRehydrationInfo:ar(p=>n(p)!=null)},a={injectEndpoints:m,enhanceEndpoints({addTagTypes:p,endpoints:h}){if(p)for(let y of p)o.tagTypes.includes(y)||o.tagTypes.push(y);if(h)for(let[y,S]of Object.entries(h))typeof S=="function"?S(i.endpointDefinitions[y]):Object.assign(i.endpointDefinitions[y]||{},S);return a}},f=e.map(p=>p.init(a,o,i));function m(p){let h=p.endpoints({query:y=>({...y,type:"query"}),mutation:y=>({...y,type:"mutation"}),infiniteQuery:y=>({...y,type:"infinitequery"})});for(let[y,S]of Object.entries(h)){if(p.overrideExisting!==!0&&y in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error(He(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[y]=S;for(let g of f)g.injectEndpoint(y,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function dt(e,...t){return Object.assign(e,...t)}var $S=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:f}=e.internalActions,m=(g,v)=>{var P,x;if(a.match(v)){let{queryCacheKey:T,requestId:w,options:E}=v.payload;return g?.[T]?.[w]&&(g[T][w]=E),!0}if(f.match(v)){let{queryCacheKey:T,requestId:w}=v.payload;return g[T]&&delete g[T][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete g[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:T,requestId:w}}=v,E=g[P=T.queryCacheKey]??(g[P]={});return E[`${w}_running`]={},T.subscribe&&(E[w]=T.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let T=g[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;R||(R=!!T[w]),delete T[w]}if(t.rejected.match(v)){let{meta:{condition:T,arg:w,requestId:E}}=v;if(T&&w.subscribe){let N=g[x=w.queryCacheKey]??(g[x]={});N[E]=w.subscriptionOptions??N[E]??{},R=!0}}return R},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:g=>{let R=p()[g]??{};return Dr(R)},isRequestSubscribed:(g,v)=>!!p()?.[g]?.[v]};return(g,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let R=m(r.currentSubscriptions,g),P=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=Jn(o,()=>w);v.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof g.type=="string"&&!!g.type.startsWith(n),T=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;P=!x&&!T}return[P,!1]}};function HS(e){for(let t in e)return!1;return!0}var zS=2147483647/1e3-1,WS=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:f,unsubscribeQueryResult:m,cacheEntriesUpserted:p}=t.internalActions,h=Ye(m.match,r.fulfilled,r.rejected,p.match);function y(P){let x=o.currentSubscriptions[P];return!!x&&!HS(x)}let S={},g=(P,x,T)=>{let w=x.getState(),E=a(w);if(h(P)){let N;if(p.match(P))N=P.payload.map(k=>k.queryDescription.queryCacheKey);else{let{queryCacheKey:k}=m.match(P)?P.payload:P.meta.arg;N=[k]}v(N,x,E)}if(t.util.resetApiState.match(P))for(let[N,k]of Object.entries(S))k&&clearTimeout(k),delete S[N];if(n.hasRehydrationInfo(P)){let{queries:N}=n.extractRehydrationInfo(P);v(Object.keys(N),x,E)}};function v(P,x,T){let w=x.getState();for(let E of P){let N=i(w,E);R(E,N?.endpointName,x,T)}}function R(P,x,T,w){let N=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(N===1/0)return;let k=Math.max(0,Math.min(N,zS));if(!y(P)){let I=S[P];I&&clearTimeout(I),S[P]=setTimeout(()=>{y(P)||T.dispatch(f({queryCacheKey:P})),delete S[P]},k*1e3)}}return g},vd=new Error("Promise never resolved before cacheEntryRemoved."),GS=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:f}})=>{let m=ro(n),p=ro(o),h=at(n,o),y={};function S(x,T,w){let E=y[x];E?.valueResolved&&(E.valueResolved({data:T,meta:w}),delete E.valueResolved)}function g(x){let T=y[x];T&&(delete y[x],T.cacheEntryRemoved())}let v=(x,T,w)=>{let E=R(x);function N(k,I,F,O){let _=a(w,I),$=a(T.getState(),I);!_&&$&&P(k,O,I,T,F)}if(n.pending.match(x))N(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:k,value:I}of x.payload){let{endpointName:F,originalArgs:O,queryCacheKey:_}=k;N(F,_,x.meta.requestId,O),S(_,I,{})}else if(o.pending.match(x))T.getState()[t].mutations[E]&&P(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,T,x.meta.requestId);else if(h(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))g(E);else if(e.util.resetApiState.match(x))for(let k of Object.keys(y))g(k)};function R(x){return m(x)?x.meta.arg.queryCacheKey:p(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?In(x.payload):""}function P(x,T,w,E,N){let k=r.endpointDefinitions[x],I=k?.onCacheEntryAdded;if(!I)return;let F={},O=new Promise(Q=>{F.cacheEntryRemoved=Q}),_=Promise.race([new Promise(Q=>{F.valueResolved=Q}),O.then(()=>{throw vd})]);_.catch(()=>{}),y[w]=F;let $=e.endpoints[x].select(k.type==="query"?T:w),U=E.dispatch((Q,L,z)=>z),j={...E,getCacheEntry:()=>$(E.getState()),requestId:N,extra:U,updateCachedData:k.type==="query"?Q=>E.dispatch(e.util.updateQueryData(x,T,Q)):void 0,cacheDataLoaded:_,cacheEntryRemoved:O},V=I(T,j);Promise.resolve(V).catch(Q=>{if(Q!==vd)throw Q})}return v},KS=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},YS=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:f,internalState:m})=>{let{removeQueryResult:p}=i.internalActions,h=Ye(at(n),dn(n)),y=Ye(at(n,o),$t(n,o)),S=[],g=(P,x)=>{h(P)?R(Id(P,"invalidatesTags",r,a),x):y(P)?R([],x):i.util.invalidateTags.match(P)&&R(xs(P.payload,void 0,void 0,void 0,void 0,a),x)};function v(P){let{queries:x,mutations:T}=P;for(let w of[x,T])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(P,x){let T=x.getState(),w=T[e];if(S.push(...P),w.config.invalidationBehavior==="delayed"&&v(w))return;let E=S;if(S=[],E.length===0)return;let N=i.util.selectInvalidatedBy(T,E);t.batch(()=>{let k=Array.from(N.values());for(let{queryCacheKey:I}of k){let F=w.queries[I],O=m.currentSubscriptions[I]??{};F&&(Dr(O)===0?x.dispatch(p({queryCacheKey:I})):F.status!=="uninitialized"&&x.dispatch(f(F)))}})}return g},JS=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,v)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&p(g.payload,v),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&p(g.meta.arg,v),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&m(g.meta.arg,v),r.util.resetApiState.match(g)&&y()};function f(g,v){let P=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!(!P||P.status==="uninitialized"))return x}function m({queryCacheKey:g},v){let R=v.getState()[e],P=R.queries[g],x=o.currentSubscriptions[g];if(!P||P.status==="uninitialized")return;let{lowestPollingInterval:T,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(T))return;let E=i[g];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let N=Date.now()+T;i[g]={nextPollTimestamp:N,pollingInterval:T,timeout:setTimeout(()=>{(R.config.focused||!w)&&v.dispatch(n(P)),m({queryCacheKey:g},v)},T)}}function p({queryCacheKey:g},v){let P=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!P||P.status==="uninitialized")return;let{lowestPollingInterval:T}=S(x);if(!Number.isFinite(T)){h(g);return}let w=i[g],E=Date.now()+T;(!w||E<w.nextPollTimestamp)&&m({queryCacheKey:g},v)}function h(g){let v=i[g];v?.timeout&&clearTimeout(v.timeout),delete i[g]}function y(){for(let g of Object.keys(i))h(g)}function S(g={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let P in g)g[P].pollingInterval&&(R=Math.min(g[P].pollingInterval,R),v=g[P].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return a},XS=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=to(r,n),i=$t(r,n),a=at(r,n),f={};return(p,h)=>{if(o(p)){let{requestId:y,arg:{endpointName:S,originalArgs:g}}=p.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let P={},x=new Promise((N,k)=>{P.resolve=N,P.reject=k});x.catch(()=>{}),f[y]=P;let T=e.endpoints[S].select(v.type==="query"?g:y),w=h.dispatch((N,k,I)=>I),E={...h,getCacheEntry:()=>T(h.getState()),requestId:y,extra:w,updateCachedData:v.type==="query"?N=>h.dispatch(e.util.updateQueryData(S,g,N)):void 0,queryFulfilled:x};R(g,E)}}else if(a(p)){let{requestId:y,baseQueryMeta:S}=p.meta;f[y]?.resolve({data:p.payload,meta:S}),delete f[y]}else if(i(p)){let{requestId:y,rejectedWithValue:S,baseQueryMeta:g}=p.meta;f[y]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:g}),delete f[y]}}},ZS=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(m,p)=>{Cs.match(m)&&f(p,"refetchOnFocus"),bs.match(m)&&f(p,"refetchOnReconnect")};function f(m,p){let h=m.getState()[e],y=h.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let v=y[g],R=S[g];if(!R||!v)continue;(Object.values(R).some(x=>x[p]===!0)||Object.values(R).every(x=>x[p]===void 0)&&h.config[p])&&(Dr(R)===0?m.dispatch(i({queryCacheKey:g})):v.status!=="uninitialized"&&m.dispatch(n(v)))}})}return a};function ev(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:D(`${t}/invalidateTags`)},f=y=>y.type.startsWith(`${t}/`),m=[KS,WS,YS,JS,GS,XS];return{middleware:y=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:f},R=m.map(T=>T(v)),P=$S(v),x=ZS(v);return T=>w=>{if(!zn(w))return T(w);S||(S=!0,y.dispatch(n.internalActions.middlewareRegistered(i)));let E={...y,next:T},N=y.getState(),[k,I]=P(w,E,N),F;if(k?F=T(w):F=I,y.getState()[t]&&(x(w,E,N),f(w)||o.hasRehydrationInfo(w)))for(let O of R)O(w,E,N);return F}},actions:a};function h(y){return e.api.endpoints[y.endpointName].initiate(y.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Cd=Symbol(),tv=({createSelector:e=pe}={})=>({name:Cd,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:f,refetchOnFocus:m,refetchOnReconnect:p,invalidationBehavior:h},y){Jc();let S=ee=>(typeof process<"u",ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:bs,onOffline:Rd,onFocus:Cs,onFocusLost:xd},util:{}});let g=BS({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:P,buildInfiniteQuerySelector:x,buildMutationSelector:T}=g;dt(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:N,patchQueryData:k,updateQueryData:I,upsertQueryData:F,prefetch:O,buildMatchThunkActions:_}=LS({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:$,actions:U}=US({context:y,queryThunk:w,infiniteQueryThunk:E,mutationThunk:N,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:m,refetchOnReconnect:p,refetchOnMountOrArgChange:f,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:h}});dt(t.util,{patchQueryData:k,updateQueryData:I,upsertQueryData:F,prefetch:O,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),dt(t.internalActions,U);let{middleware:j,actions:V}=ev({reducerPath:o,context:y,queryThunk:w,mutationThunk:N,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:g});dt(t.util,V),dt(t,{reducer:$,middleware:j});let{buildInitiateQuery:Q,buildInitiateInfiniteQuery:L,buildInitiateMutation:z,getRunningMutationThunk:W,getRunningMutationsThunk:Y,getRunningQueriesThunk:re,getRunningQueryThunk:se}=VS({queryThunk:w,mutationThunk:N,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:y});return dt(t.util,{getRunningMutationThunk:W,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:re}),{name:Cd,injectEndpoint(ee,ne){var he;let oe=(he=t.endpoints)[ee]??(he[ee]={});As(ne)&&dt(oe,{name:ee,select:P(ee,ne),initiate:Q(ee,ne)},_(w,ee)),qS(ne)&&dt(oe,{name:ee,select:T(),initiate:z(ee)},_(N,ee)),ws(ne)&&dt(oe,{name:ee,select:x(ee,ne),initiate:L(ee,ne)},_(w,ee))}}}}),Td=QS(tv());var rv=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,f=n.generatedAnswer.answerConfigurationId,m={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let p=Pe(a,i);return{data:Ad({baseUrl:`${p}/rest/organizations/${a}/answer/v1/configs/${f}`,fetchFn:function(){var _ref24=_asyncToGenerator(function*(y){if(y instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=y.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{g[v]=y[v]}),g.duplex="half",g.body=yield y.text(),b(S,g)});return function fetchFn(_x55){return _ref24.apply(this,arguments)}}()})(m,{...t,signal:null},r)}}catch(p){return{error:p}}});return function rv(_x52,_x53,_x54){return _ref23.apply(this,arguments)}}(),Fd=Td({reducerPath:"answer",baseQuery:wd(rv,{maxRetries:3}),endpoints:()=>({})});var nv=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},ov=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},iv=(e,t)=>{e.citations=t.citations},av=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},sv=(e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)},cv=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&sv(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(nv(t,o),r(es(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(ov(t,o),r(Xa({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(iv(t,o),r(Za({citations:o.citations})));break;case"genqa.endOfStreamType":av(t,o),r(jo(o.answerGenerated??!1));break}},Rs=Fd.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let n=JSON.parse(JSON.stringify(r));return n.analytics&&(delete n.analytics.clientTimestamp,delete n.analytics.actionCause),`${t}(${JSON.stringify(n)})`},onCacheEntryAdded(_x56,_x57){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:f,insightConfiguration:m}=r(),{organizationId:p,environment:h,accessToken:y}=a,S=Pe(p,h),g=`${S}/rest/organizations/${p}/insight/v1/configs/${m?.insightId}/answer/${f.answerConfigurationId}/generate`,v=`${S}/rest/organizations/${p}/answer/v1/configs/${f.answerConfigurationId}/generate`;yield sd(m?g:v,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${y}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:b,onopen:function(){var _ref25=_asyncToGenerator(function*(R){let P=R.headers.get("x-answer-id");P&&o(x=>{x.answerId=P})});return function onopen(_x58){return _ref25.apply(this,arguments)}}(),onmessage:R=>{o(P=>{cv(R,P,i)})},onerror:R=>{throw R},onclose:()=>{o(R=>{i(ts(!R.generated))})}})}).apply(this,arguments)}})})}),C_=pe(e=>bn(e)?.q,e=>e.search.requestId,(e,t)=>({q:e,requestId:t})),Ko={},uv=(e,t)=>({...Ko,[e]:Ho(t)?.map(r=>ds(r,ls())).sort((r,n)=>r.facetId>n.facetId?1:n.facetId>r.facetId?-1:0)}),lv=e=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,dv=e=>{let t=Ya(e),r=pv(e);return{...t,...(r&&{cq:r})}},pv=e=>{let t=Zl(e.tabSet),r=$o(e),{cq:n}=Ya(e);return[t,...r,n].filter(o=>!!o).join(" AND ")},fv=(e,t,r)=>{let n=bn(e)?.q,{aq:o,cq:i,dq:a,lq:f}=dv(e),m=wl(e),p=Dl(e),h=Ol(e),y=Rl(e)??[];return n&&t==="fetch"&&(Ko=uv(n,e)),{q:n,...(o&&{aq:o}),...(i&&{cq:i}),...(a&&{dq:a}),...(f&&{lq:f}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:y}},...(p?.length&&{searchHub:p}),...(h?.length&&{pipeline:h}),...(Ko[n]?.length&&{facets:Ko[n]}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:lv(e),firstResult:e.pagination.firstResult}),tab:ps(e.tabSet),...Vo(e.configuration.analytics,r,{actionCause:Xl(e)})}};var El=(e,t)=>Rs.endpoints.getAnswer.select(fv(e,"select",t||Cn()))(e);d();c();l();u();var kd=ge(ur,e=>e);d();c();l();u();function Es(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();function mv(e){let t=e.payload?.analyticsAction;return Od(e)&&!X(t)}function Od(e){return"type"in e}var Dd=e=>t=>r=>{let n;mv(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Od(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var W_=D("tab/register",e=>{let t=new K({values:{id:G,expression:we}});return B(e,t)}),Yo=D("tab/updateActiveTab",e=>B(e,G));d();c();l();u();var Jo=Qe(Lo(),1),Nd=Qe(Md(),1),_d=Qe(qd(),1);Jo.default.extend(_d.default);Jo.default.extend(Nd.default);var Vd=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Jo.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});d();c();l();u();var gv=/(^|; )Coveo-Pendragon=([^;]*)/;function ks(){return typeof window>"u"?!1:gv.exec(document.cookie)?.pop()||null}var jd=ge(Vd(),e=>e.addCase(St,(t,r)=>{hv(t,r.payload)}).addCase(Je,(t,r)=>{yv(t,r.payload)}).addCase(lr,(t,r)=>{Sv(t,r.payload)}).addCase(dr,t=>{t.analytics.enabled=!1}).addCase(pr,t=>{t.analytics.enabled=!0}).addCase(io,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(ao,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Yo,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Ru,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(vt,(t,r)=>{X(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function hv(e,t){X(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",X(t.organizationId)||(e.organizationId=t.organizationId)}function yv(e,t){X(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),X(t.locale)||(e.search.locale=t.locale),X(t.timezone)||(e.search.timezone=t.timezone),X(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function Sv(e,t){X(t.enabled)||(e.analytics.enabled=t.enabled),X(t.originContext)||(e.analytics.originContext=t.originContext),X(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),X(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),X(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),X(t.trackingId)||(e.analytics.trackingId=t.trackingId),X(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),X(t.source)||(e.analytics.source=t.source);try{let r=ks();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}X(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),X(t.anonymous)||(e.analytics.anonymous=t.anonymous),X(t.deviceId)||(e.analytics.deviceId=t.deviceId),X(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),X(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var ze=jd;d();c();l();u();function vv(e){return e.instantlyCallable}var Ld=()=>e=>t=>e(vv(t)?t():t);d();c();l();u();var Ud=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error,i=[n.payload?.errorCode,n.payload?.message].filter(Boolean).join(" - ");if(n.payload?.ignored||e.error(i||o.stack||o.message||o.name||"Error",`Action dispatch error ${n.type}`,r),n.error.name!=="SchemaValidationError")return t(r)},Bd=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();function Qd(e,t){let r={...e},n,o=i=>(a,f)=>{let m=i(a,f);return n?n(m,f):m};return{get combinedReducer(){let i=vc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,f])=>[a,()=>f]));return o(or({...i,...r}))},containsAll(i){return Object.keys(i).every(f=>f in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>r[a]=i[a])},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function Xo(e,t,r){var n,o,i;t===void 0&&(t=50),r===void 0&&(r={});var a=(n=r.isImmediate)!=null&&n,f=(o=r.callback)!=null&&o,m=r.maxWait,p=Date.now(),h=[];function y(){if(m!==void 0){var g=Date.now()-p;if(g+t>=m)return m-g}return t}var S=function(){var g=[].slice.call(arguments),v=this;return new Promise(function(R,P){var x=a&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,p=Date.now(),!a){var w=e.apply(v,g);f&&f(w),h.forEach(function(E){return(0,E.resolve)(w)}),h=[]}},y()),x){var T=e.apply(v,g);return f&&f(T),R(T)}h.push({resolve:R,reject:P})})};return S.cancel=function(g){i!==void 0&&clearTimeout(i),h.forEach(function(v){return(0,v.reject)(g)}),h=[]},S}function $d(e,t){let r=0,n=Xo(()=>r=0,500);return o=>i=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(a){if(!(typeof a=="function"))return i(a);let m=yield i(a);if(!Cv(m))return m;if(typeof t!="function")return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),m;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),m;r++,n();let p=yield bv(t);o.dispatch(St({accessToken:p})),o.dispatch(a)});return function(_x59){return _ref26.apply(this,arguments)}}())}function Cv(e){return e?.error?.name===new nr().name}function bv(_x60){return _bv.apply(this,arguments)}function _bv(){_bv=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _bv.apply(this,arguments)}d();c();l();u();function Hd({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return uu({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Bd(n.logger))})}function Av(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&Sc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function zd(e,t){let r={...e.reducers,configuration:ze,version:kd},n=wv({...e,reducers:r},t,ze),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(St({accessToken:o,environment:i,organizationId:a}));let f=Av(e.configuration,n.logger);return f&&n.dispatch(lr(f)),n}function wv(e,t,r){let{reducers:n}=e,o=Qd({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&o.addCrossReducer(e.crossReducer);let i=t.logger,a=()=>{let h="";try{h=Rr(p.state).getMeta("").clientId}catch(y){i.warn("Error while obtaining clientID from relay",y)}return h},f={...t,get relay(){return Rr(p.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():Es()?Ka(a()):Cn()}},m=xv(e,f,o),p={addReducers(h){o.containsAll(h)||(o.add(h),m.replaceReducer(o.combinedReducer))},dispatch:m.dispatch,subscribe:m.subscribe,enableAnalytics(){m.dispatch(pr())},disableAnalytics(){m.dispatch(dr())},get state(){return m.getState()},get relay(){return Rr(this.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():Es()?Ka(a()):Cn()},logger:i,store:m};return p}function xv(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=Rv(e,t.logger);return Hd({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function Rv(e,t){let{renewAccessToken:r}=e.configuration,n=$d(t,r);return[Ld,n,Ud(t),Dd].concat(Rs.middleware,e.middlewares||[])}d();c();l();u();var tp=Qe(ep(),1);function rp(e){return(0,tp.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function np(e,t){let r=Qv(e),n=Le,o=$v(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function Qv(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function $v(e){return e.preprocessRequest||Vn}d();c();l();u();d();c();l();u();var op={organizationId:G,accessToken:G,name:new H({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new te({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function ip(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var ap=new Fe({...op,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ae,locale:Ae,timezone:Ae});function _s(){return{...ip(),searchHub:"default"}}var Hv={debug:lo,pipeline:gr,searchHub:Tr,recommendation:Ir};function sp(e){let t=rp(e.loggerOptions);zv(e.configuration,t);let r=Wv(e.configuration,t),n={...np(e.configuration,t),apiClient:r},o={...e,reducers:Hv},i=zd(o,n),{pipeline:a,searchHub:f,timezone:m,locale:p,proxyBaseUrl:h}=e.configuration;return i.dispatch(Je({timezone:m,locale:p,proxyBaseUrl:h})),X(a)||i.dispatch(fr(a)),X(f)||i.dispatch(Pr(f)),{...i,get state(){return i.state}}}function zv(e,t){try{ap.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function Wv(e,t){return new Qn({logger:t,preprocessRequest:e.preprocessRequest||Vn,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Cc,postprocessFacetSearchResponseMiddleware:bc,postprocessQuerySuggestResponseMiddleware:Ac})}d();c();l();u();function Gv(e){return e.addReducers({configuration:ze}),{disableAnalytics:dr,enableAnalytics:pr,setOriginLevel2:io,setOriginLevel3:ao,updateAnalyticsConfiguration:lr,updateBasicConfiguration:St}}d();c();l();u();function Kv(e){return e.addReducers({configuration:ze,pipeline:gr,searchHub:Tr}),{updateSearchConfiguration:Je}}d();c();l();u();d();c();l();u();d();c();l();u();var It=()=>new H({required:!1,emptyAllowed:!0}),ti=D("advancedSearchQueries/update",e=>B(e,{aq:It(),cq:It(),lq:It(),dq:It()})),ri=D("advancedSearchQueries/register",e=>B(e,{aq:It(),cq:It(),lq:It(),dq:It()}));d();c();l();u();var Pt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var cp=ge(Pt(),e=>{e.addCase(ti,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0),ve(i)||(t.lq=i,t.lqWasSet=!0),ve(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(ri,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ve(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ve(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ve(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(Me.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(vt,(t,r)=>{let{aq:n,cq:o}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0)})});function Yv(e){return e.addReducers({advancedSearchQueries:cp}),{updateAdvancedSearchQueries:ti,registerAdvancedSearchQueries:ri}}d();c();l();u();d();c();l();u();d();c();l();u();var Jv=new ie({each:G,required:!0}),up=(e,t)=>(B(e,G),Nn(t)?B(t,G):B(t,Jv),{payload:{contextKey:e,contextValue:t}}),Kt=D("context/set",e=>{for(let[t,r]of Object.entries(e))up(t,r);return{payload:e}}),Yt=D("context/add",e=>up(e.contextKey,e.contextValue)),Jt=D("context/remove",e=>B(e,G));d();c();l();u();function ni(){return{contextValues:{}}}var oi=ge(ni(),e=>{e.addCase(Kt,(t,r)=>{t.contextValues=r.payload}).addCase(Yt,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Jt,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});function Xv(e){return e.addReducers({context:oi}),{addContext:Yt,removeContext:Jt,setContext:Kt}}d();c();l();u();d();c();l();u();d();c();l();u();var Nr=D("dictionaryFieldContext/set",e=>{let t=new K({options:{required:!0}}),r=B(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:we}),i=B(n,o).error;return i?{payload:e,error:i}:{payload:e}}),_r=D("dictionaryFieldContext/add",e=>{let t=new K({options:{required:!0},values:{field:we,key:we}});return B(e,t)}),Vr=D("dictionaryFieldContext/remove",e=>B(e,we));d();c();l();u();function ii(){return{contextValues:{}}}var ai=ge(ii(),e=>{e.addCase(Nr,(t,r)=>{t.contextValues=r.payload}).addCase(_r,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Vr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function Zv(e){return e.addReducers({dictionaryFieldContext:ai}),{addContext:_r,removeContext:Vr,setContext:Nr}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Tt=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ht(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Ze.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Mo(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Tt(_x61,_x62){return _ref27.apply(this,arguments)}}();d();c();l();u();var jr=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ht(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Vo(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});var eC={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new J({min:0,required:!1})},lp=D("folding/register",e=>B(e,eC)),BQ=ue("folding/loadCollection",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Tt(i):jr(i,o),f=yield n.search({...a,q:tC(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return ke(f)?r(f.error):{collectionId:e,results:f.success.results,searchUid:f.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x63,_x64){return _ref28.apply(this,arguments)}}());function tC(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var dp=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});d();c();l();u();var Lr=D("fields/registerFieldsToInclude",e=>B(e,oo)),si=D("fields/fetchall/enable"),ci=D("fields/fetchall/disable"),ui=ue("fields/fetchDescription",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:f}=o.configuration,{apiBaseUrl:m}=o.configuration.search,p=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:f,url:m??ht(f,a)});return ke(p)?n(p.error):p.success.fields});return function(_x65,_x66){return _ref29.apply(this,arguments)}}());d();c();l();u();var li=["author","language","urihash","objecttype","collection","source","permanentid"],Vs=[...li,"date","filetype","parents"],pp=[...Vs,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],fp=()=>({fieldsToInclude:li,fetchAllFields:!1,fieldsDescription:[]});var di=ge(fp(),e=>e.addCase(Lr,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(si,t=>{t.fetchAllFields=!0}).addCase(ci,t=>{t.fetchAllFields=!1}).addCase(ui.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(lp,(t,{payload:r})=>{let n=dp().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function rC(e){return e.addReducers({fields:di}),{registerFieldsToInclude:Lr,enableFetchAllFields:si,disableFetchAllFields:ci,fetchFieldsDescription:ui}}d();c();l();u();function nC(e){return e.addReducers({pipeline:gr}),{setPipeline:fr}}d();c();l();u();function oC(e){return e.addReducers({searchHub:Tr}),{setSearchHub:Pr}}d();c();l();u();function iC(e){return e.addReducers({debug:lo}),{disableDebug:co,enableDebug:so}}d();c();l();u();function aC(e){return e.addReducers({recommendation:Ir}),{getRecommendations:At,setRecommendationId:Er}}d();c();l();u();function sC(e){return e.addReducers({}),{logRecommendationOpen:_o}}d();c();l();u();d();c();l();u();d();c();l();u();var Ur=D("breadcrumb/deselectAll"),pi=D("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();d();c();l();u();var Tn={value:G,numberOfResults:new J({min:0}),state:G};d();c();l();u();var le=G;var dC=new J({min:1,default:8,required:!1}),pC=new J({min:1,max:20,default:5,required:!1}),fC={desiredCount:pC,numberOfValues:dC},j$=D("automaticFacet/setOptions",e=>B(e,fC)),L$=D("automaticFacet/deselectAll",e=>B(e,le)),mC=G,mp=D("automaticFacet/toggleSelectValue",e=>B(e,{field:mC,selection:new K({values:Tn})}));d();c();l();u();d();c();l();u();var gC={state:new fe({required:!0}),numberOfResults:new J({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:G}),moreValuesAvailable:new te({required:!1})};function js(e){e.children.forEach(t=>{js(t)}),Le({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},gC)}var Br={facetId:le,field:G,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),basePath:new ie({required:!1,each:G}),filterByBasePath:new te({required:!1})};var oH=D("categoryFacet/register",e=>B(e,Br)),gp=D("categoryFacet/toggleSelectValue",e=>{try{return Le(e.facetId,G),js(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}}),hp=D("categoryFacet/deselectAll",e=>B(e,Br.facetId)),iH=D("categoryFacet/updateNumberOfValues",e=>B(e,{facetId:Br.facetId,numberOfValues:Br.numberOfValues})),aH=D("categoryFacet/updateSortCriterion",e=>B(e,{facetId:Br.facetId,criterion:new fe})),sH=D("categoryFacet/updateBasePath",e=>B(e,{facetId:Br.facetId,basePath:new ie({each:G})}));d();c();l();u();d();c();l();u();var Fn={facetId:le,captions:new K({options:{required:!1}}),numberOfValues:new J({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var hC={path:new ie({required:!0,each:G}),displayValue:we,rawValue:we,count:new J({required:!0,min:0})},yp=D("categoryFacet/selectSearchResult",e=>B(e,{facetId:le,value:new K({values:hC})})),RH=D("categoryFacetSearch/register",e=>B(e,Fn));d();c();l();u();var Sp={facetId:le,value:new K({values:{displayValue:we,rawValue:we,count:new J({required:!0,min:0})}})},NH=D("facetSearch/register",e=>B(e,Fn)),_H=D("facetSearch/update",e=>B(e,Fn)),vp=D("facetSearch/toggleSelectValue",e=>B(e,Sp)),Cp=D("facetSearch/toggleExcludeValue",e=>B(e,Sp));d();c();l();u();d();c();l();u();function Ap(e){let t=bp(e.start,e),r=bp(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function bp(e,t){let{dateFormat:r}=t;return Hl(e)?(us(e),Bl(e)):typeof e=="string"&&wt(e)?(us(e),e):(Vl(e,r),Bo(Or(e,r)))}d();c();l();u();d();c();l();u();var ez=new H({regex:/^[a-zA-Z0-9-_]+$/}),tz=new H({required:!0}),rz=new ie({each:new H}),nz=new H,oz=new te,iz=new te,az=new J({min:0}),yC=new J({min:1}),sz=new te({required:!0}),SC=new K,vC=new H,CC={captions:SC,numberOfValues:yC,query:vC},cz=new K({values:CC}),wp=new K({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),uz=new te,xp=new ie({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var bC={facetId:le,field:new H({required:!0,emptyAllowed:!0}),tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),resultsMustMatch:new fe({required:!1}),allowedValues:wp,customSort:xp},bz=D("facet/register",e=>B(e,bC)),Rp=D("facet/toggleSelectValue",e=>B(e,{facetId:le,selection:new K({values:Tn})})),Ep=D("facet/toggleExcludeValue",e=>B(e,{facetId:le,selection:new K({values:Tn})})),fi=D("facet/deselectAll",e=>B(e,le)),Az=D("facet/updateSortCriterion",e=>B(e,{facetId:le,criterion:new fe({required:!0})})),wz=D("facet/updateNumberOfValues",e=>B(e,{facetId:le,numberOfValues:new J({required:!0,min:1})})),xz=D("facet/updateIsFieldExpanded",e=>B(e,{facetId:le,isFieldExpanded:new te({required:!0})})),Rz=D("facet/updateFreezeCurrentValues",e=>B(e,{facetId:le,freezeCurrentValues:new te({required:!0})}));d();c();l();u();var Ip=D("rangeFacet/updateSortCriterion",e=>B(e,{facetId:le,criterion:new fe({required:!0})}));d();c();l();u();var mi={state:G,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new te({required:!0}),numberOfResults:new J({required:!0,min:0})},gi={start:G,end:G,endInclusive:new te({required:!0}),state:G,numberOfResults:new J({required:!0,min:0})};var AC={start:G,end:G,endInclusive:new te({required:!0}),state:G},wC={facetId:le,field:G,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:AC})}),generateAutomaticRanges:new te({required:!0}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Pp(e){return wt(e)?wn(e):e}function Tp(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Ap(t);if(Or(Pp(r)).isAfter(Or(Pp(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var oW=D("dateFacet/register",e=>{try{return Le(e,wC),Tp(e),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}}),Fp=D("dateFacet/toggleSelectValue",e=>B(e,{facetId:le,selection:new K({values:gi})})),kp=D("dateFacet/toggleExcludeValue",e=>B(e,{facetId:le,selection:new K({values:gi})})),Op=D("dateFacet/updateFacetValues",e=>{try{return Le(e,{facetId:le,values:new ie({each:new K({values:gi})})}),Tp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}});d();c();l();u();var xC={state:G,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new te({required:!0})},RC={facetId:le,field:G,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:xC})}),generateAutomaticRanges:new te({required:!0}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Dp(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var yW=D("numericFacet/register",e=>{try{return B(e,RC),Dp(e),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}}),Mp=D("numericFacet/toggleSelectValue",e=>B(e,{facetId:le,selection:new K({values:mi})})),qp=D("numericFacet/toggleExcludeValue",e=>B(e,{facetId:le,selection:new K({values:mi})})),Np=D("numericFacet/updateFacetValues",e=>{try{return Le(e,{facetId:le,values:new ie({each:new K({values:mi})})}),Dp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}});d();c();l();u();d();c();l();u();var hi=D("facet/updateFacetAutoSelection",e=>B(e,{allow:new te({required:!0})}));d();c();l();u();d();c();l();u();var yi=class extends bt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ve().q}get responseTime(){return this.activeInstantResultCache?.duration??We().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??We().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var _p=()=>qe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new yi(e)),Vp=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var Ls={id:G},EC={...Ls,q:we},e2=D("instantResults/register",e=>B(e,Ls)),Si=D("instantResults/updateQuery",e=>B(e,EC)),t2=D("instantResults/clearExpired",e=>B(e,Ls));d();c();l();u();var vi=new J({required:!0,min:0}),Ci=D("pagination/registerNumberOfResults",e=>B(e,vi)),bi=D("pagination/updateNumberOfResults",e=>B(e,vi)),Ai=D("pagination/registerPage",e=>B(e,vi)),Ft=D("pagination/updatePage",e=>B(e,vi)),wi=D("pagination/nextPage"),xi=D("pagination/previousPage");d();c();l();u();var kt=D("query/updateQuery",e=>B(e,{q:new H,enableQuerySyntax:new te}));d();c();l();u();d();c();l();u();var Us=()=>qe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Ot=e=>qe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ve().q,aq:r.advancedSearchQueries?.aq||Pt().aq,cq:r.advancedSearchQueries?.cq||Pt().cq,dq:r.advancedSearchQueries?.dq||Pt().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var q2=D("didYouMean/enable"),N2=D("didYouMean/disable"),_2=D("didYouMean/automaticCorrections/disable"),V2=D("didYouMean/automaticCorrections/enable"),Ri=D("didYouMean/correction",e=>B(e,G)),j2=D("didYouMean/automaticCorrections/mode",e=>B(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Bs=()=>qe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var jp=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Lp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Up(){return[]}d();c();l();u();function kn(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Bp(){return{}}d();c();l();u();function Qp(){return{}}d();c();l();u();function $p(){return{}}function rt(e){return{context:e.context||ni(),dictionaryFieldContext:e.dictionaryFieldContext||ii(),facetSet:e.facetSet||Oo(),numericFacetSet:e.numericFacetSet||ko(),dateFacetSet:e.dateFacetSet||Fo(),categoryFacetSet:e.categoryFacetSet||To(),automaticFacetSet:e.automaticFacetSet??Po(),pagination:e.pagination||kn(),query:e.query||Ve(),tabSet:e.tabSet||$p(),advancedSearchQueries:e.advancedSearchQueries||Pt(),staticFilterSet:e.staticFilterSet||Qp(),querySet:e.querySet||Bp(),sortCriteria:e.sortCriteria||Do(),pipeline:e.pipeline||mr(),searchHub:e.searchHub||wr(),facetOptions:e.facetOptions||Lp(),facetOrder:e.facetOrder??Up(),debug:e.debug??uo()}}d();c();l();u();var nK=new K({values:{undoneQuery:we},options:{required:!0}}),Hp=()=>qe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var Ei=D("trigger/query/ignore",e=>B(e,new H({emptyAllowed:!0,required:!0}))),Ii=D("trigger/query/modification",e=>B(e,new K({values:{originalQuery:Ae,modification:Ae}})));d();c();l();u();var Dt=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=TC(e),n=Ho(e),o=IC(e),i=yield Tt(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return xt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Dt(_x67,_x68){return _ref30.apply(this,arguments)}}();function IC(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(PC).filter(r=>r.currentValues.length>0):void 0}function PC(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function TC(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=FC(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function FC(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Mt=class{constructor(t,r=n=>{this.dispatch(kt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x69,_x70){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=new Date().getTime(),i=Qo(yield _this10.extra.apiClient.search(r,n),t),a=new Date().getTime()-o,f=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(Ot(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,h=!X(m)&&!X(m.correctedQuery);if(!p&&!h)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Xe(rt(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return ke(i.response)?(_this13.dispatch(Ot(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Xe(rt(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Bs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Bs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction&&this.analyticsAction()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Ei("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return ke(a.response)?(_this14.dispatch(Ot(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Xe(rt(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Hp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ve().enableQuerySyntax},search:{...We(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Xe(rt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Dt(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Ri(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Ii({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Dt(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var g3=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;B(e,{q:new H,enableQuerySyntax:new te,clearFilters:new te}),e.clearFilters&&(r(Ur()),r(pi())),r(hi({allow:!0})),r(kt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Ft(1))}),h3=ue("search/executeSearch",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Pi(r,t,e)});return function(_x71,_x72){return _ref31.apply(this,arguments)}}()),y3=ue("search/fetchPage",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield $s(r,t,e)});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),S3=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Hs(t,r)});return function(_x75,_x76){return _ref33.apply(this,arguments)}}()),v3=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();return yield MC(t,e,r)});return function(_x77,_x78){return _ref34.apply(this,arguments)}}()),C3=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){return Qs(e,t)});return function(_x79,_x80){return _ref35.apply(this,arguments)}}()),kC=/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=yield Dt(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function kC(_x81,_x82){return _ref36.apply(this,arguments)}}(),OC=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t,r){let n=yield Tt(e);return xt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function OC(_x83,_x84,_x85){return _ref37.apply(this,arguments)}}(),DC=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=yield Dt(e,t);return r.request.numberOfResults=0,r});return function DC(_x86,_x87){return _ref38.apply(this,arguments)}}(),zp=e=>{e.configuration.analytics.enabled&&Ze.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Qs(_x88,_x89){return _Qs.apply(this,arguments)}function _Qs(){_Qs=_asyncToGenerator(function*(e,t){B(e,{id:G,q:G,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Mt({...t,analyticsAction:_p()},p=>{t.dispatch(Si({q:p,id:e.id}))}),a=yield OC(o,r,n),f=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),m=yield i.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,analyticsAction:m.analyticsAction,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return _Qs.apply(this,arguments)}function $s(_x90,_x91,_x92){return _$s.apply(this,arguments)}function _$s(){_$s=_asyncToGenerator(function*(e,t,r){zp(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Mt({...t,analyticsAction:r}),m=yield Dt(e,a),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _$s.apply(this,arguments)}function Hs(_x93,_x94){return _Hs.apply(this,arguments)}function _Hs(){_Hs=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Us().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Mt({...e,analyticsAction:Us()}),f=yield kC(t,i),m=yield a.fetchFromAPI(f,{origin:"mainSearch"});return yield a.process(m)});return _Hs.apply(this,arguments)}function MC(_x95,_x96,_x97){return _MC.apply(this,arguments)}function _MC(){_MC=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Mt({...e,analyticsAction:t}),m=yield DC(r,a),p=yield f.fetchFromAPI(m,{origin:"facetValues"});return yield f.process(p)});return _MC.apply(this,arguments)}function Pi(_x98,_x99,_x100){return _Pi.apply(this,arguments)}function _Pi(){_Pi=_asyncToGenerator(function*(e,t,r){zp(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=yield Dt(e,a),m=new Mt({...t,analyticsAction:r}),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _Pi.apply(this,arguments)}d();c();l();u();d();c();l();u();var qt=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r){let n=UC(e),o=qC(e),i=NC(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Tt(e,r):jr(e,t,r),f=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return xt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:f(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function qt(_x101,_x102,_x103){return _ref39.apply(this,arguments)}}();function qC(e){return fs(VC(e),e.facetOrder??[])}function NC(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(_C).filter(r=>r.currentValues.length>0):void 0}function _C(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function VC(e){return jC(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function jC(e){return[...LC(e.facetSet??{}),...Wp(e.numericFacetSet??{}),...Wp(e.dateFacetSet??{}),...Rt(e.categoryFacetSet??{})]}function LC(e){return Rt(e).map(t=>{let r=ms[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Wp(e){return Rt(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}function UC(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=$o(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Nt=class{constructor(t,r=n=>{this.dispatch(kt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x104,_x105){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=new Date().getTime(),i=Qo(yield _this17.extra.apiClient.search(r,n),t),a=new Date().getTime()-o,f=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(Ot(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,h=!X(m)&&!X(m.correctedQuery);if(!p&&!h)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Xe(rt(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return ke(i.response)?(_this20.dispatch(Ot(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Xe(rt(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Ei("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return ke(a.response)?(_this21.dispatch(Ot(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Xe(rt(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Xe(rt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=jp(),o=yield _this22.fetchFromAPI(yield qt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Ri(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ii({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield qt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var PY=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;B(e,{q:new H,enableQuerySyntax:new te,clearFilters:new te}),e.clearFilters&&(r(Ur()),r(pi())),r(hi({allow:!0})),r(kt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Ft(1))}),BC=D("search/updateSearchAction"),Gp=ue("search/executeSearch",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Pi(r,t,e.legacy);Kp(r);let n=e.next?Yp(e.next):void 0;t.dispatch(BC(e.next));let o=yield qt(r,t.extra.navigatorContext,n),i=new Nt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x106,_x107){return _ref40.apply(this,arguments)}}()),TY=ue("search/fetchPage",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();if(Kp(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return $s(r,t,e.legacy);let n=new Nt({...t,analyticsAction:e.next}),o=yield qt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x108,_x109){return _ref41.apply(this,arguments)}}()),FY=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Hs(t,r);let n=yl("browseResults",t.getState),o=new Nt({...t,analyticsAction:n}),i=yield QC(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x110,_x111){return _ref42.apply(this,arguments)}}()),kY=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Pi(r,t,e.legacy);let n=new Nt({...t,analyticsAction:{}}),o=yield HC(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x112,_x113){return _ref43.apply(this,arguments)}}()),OY=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Qs(e,t);B(e,{id:G,q:G,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=Yp(Vp()),a=yield $C(r,t.extra.navigatorContext,n,o,i),f=new Nt({...t,analyticsAction:i},h=>{t.dispatch(Si({q:h,id:e.id}))}),m=yield f.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield f.process(m);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x114,_x115){return _ref44.apply(this,arguments)}}()),QC=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t,r){let n=yield qt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function QC(_x116,_x117,_x118){return _ref45.apply(this,arguments)}}(),$C=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t,r,n,o){let i=jr(e,t,o);return xt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function $C(_x119,_x120,_x121,_x122,_x123){return _ref46.apply(this,arguments)}}(),HC=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t,r){let n=yield qt(e,t,r);return n.request.numberOfResults=0,n});return function HC(_x124,_x125,_x126){return _ref47.apply(this,arguments)}}(),Kp=e=>{e.configuration.analytics.enabled&&Ze.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Yp=e=>({actionCause:e.actionCause,type:e.actionCause});var Jp=ge(kn(),e=>{e.addCase(Ci,(t,r)=>{let n=zs(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=On(n,o)}).addCase(bi,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(Yo,t=>{t.firstResult=0}).addCase(Ai,(t,r)=>{let n=r.payload;t.firstResult=On(n,t.numberOfResults)}).addCase(Ft,(t,r)=>{let n=r.payload;t.firstResult=On(n,t.numberOfResults)}).addCase(xi,t=>{let r=zs(t),n=Math.max(r-1,1);t.firstResult=On(n,t.numberOfResults)}).addCase(wi,t=>{let r=zs(t),n=WC(t),o=Math.min(r+1,n);t.firstResult=On(o,t.numberOfResults)}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(vt,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Gp.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(fi,t=>{Ie(t)}).addCase(kp,t=>{Ie(t)}).addCase(Ep,t=>{Ie(t)}).addCase(qp,t=>{Ie(t)}).addCase(Cp,t=>{Ie(t)}).addCase(Rp,t=>{Ie(t)}).addCase(hp,t=>{Ie(t)}).addCase(gp,t=>{Ie(t)}).addCase(yp,t=>{Ie(t)}).addCase(Fp,t=>{Ie(t)}).addCase(Mp,t=>{Ie(t)}).addCase(Ur,t=>{Ie(t)}).addCase(Op,t=>{Ie(t)}).addCase(Np,t=>{Ie(t)}).addCase(vp,t=>{Ie(t)}).addCase(mp,t=>{Ie(t)})});function Ie(e){e.firstResult=kn().firstResult}function zs(e){let{firstResult:t,numberOfResults:r}=e;return GC(t,r)}function WC(e){let{totalCountFiltered:t,numberOfResults:r}=e;return KC(t,r)}function On(e,t){return(e-1)*t}function GC(e,t){return Math.round(e/t)+1}function KC(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Ws(e){return e.addReducers({pagination:Jp}),{nextPage:wi,previousPage:xi,registerNumberOfResults:Ci,registerPage:Ai,updateNumberOfResults:bi,updatePage:Ft}}d();c();l();u();function _t(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),f=t!==a;return t=a,f}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),f;return n()&&(t=JSON.stringify(this.state),f=e.subscribe(()=>{o(this.state)&&r.forEach(m=>m())})),r.set(a,i),()=>{r.delete(a),n()&&f&&f()}},get state(){return{}}}}d();c();l();u();var YC=new Fe({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new J({min:0})});function Xp(e,t={}){if(!JC(e))throw Ge;let r=_t(e),{dispatch:n}=e,o=()=>e.state,i=Cu(e,YC,t.options,"buildRecommendationList");return i.id!==""&&n(Er({id:i.id})),i.numberOfRecommendations&&n(Ws(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(At())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function JC(e){return e.addReducers({recommendation:Ir,configuration:ze}),!0}d();c();l();u();d();c();l();u();function Zp(e,t,r){if(!XC(e))throw Ge;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Xo(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function XC(e){return e.addReducers({configuration:ze}),!0}function ef(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(_o(t.options.result)))};return Zp(e,t,()=>{n()})}d();c();l();u();d();c();l();u();d();c();l();u();var ZC=["caseId","caseNumber"],eb={caseId:"caseContext",caseNumber:"caseContext"},Dn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${eb[t]} to set this value.}`)}};function Gs(e){return ZC.includes(e)}var tb=new Fe({values:new K({options:{required:!1}})});function tf(e,t={}){if(!ob(e))throw Ge;let r=_t(e),{dispatch:n}=e,o=()=>e.state,i=vu(e,tb,t.initialState,"buildContext");return i.values&&n(Kt(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(Kt(a))},...(o().configuration.analytics.analyticsMode==="legacy"?rb(n):nb(n))}}var rb=e=>({add(t,r){e(Yt({contextKey:t,contextValue:r}))},remove(t){e(Jt(t))}}),nb=e=>({add(t,r){if(Gs(t))throw new Dn(t);e(Yt({contextKey:t,contextValue:r}))},remove(t){if(Gs(t))throw new Dn(t);e(Jt(t))}});function ob(e){return e.addReducers({context:oi}),!0}function rf(e,t){return tf(e,t)}d();c();l();u();function nf(e){if(!ib(e))throw Ge;let t=_t(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Nr(o))},add(o,i){r(_r({field:o,key:i}))},remove(o){r(Vr(o))}}}function ib(e){return e.addReducers({dictionaryFieldContext:ai}),!0}d();c();l();u();d();c();l();u();var ab=new Fe({content:new fe({required:!0}),conditions:new fe({required:!0}),priority:new J({required:!1,default:0,min:0}),fields:new ie({required:!1,each:G})});function of(){let e=[],t=r=>{let n=ab.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new Kr("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function af(e){if(!sb(e))throw Ge;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=of();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Lr(i))},selectTemplate:r,selectLinkTemplate:n}}function sb(e){return e.addReducers({fields:di}),!0}/**
|
|
30
|
+
`;function Yh(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Jh=["1",1,"yes",!0];function Ao(){let e=[];return Ca()&&e.push(window.doNotTrack),Da()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Jh.indexOf(t)!==-1)}var Ju="v15",Xu={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function Xh(e=Xu.default,t=Ju,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Zh="38824e1f-37f5-42d3-8372-a4b8fa9df946",et=class{get defaultOptions(){return{endpoint:Xu.default,isCustomEndpoint:!1,token:"",version:Ju,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Wu}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Ug,Ng].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Ao()?this.runtime=new bo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return Ca()&&vr()?new ka(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Yh()&&console.warn(Kh),new Oa(t))}get storage(){return this.runtime.storage}determineVisitorId(){return M(this,void 0,void 0,function*(){try{return Ca()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Wt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Wt()}})}getCurrentVisitorId(){return M(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return M(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return M(this,void 0,void 0,function*(){if(yo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Mu(t,Mu(r,Zh)))}})}getParameters(t,...r){return M(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return M(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Wt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Ao())return null;try{let r=new URL(t).searchParams.get(Ct.cvo_cid);if(r==null)return null;let n=Ct.fromString(r);return!n||!vr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return M(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>M(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>M(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((v,R)=>M(this,void 0,void 0,function*(){let P=yield v;return yield R(t,P)}),g)].reduce((g,v)=>M(this,void 0,void 0,function*(){let R=yield g;return yield v(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return M(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[y=>this.setTrackingIdIfTrackingIdNotPresent(y),y=>this.removeEmptyPayloadValues(y,t),y=>this.validateParams(y,t),y=>n?jh(y):y,y=>n?this.removeUnknownParameters(y):y,y=>n?this.processCustomParameters(y):this.mapCustomParametersToCustomData(y)].reduce((y,S)=>M(this,void 0,void 0,function*(){let g=yield y;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return M(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>M(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(f=>f(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return M(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return M(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new ho().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=ct(t,["searchQueryUid"]);return M(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=ct(t,["searchQueryUid"]);return M(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=ct(t,["lastSearchQueryUid"]);return M(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return M(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return M(this,void 0,void 0,function*(){let r=yield(yield b(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return M(this,void 0,void 0,function*(){return yield(yield b(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Qh(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=ct(t,["custom"]),o={};r&&go(r)&&(o=this.lowercaseKeys(r));let i=$h(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=ct(t,["custom"]);if(r&&go(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=ct(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=ct(t,["userId"]);return Gh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=ct(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&go(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&go(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?rh(t,r):t}get baseUrl(){return Xh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},ut;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(ut||(ut={}));var q;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(q||(q={}));var Uu={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[q.queryError]:"errors",[q.queryErrorBack]:"errors",[q.queryErrorClear]:"errors",[q.queryErrorRetry]:"errors",[q.pagerNext]:"getMoreResults",[q.pagerPrevious]:"getMoreResults",[q.pagerNumber]:"getMoreResults",[q.pagerResize]:"getMoreResults",[q.pagerScrolling]:"getMoreResults",[q.facetSearch]:"facet",[q.facetShowLess]:"facet",[q.facetShowMore]:"facet",[q.recommendation]:"recommendation",[q.likeSmartSnippet]:"smartSnippet",[q.dislikeSmartSnippet]:"smartSnippet",[q.expandSmartSnippet]:"smartSnippet",[q.collapseSmartSnippet]:"smartSnippet",[q.openSmartSnippetFeedbackModal]:"smartSnippet",[q.closeSmartSnippetFeedbackModal]:"smartSnippet",[q.sendSmartSnippetReason]:"smartSnippet",[q.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.clearRecentQueries]:"recentQueries",[q.recentResultClick]:"recentlyClickedDocuments",[q.clearRecentResults]:"recentlyClickedDocuments",[q.showLessFoldedResults]:"folding",[q.caseDetach]:"case",[q.likeGeneratedAnswer]:"generatedAnswer",[q.dislikeGeneratedAnswer]:"generatedAnswer",[q.openGeneratedAnswerSource]:"generatedAnswer",[q.generatedAnswerStreamEnd]:"generatedAnswer",[q.generatedAnswerSourceHover]:"generatedAnswer",[q.generatedAnswerCopyToClipboard]:"generatedAnswer",[q.generatedAnswerHideAnswers]:"generatedAnswer",[q.generatedAnswerShowAnswers]:"generatedAnswer",[q.generatedAnswerExpand]:"generatedAnswer",[q.generatedAnswerCollapse]:"generatedAnswer",[q.generatedAnswerFeedbackSubmit]:"generatedAnswer",[q.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[ut.expandToFullUI]:"interface",[ut.openUserActions]:"User Actions",[ut.showPrecedingSessions]:"User Actions",[ut.showFollowingSessions]:"User Actions",[ut.clickViewedDocument]:"User Actions",[ut.clickPageView]:"User Actions",[ut.createArticle]:"createArticle"},Ar=class{constructor(){this.runtime=new bo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Wu}};function ey(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function ty(e){return e.map(t=>t.replace(/;/g,""))}function Zu(e){let r=e.join(";");return r.length<=256?r:Zu(e.slice(1))}var Bu=e=>{let t=ty(e),r=ey(t);return Zu(r)};function Qu(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Bu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Bu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var wo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Ao();this.coveoAnalyticsClient=n?new Ar:new et(t)}disable(){this.coveoAnalyticsClient=new Ar}enable(){this.coveoAnalyticsClient=new et(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(q.interfaceLoad)}logInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(q.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(q.recommendation)}logRecommendation(){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(q.recommendationOpen,t,r)}logRecommendationOpen(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(q.staticFilterClearAll,t)}logStaticFilterClearAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(q.staticFilterSelect,t)}logStaticFilterSelect(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(q.staticFilterDeselect,t)}logStaticFilterDeselect(t){return M(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(q.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return M(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(q.interfaceChange,t)}logInterfaceChange(t){return M(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(q.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return M(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(q.didyoumeanClick)}logDidYouMeanClick(){return M(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(q.resultsSort,t)}logResultsSort(t){return M(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(q.searchboxSubmit)}logSearchboxSubmit(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(q.searchboxClear)}logSearchboxClear(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(q.searchboxAsYouType)}logSearchboxAsYouType(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(q.breadcrumbFacet,t)}logBreadcrumbFacet(t){return M(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(q.breadcrumbResetAll)}logBreadcrumbResetAll(){return M(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(q.documentQuickview,t,r)}logDocumentQuickview(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(q.documentOpen,t,r)}logDocumentOpen(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(q.omniboxAnalytics,Qu(t))}logOmniboxAnalytics(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(q.omniboxFromLink,Qu(t))}logOmniboxFromLink(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(q.searchFromLink)}logSearchFromLink(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(q.triggerNotify,t)}logTriggerNotify(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(q.triggerExecute,t)}logTriggerExecute(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(q.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(q.undoTriggerQuery,t)}logUndoTriggerQuery(t){return M(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(q.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return M(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(q.pagerResize,t)}logPagerResize(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(q.pagerNumber,t)}logPagerNumber(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(q.pagerNext,t)}logPagerNext(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(q.pagerPrevious,t)}logPagerPrevious(t){return M(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(q.pagerScrolling)}logPagerScrolling(){return M(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(q.facetClearAll,t)}logFacetClearAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(q.facetSearch,t)}logFacetSearch(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(q.facetSelect,t)}logFacetSelect(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(q.facetDeselect,t)}logFacetDeselect(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(q.facetExclude,t)}logFacetExclude(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(q.facetUnexclude,t)}logFacetUnexclude(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(q.facetSelectAll,t)}logFacetSelectAll(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(q.facetUpdateSort,t)}logFacetUpdateSort(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(q.facetShowMore,t)}logFacetShowMore(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(q.facetShowLess,t)}logFacetShowLess(t){return M(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(q.queryError,t)}logQueryError(t){return M(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorBack);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorBack)})}})}logQueryErrorBack(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorRetry);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorRetry)})}})}logQueryErrorRetry(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorClear);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorClear)})}})}logQueryErrorClear(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(q.likeSmartSnippet)}logLikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(q.dislikeSmartSnippet)}logDislikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(q.expandSmartSnippet)}logExpandSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(q.collapseSmartSnippet)}logCollapseSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return M(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(q.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(q.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(q.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return M(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(q.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(q.copyToClipboard,t,r)}logCopyToClipboard(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(q.recentQueryClick)}logRecentQueryClick(){return M(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(q.clearRecentQueries)}logClearRecentQueries(){return M(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(q.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(q.clearRecentResults)}logClearRecentResults(){return M(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(q.noResultsBack)}logNoResultsBack(){return M(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(q.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(q.showLessFoldedResults)}logShowLessFoldedResults(){return M(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r,n=Uu[t]){return M(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:n,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEvent(t,r,n=Uu[t]){return M(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return M(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({searchQueryUid:f})}})}logClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,o;return M(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return M(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof et?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(q.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(q.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(q.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return M(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(q.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(q.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(q.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(q.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(q.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(q.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(q.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(q.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return M(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(q.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return M(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(q.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},xo=Object.assign({},pn),$u=Object.keys(xo).map(e=>xo[e]),Cr=class extends wa{constructor({client:t,uuidGenerator:r=Wt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>$u.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>($u.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(xo.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(xo.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return sh(this.ticket)}};Cr.Id="svc";var Ro;(function(e){e.click="click",e.flowStart="flowStart"})(Ro||(Ro={}));var Ue;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(Ue||(Ue={}));var Eo;(function(e){e.quit="Quit",e.solved="Solved"})(Eo||(Eo={}));var Io=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Ao();this.coveoAnalyticsClient=o?new et(t):new Ar,this.svc=new Cr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ar,this.svc=new Cr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new et(this.options),this.svc=new Cr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Ue.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Ue.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Ue.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Ue.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Ue.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Ue.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Ue.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Ue.caseCancelled,{reason:Eo.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Ue.caseSolved,{reason:Eo.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Ue.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ro.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ro.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return M(this,void 0,void 0,function*(){let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof et?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){var i,a;return M(this,void 0,void 0,function*(){let f=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(f)})}};var el=e=>new et(e).getCurrentVisitorId(),gn=(e,t)=>typeof t=="function"?(...r)=>{let n=Yr(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,hn=(e,t)=>(...r)=>{let n=Yr(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Po(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function tl(e){let{activeValue:t,ancestryMap:r}=ry(e);return t?ny(t,r):[]}function ry(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function ny(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var oy=(e,t)=>e.categoryFacetSet[t]?.request;var Na=(e,t)=>{let r=oy(e,t);return tl(r?.currentValues??[])};d();c();l();u();function To(){return{}}d();c();l();u();function Fo(){return{}}d();c();l();u();function ko(){return{}}d();c();l();u();function Oo(){return{}}function _a(e){return{facetSet:e.facetSet??Oo(),categoryFacetSet:e.categoryFacetSet??To(),dateFacetSet:e.dateFacetSet??Fo(),numericFacetSet:e.numericFacetSet??ko(),automaticFacetSet:e.automaticFacetSet??Po()}}var Va=e=>{let t=[];return sy(e).forEach((r,n)=>{let o=gy(e,r.facetId),i=fy(r,n+1);if(ay(r)){if(!!!Na(e,r.facetId).length)return;t.push({...i,...dy(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,f)=>{if(a.state==="idle")return;let m=rl(a,f+1,o),p=iy(r)?nl(a):uy(a);t.push({...i,...m,...p})})}),cy(e).forEach((r,n)=>{let o=py(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let f=rl(i,a+1,"specific"),m=nl(i);t.push({...o,...f,...m})})}),t},iy=e=>e.type==="specific",ay=e=>e.type==="hierarchical",sy=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),cy=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),rl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),uy=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),nl=e=>({displayValue:e.value,value:e.value}),ly=(e,t)=>Na(e,t).map(n=>n.value).join(";"),dy=(e,t)=>{let n=ly(e,t);return{value:n,valuePosition:1,displayValue:n}},py=(e,t)=>({title:ol(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),fy=(e,t)=>({title:ol(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),ol=(e,t)=>`${e}_${t}`,my=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,gy=(e,t)=>{let r=my(e,t);return r?r.type:"specific"};d();c();l();u();var Ve=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var il=(r=>(r.Ascending="ascending",r.Descending="descending",r))(il||{}),al=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(al||{}),ja=e=>{if(yc(e))return e.map(t=>ja(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},sl=()=>({by:"relevancy"});var ET=new K({values:{by:new ji({enum:al,required:!0}),order:new ji({enum:il}),field:new H}});function Do(){return ja(sl())}d();c();l();u();d();c();l();u();var wr=()=>"default";var hy=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},lt=class{constructor(t){this.getState=t;de(this,"state");this.state=t()}getLanguage(){return hy(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let f=`context_${i}`;o[f]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=ur),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||wr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var yn=class yn extends lt{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Va(_a(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||yn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||We().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||yn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=r.search?.response?.extendedResults?.generativeQuestionAnsweringId;return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Do()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest&&this.state.querySuggest[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,f=o.partialQueries[a]||"",m=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:f,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:m}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||Ve().q}get responseTime(){return this.state.search?.duration||We().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||We().response.totalCountFiltered}};de(yn,"fallbackPipelineName","default");var bt=yn,cl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new bt(t)})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??Pe(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,h=new wo({token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:gn(e,n),beforeSendHooks:[hn(e,r),(y,S)=>(e.info({...S,type:y,endpoint:f,token:a},"Analytics request"),S)]},o);return p||h.disable(),h},La=()=>{let t=Ze.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Mo=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield el(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(La()&&{pageId:La()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Sr(e)})}}});return function Mo(_x9,_x0){return _ref7.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var xr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Sn=class extends lt{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ve().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||xr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||xr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||xr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ul=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function yy(e){return typeof e=="string"&&ul.test(e)}var Ua=yy;d();c();l();u();var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function ll(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}d();c();l();u();var Ba,Sy=new Uint8Array(16);function Qa(){if(!Ba){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ba=crypto.getRandomValues.bind(crypto)}return Ba(Sy)}d();c();l();u();d();c();l();u();var vy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$a={randomUUID:vy};function Cy(e,t,r){if($a.randomUUID&&!t&&!e)return $a.randomUUID();e=e||{};let n=e.random??e.rng?.()??Qa();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return ll(n)}var Ha=Cy;d();c();l();u();function dl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function by({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var pl="visitorId";function Ay(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(pl),o=n&&Ua(n)?n:t.generateUUID();return r.setItem(pl,o),o}}}var ml="1.2.1";function wy(e){let{trackingId:t}=e;return{trackingId:t}}function xy(e){return(e.source||[]).concat([`relay@${ml}`])}function gl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,f=wy(t),m=n.getClientId();return Object.freeze({type:e,config:f,ts:Date.now(),source:xy(t),clientId:m,userAgent:a(),referrer:o(),location:i()})}function Ry(e,t,r,n,o){return{...t,meta:gl(e,r,n,o)}}var Ey="*";function Iy(){let e=[];function t({type:m,callback:p}){return e.findIndex(h=>h.type===m&&h.callback===p)}function r(m,p){return m.type==="*"||p===m.type}function n(m){return t(m)<0&&e.push(m),()=>f(m.type,m.callback)}function o(m){e.forEach(p=>{if(r(p,m.meta.type))try{p.callback(m)}catch(h){console.error(h)}})}function i(m){if(m===Ey)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===m&&e.splice(p,1)}function a(m){let p=t(m);p>=0&&e.splice(p,1)}function f(m,p){p?a({type:m,callback:p}):i(m)}return{add:n,call:o,remove:f}}function fl({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function Py(e){let t=fl(e);return{get:()=>t,update:r=>{t=fl({...t,...r})}}}var za=Ty();function Ty(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,f=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${f};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Fy(){return{getItem(e){return za.getItem(e)||localStorage.getItem(e)},removeItem(e){za.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),za.setItem(e,t,31556952e3)}}}function ky(){let e=document.referrer;return e===""?null:e}function Oy(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(dl().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:()=>ky(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Ha(),storage:Fy()}}function Dy(){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 My(){return{getItem(){return null},removeItem(){},setItem(){}}}function qy(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:My()}}function Ny(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=qy();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&_y()&&Dy()?Oy():n}function _y(){try{return typeof window=="object"}catch{return!1}}function Vy(e){return{get:()=>Object.freeze(Ny(e))}}function hl(e){let t=Py(e),r=Iy(),n=Vy(t),o=Ay(n);return{emit:(i,a)=>{let f=t.get(),m=n.get(),p=Ry(i,a,f,m,o);return by({config:f,environment:m,event:p,listenerManager:r})},getMeta:i=>gl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:ml}}var Rr=pe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Sr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a)=>hl({mode:i?"emit":"disabled",url:o??Un(e,t),token:r,trackingId:n??null,source:a}));d();c();l();u();var vn=class extends lt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},yl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new vn(t)})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??Pe(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,h=new Io({enableAnalytics:p,token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:gn(e,n),beforeSendHooks:[hn(e,r),(y,S)=>(e.info({...S,type:y,endpoint:f,token:a},"Analytics request"),S)]},o);return p||h.disable(),h};d();c();l();u();d();c();l();u();function Sl(e,t){return{...new bt(t).getBaseMetadata(),actionCause:e,type:e}}function jy(e){return Object.assign(e,{instantlyCallable:!0})}function Ly(e,t){let r=i=>jy(ue(e,i)),n=r(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(i,{getState:a,extra:f}){let{analyticsClientMiddleware:m,preprocessRequest:p,logger:h}=f;return yield(yield t({getState:a,analyticsClientMiddleware:m,preprocessRequest:p,logger:h})).log({state:a(),extra:f})});return function(_x1,_x10){return _ref8.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref9=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m}){let{description:p,log:h}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m});return{description:p,action:r(/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(y,{getState:S,extra:g}){return yield h({state:S(),extra:g})});return function(_x12,_x13){return _ref0.apply(this,arguments)}}())}});return function prepare(_x11){return _ref9.apply(this,arguments)}}()}),n}var vl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return Qy(i)}return n},Uy=e=>e.configuration.analytics.analyticsMode==="legacy",By=e=>e.configuration.analytics.analyticsMode==="next",Qy=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=f=>new a(f)),Ly(e,/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*({getState:f,analyticsClientMiddleware:m,preprocessRequest:p,logger:h}){let y=[],S={log:function(){var _ref10=_asyncToGenerator(function*({state:x}){for(let T of y)yield T(x)});return function log(_x15){return _ref10.apply(this,arguments)}}()},g=f(),v=i({getState:f,logger:h,analyticsClientMiddleware:m,preprocessRequest:p,provider:r(f)}),R=yield t(v,f());S.description=R?.description,y.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(x){Uy(x)&&(yield $y(R,r,x,h,v.coveoAnalyticsClient))});return function(_x16){return _ref11.apply(this,arguments)}}());let{emit:P}=Rr(g);return y.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){if(By(x)&&o&&n){let T=n(x);yield Jy(P,o,T)}});return function(_x17){return _ref12.apply(this,arguments)}}()),S});return function(_x14){return _ref1.apply(this,arguments)}}()));function $y(_x18,_x19,_x20,_x21,_x22){return _$y.apply(this,arguments)}function _$y(){_$y=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _$y.apply(this,arguments)}var Hy=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref13=_asyncToGenerator(function*(i){r(n,o)});return function log(_x23){return _ref13.apply(this,arguments)}}()}),qe=vl(cl,e=>e,bt),LO=vl(yl,Hy("caseAssist"),vn);var Wa=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return zy(e,r,t)};function zy(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:Ky(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:Yy(e),queryPipeline:r.pipeline||mr()}}var qo=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),Cl={urihash:new H,sourcetype:new H,permanentid:new H},bl={uniqueId:G,raw:new K({values:Cl}),title:G,uri:G,clickUri:G,rankingModifier:new H({required:!1,emptyAllowed:!0})};function Wy(e){return Object.assign({},...Object.keys(Cl).map(t=>({[t]:e[t]})))}function Gy(e){return Object.assign({},...Object.keys(bl).map(t=>({[t]:e[t]})),{raw:Wy(e.raw)})}function Ky(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function Yy(e){let t=e.raw.source;return X(t)?"unknown":t}var Ga=e=>new Fe(bl).validate(Gy(e));function Jy(_x24,_x25,_x26){return _Jy.apply(this,arguments)}function _Jy(){_Jy=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _Jy.apply(this,arguments)}d();c();l();u();var Al=()=>qe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Sn(e)),wl=()=>({actionCause:"recommendationInterfaceLoad"}),_o=e=>qe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ga(e),t.makeRecommendationOpen(Wa(e,r),qo(e))),__legacy__provider:t=>new Sn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Wa(e,t),n=qo(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var Er=D("recommendation/set",e=>B(e,{id:G})),At=ue("recommendation/get",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=new Date().getTime(),a=yield Xy(o),f=yield n.recommendations(a),m=new Date().getTime()-i;return ke(f)?r(f.error):{recommendations:f.success.results,analyticsAction:Al(),duration:m,searchUid:f.success.searchUid,splitTestRun:f.success.splitTestRun,pipeline:f.success.pipeline}});return function(_x27,_x28){return _ref14.apply(this,arguments)}}()),Xy=/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ht(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Ze.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield Zy(e,wl()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function Xy(_x29){return _ref15.apply(this,arguments)}}(),Zy=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Mo(e.configuration.analytics,r)});return function Zy(_x30,_x31){return _ref16.apply(this,arguments)}}();var Ir=ge(xr(),e=>{e.addCase(Er,(t,r)=>{t.id=r.payload.id}).addCase(At.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(At.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(At.pending,t=>{t.isLoading=!0})});d();c();l();u();var Pr=D("searchHub/set",e=>B(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();var Tr=ge(wr(),e=>{e.addCase(Pr,(t,r)=>r.payload).addCase(Me.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Je,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();var Ka=e=>({referrer:document.referrer,userAgent:navigator.userAgent,location:window.location.href,clientId:e}),Cn=()=>({referrer:null,userAgent:null,location:null,clientId:""});d();c();l();u();var Ya=pe(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Vo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:Sr(e)}});d();c();l();u();var xl=pe(e=>e.context,e=>e);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var bn=pe(e=>e.query,e=>e);var Rl=e=>tS(e)?{answerAPIEnabled:!0,id:Il(e).data?.answerId}:eS(e)?{answerAPIEnabled:!1,id:e.search.response.extendedResults.generativeQuestionAnsweringId}:{answerAPIEnabled:!1,id:void 0},eS=e=>"search"in e,tS=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),El=e=>e.generatedAnswer?.fieldsToIncludeInCitations,rS=pe(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t)),E0=pe(e=>bn(e)?.q,e=>e.search.requestId,(e,t)=>({q:e,requestId:t}));var jo=e=>qe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let{id:n,answerAPIEnabled:o}=Rl(r),i=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({...(o?{answerAPIStreamId:n}:{generativeQuestionAnsweringId:n}),answerGenerated:e,answerTextIsEmpty:i}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:t.search?.response.searchUid||"",answerGenerated:e??!1})});d();c();l();u();var Pl=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Pe(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Pl(_x32){return _ref17.apply(this,arguments)}}();d();c();l();u();var Tl=["text/plain","text/markdown"];var Fr=new H({required:!0}),kl=new H,kr=new te({required:!0}),nS={id:Fr,title:Fr,uri:Fr,permanentid:Fr,clickUri:kl},Ol=new H({required:!0,constrainTo:Tl}),uM=D("generatedAnswer/setIsVisible",e=>B(e,kr)),lM=D("generatedAnswer/setIsEnabled",e=>B(e,kr)),Xa=D("generatedAnswer/updateMessage",e=>B(e,{textDelta:Fr})),Za=D("generatedAnswer/updateCitations",e=>B(e,{citations:new ie({required:!0,each:new K({values:nS})})})),oS=D("generatedAnswer/updateError",e=>B(e,{message:kl,code:new J({min:0})})),iS=D("generatedAnswer/resetAnswer"),dM=D("generatedAnswer/like"),pM=D("generatedAnswer/dislike"),fM=D("generatedAnswer/feedbackModal/open"),mM=D("generatedAnswer/expand"),gM=D("generatedAnswer/collapse"),hM=D("generatedAnswer/setId",e=>B(e,{id:new H({required:!0})})),yM=D("generatedAnswer/feedbackModal/close"),SM=D("generatedAnswer/sendFeedback"),Ja=D("generatedAnswer/setIsLoading",e=>B(e,kr)),Fl=D("generatedAnswer/setIsStreaming",e=>B(e,kr)),es=D("generatedAnswer/setAnswerContentFormat",e=>B(e,Ol)),vM=D("generatedAnswer/updateResponseFormat",e=>B(e,{contentFormat:new ie({each:Ol,default:["text/plain"]})})),CM=D("knowledge/updateAnswerConfigurationId",e=>B(e,Fr)),bM=D("generatedAnswer/registerFieldsToIncludeInCitations",e=>B(e,oo)),aS=D("generatedAnswer/setIsAnswerGenerated",e=>B(e,kr)),ts=D("generatedAnswer/setCannotAnswer",e=>B(e,kr)),AM=ue("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:f}=a,{setAbortControllerRef:m}=e,p=yield Pl(r),h=(g,v)=>{switch(g){case"genqa.headerMessageType":{let R=JSON.parse(v);n(es(R.contentFormat));break}case"genqa.messageType":n(Xa(JSON.parse(v)));break;case"genqa.citationsType":n(Za(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,P=f.length!==0&&!R;n(ts(P)),n(Fl(!1)),n(aS(R)),n(jo(R));break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Ja(!0));let y=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:g=>{y(p)&&(n(Ja(!1)),g.payload&&g.payloadType&&h(g.payloadType,g.payload))},abort:g=>{y(p)&&n(oS(g))},close:()=>{y(p)&&n(Fl(!1))},resetAnswer:()=>{y(p)&&n(iS())}});S?m(S):n(Ja(!1))});return function(_x33,_x34){return _ref18.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Dl=pe(e=>e.pipeline,e=>e);d();c();l();u();var Ml=pe(e=>e.searchHub,e=>e);d();c();l();u();d();c();l();u();var An=Qe(Lo(),1),Ll=Qe(ql(),1);d();c();l();u();var Uo=Qe(Lo(),1),_l=Qe(Nl(),1);Uo.default.extend(_l.default);var Vl="YYYY/MM/DD@HH:mm:ss",sS="1401-01-01";function Or(e,t){let r=(0,Uo.default)(e,t);return!r.isValid()&&!t?(0,Uo.default)(e,Vl):r}function Bo(e){return e.format(Vl)}function jl(e,t){let r=Or(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}cs(r)}function cs(e){if(e.isBefore(sS))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}An.default.extend(Ll.default);var Ul=["past","now","next"],Bl=["minute","hour","day","week","month","quarter","year"],cS=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new H({required:!t,constrainTo:Bl}),period:new H({required:!0,constrainTo:Ul})}};function us(e){if(typeof e=="string"&&!wt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Wl(e):e;new Fe(cS(t.period)).validate(t);let r=$l(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);cs(r)}function Ql(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function $l(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,An.default)().subtract(r,n);case"next":return(0,An.default)().add(r,n);case"now":return(0,An.default)()}}function wn(e){return Bo($l(Wl(e)))}function Hl(e){return e.toLocaleLowerCase().split("-")}function wt(e){let[t,r,n]=Hl(e);if(t==="now")return!0;if(!Ul.includes(t)||!Bl.includes(n))return!1;let o=parseInt(r);return!(isNaN(o)||o<=0)}function zl(e){return!!e&&typeof e=="object"&&"period"in e}function Wl(e){let[t,r,n]=Hl(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function Gl(e){return e.type==="dateRange"}function Kl(e){return`start${e}`}function Yl(e){return`end${e}`}var ls=()=>({dateFacetValueMap:{}});function uS(e,t,r){let n=e.start,o=e.end;return wt(n)&&(n=wn(n),r.dateFacetValueMap[t][Kl(n)]=e.start),wt(o)&&(o=wn(o),r.dateFacetValueMap[t][Yl(o)]=e.end),{...e,start:n,end:o}}function ds(e,t){if(Gl(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>uS(o,r,t))}}return e}function xt(e){let t=ls();return{request:{...e,facets:e.facets?.map(n=>ds(n,t))},mappings:t}}function lS(e,t,r){return{...e,start:r.dateFacetValueMap[t][Kl(e.start)]||e.start,end:r.dateFacetValueMap[t][Yl(e.end)]||e.end}}function dS(e,t){return e.facetId in t.dateFacetValueMap}function pS(e,t){return dS(e,t)?{...e,values:e.values.map(r=>lS(r,e.facetId,t))}:e}function Qo(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>pS(n,t))}}:e}d();c();l();u();d();c();l();u();var xn=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},fS=e=>t=>e.every(r=>!X(xn(t,r))),mS=e=>t=>e.every(r=>X(xn(t,r))),gS=(e,t)=>r=>{let n=Jl(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},hS=(e,t)=>r=>{let n=Jl(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Jl=(e,t)=>{let r=xn(t,e);return Sc(r)?r:[r]},Xl={getResultProperty:xn,fieldsMustBeDefined:fS,fieldsMustNotBeDefined:mS,fieldMustMatch:gS,fieldMustNotMatch:hS};var Zl=pe(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var $o=pe(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));d();c();l();u();var ps=pe(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),ed=pe(e=>e,e=>{let t=ps(e);return t&&e?e[t].expression:""});d();c();l();u();d();c();l();u();function Rt(e){return Object.values(e).map(t=>t.request)}function fs(e,t){let r={};e.forEach(i=>r[i.facetId]=i);let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function td(e){return Rt(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ms={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function yS(e){return Rt(e).map(t=>{let r=ms[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function SS(e){return[...yS(e.facetSet??{}),...td(e.numericFacetSet??{}),...td(e.dateFacetSet??{}),...Rt(e.categoryFacetSet??{})]}function vS(e){return SS(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Ho(e){return fs(vS(e),e.facetOrder??[])}d();c();l();u();d();c();l();u();function nd(_x35,_x36){return _nd.apply(this,arguments)}function _nd(){_nd=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _nd.apply(this,arguments)}function od(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=bS(t,a);let f=t.length,m=0;for(;r<f;){o&&(t[r]===10&&(m=++r),o=!1);let p=-1;for(;r<f&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(m,p),n),m=r,n=-1}m===f?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function id(e,t,r){let n=rd(),o=new TextDecoder;return function(a,f){if(a.length===0)r?.(n),n=rd();else if(f>0){let m=o.decode(a.subarray(0,f)),p=f+(a[f+1]===32?2:1),h=o.decode(a.subarray(p));switch(m){case"data":n.data=n.data?n.data+`
|
|
31
|
+
`+h:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":CS(h,n,t);break}}}}function CS(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function bS(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function rd(){return{data:"",event:"",id:"",retry:void 0}}var gs="text/event-stream",AS=1e3,ad="last-event-id";function sd(){return typeof window<"u"}function cd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:f,fetch:m,...p}){return new Promise((h,y)=>{let S={...r};S.accept||(S.accept=gs);let g;function v(){g?.abort(),document.hidden||E()}!f&&sd()&&document.addEventListener("visibilitychange",v);let R=AS,P;function x(){sd()&&document.removeEventListener("visibilitychange",v),clearTimeout(P),g?.abort()}t?.addEventListener("abort",()=>{x(),h()});let T=m??b,w=n??wS;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let N=yield T(e,{...p,headers:S,signal:g?.signal});yield w(N),yield nd(N.body,od(id(k=>{k?S[ad]=k:delete S[ad]},k=>{R=k},o))),i?.(),x(),h()}catch(N){if(!g?.signal?.aborted)try{let k=a?.(N)??R;clearTimeout(P),P=setTimeout(E,k)}catch(k){x(),y(k)}}});return _E.apply(this,arguments)}E()})}function wS(e){let t=e.headers.get("content-type");if(!t?.startsWith(gs))throw new Error(`Expected content-type to be ${gs}, Actual: ${t}`)}d();c();l();u();d();c();l();u();function ud(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var ld=Ke;function Ad(e,t){if(e===t||!(ld(e)&&ld(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Ad(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Dr(e){let t=0;for(let r in e)t++;return t}var dd=e=>[].concat(...e);function xS(e){return new RegExp("(^|:)//").test(e)}function RS(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Go(e){return e!=null}function ES(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var IS=e=>e.replace(/\/$/,""),PS=e=>e.replace(/^\//,"");function TS(e,t){if(!e)return t;if(!t)return e;if(xS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=IS(e),t=PS(t),`${e}${r}${t}`}function FS(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var pd=(...e)=>b(...e),kS=e=>e.status>=200&&e.status<=299,OS=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function fd(e){if(!Ke(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function wd({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:r=pd,paramsSerializer:n,isJsonContentType:o=OS,jsonContentType:i="application/json",jsonReplacer:a,timeout:f,responseHandler:m,validateStatus:p,...h}={}){return typeof b>"u"&&r===pd&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(S,g,v){let{getState:R,extra:P,endpoint:x,forced:T,type:w}=g,E,{url:N,headers:k=new A(h.headers),params:I=void 0,responseHandler:F=m??"json",validateStatus:O=p??kS,timeout:_=f,...$}=typeof S=="string"?{url:S}:S,U,j=g.signal;_&&(U=new s.AbortController,g.signal.addEventListener("abort",U.abort),j=U.signal);let V={...h,signal:j,...$};k=new A(fd(k)),V.headers=(yield t(k,{getState:R,arg:S,extra:P,endpoint:x,forced:T,type:w,extraOptions:v}))||k;let Q=Z=>typeof Z=="object"&&(Ke(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!V.headers.has("content-type")&&Q(V.body)&&V.headers.set("content-type",i),Q(V.body)&&o(V.headers)&&(V.body=JSON.stringify(V.body,a)),I){let Z=~N.indexOf("?")?"&":"?",oe=n?n(I):new URLSearchParams(fd(I));N+=Z+oe}N=TS(e,N);let L=new Request(N,V);E={request:new Request(N,V)};let W,Y=!1,re=U&&setTimeout(()=>{Y=!0,U.abort()},_);try{W=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{re&&clearTimeout(re),U?.signal.removeEventListener("abort",U.abort)}let se=W.clone();E.response=se;let ee,ne="";try{let Z;if(yield Promise.all([y(W,F).then(oe=>ee=oe,oe=>Z=oe),se.text().then(oe=>ne=oe,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:W.status,data:ne,error:String(Z)},meta:E}}return O(W,ee)?{data:ee,meta:E}:{error:{status:W.status,data:ee},meta:E}});return function(_x37,_x38,_x39){return _ref19.apply(this,arguments)}}());function y(_x40,_x41){return _y2.apply(this,arguments)}function _y2(){_y2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _y2.apply(this,arguments)}}var Mr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function DS(){return _DS.apply(this,arguments)}function _DS(){_DS=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _DS.apply(this,arguments)}function MS(e,t){throw Object.assign(new Mr({error:e,meta:t}),{throwImmediately:!0})}var md={},qS=(e,t)=>(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(r,n,o){let i=[5,(t||md).maxRetries,(o||md).maxRetries].filter(h=>h!==void 0),[a]=i.slice(-1),m={maxRetries:a,backoff:DS,retryCondition:(h,y,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let h=yield e(r,n,o);if(h.error)throw new Mr(h);return h}catch(h){if(p++,h.throwImmediately){if(h instanceof Mr)return h.value;throw h}if(h instanceof Mr&&!m.retryCondition(h.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return h.value;yield m.backoff(p,m.maxRetries)}});return function(_x42,_x43,_x44){return _ref20.apply(this,arguments)}}()),xd=Object.assign(qS,{fail:MS}),Cs=D("__rtkq/focused"),Rd=D("__rtkq/unfocused"),bs=D("__rtkq/online"),Ed=D("__rtkq/offline");function As(e){return e.type==="query"}function NS(e){return e.type==="mutation"}function ws(e){return e.type==="infinitequery"}function xs(e,t,r,n,o,i){return _S(e)?e(t,r,n,o).filter(Go).map(ys).map(i):Array.isArray(e)?e.map(ys).map(i):[]}function _S(e){return typeof e=="function"}function ys(e){return typeof e=="string"?{type:e}:e}function VS(e,t){return e.catch(t)}var En=Symbol("forceQueryFn"),Ss=e=>typeof e[En]=="function";function jS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,f=new Map,{unsubscribeQueryResult:m,removeMutationResult:p,updateSubscriptionOptions:h}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:T,buildInitiateMutation:w,getRunningQueryThunk:y,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:v};function y(E,N){return k=>{let I=i.endpointDefinitions[E],F=e({queryArgs:N,endpointDefinition:I,endpointName:E});return a.get(k)?.[F]}}function S(E,N){return k=>f.get(k)?.[N]}function g(){return E=>Object.values(a.get(E)||{}).filter(Go)}function v(){return E=>Object.values(f.get(E)||{}).filter(Go)}function R(E){}function P(E,N){let k=(I,{subscribe:F=!0,forceRefetch:O,subscriptionOptions:_,[En]:$,...U}={})=>(j,V)=>{let Q=e({queryArgs:I,endpointDefinition:N,endpointName:E}),L,z={...U,type:"query",subscribe:F,forceRefetch:O,subscriptionOptions:_,endpointName:E,originalArgs:I,queryCacheKey:Q,[En]:$};if(As(N))L=t(z);else{let{direction:ce,initialPageParam:me}=U;L=r({...z,direction:ce,initialPageParam:me})}let W=o.endpoints[E].select(I),Y=j(L),re=W(V());let{requestId:se,abort:ee}=Y,ne=re.requestId!==se,Z=a.get(j)?.[Q],oe=()=>W(V()),he=Object.assign($?Y.then(oe):ne&&!Z?Promise.resolve(re):Promise.all([Z,Y]).then(oe),{arg:I,requestId:se,subscriptionOptions:_,queryCacheKey:Q,abort:ee,unwrap(){return _asyncToGenerator(function*(){let ce=yield he;if(ce.isError)throw ce.error;return ce.data})()},refetch:()=>j(k(I,{subscribe:!1,forceRefetch:!0})),unsubscribe(){F&&j(m({queryCacheKey:Q,requestId:se}))},updateSubscriptionOptions(ce){he.subscriptionOptions=ce,j(h({endpointName:E,requestId:se,queryCacheKey:Q,options:ce}))}});if(!Z&&!ne&&!$){let ce=FS(a,j,{});ce[Q]=he,he.then(()=>{delete ce[Q],Dr(ce)||a.delete(j)})}return he};return k}function x(E,N){return P(E,N)}function T(E,N){return P(E,N)}function w(E){return(N,{track:k=!0,fixedCacheKey:I}={})=>(F,O)=>{let _=n({type:"mutation",endpointName:E,originalArgs:N,track:k,fixedCacheKey:I}),$=F(_);let{requestId:U,abort:j,unwrap:V}=$,Q=VS($.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{F(p({requestId:U,fixedCacheKey:I}))},z=Object.assign(Q,{arg:$.arg,requestId:U,abort:j,unwrap:V,reset:L}),W=f.get(F)||{};return f.set(F,W),W[U]=z,z.then(()=>{delete W[U],Dr(W)||f.delete(F)}),I&&(W[I]=z,z.then(()=>{W[I]===z&&(delete W[I],Dr(W)||f.delete(F))})),z}}}function LS(e){return e}var zo=(e={})=>({...e,[un]:!0});function US({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let f=(F,O,_,$)=>(U,j)=>{let V=r[F],Q=n({queryArgs:O,endpointDefinition:V,endpointName:F});if(U(o.internalActions.queryResultPatched({queryCacheKey:Q,patches:_})),!$)return;let L=o.endpoints[F].select(O)(j()),z=xs(V.providesTags,L.data,void 0,O,{},i);U(o.internalActions.updateProvidedBy({queryCacheKey:Q,providedTags:z}))};function m(F,O,_=0){let $=[O,...F];return _&&$.length>_?$.slice(0,-1):$}function p(F,O,_=0){let $=[...F,O];return _&&$.length>_?$.slice(1):$}let h=(F,O,_,$=!0)=>(U,j)=>{let Q=o.endpoints[F].select(O)(j()),L={patches:[],inversePatches:[],undo:()=>U(o.util.patchQueryData(F,O,L.inversePatches,$))};if(Q.status==="uninitialized")return L;let z;if("data"in Q)if(De(Q.data)){let[W,Y,re]=Jn(Q.data,_);L.patches.push(...Y),L.inversePatches.push(...re),z=W}else z=_(Q.data),L.patches.push({op:"replace",path:[],value:z}),L.inversePatches.push({op:"replace",path:[],value:Q.data});return L.patches.length===0||U(o.util.patchQueryData(F,O,L.patches,$)),L},y=(F,O,_)=>$=>$(o.endpoints[F].initiate(O,{subscribe:!1,forceRefetch:!0,[En]:()=>({data:_})})),S=(F,O)=>F.query&&F[O]?F[O]:LS,g=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(F,{signal:O,abort:_,rejectWithValue:$,fulfillWithValue:U,dispatch:j,getState:V,extra:Q}){let L=r[F.endpointName];try{let z=S(L,"transformResponse"),W={signal:O,abort:_,dispatch:j,getState:V,extra:Q,endpoint:F.endpointName,type:F.type,forced:F.type==="query"?v(F,V()):void 0,queryCacheKey:F.type==="query"?F.queryCacheKey:void 0},Y=F.type==="query"?F[En]:void 0,re,se=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(ne,Z,oe,he){if(Z==null&&ne.pages.length)return Promise.resolve({data:ne});let ce={queryArg:F.originalArgs,pageParam:Z},me=yield ee(ce),ye=he?m:p;return{data:{pages:ye(ne.pages,me.data,oe),pageParams:ye(ne.pageParams,Z,oe)}}});return function se(_x47,_x48,_x49,_x50){return _ref22.apply(this,arguments)}}();function ee(_x51){return _ee.apply(this,arguments)}function _ee(){_ee=_asyncToGenerator(function*(ne){let Z,{extraOptions:oe}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(ne),W,oe):Z=yield L.queryFn(ne,W,oe,ce=>t(ce,W,oe)),typeof process<"u",Z.error)throw new Mr(Z.error,Z.meta);let he=yield z(Z.data,Z.meta,ne);return{...Z,data:he}});return _ee.apply(this,arguments)}if(F.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:ne}=L,{maxPages:Z=1/0}=ne,oe,he={pages:[],pageParams:[]},ce=a.selectQueryEntry(V(),F.queryCacheKey)?.data,ye=v(F,V())&&!F.direction||!ce?he:ce;if("direction"in F&&F.direction&&ye.pages.length){let Te=F.direction==="backward",ft=(Te?Id:vs)(ne,ye);oe=yield se(ye,ft,Z,Te)}else{let{initialPageParam:Te=ne.initialPageParam}=F,je=ce?.pageParams??[],ft=je[0]??Te,Xt=je.length;oe=yield se(ye,ft,Z),Y&&(oe={data:oe.data.pages[0]});for(let Zt=1;Zt<Xt;Zt++){let Qr=vs(ne,oe.data);oe=yield se(oe.data,Qr,Z)}}re=oe}else re=yield ee(F.originalArgs);return U(re.data,zo({fulfilledTimeStamp:Date.now(),baseQueryMeta:re.meta}))}catch(z){let W=z;if(W instanceof Mr){let Y=S(L,"transformErrorResponse");try{return $(yield Y(W.value,W.meta,F.originalArgs),zo({baseQueryMeta:W.meta}))}catch(re){W=re}}throw typeof process<"u",console.error(W),W}});return function g(_x45,_x46){return _ref21.apply(this,arguments)}}();function v(F,O){let _=a.selectQueryEntry(O,F.queryCacheKey),$=a.selectConfig(O).refetchOnMountOrArgChange,U=_?.fulfilledTimeStamp,j=F.forceRefetch??(F.subscribe&&$);return j?j===!0||(Number(new Date)-Number(U))/1e3>=j:!1}let R=()=>ue(`${e}/executeQuery`,g,{getPendingMeta({arg:O}){let _=r[O.endpointName];return zo({startedTimeStamp:Date.now(),...(ws(_)?{direction:O.direction}:{})})},condition(O,{getState:_}){let $=_(),U=a.selectQueryEntry($,O.queryCacheKey),j=U?.fulfilledTimeStamp,V=O.originalArgs,Q=U?.originalArgs,L=r[O.endpointName],z=O.direction;return Ss(O)?!0:U?.status==="pending"?!1:v(O,$)||As(L)&&L?.forceRefetch?.({currentArg:V,previousArg:Q,endpointState:U,state:$})?!0:!(j&&!z)},dispatchConditionRejection:!0}),P=R(),x=R(),T=ue(`${e}/executeMutation`,g,{getPendingMeta(){return zo({startedTimeStamp:Date.now()})}}),w=F=>"force"in F,E=F=>"ifOlderThan"in F,N=(F,O,_)=>($,U)=>{let j=w(_)&&_.force,V=E(_)&&_.ifOlderThan,Q=(z=!0)=>{let W={forceRefetch:z,isPrefetch:!0};return o.endpoints[F].initiate(O,W)},L=o.endpoints[F].select(O)(U());if(j)$(Q());else if(V){let z=L?.fulfilledTimeStamp;if(!z){$(Q());return}(Number(new Date)-Number(new Date(z)))/1e3>=V&&$(Q())}else $(Q(!1))};function k(F){return O=>O?.meta?.arg?.endpointName===F}function I(F,O){return{matchPending:sr(to(F),k(O)),matchFulfilled:sr(at(F),k(O)),matchRejected:sr($t(F),k(O))}}return{queryThunk:P,mutationThunk:T,infiniteQueryThunk:x,prefetch:N,updateQueryData:h,upsertQueryData:y,patchQueryData:f,buildMatchThunkActions:I}}function vs(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Id(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Pd(e,t,r,n){return xs(r[e.meta.arg.endpointName][t],at(e)?e.payload:void 0,dn(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Wo(e,t,r){let n=e[t];n&&r(n)}function In(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function gd(e,t,r){let n=e[In(t)];n&&r(n)}var Rn={};function BS({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:f},assertTagType:m,config:p}){let h=D(`${e}/resetApiState`);function y(k,I,F,O){var _;k[_=I.queryCacheKey]??(k[_]={status:"uninitialized",endpointName:I.endpointName}),Wo(k,I.queryCacheKey,$=>{$.status="pending",$.requestId=F&&$.requestId?$.requestId:O.requestId,I.originalArgs!==void 0&&($.originalArgs=I.originalArgs),$.startedTimeStamp=O.startedTimeStamp;let U=o[O.arg.endpointName];ws(U)&&"direction"in I&&($.direction=I.direction)})}function S(k,I,F,O){Wo(k,I.arg.queryCacheKey,_=>{if(_.requestId!==I.requestId&&!O)return;let{merge:$}=o[I.arg.endpointName];if(_.status="fulfilled",$){if(_.data!==void 0){let{fulfilledTimeStamp:U,arg:j,baseQueryMeta:V,requestId:Q}=I,L=it(_.data,z=>$(z,F,{arg:j.originalArgs,baseQueryMeta:V,fulfilledTimeStamp:U,requestId:Q}));_.data=L}else _.data=F;}else _.data=o[I.arg.endpointName].structuralSharing??!0?Ad(Ne(_.data)?ca(_.data):_.data,F):F;delete _.error,_.fulfilledTimeStamp=I.fulfilledTimeStamp})}let g=Ht({name:`${e}/queries`,initialState:Rn,reducers:{removeQueryResult:{reducer(k,{payload:{queryCacheKey:I}}){delete k[I]},prepare:cr()},cacheEntriesUpserted:{reducer(k,I){for(let F of I.payload){let{queryDescription:O,value:_}=F;y(k,O,!0,{arg:O,requestId:I.meta.requestId,startedTimeStamp:I.meta.timestamp}),S(k,{arg:O,requestId:I.meta.requestId,fulfilledTimeStamp:I.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:k=>({payload:k.map(O=>{let{endpointName:_,arg:$,value:U}=O,j=o[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:O.arg,queryCacheKey:n({queryArgs:$,endpointDefinition:j,endpointName:_})},value:U}}),meta:{[un]:!0,requestId:no(),timestamp:Date.now()}})},queryResultPatched:{reducer(k,{payload:{queryCacheKey:I,patches:F}}){Wo(k,I,O=>{O.data=la(O.data,F.concat())})},prepare:cr()}},extraReducers(k){k.addCase(t.pending,(I,{meta:F,meta:{arg:O}})=>{let _=Ss(O);y(I,O,_,F)}).addCase(t.fulfilled,(I,{meta:F,payload:O})=>{let _=Ss(F.arg);S(I,F,O,_)}).addCase(t.rejected,(I,{meta:{condition:F,arg:O,requestId:_},error:$,payload:U})=>{Wo(I,O.queryCacheKey,j=>{if(!F){if(j.requestId!==_)return;j.status="rejected",j.error=U??$}})}).addMatcher(f,(I,F)=>{let{queries:O}=a(F);for(let[_,$]of Object.entries(O))($?.status==="fulfilled"||$?.status==="rejected")&&(I[_]=$)})}}),v=Ht({name:`${e}/mutations`,initialState:Rn,reducers:{removeMutationResult:{reducer(k,{payload:I}){let F=In(I);F in k&&delete k[F]},prepare:cr()}},extraReducers(k){k.addCase(r.pending,(I,{meta:F,meta:{requestId:O,arg:_,startedTimeStamp:$}})=>{_.track&&(I[In(F)]={requestId:O,status:"pending",endpointName:_.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,(I,{payload:F,meta:O})=>{O.arg.track&&gd(I,O,_=>{_.requestId===O.requestId&&(_.status="fulfilled",_.data=F,_.fulfilledTimeStamp=O.fulfilledTimeStamp)})}).addCase(r.rejected,(I,{payload:F,error:O,meta:_})=>{_.arg.track&&gd(I,_,$=>{$.requestId===_.requestId&&($.status="rejected",$.error=F??O)})}).addMatcher(f,(I,F)=>{let{mutations:O}=a(F);for(let[_,$]of Object.entries(O))($?.status==="fulfilled"||$?.status==="rejected")&&_!==$?.requestId&&(I[_]=$)})}}),R=Ht({name:`${e}/invalidation`,initialState:Rn,reducers:{updateProvidedBy:{reducer(k,I){var _,$;let{queryCacheKey:F,providedTags:O}=I.payload;for(let U of Object.values(k))for(let j of Object.values(U)){let V=j.indexOf(F);V!==-1&&j.splice(V,1)}for(let{type:U,id:j}of O){let V=(_=k[U]??(k[U]={}))[$=j||"__internal_without_id"]??(_[$]=[]);V.includes(F)||V.push(F)}},prepare:cr()}},extraReducers(k){k.addCase(g.actions.removeQueryResult,(I,{payload:{queryCacheKey:F}})=>{for(let O of Object.values(I))for(let _ of Object.values(O)){let $=_.indexOf(F);$!==-1&&_.splice($,1)}}).addMatcher(f,(I,F)=>{var _,$;let{provided:O}=a(F);for(let[U,j]of Object.entries(O))for(let[V,Q]of Object.entries(j)){let L=(_=I[U]??(I[U]={}))[$=V||"__internal_without_id"]??(_[$]=[]);for(let z of Q)L.includes(z)||L.push(z)}}).addMatcher(Ye(at(t),dn(t)),(I,F)=>{let O=Pd(F,"providesTags",o,m),{queryCacheKey:_}=F.meta.arg;R.caseReducers.updateProvidedBy(I,R.actions.updateProvidedBy({queryCacheKey:_,providedTags:O}))})}}),P=Ht({name:`${e}/subscriptions`,initialState:Rn,reducers:{updateSubscriptionOptions(k,I){},unsubscribeQueryResult(k,I){},internal_getRTKQSubscriptions(){}}}),x=Ht({name:`${e}/internalSubscriptions`,initialState:Rn,reducers:{subscriptionsUpdated:{reducer(k,I){return la(k,I.payload)},prepare:cr()}}}),T=Ht({name:`${e}/config`,initialState:{online:ES(),focused:RS(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(k,{payload:I}){k.middlewareRegistered=k.middlewareRegistered==="conflict"||i!==I?"conflict":!0}},extraReducers:k=>{k.addCase(bs,I=>{I.online=!0}).addCase(Ed,I=>{I.online=!1}).addCase(Cs,I=>{I.focused=!0}).addCase(Rd,I=>{I.focused=!1}).addMatcher(f,I=>({...I}))}}),w=or({queries:g.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:x.reducer,config:T.reducer}),E=(k,I)=>w(h.match(I)?void 0:k,I),N={...T.actions,...g.actions,...P.actions,...x.actions,...v.actions,...R.actions,resetApiState:h};return{reducer:E,actions:N}}var hs=Symbol.for("RTKQ/skipToken"),Td={status:"uninitialized"},hd=it(Td,()=>{}),yd=it(Td,()=>{});function QS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>hd,o=w=>yd;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:P,selectApiState:a,selectQueries:f,selectMutations:p,selectQueryEntry:m,selectConfig:h};function i(w){return{...w,...ud(w.status)}}function a(w){return w[t]}function f(w){return a(w)?.queries}function m(w,E){return f(w)?.[E]}function p(w){return a(w)?.mutations}function h(w){return a(w)?.config}function y(w,E,N){return k=>{if(k===hs)return r(n,N);let I=e({queryArgs:k,endpointDefinition:E,endpointName:w});return r(O=>m(O,I)??hd,N)}}function S(w,E){return y(w,E,i)}function g(w,E){let{infiniteQueryOptions:N}=E;function k(I){let F={...I,...ud(I.status)},{isLoading:O,isError:_,direction:$}=F,U=$==="forward",j=$==="backward";return{...F,hasNextPage:x(N,F.data),hasPreviousPage:T(N,F.data),isFetchingNextPage:O&&U,isFetchingPreviousPage:O&&j,isFetchNextPageError:_&&U,isFetchPreviousPageError:_&&j}}return y(w,E,k)}function v(){return w=>{let E;return typeof w=="object"?E=In(w)??hs:E=w,r(E===hs?o:I=>a(I)?.mutations?.[E]??yd,i)}}function R(w,E){let N=w[t],k=new Set;for(let I of E.filter(Go).map(ys)){let F=N.provided[I.type];if(!F)continue;let O=(I.id!==void 0?F[I.id]:dd(Object.values(F)))??[];for(let _ of O)k.add(_)}return dd(Array.from(k.values()).map(I=>{let F=N.queries[I];return F?[{queryCacheKey:I,endpointName:F.endpointName,originalArgs:F.originalArgs}]:[]}))}function P(w,E){return Object.values(f(w)).filter(N=>N?.endpointName===E&&N.status!=="uninitialized").map(N=>N.originalArgs)}function x(w,E){return E?vs(w,E)!=null:!1}function T(w,E){return!E||!w.getPreviousPageParam?!1:Id(w,E)!=null}}var Sd=WeakMap?new WeakMap:void 0,vd=({endpointName:e,queryArgs:t})=>{let r="",n=Sd?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Ke(a)?Object.keys(a).sort().reduce((f,m)=>(f[m]=a[m],f),{}):a,a));Ke(t)&&Sd?.set(t,o),r=o}return`${e}(${r})`};function $S(...e){return function(r){let n=ar(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let h=vd;if("serializeQueryArgs"in p.endpointDefinition){let y=p.endpointDefinition.serializeQueryArgs;h=S=>{let g=y(S);return typeof g=="string"?g:vd({...S,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:no(),extractRehydrationInfo:n,hasRehydrationInfo:ar(p=>n(p)!=null)},a={injectEndpoints:m,enhanceEndpoints({addTagTypes:p,endpoints:h}){if(p)for(let y of p)o.tagTypes.includes(y)||o.tagTypes.push(y);if(h)for(let[y,S]of Object.entries(h))typeof S=="function"?S(i.endpointDefinitions[y]):Object.assign(i.endpointDefinitions[y]||{},S);return a}},f=e.map(p=>p.init(a,o,i));function m(p){let h=p.endpoints({query:y=>({...y,type:"query"}),mutation:y=>({...y,type:"mutation"}),infiniteQuery:y=>({...y,type:"infinitequery"})});for(let[y,S]of Object.entries(h)){if(p.overrideExisting!==!0&&y in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error(He(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[y]=S;for(let g of f)g.injectEndpoint(y,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function dt(e,...t){return Object.assign(e,...t)}var HS=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:f}=e.internalActions,m=(g,v)=>{var P,x;if(a.match(v)){let{queryCacheKey:T,requestId:w,options:E}=v.payload;return g?.[T]?.[w]&&(g[T][w]=E),!0}if(f.match(v)){let{queryCacheKey:T,requestId:w}=v.payload;return g[T]&&delete g[T][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete g[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:T,requestId:w}}=v,E=g[P=T.queryCacheKey]??(g[P]={});return E[`${w}_running`]={},T.subscribe&&(E[w]=T.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let T=g[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;R||(R=!!T[w]),delete T[w]}if(t.rejected.match(v)){let{meta:{condition:T,arg:w,requestId:E}}=v;if(T&&w.subscribe){let N=g[x=w.queryCacheKey]??(g[x]={});N[E]=w.subscriptionOptions??N[E]??{},R=!0}}return R},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:g=>{let R=p()[g]??{};return Dr(R)},isRequestSubscribed:(g,v)=>!!p()?.[g]?.[v]};return(g,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let R=m(r.currentSubscriptions,g),P=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=Jn(o,()=>w);v.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof g.type=="string"&&!!g.type.startsWith(n),T=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;P=!x&&!T}return[P,!1]}};function zS(e){for(let t in e)return!1;return!0}var WS=2147483647/1e3-1,GS=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:f,unsubscribeQueryResult:m,cacheEntriesUpserted:p}=t.internalActions,h=Ye(m.match,r.fulfilled,r.rejected,p.match);function y(P){let x=o.currentSubscriptions[P];return!!x&&!zS(x)}let S={},g=(P,x,T)=>{let w=x.getState(),E=a(w);if(h(P)){let N;if(p.match(P))N=P.payload.map(k=>k.queryDescription.queryCacheKey);else{let{queryCacheKey:k}=m.match(P)?P.payload:P.meta.arg;N=[k]}v(N,x,E)}if(t.util.resetApiState.match(P))for(let[N,k]of Object.entries(S))k&&clearTimeout(k),delete S[N];if(n.hasRehydrationInfo(P)){let{queries:N}=n.extractRehydrationInfo(P);v(Object.keys(N),x,E)}};function v(P,x,T){let w=x.getState();for(let E of P){let N=i(w,E);R(E,N?.endpointName,x,T)}}function R(P,x,T,w){let N=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(N===1/0)return;let k=Math.max(0,Math.min(N,WS));if(!y(P)){let I=S[P];I&&clearTimeout(I),S[P]=setTimeout(()=>{y(P)||T.dispatch(f({queryCacheKey:P})),delete S[P]},k*1e3)}}return g},Cd=new Error("Promise never resolved before cacheEntryRemoved."),KS=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:f}})=>{let m=ro(n),p=ro(o),h=at(n,o),y={};function S(x,T,w){let E=y[x];E?.valueResolved&&(E.valueResolved({data:T,meta:w}),delete E.valueResolved)}function g(x){let T=y[x];T&&(delete y[x],T.cacheEntryRemoved())}let v=(x,T,w)=>{let E=R(x);function N(k,I,F,O){let _=a(w,I),$=a(T.getState(),I);!_&&$&&P(k,O,I,T,F)}if(n.pending.match(x))N(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:k,value:I}of x.payload){let{endpointName:F,originalArgs:O,queryCacheKey:_}=k;N(F,_,x.meta.requestId,O),S(_,I,{})}else if(o.pending.match(x))T.getState()[t].mutations[E]&&P(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,T,x.meta.requestId);else if(h(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))g(E);else if(e.util.resetApiState.match(x))for(let k of Object.keys(y))g(k)};function R(x){return m(x)?x.meta.arg.queryCacheKey:p(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?In(x.payload):""}function P(x,T,w,E,N){let k=r.endpointDefinitions[x],I=k?.onCacheEntryAdded;if(!I)return;let F={},O=new Promise(Q=>{F.cacheEntryRemoved=Q}),_=Promise.race([new Promise(Q=>{F.valueResolved=Q}),O.then(()=>{throw Cd})]);_.catch(()=>{}),y[w]=F;let $=e.endpoints[x].select(k.type==="query"?T:w),U=E.dispatch((Q,L,z)=>z),j={...E,getCacheEntry:()=>$(E.getState()),requestId:N,extra:U,updateCachedData:k.type==="query"?Q=>E.dispatch(e.util.updateQueryData(x,T,Q)):void 0,cacheDataLoaded:_,cacheEntryRemoved:O},V=I(T,j);Promise.resolve(V).catch(Q=>{if(Q!==Cd)throw Q})}return v},YS=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},JS=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:f,internalState:m})=>{let{removeQueryResult:p}=i.internalActions,h=Ye(at(n),dn(n)),y=Ye(at(n,o),$t(n,o)),S=[],g=(P,x)=>{h(P)?R(Pd(P,"invalidatesTags",r,a),x):y(P)?R([],x):i.util.invalidateTags.match(P)&&R(xs(P.payload,void 0,void 0,void 0,void 0,a),x)};function v(P){let{queries:x,mutations:T}=P;for(let w of[x,T])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(P,x){let T=x.getState(),w=T[e];if(S.push(...P),w.config.invalidationBehavior==="delayed"&&v(w))return;let E=S;if(S=[],E.length===0)return;let N=i.util.selectInvalidatedBy(T,E);t.batch(()=>{let k=Array.from(N.values());for(let{queryCacheKey:I}of k){let F=w.queries[I],O=m.currentSubscriptions[I]??{};F&&(Dr(O)===0?x.dispatch(p({queryCacheKey:I})):F.status!=="uninitialized"&&x.dispatch(f(F)))}})}return g},XS=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,v)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&p(g.payload,v),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&p(g.meta.arg,v),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&m(g.meta.arg,v),r.util.resetApiState.match(g)&&y()};function f(g,v){let P=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!(!P||P.status==="uninitialized"))return x}function m({queryCacheKey:g},v){let R=v.getState()[e],P=R.queries[g],x=o.currentSubscriptions[g];if(!P||P.status==="uninitialized")return;let{lowestPollingInterval:T,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(T))return;let E=i[g];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let N=Date.now()+T;i[g]={nextPollTimestamp:N,pollingInterval:T,timeout:setTimeout(()=>{(R.config.focused||!w)&&v.dispatch(n(P)),m({queryCacheKey:g},v)},T)}}function p({queryCacheKey:g},v){let P=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!P||P.status==="uninitialized")return;let{lowestPollingInterval:T}=S(x);if(!Number.isFinite(T)){h(g);return}let w=i[g],E=Date.now()+T;(!w||E<w.nextPollTimestamp)&&m({queryCacheKey:g},v)}function h(g){let v=i[g];v?.timeout&&clearTimeout(v.timeout),delete i[g]}function y(){for(let g of Object.keys(i))h(g)}function S(g={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let P in g)g[P].pollingInterval&&(R=Math.min(g[P].pollingInterval,R),v=g[P].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return a},ZS=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=to(r,n),i=$t(r,n),a=at(r,n),f={};return(p,h)=>{if(o(p)){let{requestId:y,arg:{endpointName:S,originalArgs:g}}=p.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let P={},x=new Promise((N,k)=>{P.resolve=N,P.reject=k});x.catch(()=>{}),f[y]=P;let T=e.endpoints[S].select(v.type==="query"?g:y),w=h.dispatch((N,k,I)=>I),E={...h,getCacheEntry:()=>T(h.getState()),requestId:y,extra:w,updateCachedData:v.type==="query"?N=>h.dispatch(e.util.updateQueryData(S,g,N)):void 0,queryFulfilled:x};R(g,E)}}else if(a(p)){let{requestId:y,baseQueryMeta:S}=p.meta;f[y]?.resolve({data:p.payload,meta:S}),delete f[y]}else if(i(p)){let{requestId:y,rejectedWithValue:S,baseQueryMeta:g}=p.meta;f[y]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:g}),delete f[y]}}},ev=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(m,p)=>{Cs.match(m)&&f(p,"refetchOnFocus"),bs.match(m)&&f(p,"refetchOnReconnect")};function f(m,p){let h=m.getState()[e],y=h.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let v=y[g],R=S[g];if(!R||!v)continue;(Object.values(R).some(x=>x[p]===!0)||Object.values(R).every(x=>x[p]===void 0)&&h.config[p])&&(Dr(R)===0?m.dispatch(i({queryCacheKey:g})):v.status!=="uninitialized"&&m.dispatch(n(v)))}})}return a};function tv(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:D(`${t}/invalidateTags`)},f=y=>y.type.startsWith(`${t}/`),m=[YS,GS,JS,XS,KS,ZS];return{middleware:y=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:f},R=m.map(T=>T(v)),P=HS(v),x=ev(v);return T=>w=>{if(!zn(w))return T(w);S||(S=!0,y.dispatch(n.internalActions.middlewareRegistered(i)));let E={...y,next:T},N=y.getState(),[k,I]=P(w,E,N),F;if(k?F=T(w):F=I,y.getState()[t]&&(x(w,E,N),f(w)||o.hasRehydrationInfo(w)))for(let O of R)O(w,E,N);return F}},actions:a};function h(y){return e.api.endpoints[y.endpointName].initiate(y.originalArgs,{subscribe:!1,forceRefetch:!0})}}var bd=Symbol(),rv=({createSelector:e=pe}={})=>({name:bd,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:f,refetchOnFocus:m,refetchOnReconnect:p,invalidationBehavior:h},y){Xc();let S=ee=>(typeof process<"u",ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:bs,onOffline:Ed,onFocus:Cs,onFocusLost:Rd},util:{}});let g=QS({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:P,buildInfiniteQuerySelector:x,buildMutationSelector:T}=g;dt(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:N,patchQueryData:k,updateQueryData:I,upsertQueryData:F,prefetch:O,buildMatchThunkActions:_}=US({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:$,actions:U}=BS({context:y,queryThunk:w,infiniteQueryThunk:E,mutationThunk:N,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:m,refetchOnReconnect:p,refetchOnMountOrArgChange:f,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:h}});dt(t.util,{patchQueryData:k,updateQueryData:I,upsertQueryData:F,prefetch:O,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),dt(t.internalActions,U);let{middleware:j,actions:V}=tv({reducerPath:o,context:y,queryThunk:w,mutationThunk:N,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:g});dt(t.util,V),dt(t,{reducer:$,middleware:j});let{buildInitiateQuery:Q,buildInitiateInfiniteQuery:L,buildInitiateMutation:z,getRunningMutationThunk:W,getRunningMutationsThunk:Y,getRunningQueriesThunk:re,getRunningQueryThunk:se}=jS({queryThunk:w,mutationThunk:N,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:y});return dt(t.util,{getRunningMutationThunk:W,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:re}),{name:bd,injectEndpoint(ee,ne){var he;let oe=(he=t.endpoints)[ee]??(he[ee]={});As(ne)&&dt(oe,{name:ee,select:P(ee,ne),initiate:Q(ee,ne)},_(w,ee)),NS(ne)&&dt(oe,{name:ee,select:T(),initiate:z(ee)},_(N,ee)),ws(ne)&&dt(oe,{name:ee,select:x(ee,ne),initiate:L(ee,ne)},_(w,ee))}}}}),Fd=$S(rv());var nv=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,f=n.generatedAnswer.answerConfigurationId,m={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let p=Pe(a,i);return{data:wd({baseUrl:`${p}/rest/organizations/${a}/answer/v1/configs/${f}`,fetchFn:function(){var _ref24=_asyncToGenerator(function*(y){if(y instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=y.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{g[v]=y[v]}),g.duplex="half",g.body=yield y.text(),b(S,g)});return function fetchFn(_x55){return _ref24.apply(this,arguments)}}()})(m,{...t,signal:null},r)}}catch(p){return{error:p}}});return function nv(_x52,_x53,_x54){return _ref23.apply(this,arguments)}}(),kd=Fd({reducerPath:"answer",baseQuery:xd(nv,{maxRetries:3}),endpoints:()=>({})});var ov=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},iv=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},av=(e,t)=>{e.citations=t.citations},sv=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},cv=(e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)},uv=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&cv(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(ov(t,o),r(es(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(iv(t,o),r(Xa({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(av(t,o),r(Za({citations:o.citations})));break;case"genqa.endOfStreamType":sv(t,o),r(jo(o.answerGenerated??!1));break}},Rs=kd.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let n=JSON.parse(JSON.stringify(r));return n.analytics&&(delete n.analytics.clientTimestamp,delete n.analytics.actionCause),`${t}(${JSON.stringify(n)})`},onCacheEntryAdded(_x56,_x57){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:f,insightConfiguration:m}=r(),{organizationId:p,environment:h,accessToken:y}=a,S=Pe(p,h),g=`${S}/rest/organizations/${p}/insight/v1/configs/${m?.insightId}/answer/${f.answerConfigurationId}/generate`,v=`${S}/rest/organizations/${p}/answer/v1/configs/${f.answerConfigurationId}/generate`;yield cd(m?g:v,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${y}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:b,onopen:function(){var _ref25=_asyncToGenerator(function*(R){let P=R.headers.get("x-answer-id");P&&o(x=>{x.answerId=P})});return function onopen(_x58){return _ref25.apply(this,arguments)}}(),onmessage:R=>{o(P=>{uv(R,P,i)})},onerror:R=>{throw R},onclose:()=>{o(R=>{i(ts(!R.generated))})}})}).apply(this,arguments)}})})}),C_=pe(e=>bn(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,(e,t,r)=>({q:e,requestId:t,cannotAnswer:r})),Ko={},lv=(e,t)=>({...Ko,[e]:Ho(t)?.map(r=>ds(r,ls())).sort((r,n)=>r.facetId>n.facetId?1:n.facetId>r.facetId?-1:0)}),dv=e=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,pv=e=>{let t=Ya(e),r=fv(e);return{...t,...(r&&{cq:r})}},fv=e=>{let t=ed(e.tabSet),r=$o(e),{cq:n}=Ya(e);return[t,...r,n].filter(o=>!!o).join(" AND ")},mv=(e,t,r)=>{let n=bn(e)?.q,{aq:o,cq:i,dq:a,lq:f}=pv(e),m=xl(e),p=Ml(e),h=Dl(e),y=El(e)??[];return n&&t==="fetch"&&(Ko=lv(n,e)),{q:n,...(o&&{aq:o}),...(i&&{cq:i}),...(a&&{dq:a}),...(f&&{lq:f}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:y}},...(p?.length&&{searchHub:p}),...(h?.length&&{pipeline:h}),...(Ko[n]?.length&&{facets:Ko[n]}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:dv(e),firstResult:e.pagination.firstResult}),tab:ps(e.tabSet),...Vo(e.configuration.analytics,r,{actionCause:Zl(e)})}};var Il=(e,t)=>Rs.endpoints.getAnswer.select(mv(e,"select",t||Cn()))(e);d();c();l();u();var Od=ge(ur,e=>e);d();c();l();u();function Es(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();function gv(e){let t=e.payload?.analyticsAction;return Dd(e)&&!X(t)}function Dd(e){return"type"in e}var Md=e=>t=>r=>{let n;gv(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Dd(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var W_=D("tab/register",e=>{let t=new K({values:{id:G,expression:we}});return B(e,t)}),Yo=D("tab/updateActiveTab",e=>B(e,G));d();c();l();u();var Jo=Qe(Lo(),1),_d=Qe(qd(),1),Vd=Qe(Nd(),1);Jo.default.extend(Vd.default);Jo.default.extend(_d.default);var jd=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Jo.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});d();c();l();u();var hv=/(^|; )Coveo-Pendragon=([^;]*)/;function ks(){return typeof window>"u"?!1:hv.exec(document.cookie)?.pop()||null}var Ld=ge(jd(),e=>e.addCase(St,(t,r)=>{yv(t,r.payload)}).addCase(Je,(t,r)=>{Sv(t,r.payload)}).addCase(lr,(t,r)=>{vv(t,r.payload)}).addCase(dr,t=>{t.analytics.enabled=!1}).addCase(pr,t=>{t.analytics.enabled=!0}).addCase(io,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(ao,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Yo,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Eu,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(vt,(t,r)=>{X(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function yv(e,t){X(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",X(t.organizationId)||(e.organizationId=t.organizationId)}function Sv(e,t){X(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),X(t.locale)||(e.search.locale=t.locale),X(t.timezone)||(e.search.timezone=t.timezone),X(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function vv(e,t){X(t.enabled)||(e.analytics.enabled=t.enabled),X(t.originContext)||(e.analytics.originContext=t.originContext),X(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),X(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),X(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),X(t.trackingId)||(e.analytics.trackingId=t.trackingId),X(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),X(t.source)||(e.analytics.source=t.source);try{let r=ks();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}X(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),X(t.anonymous)||(e.analytics.anonymous=t.anonymous),X(t.deviceId)||(e.analytics.deviceId=t.deviceId),X(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),X(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var ze=Ld;d();c();l();u();function Cv(e){return e.instantlyCallable}var Ud=()=>e=>t=>e(Cv(t)?t():t);d();c();l();u();var Bd=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error,i=[n.payload?.errorCode,n.payload?.message].filter(Boolean).join(" - ");if(n.payload?.ignored||e.error(i||o.stack||o.message||o.name||"Error",`Action dispatch error ${n.type}`,r),n.error.name!=="SchemaValidationError")return t(r)},Qd=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();function $d(e,t){let r={...e},n,o=i=>(a,f)=>{let m=i(a,f);return n?n(m,f):m};return{get combinedReducer(){let i=Cc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,f])=>[a,()=>f]));return o(or({...i,...r}))},containsAll(i){return Object.keys(i).every(f=>f in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>r[a]=i[a])},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function Xo(e,t,r){var n,o,i;t===void 0&&(t=50),r===void 0&&(r={});var a=(n=r.isImmediate)!=null&&n,f=(o=r.callback)!=null&&o,m=r.maxWait,p=Date.now(),h=[];function y(){if(m!==void 0){var g=Date.now()-p;if(g+t>=m)return m-g}return t}var S=function(){var g=[].slice.call(arguments),v=this;return new Promise(function(R,P){var x=a&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,p=Date.now(),!a){var w=e.apply(v,g);f&&f(w),h.forEach(function(E){return(0,E.resolve)(w)}),h=[]}},y()),x){var T=e.apply(v,g);return f&&f(T),R(T)}h.push({resolve:R,reject:P})})};return S.cancel=function(g){i!==void 0&&clearTimeout(i),h.forEach(function(v){return(0,v.reject)(g)}),h=[]},S}function Hd(e,t){let r=0,n=Xo(()=>r=0,500);return o=>i=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(a){if(!(typeof a=="function"))return i(a);let m=yield i(a);if(!bv(m))return m;if(typeof t!="function")return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),m;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),m;r++,n();let p=yield Av(t);o.dispatch(St({accessToken:p})),o.dispatch(a)});return function(_x59){return _ref26.apply(this,arguments)}}())}function bv(e){return e?.error?.name===new nr().name}function Av(_x60){return _Av.apply(this,arguments)}function _Av(){_Av=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _Av.apply(this,arguments)}d();c();l();u();function zd({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return lu({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Qd(n.logger))})}function wv(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&vc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function Wd(e,t){let r={...e.reducers,configuration:ze,version:Od},n=xv({...e,reducers:r},t,ze),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(St({accessToken:o,environment:i,organizationId:a}));let f=wv(e.configuration,n.logger);return f&&n.dispatch(lr(f)),n}function xv(e,t,r){let{reducers:n}=e,o=$d({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&o.addCrossReducer(e.crossReducer);let i=t.logger,a=()=>{let h="";try{h=Rr(p.state).getMeta("").clientId}catch(y){i.warn("Error while obtaining clientID from relay",y)}return h},f={...t,get relay(){return Rr(p.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():Es()?Ka(a()):Cn()}},m=Rv(e,f,o),p={addReducers(h){o.containsAll(h)||(o.add(h),m.replaceReducer(o.combinedReducer))},dispatch:m.dispatch,subscribe:m.subscribe,enableAnalytics(){m.dispatch(pr())},disableAnalytics(){m.dispatch(dr())},get state(){return m.getState()},get relay(){return Rr(this.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():Es()?Ka(a()):Cn()},logger:i,store:m};return p}function Rv(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=Ev(e,t.logger);return zd({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function Ev(e,t){let{renewAccessToken:r}=e.configuration,n=Hd(t,r);return[Ud,n,Bd(t),Md].concat(Rs.middleware,e.middlewares||[])}d();c();l();u();var rp=Qe(tp(),1);function np(e){return(0,rp.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function op(e,t){let r=$v(e),n=Le,o=Hv(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function $v(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function Hv(e){return e.preprocessRequest||Vn}d();c();l();u();d();c();l();u();var ip={organizationId:G,accessToken:G,name:new H({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new te({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function ap(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var sp=new Fe({...ip,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ae,locale:Ae,timezone:Ae});function _s(){return{...ap(),searchHub:"default"}}var zv={debug:lo,pipeline:gr,searchHub:Tr,recommendation:Ir};function cp(e){let t=np(e.loggerOptions);Wv(e.configuration,t);let r=Gv(e.configuration,t),n={...op(e.configuration,t),apiClient:r},o={...e,reducers:zv},i=Wd(o,n),{pipeline:a,searchHub:f,timezone:m,locale:p,proxyBaseUrl:h}=e.configuration;return i.dispatch(Je({timezone:m,locale:p,proxyBaseUrl:h})),X(a)||i.dispatch(fr(a)),X(f)||i.dispatch(Pr(f)),{...i,get state(){return i.state}}}function Wv(e,t){try{sp.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function Gv(e,t){return new Qn({logger:t,preprocessRequest:e.preprocessRequest||Vn,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||bc,postprocessFacetSearchResponseMiddleware:Ac,postprocessQuerySuggestResponseMiddleware:wc})}d();c();l();u();function Kv(e){return e.addReducers({configuration:ze}),{disableAnalytics:dr,enableAnalytics:pr,setOriginLevel2:io,setOriginLevel3:ao,updateAnalyticsConfiguration:lr,updateBasicConfiguration:St}}d();c();l();u();function Yv(e){return e.addReducers({configuration:ze,pipeline:gr,searchHub:Tr}),{updateSearchConfiguration:Je}}d();c();l();u();d();c();l();u();d();c();l();u();var It=()=>new H({required:!1,emptyAllowed:!0}),ti=D("advancedSearchQueries/update",e=>B(e,{aq:It(),cq:It(),lq:It(),dq:It()})),ri=D("advancedSearchQueries/register",e=>B(e,{aq:It(),cq:It(),lq:It(),dq:It()}));d();c();l();u();var Pt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var up=ge(Pt(),e=>{e.addCase(ti,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0),ve(i)||(t.lq=i,t.lqWasSet=!0),ve(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(ri,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ve(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ve(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ve(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(Me.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(vt,(t,r)=>{let{aq:n,cq:o}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0)})});function Jv(e){return e.addReducers({advancedSearchQueries:up}),{updateAdvancedSearchQueries:ti,registerAdvancedSearchQueries:ri}}d();c();l();u();d();c();l();u();d();c();l();u();var Xv=new ie({each:G,required:!0}),lp=(e,t)=>(B(e,G),Nn(t)?B(t,G):B(t,Xv),{payload:{contextKey:e,contextValue:t}}),Kt=D("context/set",e=>{for(let[t,r]of Object.entries(e))lp(t,r);return{payload:e}}),Yt=D("context/add",e=>lp(e.contextKey,e.contextValue)),Jt=D("context/remove",e=>B(e,G));d();c();l();u();function ni(){return{contextValues:{}}}var oi=ge(ni(),e=>{e.addCase(Kt,(t,r)=>{t.contextValues=r.payload}).addCase(Yt,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Jt,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});function Zv(e){return e.addReducers({context:oi}),{addContext:Yt,removeContext:Jt,setContext:Kt}}d();c();l();u();d();c();l();u();d();c();l();u();var Nr=D("dictionaryFieldContext/set",e=>{let t=new K({options:{required:!0}}),r=B(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:we}),i=B(n,o).error;return i?{payload:e,error:i}:{payload:e}}),_r=D("dictionaryFieldContext/add",e=>{let t=new K({options:{required:!0},values:{field:we,key:we}});return B(e,t)}),Vr=D("dictionaryFieldContext/remove",e=>B(e,we));d();c();l();u();function ii(){return{contextValues:{}}}var ai=ge(ii(),e=>{e.addCase(Nr,(t,r)=>{t.contextValues=r.payload}).addCase(_r,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Vr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function eC(e){return e.addReducers({dictionaryFieldContext:ai}),{addContext:_r,removeContext:Vr,setContext:Nr}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Tt=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ht(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Ze.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Mo(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Tt(_x61,_x62){return _ref27.apply(this,arguments)}}();d();c();l();u();var jr=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ht(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Vo(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});var tC={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new J({min:0,required:!1})},dp=D("folding/register",e=>B(e,tC)),BQ=ue("folding/loadCollection",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Tt(i):jr(i,o),f=yield n.search({...a,q:rC(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return ke(f)?r(f.error):{collectionId:e,results:f.success.results,searchUid:f.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x63,_x64){return _ref28.apply(this,arguments)}}());function rC(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var pp=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});d();c();l();u();var Lr=D("fields/registerFieldsToInclude",e=>B(e,oo)),si=D("fields/fetchall/enable"),ci=D("fields/fetchall/disable"),ui=ue("fields/fetchDescription",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:f}=o.configuration,{apiBaseUrl:m}=o.configuration.search,p=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:f,url:m??ht(f,a)});return ke(p)?n(p.error):p.success.fields});return function(_x65,_x66){return _ref29.apply(this,arguments)}}());d();c();l();u();var li=["author","language","urihash","objecttype","collection","source","permanentid"],Vs=[...li,"date","filetype","parents"],fp=[...Vs,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],mp=()=>({fieldsToInclude:li,fetchAllFields:!1,fieldsDescription:[]});var di=ge(mp(),e=>e.addCase(Lr,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(si,t=>{t.fetchAllFields=!0}).addCase(ci,t=>{t.fetchAllFields=!1}).addCase(ui.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(dp,(t,{payload:r})=>{let n=pp().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function nC(e){return e.addReducers({fields:di}),{registerFieldsToInclude:Lr,enableFetchAllFields:si,disableFetchAllFields:ci,fetchFieldsDescription:ui}}d();c();l();u();function oC(e){return e.addReducers({pipeline:gr}),{setPipeline:fr}}d();c();l();u();function iC(e){return e.addReducers({searchHub:Tr}),{setSearchHub:Pr}}d();c();l();u();function aC(e){return e.addReducers({debug:lo}),{disableDebug:co,enableDebug:so}}d();c();l();u();function sC(e){return e.addReducers({recommendation:Ir}),{getRecommendations:At,setRecommendationId:Er}}d();c();l();u();function cC(e){return e.addReducers({}),{logRecommendationOpen:_o}}d();c();l();u();d();c();l();u();d();c();l();u();var Ur=D("breadcrumb/deselectAll"),pi=D("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();d();c();l();u();var Tn={value:G,numberOfResults:new J({min:0}),state:G};d();c();l();u();var le=G;var pC=new J({min:1,default:8,required:!1}),fC=new J({min:1,max:20,default:5,required:!1}),mC={desiredCount:fC,numberOfValues:pC},j$=D("automaticFacet/setOptions",e=>B(e,mC)),L$=D("automaticFacet/deselectAll",e=>B(e,le)),gC=G,gp=D("automaticFacet/toggleSelectValue",e=>B(e,{field:gC,selection:new K({values:Tn})}));d();c();l();u();d();c();l();u();var hC={state:new fe({required:!0}),numberOfResults:new J({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:G}),moreValuesAvailable:new te({required:!1})};function js(e){e.children.forEach(t=>{js(t)}),Le({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},hC)}var Br={facetId:le,field:G,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),basePath:new ie({required:!1,each:G}),filterByBasePath:new te({required:!1})};var oH=D("categoryFacet/register",e=>B(e,Br)),hp=D("categoryFacet/toggleSelectValue",e=>{try{return Le(e.facetId,G),js(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}}),yp=D("categoryFacet/deselectAll",e=>B(e,Br.facetId)),iH=D("categoryFacet/updateNumberOfValues",e=>B(e,{facetId:Br.facetId,numberOfValues:Br.numberOfValues})),aH=D("categoryFacet/updateSortCriterion",e=>B(e,{facetId:Br.facetId,criterion:new fe})),sH=D("categoryFacet/updateBasePath",e=>B(e,{facetId:Br.facetId,basePath:new ie({each:G})}));d();c();l();u();d();c();l();u();var Fn={facetId:le,captions:new K({options:{required:!1}}),numberOfValues:new J({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var yC={path:new ie({required:!0,each:G}),displayValue:we,rawValue:we,count:new J({required:!0,min:0})},Sp=D("categoryFacet/selectSearchResult",e=>B(e,{facetId:le,value:new K({values:yC})})),RH=D("categoryFacetSearch/register",e=>B(e,Fn));d();c();l();u();var vp={facetId:le,value:new K({values:{displayValue:we,rawValue:we,count:new J({required:!0,min:0})}})},NH=D("facetSearch/register",e=>B(e,Fn)),_H=D("facetSearch/update",e=>B(e,Fn)),Cp=D("facetSearch/toggleSelectValue",e=>B(e,vp)),bp=D("facetSearch/toggleExcludeValue",e=>B(e,vp));d();c();l();u();d();c();l();u();function wp(e){let t=Ap(e.start,e),r=Ap(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function Ap(e,t){let{dateFormat:r}=t;return zl(e)?(us(e),Ql(e)):typeof e=="string"&&wt(e)?(us(e),e):(jl(e,r),Bo(Or(e,r)))}d();c();l();u();d();c();l();u();var ez=new H({regex:/^[a-zA-Z0-9-_]+$/}),tz=new H({required:!0}),rz=new ie({each:new H}),nz=new H,oz=new te,iz=new te,az=new J({min:0}),SC=new J({min:1}),sz=new te({required:!0}),vC=new K,CC=new H,bC={captions:vC,numberOfValues:SC,query:CC},cz=new K({values:bC}),xp=new K({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),uz=new te,Rp=new ie({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var AC={facetId:le,field:new H({required:!0,emptyAllowed:!0}),tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),resultsMustMatch:new fe({required:!1}),allowedValues:xp,customSort:Rp},bz=D("facet/register",e=>B(e,AC)),Ep=D("facet/toggleSelectValue",e=>B(e,{facetId:le,selection:new K({values:Tn})})),Ip=D("facet/toggleExcludeValue",e=>B(e,{facetId:le,selection:new K({values:Tn})})),fi=D("facet/deselectAll",e=>B(e,le)),Az=D("facet/updateSortCriterion",e=>B(e,{facetId:le,criterion:new fe({required:!0})})),wz=D("facet/updateNumberOfValues",e=>B(e,{facetId:le,numberOfValues:new J({required:!0,min:1})})),xz=D("facet/updateIsFieldExpanded",e=>B(e,{facetId:le,isFieldExpanded:new te({required:!0})})),Rz=D("facet/updateFreezeCurrentValues",e=>B(e,{facetId:le,freezeCurrentValues:new te({required:!0})}));d();c();l();u();var Pp=D("rangeFacet/updateSortCriterion",e=>B(e,{facetId:le,criterion:new fe({required:!0})}));d();c();l();u();var mi={state:G,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new te({required:!0}),numberOfResults:new J({required:!0,min:0})},gi={start:G,end:G,endInclusive:new te({required:!0}),state:G,numberOfResults:new J({required:!0,min:0})};var wC={start:G,end:G,endInclusive:new te({required:!0}),state:G},xC={facetId:le,field:G,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:wC})}),generateAutomaticRanges:new te({required:!0}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Tp(e){return wt(e)?wn(e):e}function Fp(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=wp(t);if(Or(Tp(r)).isAfter(Or(Tp(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var oW=D("dateFacet/register",e=>{try{return Le(e,xC),Fp(e),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}}),kp=D("dateFacet/toggleSelectValue",e=>B(e,{facetId:le,selection:new K({values:gi})})),Op=D("dateFacet/toggleExcludeValue",e=>B(e,{facetId:le,selection:new K({values:gi})})),Dp=D("dateFacet/updateFacetValues",e=>{try{return Le(e,{facetId:le,values:new ie({each:new K({values:gi})})}),Fp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}});d();c();l();u();var RC={state:G,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new te({required:!0})},EC={facetId:le,field:G,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:RC})}),generateAutomaticRanges:new te({required:!0}),filterFacetCount:new te({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Mp(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var yW=D("numericFacet/register",e=>{try{return B(e,EC),Mp(e),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}}),qp=D("numericFacet/toggleSelectValue",e=>B(e,{facetId:le,selection:new K({values:mi})})),Np=D("numericFacet/toggleExcludeValue",e=>B(e,{facetId:le,selection:new K({values:mi})})),_p=D("numericFacet/updateFacetValues",e=>{try{return Le(e,{facetId:le,values:new ie({each:new K({values:mi})})}),Mp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:st(t)}}});d();c();l();u();d();c();l();u();var hi=D("facet/updateFacetAutoSelection",e=>B(e,{allow:new te({required:!0})}));d();c();l();u();d();c();l();u();var yi=class extends bt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ve().q}get responseTime(){return this.activeInstantResultCache?.duration??We().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??We().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Vp=()=>qe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new yi(e)),jp=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var Ls={id:G},IC={...Ls,q:we},e2=D("instantResults/register",e=>B(e,Ls)),Si=D("instantResults/updateQuery",e=>B(e,IC)),t2=D("instantResults/clearExpired",e=>B(e,Ls));d();c();l();u();var vi=new J({required:!0,min:0}),Ci=D("pagination/registerNumberOfResults",e=>B(e,vi)),bi=D("pagination/updateNumberOfResults",e=>B(e,vi)),Ai=D("pagination/registerPage",e=>B(e,vi)),Ft=D("pagination/updatePage",e=>B(e,vi)),wi=D("pagination/nextPage"),xi=D("pagination/previousPage");d();c();l();u();var kt=D("query/updateQuery",e=>B(e,{q:new H,enableQuerySyntax:new te}));d();c();l();u();d();c();l();u();var Us=()=>qe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Ot=e=>qe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ve().q,aq:r.advancedSearchQueries?.aq||Pt().aq,cq:r.advancedSearchQueries?.cq||Pt().cq,dq:r.advancedSearchQueries?.dq||Pt().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var q2=D("didYouMean/enable"),N2=D("didYouMean/disable"),_2=D("didYouMean/automaticCorrections/disable"),V2=D("didYouMean/automaticCorrections/enable"),Ri=D("didYouMean/correction",e=>B(e,G)),j2=D("didYouMean/automaticCorrections/mode",e=>B(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Bs=()=>qe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Lp=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Up(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Bp(){return[]}d();c();l();u();function kn(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Qp(){return{}}d();c();l();u();function $p(){return{}}d();c();l();u();function Hp(){return{}}function rt(e){return{context:e.context||ni(),dictionaryFieldContext:e.dictionaryFieldContext||ii(),facetSet:e.facetSet||Oo(),numericFacetSet:e.numericFacetSet||ko(),dateFacetSet:e.dateFacetSet||Fo(),categoryFacetSet:e.categoryFacetSet||To(),automaticFacetSet:e.automaticFacetSet??Po(),pagination:e.pagination||kn(),query:e.query||Ve(),tabSet:e.tabSet||Hp(),advancedSearchQueries:e.advancedSearchQueries||Pt(),staticFilterSet:e.staticFilterSet||$p(),querySet:e.querySet||Qp(),sortCriteria:e.sortCriteria||Do(),pipeline:e.pipeline||mr(),searchHub:e.searchHub||wr(),facetOptions:e.facetOptions||Up(),facetOrder:e.facetOrder??Bp(),debug:e.debug??uo()}}d();c();l();u();var nK=new K({values:{undoneQuery:we},options:{required:!0}}),zp=()=>qe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var Ei=D("trigger/query/ignore",e=>B(e,new H({emptyAllowed:!0,required:!0}))),Ii=D("trigger/query/modification",e=>B(e,new K({values:{originalQuery:Ae,modification:Ae}})));d();c();l();u();var Dt=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=FC(e),n=Ho(e),o=PC(e),i=yield Tt(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return xt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Dt(_x67,_x68){return _ref30.apply(this,arguments)}}();function PC(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(TC).filter(r=>r.currentValues.length>0):void 0}function TC(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function FC(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=kC(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function kC(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Mt=class{constructor(t,r=n=>{this.dispatch(kt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x69,_x70){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=new Date().getTime(),i=Qo(yield _this10.extra.apiClient.search(r,n),t),a=new Date().getTime()-o,f=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(Ot(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,h=!X(m)&&!X(m.correctedQuery);if(!p&&!h)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Xe(rt(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return ke(i.response)?(_this13.dispatch(Ot(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Xe(rt(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Bs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Bs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction&&this.analyticsAction()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Ei("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return ke(a.response)?(_this14.dispatch(Ot(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Xe(rt(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:zp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ve().enableQuerySyntax},search:{...We(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Xe(rt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Dt(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Ri(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Ii({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Dt(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var h3=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;B(e,{q:new H,enableQuerySyntax:new te,clearFilters:new te}),e.clearFilters&&(r(Ur()),r(pi())),r(hi({allow:!0})),r(kt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Ft(1))}),y3=ue("search/executeSearch",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Pi(r,t,e)});return function(_x71,_x72){return _ref31.apply(this,arguments)}}()),S3=ue("search/fetchPage",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield $s(r,t,e)});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),v3=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Hs(t,r)});return function(_x75,_x76){return _ref33.apply(this,arguments)}}()),C3=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();return yield qC(t,e,r)});return function(_x77,_x78){return _ref34.apply(this,arguments)}}()),b3=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){return Qs(e,t)});return function(_x79,_x80){return _ref35.apply(this,arguments)}}()),OC=/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=yield Dt(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function OC(_x81,_x82){return _ref36.apply(this,arguments)}}(),DC=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t,r){let n=yield Tt(e);return xt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function DC(_x83,_x84,_x85){return _ref37.apply(this,arguments)}}(),MC=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=yield Dt(e,t);return r.request.numberOfResults=0,r});return function MC(_x86,_x87){return _ref38.apply(this,arguments)}}(),Wp=e=>{e.configuration.analytics.enabled&&Ze.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Qs(_x88,_x89){return _Qs.apply(this,arguments)}function _Qs(){_Qs=_asyncToGenerator(function*(e,t){B(e,{id:G,q:G,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Mt({...t,analyticsAction:Vp()},p=>{t.dispatch(Si({q:p,id:e.id}))}),a=yield DC(o,r,n),f=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),m=yield i.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,analyticsAction:m.analyticsAction,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return _Qs.apply(this,arguments)}function $s(_x90,_x91,_x92){return _$s.apply(this,arguments)}function _$s(){_$s=_asyncToGenerator(function*(e,t,r){Wp(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Mt({...t,analyticsAction:r}),m=yield Dt(e,a),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _$s.apply(this,arguments)}function Hs(_x93,_x94){return _Hs.apply(this,arguments)}function _Hs(){_Hs=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Us().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Mt({...e,analyticsAction:Us()}),f=yield OC(t,i),m=yield a.fetchFromAPI(f,{origin:"mainSearch"});return yield a.process(m)});return _Hs.apply(this,arguments)}function qC(_x95,_x96,_x97){return _qC.apply(this,arguments)}function _qC(){_qC=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Mt({...e,analyticsAction:t}),m=yield MC(r,a),p=yield f.fetchFromAPI(m,{origin:"facetValues"});return yield f.process(p)});return _qC.apply(this,arguments)}function Pi(_x98,_x99,_x100){return _Pi.apply(this,arguments)}function _Pi(){_Pi=_asyncToGenerator(function*(e,t,r){Wp(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i});a?.actionCause&&t.dispatch(zs({actionCause:a.actionCause}));let f=yield Dt(e,a),m=new Mt({...t,analyticsAction:r}),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _Pi.apply(this,arguments)}d();c();l();u();d();c();l();u();var qt=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r){let n=BC(e),o=NC(e),i=_C(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Tt(e,r):jr(e,t,r),f=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return xt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:f(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function qt(_x101,_x102,_x103){return _ref39.apply(this,arguments)}}();function NC(e){return fs(jC(e),e.facetOrder??[])}function _C(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(VC).filter(r=>r.currentValues.length>0):void 0}function VC(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function jC(e){return LC(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function LC(e){return[...UC(e.facetSet??{}),...Gp(e.numericFacetSet??{}),...Gp(e.dateFacetSet??{}),...Rt(e.categoryFacetSet??{})]}function UC(e){return Rt(e).map(t=>{let r=ms[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Gp(e){return Rt(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}function BC(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=$o(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Nt=class{constructor(t,r=n=>{this.dispatch(kt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x104,_x105){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=new Date().getTime(),i=Qo(yield _this17.extra.apiClient.search(r,n),t),a=new Date().getTime()-o,f=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ke(t.response)?(this.dispatch(Ot(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,h=!X(m)&&!X(m.correctedQuery);if(!p&&!h)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Xe(rt(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return ke(i.response)?(_this20.dispatch(Ot(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Xe(rt(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Ei("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return ke(a.response)?(_this21.dispatch(Ot(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Xe(rt(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Xe(rt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Lp(),o=yield _this22.fetchFromAPI(yield qt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Ri(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ii({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield qt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var TY=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;B(e,{q:new H,enableQuerySyntax:new te,clearFilters:new te}),e.clearFilters&&(r(Ur()),r(pi())),r(hi({allow:!0})),r(kt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Ft(1))}),zs=D("search/updateSearchAction"),Kp=ue("search/executeSearch",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Pi(r,t,e.legacy);Yp(r);let n=e.next?Jp(e.next):void 0;t.dispatch(zs(e.next));let o=yield qt(r,t.extra.navigatorContext,n),i=new Nt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x106,_x107){return _ref40.apply(this,arguments)}}()),FY=ue("search/fetchPage",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();if(Yp(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return $s(r,t,e.legacy);let n=new Nt({...t,analyticsAction:e.next}),o=yield qt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x108,_x109){return _ref41.apply(this,arguments)}}()),kY=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Hs(t,r);let n=Sl("browseResults",t.getState),o=new Nt({...t,analyticsAction:n}),i=yield QC(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x110,_x111){return _ref42.apply(this,arguments)}}()),OY=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Pi(r,t,e.legacy);let n=new Nt({...t,analyticsAction:{}}),o=yield HC(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x112,_x113){return _ref43.apply(this,arguments)}}()),DY=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Qs(e,t);B(e,{id:G,q:G,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=Jp(jp()),a=yield $C(r,t.extra.navigatorContext,n,o,i),f=new Nt({...t,analyticsAction:i},h=>{t.dispatch(Si({q:h,id:e.id}))}),m=yield f.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield f.process(m);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x114,_x115){return _ref44.apply(this,arguments)}}()),QC=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t,r){let n=yield qt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function QC(_x116,_x117,_x118){return _ref45.apply(this,arguments)}}(),$C=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t,r,n,o){let i=jr(e,t,o);return xt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function $C(_x119,_x120,_x121,_x122,_x123){return _ref46.apply(this,arguments)}}(),HC=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t,r){let n=yield qt(e,t,r);return n.request.numberOfResults=0,n});return function HC(_x124,_x125,_x126){return _ref47.apply(this,arguments)}}(),Yp=e=>{e.configuration.analytics.enabled&&Ze.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Jp=e=>({actionCause:e.actionCause,type:e.actionCause});var Xp=ge(kn(),e=>{e.addCase(Ci,(t,r)=>{let n=Ws(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=On(n,o)}).addCase(bi,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(Yo,t=>{t.firstResult=0}).addCase(Ai,(t,r)=>{let n=r.payload;t.firstResult=On(n,t.numberOfResults)}).addCase(Ft,(t,r)=>{let n=r.payload;t.firstResult=On(n,t.numberOfResults)}).addCase(xi,t=>{let r=Ws(t),n=Math.max(r-1,1);t.firstResult=On(n,t.numberOfResults)}).addCase(wi,t=>{let r=Ws(t),n=WC(t),o=Math.min(r+1,n);t.firstResult=On(o,t.numberOfResults)}).addCase(Me.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(vt,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Kp.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(fi,t=>{Ie(t)}).addCase(Op,t=>{Ie(t)}).addCase(Ip,t=>{Ie(t)}).addCase(Np,t=>{Ie(t)}).addCase(bp,t=>{Ie(t)}).addCase(Ep,t=>{Ie(t)}).addCase(yp,t=>{Ie(t)}).addCase(hp,t=>{Ie(t)}).addCase(Sp,t=>{Ie(t)}).addCase(kp,t=>{Ie(t)}).addCase(qp,t=>{Ie(t)}).addCase(Ur,t=>{Ie(t)}).addCase(Dp,t=>{Ie(t)}).addCase(_p,t=>{Ie(t)}).addCase(Cp,t=>{Ie(t)}).addCase(gp,t=>{Ie(t)})});function Ie(e){e.firstResult=kn().firstResult}function Ws(e){let{firstResult:t,numberOfResults:r}=e;return GC(t,r)}function WC(e){let{totalCountFiltered:t,numberOfResults:r}=e;return KC(t,r)}function On(e,t){return(e-1)*t}function GC(e,t){return Math.round(e/t)+1}function KC(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Gs(e){return e.addReducers({pagination:Xp}),{nextPage:wi,previousPage:xi,registerNumberOfResults:Ci,registerPage:Ai,updateNumberOfResults:bi,updatePage:Ft}}d();c();l();u();function _t(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),f=t!==a;return t=a,f}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),f;return n()&&(t=JSON.stringify(this.state),f=e.subscribe(()=>{o(this.state)&&r.forEach(m=>m())})),r.set(a,i),()=>{r.delete(a),n()&&f&&f()}},get state(){return{}}}}d();c();l();u();var YC=new Fe({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new J({min:0})});function Zp(e,t={}){if(!JC(e))throw Ge;let r=_t(e),{dispatch:n}=e,o=()=>e.state,i=bu(e,YC,t.options,"buildRecommendationList");return i.id!==""&&n(Er({id:i.id})),i.numberOfRecommendations&&n(Gs(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(At())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function JC(e){return e.addReducers({recommendation:Ir,configuration:ze}),!0}d();c();l();u();d();c();l();u();function ef(e,t,r){if(!XC(e))throw Ge;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Xo(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function XC(e){return e.addReducers({configuration:ze}),!0}function tf(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(_o(t.options.result)))};return ef(e,t,()=>{n()})}d();c();l();u();d();c();l();u();d();c();l();u();var ZC=["caseId","caseNumber"],eb={caseId:"caseContext",caseNumber:"caseContext"},Dn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${eb[t]} to set this value.}`)}};function Ks(e){return ZC.includes(e)}var tb=new Fe({values:new K({options:{required:!1}})});function rf(e,t={}){if(!ob(e))throw Ge;let r=_t(e),{dispatch:n}=e,o=()=>e.state,i=Cu(e,tb,t.initialState,"buildContext");return i.values&&n(Kt(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(Kt(a))},...(o().configuration.analytics.analyticsMode==="legacy"?rb(n):nb(n))}}var rb=e=>({add(t,r){e(Yt({contextKey:t,contextValue:r}))},remove(t){e(Jt(t))}}),nb=e=>({add(t,r){if(Ks(t))throw new Dn(t);e(Yt({contextKey:t,contextValue:r}))},remove(t){if(Ks(t))throw new Dn(t);e(Jt(t))}});function ob(e){return e.addReducers({context:oi}),!0}function nf(e,t){return rf(e,t)}d();c();l();u();function of(e){if(!ib(e))throw Ge;let t=_t(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Nr(o))},add(o,i){r(_r({field:o,key:i}))},remove(o){r(Vr(o))}}}function ib(e){return e.addReducers({dictionaryFieldContext:ai}),!0}d();c();l();u();d();c();l();u();var ab=new Fe({content:new fe({required:!0}),conditions:new fe({required:!0}),priority:new J({required:!1,default:0,min:0}),fields:new ie({required:!1,each:G})});function af(){let e=[],t=r=>{let n=ab.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new Kr("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function sf(e){if(!sb(e))throw Ge;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=af();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Lr(i))},selectTemplate:r,selectLinkTemplate:n}}function sb(e){return e.addReducers({fields:di}),!0}/**
|
|
32
32
|
* @license
|
|
33
33
|
*
|
|
34
34
|
* Copyright 2025 Coveo Solutions Inc.
|
|
@@ -44,4 +44,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
44
44
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
45
45
|
* See the License for the specific language governing permissions and
|
|
46
46
|
* limitations under the License.
|
|
47
|
-
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
47
|
+
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
48
|
+
|
|
49
|
+
window.coveoQuanticVersion = '3.25.1-pre.1b995035ea';
|