1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[157],{417:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("arrow-up-a-z",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]])},2298:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var a=r.length+1;if(1===a)return e;var s=Array(a);s[0]=i(e);for(var o=1;o<a;o++)s[o]=i(r[o]);return s.join(" ")}if("string"!=typeof e)return e;var l=r.length;if(0===l)return e;for(var u="",c=0,d=-1,h=e&&e.length||0,p=0;p<h;){if(37===e.charCodeAt(p)&&p+1<h){switch(d=d>-1?d:0,e.charCodeAt(p+1)){case 100:case 102:if(c>=l||null==r[c])break;d<p&&(u+=e.slice(d,p)),u+=Number(r[c]),d=p+2,p++;break;case 105:if(c>=l||null==r[c])break;d<p&&(u+=e.slice(d,p)),u+=Math.floor(Number(r[c])),d=p+2,p++;break;case 79:case 111:case 106:if(c>=l||void 0===r[c])break;d<p&&(u+=e.slice(d,p));var f=typeof r[c];if("string"===f){u+="'"+r[c]+"'",d=p+2,p++;break}if("function"===f){u+=r[c].name||"<anonymous>",d=p+2,p++;break}u+=i(r[c]),d=p+2,p++;break;case 115:if(c>=l)break;d<p&&(u+=e.slice(d,p)),u+=String(r[c]),d=p+2,p++;break;case 37:d<p&&(u+=e.slice(d,p)),u+="%",d=p+2,p++,c--}++c}++p}return -1===d?e:(d<h&&(u+=e.slice(d)),u)}},2959:(e,t,r)=>{"use strict";let n,i=r(14120),{stdout:a,stderr:s}=r(42784),{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:l}=r(73497),{isArray:u}=Array,c=["ansi","ansi","ansi256","ansi16m"],d=Object.create(null);class h{constructor(e){return p(e)}}let p=e=>{let t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=a?a.level:0;e.level=void 0===t.level?r:t.level})(t,e),t.template=(...e)=>w(t.template,...e),Object.setPrototypeOf(t,f.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=h,t.template};function f(e){return p(e)}for(let[e,t]of Object.entries(i))d[e]={get(){let r=v(this,y(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};d.visible={get(){let e=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};let g=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of g)d[e]={get(){let{level:t}=this;return function(...r){return v(this,y(i.color[c[t]][e](...r),i.color.close,this._styler),this._isEmpty)}}};for(let e of g)d["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...r){return v(this,y(i.bgColor[c[t]][e](...r),i.bgColor.close,this._styler),this._isEmpty)}}};let m=Object.defineProperties(()=>{},{...d,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),y=(e,t,r)=>{let n,i;return void 0===r?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},v=(e,t,r)=>{let n=(...e)=>u(e[0])&&u(e[0].raw)?b(n,w(n,...e)):b(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,m),n._generator=e,n._styler=t,n._isEmpty=r,n},b=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(void 0===r)return t;let{openAll:n,closeAll:i}=r;if(-1!==t.indexOf("\x1b"))for(;void 0!==r;)t=o(t,r.close,r.open),r=r.parent;let a=t.indexOf("\n");return -1!==a&&(t=l(t,i,n,a)),n+t+i},w=(e,...t)=>{let[i]=t;if(!u(i)||!u(i.raw))return t.join(" ");let a=t.slice(1),s=[i.raw[0]];for(let e=1;e<i.length;e++)s.push(String(a[e-1]).replace(/[{}\\]/g,"\\$&"),String(i.raw[e]));return void 0===n&&(n=r(37028)),n(e,s.join(""))};Object.defineProperties(f.prototype,d);let S=p(void 0);S.supportsColor=a,S.stderr=p({level:s?s.level:0}),S.stderr.supportsColor=s,e.exports=S},4886:(e,t,r)=>{"use strict";r.d(t,{n:()=>o});var n=r(12115),i=r(4291),a=r(62162),s=r(84956);let o=({page:e,componentMap:t,loadServerImportMap:r})=>{var o;let{route:l}=e.layout.sitecore;if(!l)return null;let u=null==(o=null==l?void 0:l.placeholders[i.TB])?void 0:o[0],c=t.get((null==u?void 0:u.componentName)||""),d=c&&"client"===c.componentType;return n.createElement(n.Fragment,null,d?n.createElement(s.DesignLibrary,null):n.createElement(a.j,{page:e,componentMap:t,loadServerImportMap:r,rendering:l}))}},6817:(e,t,r)=>{"use strict";r.d(t,{l4:()=>ef,J1:()=>eb});let n=JSON,i=/\r\n|[\n\r]/g;function a(e,t){let r=0,n=1;
1for(let a of e.body.matchAll(i)){if("number"==typeof a.index||function(e){if(!e)throw Error("Unexpected invariant triggered.")}(!1),a.index>=t)break;r=a.index+a[0].length,n+=1}return{line:n,column:t+1-r}}function s(e,t){let r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,s=t.line+a,l=1===t.line?r:0,u=t.column+l,c=`${e.name}:${s}:${u} 2`,d=n.split(/\r\n|[\n\r]/g),h=d[i];if(h.length>120){let e=Math.floor(u/80),t=[];for(let e=0;e<h.length;e+=80)t.push(h.slice(e,e+80));return c+o([[`${s} |`,t[0]],...t.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(u%80)],["|",t[e+1]]])}return c+o([[`${s-1} |`,d[i-1]],[`${s} |`,h],["|","^".padStart(u)],[`${s+1} |`,d[i+1]]])}function o(e){let t=e.filter(([e,t])=>void 0!==t),r=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(r)+(t?" "+t:"")).join("\n")}class l extends Error{constructor(e,...t){var r,n,i;const{nodes:s,source:o,positions:c,path:d,originalError:h,extensions:p}=function(e){let t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=d?d:void 0,this.originalError=null!=h?h:void 0,this.nodes=u(Array.isArray(s)?s:s?[s]:void 0);const f=u(null==(r=this.nodes)?void 0:r.map(e=>e.loc).filter(e=>null!=e));this.source=null!=o?o:null==f||null==(n=f[0])?void 0:n.source,this.positions=null!=c?c:null==f?void 0:f.map(e=>e.start),this.locations=c&&o?c.map(e=>a(o,e)):null==f?void 0:f.map(e=>a(e.source,e.start));const g=!function(e){return"object"==typeof e&&null!==e}(null==h?void 0:h.extensions)||null==h?void 0:h.extensions;this.extensions=null!=(i=null!=p?p:g)?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=h&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,l):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(let r of this.nodes){var t;r.loc&&(e+="\n\n"+s((t=r.loc).source,a(t.source,t.start)))}else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+s(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function u(e){return void 0===e||0===e.length?void 0:e}function c(e,t,r){return new l(`Syntax Error: ${r}`,{source:e,positions:[t]})}class d{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class h{constructor(e,t,r,n,i,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}let p={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},f=new Set(Object.keys(p));function g(e){let t=null==e?void 0:e.kind;return"string"==typeof t&&f.has(t)}function m(e){return 9===e||32===e}function y(e){return e>=48&&e<=57}function v(e){return e>=97&&e<=122||e>=65&&e<=90}function b(e){return v(e)||95===e}(Y=ee||(ee={})).QUERY="query",Y.MUTATION="mutation",Y.SUBSCRIPTION="subscription",(W=et||(et={})).QUERY="QUERY",W.MUTATION="MUTATION",W.SUBSCRIPTION="SUBSCRIPTION",W.FIELD="FIELD",W.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",W.FRAGMENT_SPREAD="FRAGMENT_SPREAD",W.INLINE_FRAGMENT="INLINE_FRAGMENT",W.VARIABLE_DEFINITION="VARIABLE_DEFINITION",W.SCHEMA="SCHEMA",W.SCALAR="SCALAR",W.OBJECT="OBJECT",W.FIELD_DEFINITION="FIELD_DEFINITION",W.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",W.INTERFACE="INTERFACE",W.UNION="UNION",W.ENUM="ENUM",W.ENUM_VALUE="ENUM_VALUE",W.INPUT_OBJECT="INPUT_OBJECT",W.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",(J=er||(er={})).NAME="Name",J.DOCUMENT="Document",J.OPERATION_DEFINITION="OperationDefinition",J.VARIABLE_DEFINITION="VariableDefinition",J.SELECTION_SET="SelectionSet",J.FIELD="Field",J.ARGUMENT="Argument",J.FRAGMENT_SPREAD="FragmentSpread",J.INLINE_FRAGMENT="InlineFragment",J.FRAGMENT_DEFINITION="FragmentDefinition",J.VARIABLE="Variable",J.INT="IntValue",J.FLOAT="FloatValue",J.STRING="Str
2ingValue",J.BOOLEAN="BooleanValue",J.NULL="NullValue",J.ENUM="EnumValue",J.LIST="ListValue",J.OBJECT="ObjectValue",J.OBJECT_FIELD="ObjectField",J.DIRECTIVE="Directive",J.NAMED_TYPE="NamedType",J.LIST_TYPE="ListType",J.NON_NULL_TYPE="NonNullType",J.SCHEMA_DEFINITION="SchemaDefinition",J.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",J.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",J.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",J.FIELD_DEFINITION="FieldDefinition",J.INPUT_VALUE_DEFINITION="InputValueDefinition",J.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",J.UNION_TYPE_DEFINITION="UnionTypeDefinition",J.ENUM_TYPE_DEFINITION="EnumTypeDefinition",J.ENUM_VALUE_DEFINITION="EnumValueDefinition",J.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",J.DIRECTIVE_DEFINITION="DirectiveDefinition",J.SCHEMA_EXTENSION="SchemaExtension",J.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",J.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",J.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",J.UNION_TYPE_EXTENSION="UnionTypeExtension",J.ENUM_TYPE_EXTENSION="EnumTypeExtension",J.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",J.TYPE_COORDINATE="TypeCoordinate",J.MEMBER_COORDINATE="MemberCoordinate",J.ARGUMENT_COORDINATE="ArgumentCoordinate",J.DIRECTIVE_COORDINATE="DirectiveCoordinate",J.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",(X=en||(en={})).SOF="<SOF>",X.EOF="<EOF>",X.BANG="!",X.DOLLAR="$",X.AMP="&",X.PAREN_L="(",X.PAREN_R=")",X.DOT=".",X.SPREAD="...",X.COLON=":",X.EQUALS="=",X.AT="@",X.BRACKET_L="[",X.BRACKET_R="]",X.BRACE_L="{",X.PIPE="|",X.BRACE_R="}",X.NAME="Name",X.INT="Int",X.FLOAT="Float",X.STRING="String",X.BLOCK_STRING="BlockString",X.COMMENT="Comment";class w{constructor(e){const t=new h(en.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==en.EOF)do if(e.next)e=e.next;else{let t=function(e,t){let r=e.source.body,n=r.length,i=t;for(;i<n;){let t=r.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return function(e,t){let r=e.source.body,n=r.length,i=t+1;for(;i<n;){let e=r.charCodeAt(i);if(10===e||13===e)break;if(S(e))++i;else if(E(r,i))i+=2;else break}return I(e,en.COMMENT,t,i,r.slice(t+1,i))}(e,i);case 33:return I(e,en.BANG,i,i+1);case 36:return I(e,en.DOLLAR,i,i+1);case 38:return I(e,en.AMP,i,i+1);case 40:return I(e,en.PAREN_L,i,i+1);case 41:return I(e,en.PAREN_R,i,i+1);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return I(e,en.SPREAD,i,i+3);break;case 58:return I(e,en.COLON,i,i+1);case 61:return I(e,en.EQUALS,i,i+1);case 64:return I(e,en.AT,i,i+1);case 91:return I(e,en.BRACKET_L,i,i+1);case 93:return I(e,en.BRACKET_R,i,i+1);case 123:return I(e,en.BRACE_L,i,i+1);case 124:return I(e,en.PIPE,i,i+1);case 125:return I(e,en.BRACE_R,i,i+1);case 34:if(34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2))return function(e,t){let r=e.source.body,n=r.length,i=e.lineStart,a=t+3,s=a,o="",l=[];for(;a<n;){let n=r.charCodeAt(a);if(34===n&&34===r.charCodeAt(a+1)&&34===r.charCodeAt(a+2)){o+=r.slice(s,a),l.push(o);let n=I(e,en.BLOCK_STRING,t,a+3,(function(e){var t,r;let n=Number.MAX_SAFE_INTEGER,i=null,a=-1;for(let t=0;t<e.length;++t){let s=e[t],o=function(e){let t=0;for(;t<e.length&&m(e.charCodeAt(t));)++t;return t}(s);o!==s.length&&(i=null!=(r=i)?r:t,a=t,0!==t&&o<n&&(n=o))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!=(t=i)?t:0,a+1)})(l).join("\n"));return e.line+=l.length-1,e.lineStart=i,n}if(92===n&&34===r.charCodeAt(a+1)&&34===r.charCodeAt(a+2)&&34===r.charCodeAt(a+3)){o+=r.slice(s,a),s=a+1,a+=4;continue}if(10===n||13===n){o+=r.slice(s,a),l.push(o),13===n&&10===r.charCodeAt(a+1)?a+=2:++a,o="",s=a,i=a;continue}if(S(n))++a;else if(E(r,a))a+=2;else throw c(e.source,a,`Invalid character within String: ${k(e,a)}.`)}throw c(e.source,a,"Unterminated string.")}(e,i);return function(e,t){let r=e.source.body,n=r.length,i=t+1,a=i,s="";for(;i<n;){let n=r.charCodeAt(i);if(34===n)return s+=r.slice(a,i),I(e,en.STRING,t,i+1,s);if(92===n){s+=r.slice(a,i);let t=117===r.charCodeAt(i+1)?123===r.charCodeAt(i+2)?function(e,t){let r=e.source.body,n=0,i=3;for(;i<12;){let e=r.charCodeAt(t+i++);if(125===e){if(i<5||!S(n))break;return{value:String.fromCodePoint(n),size:i}}if((n=n<<4|T(e))<0)break}throw c(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}(e,i):function(e,t){let r=e.source.body,n=A(r,t+2);if(S(n))return{value:String.fromCodePoint(n),size:6};if(_(n)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){let e=A(r,t+8);
2if(C(e))return{value:String.fromCodePoint(n,e),size:12}}throw c(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}(e,i):function(e,t){let r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}(e,i);s+=t.value,i+=t.size,a=i;continue}if(10===n||13===n)break;if(S(n))++i;else if(E(r,i))i+=2;else throw c(e.source,i,`Invalid character within String: ${k(e,i)}.`)}throw c(e.source,i,"Unterminated string.")}(e,i)}if(y(t)||45===t)return function(e,t,r){let n=e.source.body,i=t,a=r,s=!1;if(45===a&&(a=n.charCodeAt(++i)),48===a){if(y(a=n.charCodeAt(++i)))throw c(e.source,i,`Invalid number, unexpected digit after 0: ${k(e,i)}.`)}else i=x(e,i,a),a=n.charCodeAt(i);if(46===a&&(s=!0,a=n.charCodeAt(++i),i=x(e,i,a),a=n.charCodeAt(i)),(69===a||101===a)&&(s=!0,(43===(a=n.charCodeAt(++i))||45===a)&&(a=n.charCodeAt(++i)),i=x(e,i,a),a=n.charCodeAt(i)),46===a||b(a))throw c(e.source,i,`Invalid number, expected digit but got: ${k(e,i)}.`);return I(e,s?en.FLOAT:en.INT,t,i,n.slice(t,i))}(e,i,t);if(b(t))return function(e,t){let r=e.source.body,n=r.length,i=t+1;for(;i<n;){var a;if(v(a=r.charCodeAt(i))||y(a)||95===a)++i;else break}return I(e,en.NAME,t,i,r.slice(t,i))}(e,i);throw c(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":S(t)||E(r,i)?`Unexpected character: ${k(e,i)}.`:`Invalid character: ${k(e,i)}.`)}return I(e,en.EOF,n,n)}(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===en.COMMENT);return e}}function S(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function E(e,t){return _(e.charCodeAt(t))&&C(e.charCodeAt(t+1))}function _(e){return e>=55296&&e<=56319}function C(e){return e>=56320&&e<=57343}function k(e,t){let r=e.source.body.codePointAt(t);if(void 0===r)return en.EOF;if(r>=32&&r<=126){let e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function I(e,t,r,n,i){let a=e.line,s=1+r-e.lineStart;return new h(t,r,n,a,s,i)}function x(e,t,r){if(!y(r))throw c(e.source,t,`Invalid number, expected digit but got: ${k(e,t)}.`);let n=e.source.body,i=t+1;for(;y(n.charCodeAt(i));)++i;return i}function A(e,t){return T(e.charCodeAt(t))<<12|T(e.charCodeAt(t+1))<<8|T(e.charCodeAt(t+2))<<4|T(e.charCodeAt(t+3))}function T(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function O(e,t){if(!e)throw Error(t)}function N(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){let r;if(null===e)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if("function"==typeof e.toJSON){let t=e.toJSON();if(t!==e)return"string"==typeof t?t:N(t,n)}else if(Array.isArray(e)){var i,a,s=e,o=n;if(0===s.length)return"[]";if(o.length>2)return"[Array]";let t=Math.min(10,s.length),r=s.length-t,l=[];for(let e=0;e<t;++e)l.push(N(s[e],o));return 1===r?l.push("... 1 more item"):r>1&&l.push(`... ${r} more items`),"["+l.join(", ")+"]"}return i=e,a=n,0===(r=Object.entries(i)).length?"{}":a.length>2?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(i)+"]":"{ "+r.map(([e,t])=>e+": "+N(t,a)).join(", ")+" }"}(e,t);default:return String(e)}}let R=globalThis.process&&1?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var r;let n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null==(r=e.constructor)?void 0:r.name)){let t=N(e,[]);throw Error(`Cannot use ${n} "${t}" from another module or realm. 3 4Ensure that there is only one instance of "graphql" in the node_modules 5directory. If different versions of "graphql" are the dependencies of other 6relied on modules, use "resolutions" to ensure only one version is installed. 7 8https://yarnpkg.com/en/docs/selective-version-resolutions 9 10Duplicate "graphql" modules cannot be used at the same time since different 11versions may have different capabilities and behavior. The data from one 12version used in the function from another could produce confusing and 13spurious results.`)}}return!1};class D{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||O(!1,`Body must be a string. Received: ${function(e){return N(e,[])}(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||O(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||O(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class P{constructor(e,t={}){const{lexer:r,...n}=t;if(r)this._lexer=r;else{const t=!function(e){return R(e,D)}(e)?new D(e):e;this._lexer=new w(t)}this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(en.NAME);return this.node(e,{kind:er.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:er.DOCUMENT,definitions:this.many(en.SOF,this.parseDefinition,en.EOF)})}parseDefinition(){if(this.peek(en.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;
13if(e&&t.kind===en.BRACE_L)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===en.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){let e,t=this._lexer.token;if(this.peek(en.BRACE_L))return this.node(t,{kind:er.OPERATION_DEFINITION,operation:ee.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let r=this.parseDescription(),n=this.parseOperationType();return this.peek(en.NAME)&&(e=this.parseName()),this.node(t,{kind:er.OPERATION_DEFINITION,operation:n,description:r,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(en.NAME);switch(e.value){case"query":return ee.QUERY;case"mutation":return ee.MUTATION;case"subscription":return ee.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(en.PAREN_L,this.parseVariableDefinition,en.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:er.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(en.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(en.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(en.DOLLAR),this.node(e,{kind:er.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:er.SELECTION_SET,selections:this.many(en.BRACE_L,this.parseSelection,en.BRACE_R)})}parseSelection(){return this.peek(en.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(en.COLON)?(e=n,t=this.parseName()):t=n,this.node(r,{kind:er.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(en.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(en.PAREN_L,t,en.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,r=this.parseName();return this.expectToken(en.COLON),this.node(t,{kind:er.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(en.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(en.NAME)?this.node(e,{kind:er.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:er.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return(this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables)?this.node(e,{kind:er.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:er.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case en.BRACKET_L:return this.parseList(e);case en.BRACE_L:return this.parseObject(e);case en.INT:return this.advanceLexer(),this.node(t,{kind:er.INT,value:t.value});case en.FLOAT:return this.advanceLexer(),this.node(t,{kind:er.FLOAT,value:t.value});case en.STRING:case en.BLOCK_STRING:return this.parseStringLiteral();case en.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:er.BOOLEAN,value:!0});case"false":return this.node(t,{kind:er.BOOLEAN,value:!1});case"null":return this.node(t,{kind:er.NULL});default:return this.node(t,{kind:er.ENUM,value:t.value})}case en.DOLLAR:if(e){if(this.expectToken(en.DOLLAR),this._lexer.token.kind===e
13n.NAME){let e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:er.STRING,value:e.value,block:e.kind===en.BLOCK_STRING})}parseList(e){let t=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:er.LIST,values:this.any(en.BRACKET_L,t,en.BRACKET_R)})}parseObject(e){let t=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:er.OBJECT,fields:this.any(en.BRACE_L,t,en.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,r=this.parseName();return this.expectToken(en.COLON),this.node(t,{kind:er.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(en.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(en.AT),this.node(t,{kind:er.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e,t=this._lexer.token;if(this.expectOptionalToken(en.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(en.BRACKET_R),e=this.node(t,{kind:er.LIST_TYPE,type:r})}else e=this.parseNamedType();return this.expectOptionalToken(en.BANG)?this.node(t,{kind:er.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:er.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(en.STRING)||this.peek(en.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),n=this.many(en.BRACE_L,this.parseOperationTypeDefinition,en.BRACE_R);return this.node(e,{kind:er.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(en.COLON);let r=this.parseNamedType();return this.node(e,{kind:er.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:er.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:er.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(en.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(en.BRACE_L,this.parseFieldDefinition,en.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(en.COLON);let i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:er.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(en.PAREN_L,this.parseInputValueDef,en.PAREN_R)}parseInputValueDef(){let e,t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(en.COLON);let i=this.parseTypeReference();this.expectOptionalToken(en.EQUALS)&&(e=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:er.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:e,directives:a})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:er.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:er.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(en.EQUALS)?this.delimitedMany(en.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:er.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i})}parseEnumValuesDefinition(){return this.optionalMany(en.BRACE_L,this.parseEnumValueDefinition,en.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:er.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${M(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:er.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(en.BRACE_L,this.parseInputValueDef,en.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();
13if(e.kind===en.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),r=this.optionalMany(en.BRACE_L,this.parseOperationTypeDefinition,en.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:er.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:er.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:er.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:er.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:er.UNION_TYPE_EXTENSION,name:t,directives:r,types:n})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:er.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:er.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(en.AT);let r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(e,{kind:er.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a})}parseDirectiveLocations(){return this.delimitedMany(en.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(et,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e,t,r=this._lexer.token,n=this.expectOptionalToken(en.AT),i=this.parseName();return(!n&&this.expectOptionalToken(en.DOT)&&(e=this.parseName()),(n||e)&&this.expectOptionalToken(en.PAREN_L)&&(t=this.parseName(),this.expectToken(en.COLON),this.expectToken(en.PAREN_R)),n)?t?this.node(r,{kind:er.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:t}):this.node(r,{kind:er.DIRECTIVE_COORDINATE,name:i}):e?t?this.node(r,{kind:er.ARGUMENT_COORDINATE,name:i,fieldName:e,argumentName:t}):this.node(r,{kind:er.MEMBER_COORDINATE,name:i,memberName:e}):this.node(r,{kind:er.TYPE_COORDINATE,name:i})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new d(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${j(e)}, found ${M(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;
13if(t.kind===en.NAME&&t.value===e)this.advanceLexer();else throw c(this._lexer.source,t.start,`Expected "${e}", found ${M(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===en.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=null!=e?e:this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${M(t)}.`)}any(e,t,r){this.expectToken(e);let n=[];for(;!this.expectOptionalToken(r);)n.push(t.call(this));return n}optionalMany(e,t,r){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(r));return e}return[]}many(e,t,r){this.expectToken(e);let n=[];do n.push(t.call(this));while(!this.expectOptionalToken(r));return n}delimitedMany(e,t){this.expectOptionalToken(e);let r=[];do r.push(t.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==en.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function M(e){let t=e.value;return j(e.kind)+(null!=t?` "${t}"`:"")}function j(e){return e===en.BANG||e===en.DOLLAR||e===en.AMP||e===en.PAREN_L||e===en.PAREN_R||e===en.DOT||e===en.SPREAD||e===en.COLON||e===en.EQUALS||e===en.AT||e===en.BRACKET_L||e===en.BRACKET_R||e===en.BRACE_L||e===en.PIPE||e===en.BRACE_R?`"${e}"`:e}let F=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function L(e){return q[e.charCodeAt(0)]}let q=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],$=Object.freeze({}),U={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>V(e.definitions,"\n\n")},OperationDefinition:{leave(e){let t=Q(e.variableDefinitions)?G("(\n",V(e.variableDefinitions,"\n"),"\n)"):G("(",V(e.variableDefinitions,", "),")"),r=G("",e.description,"\n")+V([e.operation,V([e.name,t]),V(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n,description:i})=>G("",i,"\n")+e+": "+t+G(" = ",r)+G(" ",V(n," "))},SelectionSet:{leave:({selections:e})=>z(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){let a=G("",e,": ")+t,s=a+G("(",V(r,", "),")");return s.length>80&&(s=a+G("(\n",B(V(r,"\n")),"\n)")),V([s,V(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+G(" ",V(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>V(["...",G("on ",e),V(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i,description:a})=>G("",a,"\n")+`fragment ${e}${G("(",V(r,", "),")")} `+`on ${t} ${G("",V(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>{let r,n,i,a,s,o,l,u,c,d,h;return t?(i=1===(n=(r=e.replace(/"""/g,'\\"""')).split(/\r\n|[\n\r]/g)).length,a=n.length>1&&n.slice(1).every(e=>0===e.length||m(e.charCodeAt(0))),s=r.endsWith('\\"""'),o=e.endsWith('"')&&!s,l=e.endsWith("\\"),u=o||l,c=!i||e.length>70||u||a||s,d="",h=i&&m(e.charCodeAt(0)),(c&&!h||a)&&(d+="\n"),d+=r,(c||u)&&(d+="\n"),'"""'+d+'"""'):`"${e.replace(F,L)}"`}},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+V(e,", ")+"]"}
13,ObjectValue:{leave:({fields:e})=>"{"+V(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+G("(",V(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>G("",e,"\n")+V(["schema",V(t," "),z(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>G("",e,"\n")+V(["scalar",t,V(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>G("",e,"\n")+V(["type",t,G("implements ",V(r," & ")),V(n," "),z(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>G("",e,"\n")+t+(Q(r)?G("(\n",B(V(r,"\n")),"\n)"):G("(",V(r,", "),")"))+": "+n+G(" ",V(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>G("",e,"\n")+V([t+": "+r,G("= ",n),V(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>G("",e,"\n")+V(["interface",t,G("implements ",V(r," & ")),V(n," "),z(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>G("",e,"\n")+V(["union",t,V(r," "),G("= ",V(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>G("",e,"\n")+V(["enum",t,V(r," "),z(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>G("",e,"\n")+V([t,V(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>G("",e,"\n")+V(["input",t,V(r," "),z(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>G("",e,"\n")+"directive @"+t+(Q(r)?G("(\n",B(V(r,"\n")),"\n)"):G("(",V(r,", "),")"))+(n?" repeatable":"")+" on "+V(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>V(["extend schema",V(e," "),z(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>V(["extend scalar",e,V(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>V(["extend type",e,G("implements ",V(t," & ")),V(r," "),z(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>V(["extend interface",e,G("implements ",V(t," & ")),V(r," "),z(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>V(["extend union",e,V(t," "),G("= ",V(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>V(["extend enum",e,V(t," "),z(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>V(["extend input",e,V(t," "),z(r)]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>V([e,G(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:r})=>V([e,G(".",t),G("(",r,":)")])},DirectiveCoordinate:{leave:({name:e})=>V(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>V(["@",e,G("(",t,":)")])}};function V(e,t=""){var r;return null!=(r=null==e?void 0:e.filter(e=>e).join(t))?r:""}function z(e){return G("{\n",B(V(e,"\n")),"\n}")}function G(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function B(e){return G(" ",e.replace(/\n/g,"\n "))}function Q(e){var t;return null!=(t=null==e?void 0:e.some(e=>e.includes("\n")))&&t}let H=e=>{let t,r=e.definitions.filter(e=>"OperationDefinition"===e.kind);return 1===r.length&&(t=r[0]?.name?.value),t},Z=e=>{if("string"==typeof e){let t;try{let r,n,i=(n=(r=new P(e,void 0)).parseDocument(),Object.defineProperty(n,"tokenCount",{enumerable:!1,value:r.tokenCount}),n);t=H(i)}catch(e){}return{query:e,operationName:t}}let t=H(e);return{query:function(e,t,r=p){let n,i,a,s=new Map;for(let e of Object.values(er))s.set(e,function(e,t){let r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}(t,e));let o=Array.isArray(e),l=[e],u=-1,c=[],d=e,h=[],f=[];do{var m,y,v;let e,p=++u===l.length,b=p&&0!==c.length;if(p){if(i=0===f.length?void 0:h[h.length-1],d=a,a=f.pop(),b)if(o){d=d.slice();let e=0;for(let[t,r]of c){let n=t-e;null===r?(d.splice(n,1),e++):d[n]=r}}else for(let[e,t]of(d={...d},c))d[e]=t;u=n.index,l=n.keys,c=n.edits,o=n.inArray,n=n.prev}else if(a){if(null==(d=a[i=o?u:l[u]]))continue;h.push(i)}if(!Array.isArray(d)){g(d)||O(!1,`Invalid AST Node: ${N(d,[])}.`);
13let r=p?null==(m=s.get(d.kind))?void 0:m.leave:null==(y=s.get(d.kind))?void 0:y.enter;if((e=null==r?void 0:r.call(t,d,i,a,h,f))===$)break;if(!1===e){if(!p){h.pop();continue}}else if(void 0!==e&&(c.push([i,e]),!p))if(g(e))d=e;else{h.pop();continue}}void 0===e&&b&&c.push([i,d]),p?h.pop():(n={inArray:o,index:u,keys:l,edits:c,prev:n},l=(o=Array.isArray(d))?d:null!=(v=r[d.kind])?v:[],u=-1,c=[],a&&f.push(a),a=d)}while(void 0!==n);return 0!==c.length?c[c.length-1][1]:e}(e,U),operationName:t}};class K extends Error{constructor(e,t){super(`${K.extractMessage(e)}: ${JSON.stringify({response:e,request:t})}`),Object.setPrototypeOf(this,K.prototype),this.response=e,this.request=t,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,K)}static extractMessage(e){return e.errors?.[0]?.message??`GraphQL Error (Code: ${e.status})`}}var Y,W,J,X,ee,et,er,en,ei=r(79442),ea=r.t(ei,2);let es="ping",eo="pong",el="complete";class eu{get type(){return this._type}get id(){return this._id}get payload(){return this._payload}constructor(e,t,r){this._type=e,this._payload=t,this._id=r}get text(){let e={type:this.type};return null!=this.id&&void 0!=this.id&&(e.id=this.id),null!=this.payload&&void 0!=this.payload&&(e.payload=this.payload),JSON.stringify(e)}static parse(e,t){let{type:r,payload:n,id:i}=JSON.parse(e);return new eu(r,t(n),i)}}class ec{constructor(e,{onInit:t,onAcknowledged:r,onPing:n,onPong:i}){this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.addEventListener("open",async r=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={},e.send(new eu("connection_init",t?await t():null).text)}),e.addEventListener("close",e=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={}}),e.addEventListener("error",e=>{console.error(e)}),e.addEventListener("message",t=>{try{let a=function(e,t=e=>e){return eu.parse(e,t)}(t.data);switch(a.type){case"connection_ack":this.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(this.socketState.acknowledged=!0,r&&r(a.payload));return;case es:n?n(a.payload).then(t=>e.send(ed(t).text)):e.send(ed(null).text);return;case eo:i&&i(a.payload);return}if(!this.socketState.acknowledged||void 0===a.id||null===a.id||!this.socketState.subscriptions[a.id])return;let{query:s,variables:o,subscriber:l}=this.socketState.subscriptions[a.id];switch(a.type){case"next":!a.payload.errors&&a.payload.data&&l.next&&l.next(a.payload.data),a.payload.errors&&l.error&&l.error(new K({...a.payload,status:200},{query:s,variables:o}));return;case"error":l.error&&l.error(new K({errors:a.payload,status:200},{query:s,variables:o}));return;case el:l.complete&&l.complete(),delete this.socketState.subscriptions[a.id];return}}catch(t){console.error(t),e.close(1006)}e.close(4400,"Unknown graphql-ws message.")})}makeSubscribe(e,t,r,n){let i=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[i]={query:e,variables:n,subscriber:r},this.socket.send(new eu("subscribe",{query:e,operationName:t,variables:n},i).text),()=>{this.socket.send(new eu(el,void 0,i).text),delete this.socketState.subscriptions[i]}}rawRequest(e,t){return new Promise((r,n)=>{let i;this.rawSubscribe(e,{next:(e,t)=>i={data:e,extensions:t},error:n,complete:()=>r(i)},t)})}request(e,t){return new Promise((r,n)=>{let i;this.subscribe(e,{next:e=>i=e,error:n,complete:()=>r(i)},t)})}subscribe(e,t,r){let{query:n,operationName:i}=Z(e);return this.makeSubscribe(n,i,t,r)}rawSubscribe(e,t,r){return this.makeSubscribe(e,void 0,t,r)}ping(e){this.socket.send(new eu(es,e,void 0).text)}close(){this.socket.close(1e3)}}function ed(e){return new eu(eo,e,void 0)}ec.PROTOCOL="graphql-transport-ws";let eh=e=>{let t={};if(e)if("u">typeof Headers&&e instanceof Headers||ea&&ei.Headers&&e instanceof ei.Headers){let r;r={},e.forEach((e,t)=>{r[t]=e}),t=r}else Array.isArray(e)?e.forEach(([e,r])=>{e&&void 0!==r&&(t[e]=r)}):t=e;return t},ep=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim();class ef{constructor(e,t={}){this.url=e,this.requestConfig=t,this.rawRequest=async(...e)=>{let[t,r,n]=e,i=t.query?t:{query:t,variables:r,requestHeaders:n,signal:void 0},{headers:a,fetch:s=ei,method:o="POST",requestMiddleware:l,responseMiddleware:u,...c}=this.requestConfig,{url:d}=this;void 0!==i.signal&&(c.signal=i.signal);let{operationName:h}=Z(i.query);return eg({url:d,query:i.query,variables:i.variables,headers:{...eh(ev(a)),...eh(i.requestHeaders)},operationName:h,fetch:s,method:o,fetchOptions:c,middleware:l}).then(e=>(u&&u(e),e)).catch(e=>{throw u&&u(e),e})}}async request(e,...t){let[r,n]=t,i=e.document?e:{document:e,variables:r,requestHeaders:n,signal:void 0},{headers:a,fetch:s=ei,method:o="POST",requestMiddleware:l,responseMiddleware:u,...c}=this.requestConfig,{url:d}=this;void 0!==i.signal&&(c.signal=i.signal);let{query:h,operationName:p}=Z(i.document);return eg({url:d,query:h,variables:i.variables,headers:{...eh(ev(a)),...eh(i.requestHeaders)},operationName:p,fetch:s,method:o,fetchOptions:c,middleware:l}).then(e=>(u&&u(e),e.data)).catch(e=>{throw u&&u(e),e})}batchRequests(e,t){let r=e.documents?e:{documents:e,requestHeaders:t,signal:void 0},{headers:n,...i}=this.requestConfig;void 0!==r.signal&&(i.signal=r.signal);let a=r.documents.map(({document:e})=>Z(e).query),s=r.documents.map(({variables:e})=>e);return eg({url:this.url,query:a,variables:s,headers:{...eh(ev(n)),...eh(r.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??ei,method:this.requestConfig.method||"POST",fetchOptions:i,middleware:this.requestConfig.requestMiddleware}).then(e=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e.data)).catch(e=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,t){let{headers:r}=this.requestConfig;return r?r[e]=t:this.requestConfig.headers={[e]:t},this}setEndpoint(e){return this.url=e,this}}let eg=async e=>{let t,{query:r,variables:i,fetchOptions:a}=e,s=(t=(e.method??"post").toUpperCase(),async e=>{let r,{url:i,query:a,variables:s,operationName:o,fetch:l,fetchOptions:u,middleware:c}=e,d={...e.headers},h="";"POST"===t?"string"==typeof(r=em(a,s,o,u.jsonSerializer))&&(d["Content-Type"]="application/json"):h=(e=>{if(!Array.isArray(e.query)){let t=[`query=${encodeURIComponent(ep(e.query))}`];return e.variables&&t.push(`variables=${encodeURIComponent(e.jsonSerializer.stringify(e.variables))}`),e.operationName&&t.push(`operationName=${encodeURIComponent(e.operationName)}`),t.join("&")}if(void 0!==e.variables&&!Array.isArray(e.variables))throw Error("Cannot create query with given variable type, array expected");let t=e.query.reduce((t,r,n)=>(t.push({query:ep(r),variables:e.variables?e.jsonSerializer.stringify(e.variables[n]):void 0}),t),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(t))}`})({query:a,variables:s,operationName:o,jsonSerializer:u.jsonSerializer??n});let p={method:t,headers:d,body:r,...u},f=i,g=p;if(c){let{url:e,...t}=await Promise.resolve(c({...p,url:i,operationName:o,variables:s}));f=e,g=t}return h&&(f=`${f}?${h}`),await l(f,g)}),o=Array.isArray(e.query),l=await s(e),u=await ey(l,a.jsonSerializer??n),c=Array.isArray(u)?!u.some(({data:e})=>!e):!!u.data,d=Array.isArray(u)||!u.errors||Array.isArray(u.errors)&&!u.errors.length||"all"===a.errorPolicy||"ignore"===a.errorPolicy;if(l.ok&&d&&c){let{errors:e,...t}=(Array.isArray(u),u),r="ignore"===a.errorPolicy?t:u;return{...o?{data:r}:r,headers:l.headers,status:l.status}}throw new K({..."string"==typeof u?{error:u}:u,status:l.status,headers:l.headers},{query:r,variables:i})},em=(e,t,r,i)=>{let a=i??n;if(!Array.isArray(e))return a.stringify({query:e,variables:t,operationName:r});if(void 0!==t&&!Array.isArray(t))throw Error("Cannot create request body with given variable type, array expected");let s=e.reduce((e,r,n)=>(e.push({query:r,variables:t?t[n]:void 0}),e),[]);return a.stringify(s)},ey=async(e,t)=>{let r;
13return(e.headers.forEach((e,t)=>{"content-type"===t.toLowerCase()&&(r=e)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json")))?t.parse(await e.text()):e.text()},ev=e=>"function"==typeof e?e():e,eb=(e,...t)=>e.reduce((e,r,n)=>`${e}${r}${n in t?String(t[n]):""}`,"")},8073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(54440);t.Delay=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise(function(t){return setTimeout(t,e.jitteredDelay)})},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return n.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){return Math.min(this.options.startingDelay*Math.pow(this.options.timeMultiple,this.numOfDelayedAttempts),this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}()},9005:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},9809:(e,t,r)=>{"use strict";r.d(t,{q:()=>u});var n=r(6817),i=r(2651),a=r.n(i),s=r(2665),o=r(10153),l=r(21456);class u{constructor(e,t={}){var r;if(this.endpoint=e,this.headers={},t.apiKey&&(this.headers.sc_apikey=t.apiKey),t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t.contextId&&(this.headers["x-sitecore-contextid"]=t.contextId),!e||!a()(e).hostname)throw Error(`Invalid GraphQL endpoint '${e}'. Verify that appropriate environment variable is set`);this.timeout=t.timeout,this.retries=null!=(r=t.retries)?r:3,this.retryStrategy=t.retryStrategy||new l.H({statusCodes:[429,502,503,504,520,521,522,523,524]}),this.client=new n.l4(e,{headers:this.headers,fetch:t.fetch}),this.debug=t.debugger||s.Ay.http}static createClientFactory({endpoint:e,apiKey:t,contextId:r}){return (n={})=>new u(e,Object.assign(Object.assign({},n),{apiKey:t,contextId:r}))}async request(e,t,r){let n=1,i=async()=>{let a=(null==r?void 0:r.retries)||this.retries,s=(null==r?void 0:r.retryStrategy)||this.retryStrategy,l=(null==r?void 0:r.debugger)||this.debug;l("request: %o",{url:this.endpoint,headers:Object.assign(Object.assign({},this.headers),null==r?void 0:r.headers),query:e,variables:t,timeout:this.timeout});let u=Object.assign(Object.assign({},this.headers),null==r?void 0:r.headers),c=performance.now(),d=[this.client.request(e,t,u)];return this.timeout&&(this.abortTimeout=new o.A(this.timeout),d.push(this.abortTimeout.start)),Promise.race(d).then(e=>{var t;return null==(t=this.abortTimeout)||t.clear(),this.debug("response in %dms: %o",performance.now()-c,e),Promise.resolve(e)},async e=>{var t,r;null==(t=this.abortTimeout)||t.clear(),l("response error: %o",e.response||e.message||e);let o=(null==(r=e.response)?void 0:r.status)||e.code;if(!s.shouldRetry(e,n,a))return Promise.reject(e);{let t=s.getDelay(e,n);return l("Error: %s. Retrying in %dms (attempt %d).",o,t,n),n++,new Promise(e=>setTimeout(e,t)).then(i)}})};return i()}}},9815:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Range:()=>W,Root:()=>K,Slider:()=>D,SliderRange:()=>V,SliderThumb:()=>G,SliderTrack:()=>$,Thumb:()=>J,Track:()=>Y,createSliderScope:()=>O});var n=r(12115),i=r.t(n,2);function a(e,[t,r]){return Math.min(r,Math.max(t,e))}function s(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function l(...e){return t=>{let r=!1,n=e.map(e=>{let n=o(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():o(e[t],null)}}}}function u(...e){return n.useCallback(l(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var c=r(95155);function d(e,t=[]){let r=[],i=()=>{let t=r.map(e=>n.createContext(e));return function(r){let i=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:i}}),[r,i])}};return i.scopeName=e,[function(t,i){let a=n.createContext(i),s=r.length;r=[...r,i];let o=t=>{let{scope:r,children:i,...o}=t,l=r?.[e]?.[s]||a,u=n.useMemo(()=>o,Object.values(o));return(0,c.jsx)(l.Provider,{value:u,children:i})};return o.displayName=t+"Provider",[o,function(r,o){let l=o?.[e]?.[s]||a,u=n.useContext(l);if(u)return u;if(void 0!==i)return i;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=r.reduce((t,{useScope:r,scopeName:n})=>{let i=r(e)[`__scope${n}`];return{...t,...i}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}(i,...t)]}var h=globalThis?.document?n.useLayoutEffect:()=>{},p=i[" useInsertionEffect ".trim().toString()]||h;Symbol("RADIX:SYNC_STATE");var f=n.createContext(void 0);function g(e){var t;let r,i=(t=e,(r=n.forwardRef((e,t)=>
13{let{children:r,...i}=e;if(n.isValidElement(r)){var a;let e,s,o=(a=r,(s=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(s=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),u=function(e,t){let r={...t};for(let n in t){let i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...a}:"className"===n&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}(i,r.props);return r.type!==n.Fragment&&(u.ref=t?l(t,o):o),n.cloneElement(r,u)}return n.Children.count(r)>1?n.Children.only(null):null})).displayName=`${t}.SlotClone`,r),a=n.forwardRef((e,t)=>{let{children:r,...a}=e,s=n.Children.toArray(r),o=s.find(y);if(o){let e=o.props.children,r=s.map(t=>t!==o?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,c.jsx)(i,{...a,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,r):null})}return(0,c.jsx)(i,{...a,ref:t,children:r})});return a.displayName=`${e}.Slot`,a}r(47650);var m=Symbol("radix.slottable");function y(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===m}var v=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=g(`Primitive.${t}`),i=n.forwardRef((e,n)=>{let{asChild:i,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,c.jsx)(i?r:t,{...a,ref:n})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),b=new WeakMap;function w(e,t){var r,n;let i,a,s;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,n=t,i=r.length,(s=(a=S(n))>=0?a:i+a)<0||s>=i?-1:s);return -1===o?void 0:e[o]}function S(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],b.set(this,!0)}set(e,t){return b.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,i=this.has(t),a=this.#e.length,s=S(e),o=s>=0?s:a+s,l=o<0||o>=a?-1:o;if(l===this.size||i&&l===this.size-1||-1===l)return this.set(t,r),this;let u=this.size+ +!i;s<0&&o++;let c=[...this.#e],d=!1;for(let e=o;e<u;e++)if(o===e){let a=c[e];c[e]===t&&(a=c[e+1]),i&&this.delete(t),n=this.get(a),this.set(t,r)}else{d||c[e-1]!==t||(d=!0);let r=c[d?e:e-1],i=n;n=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,n){let i=new e(this);return i.insert(t,r,n),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=w(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=w(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return w(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&n.push(e),i++;return new e(n)}map(t,r){let n=[],i=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(n)}reduce(...e){let[t,r]=e,n=0,i=r??this.at(0);for(let r of this)i=0===n&&1===e.length?r:Reflect.apply(t,this,[i,r,n,this]),n++;return i}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);
13n=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[n,i,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,i=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}});var E=["PageUp","PageDown"],_=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],C={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},k="Slider",[I,x,A]=function(e){let t=e+"CollectionProvider",[r,i]=d(t),[a,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:r}=e,i=n.useRef(null),s=n.useRef(new Map).current;return(0,c.jsx)(a,{scope:t,itemMap:s,collectionRef:i,children:r})};o.displayName=t;let l=e+"CollectionSlot",h=g(l),p=n.forwardRef((e,t)=>{let{scope:r,children:n}=e,i=u(t,s(l,r).collectionRef);return(0,c.jsx)(h,{ref:i,children:n})});p.displayName=l;let f=e+"CollectionItemSlot",m="data-radix-collection-item",y=g(f),v=n.forwardRef((e,t)=>{let{scope:r,children:i,...a}=e,o=n.useRef(null),l=u(t,o),d=s(f,r);return n.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,c.jsx)(y,{...{[m]:""},ref:l,children:i})});return v.displayName=f,[{Provider:o,Slot:p,ItemSlot:v},function(t){let r=s(e+"CollectionConsumer",t);return n.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},i]}(k),[T,O]=d(k,[A]),[N,R]=T(k),D=n.forwardRef((e,t)=>{let{name:r,min:i=0,max:o=100,step:l=1,orientation:u="horizontal",disabled:d=!1,minStepsBetweenThumbs:h=0,defaultValue:f=[i],value:g,onValueChange:m=()=>{},onValueCommit:y=()=>{},inverted:v=!1,form:b,...w}=e,S=n.useRef(new Set),C=n.useRef(0),k="horizontal"===u,[x=[],A]=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){let[a,s,o]=function({defaultProp:e,onChange:t}){let[r,i]=n.useState(e),a=n.useRef(r),s=n.useRef(t);return p(()=>{s.current=t},[t]),n.useEffect(()=>{a.current!==r&&(s.current?.(r),a.current=r)},[r,a]),[r,i,s]}({defaultProp:t,onChange:r}),l=void 0!==e,u=l?e:a;{let t=n.useRef(void 0!==e);n.useEffect(()=>{let e=t.current;if(e!==l){let t=l?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,i])}return[u,n.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&o.current?.(r)}else s(t)},[l,e,s,o])]}({prop:g,defaultProp:f,onChange:e=>{let t=[...S.current];t[C.current]?.focus(),m(e)}}),T=n.useRef(x);function O(e,t,{commit:r}={commit:!1}){let n,s=(String(l).split(".")[1]||"").length,u=a(Math.round((Math.round((e-i)/l)*l+i)*(n=Math.pow(10,s)))/n,[i,o]);A((e=[])=>{let n=function(e=[],t,r){let n=[...e];return n[r]=t,n.sort((e,t)=>e-t)}(e,u,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,r)=>e[r+1]-t))>=t;return!0}(n,h*l))return e;{C.current=n.indexOf(u);let t=String(n)!==String(e);return t&&r&&y(n),t?n:e}})}return(0,c.jsx)(N,{scope:e.__scopeSlider,name:r,disabled:d,min:i,max:o,valueIndexToChangeRef:C,thumbs:S.current,values:x,orientation:u,form:b,children:(0,c.jsx)(I.Provider,{scope:e.__scopeSlider,children:(0,c.jsx)(I.Slot,{scope:e.__scopeSlider,children:(0,c.jsx)(k?j:F,{"aria-disabled":d,"data-disabled":d?"":void 0,...w,ref:t,onPointerDown:s(w.onPointerDown,()=>{d||(T.current=x)}),min:i,max:o,inverted:v,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let r=e.map(e=>Math.abs(e-t)),n=Math.min(...r);return r.indexOf(n)}(x,e);O(e,t)},onSlideMove:d?void 0:function(e){O(e,C.current)},onSlideEnd:d?void 0:function(){let e=T.current[C.current];x[C.current]!==e&&y(x)},onHomeKeyDown:()=>!d&&O(i,0,{commit:!0}),onEndKeyDown:()=>!d&&O(o,x.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>
13{if(!d){let r=E.includes(e.key)||e.shiftKey&&_.includes(e.key),n=C.current;O(x[n]+l*(r?10:1)*t,n,{commit:!0})}}})})})})});D.displayName=k;var[P,M]=T(k,{startEdge:"left",endEdge:"right",size:"width",direction:1}),j=n.forwardRef((e,t)=>{let r,{min:i,max:a,dir:s,inverted:o,onSlideStart:l,onSlideMove:d,onSlideEnd:h,onStepKeyDown:p,...g}=e,[m,y]=n.useState(null),v=u(t,e=>y(e)),b=n.useRef(void 0),w=(r=n.useContext(f),s||r||"ltr"),S="ltr"===w,E=S&&!o||!S&&o;function _(e){let t=b.current||m.getBoundingClientRect(),r=Z([0,t.width],E?[i,a]:[a,i]);return b.current=t,r(e-t.left)}return(0,c.jsx)(P,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:(0,c.jsx)(L,{dir:w,"data-orientation":"horizontal",...g,ref:v,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=_(e.clientX);l?.(t)},onSlideMove:e=>{let t=_(e.clientX);d?.(t)},onSlideEnd:()=>{b.current=void 0,h?.()},onStepKeyDown:e=>{let t=C[E?"from-left":"from-right"].includes(e.key);p?.({event:e,direction:t?-1:1})}})})}),F=n.forwardRef((e,t)=>{let{min:r,max:i,inverted:a,onSlideStart:s,onSlideMove:o,onSlideEnd:l,onStepKeyDown:d,...h}=e,p=n.useRef(null),f=u(t,p),g=n.useRef(void 0),m=!a;function y(e){let t=g.current||p.current.getBoundingClientRect(),n=Z([0,t.height],m?[i,r]:[r,i]);return g.current=t,n(e-t.top)}return(0,c.jsx)(P,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:(0,c.jsx)(L,{"data-orientation":"vertical",...h,ref:f,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=y(e.clientY);s?.(t)},onSlideMove:e=>{let t=y(e.clientY);o?.(t)},onSlideEnd:()=>{g.current=void 0,l?.()},onStepKeyDown:e=>{let t=C[m?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),L=n.forwardRef((e,t)=>{let{__scopeSlider:r,onSlideStart:n,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:u,...d}=e,h=R(k,r);return(0,c.jsx)(v.span,{...d,ref:t,onKeyDown:s(e.onKeyDown,e=>{"Home"===e.key?(o(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):E.concat(_).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:s(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),h.thumbs.has(t)?t.focus():n(e)}),onPointerMove:s(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:s(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),q="SliderTrack",$=n.forwardRef((e,t)=>{let{__scopeSlider:r,...n}=e,i=R(q,r);return(0,c.jsx)(v.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:t})});$.displayName=q;var U="SliderRange",V=n.forwardRef((e,t)=>{let{__scopeSlider:r,...i}=e,a=R(U,r),s=M(U,r),o=u(t,n.useRef(null)),l=a.values.length,d=a.values.map(e=>H(e,a.min,a.max)),h=l>1?Math.min(...d):0,p=100-Math.max(...d);return(0,c.jsx)(v.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...i,ref:o,style:{...e.style,[s.startEdge]:h+"%",[s.endEdge]:p+"%"}})});V.displayName=U;var z="SliderThumb",G=n.forwardRef((e,t)=>{let r=x(e.__scopeSlider),[i,a]=n.useState(null),s=u(t,e=>a(e)),o=n.useMemo(()=>i?r().findIndex(e=>e.ref.current===i):-1,[r,i]);return(0,c.jsx)(B,{...e,ref:s,index:o})}),B=n.forwardRef((e,t)=>{var r,i,a,o,l;let d,p,{__scopeSlider:f,index:g,name:m,...y}=e,b=R(z,f),w=M(z,f),[S,E]=n.useState(null),_=u(t,e=>E(e)),C=!S||b.form||!!S.closest("form"),k=function(e){let[t,r]=n.useState(void 0);return h(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,i;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,i=t.blockSize}else n=e.offsetWidth,i=e.offsetHeight;r({width:n,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(S),x=b.values[g],A=void 0===x?0:H(x,b.min,b.max),T=(r=g,(i=b.values.length)>2?`Value ${r+1} of ${i}`:2===i?["Minimum","Maximum"][r]:void 0),O=k?.[w.size],N=O?(a=O,o=A,l=w.direction,p=Z([0,50],[0,d=a/2]),(d-p(o)*l)*l):0;return n.useEffect(()=>{if(S)return b.thumbs.add(S),()=>{b.thumbs.delete(S)}},[S,b.thumbs]),(0,c.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[w.startEdge]:`calc(${A}% + ${N}px)`},children:[(0,c.jsx)(I.ItemSlot,{scope:e.__scopeSlider,children:(0,c.jsx)(v.span,{role:"slider","aria-label":e["aria-label"]||T,"aria-valuemin":b.min,"aria-valuenow":x,"aria-valuemax":b.max,"aria-orientation":b.orientation,"data-orientation":b.orientation,"data-disabled":b.disabled?"":void 0,tabIndex:b.disabled?void 0:0,...y,ref:_,style:void 0===x?{display:"none"}:e.style,onFocus:s(e.onFocus,()=>{b.valueIndexToChangeRef.current=g})})}),C&&(0,c.jsx)(Q,{name:m??(b.name?b.name+(b.values.length>1?"[]":""):void 0),form:b.form,value:x},g)]})});G.displayName=z;var Q=n.forwardRef(({__scopeSlider:e,value:t,...r},i)=>{let a,s=n.useRef(null),o=u(s,i),l=(a=n.useRef({value:t,previous:t}),n.useMemo(()=>(a.current.value!==t&&(a.current.previous=a.current.value,a.current.value=t),a.current.previous),[t]));return n.useEffect(()=>{let e=s.current;if(!e)return;let r=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(l!==t&&r){let n=new Event("input",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[l,t]),(0,c.jsx)(v.input,{style:{display:"none"},...r,ref:o,defaultValue:t})});function H(e,t,r){return a(100/(r-t)*(e-t),[0,100])}function Z(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}Q.displayName="RadioBubbleInput";var K=D,Y=$,W=V,J=G},11650:(e,t,r)=>{"use strict";r.d(t,{_:()=>d});var n=r(85420),i=r(12115),a=r(89433),s=r(258),o=r(61578),l=r(99759),u=r(92242),c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let d=(0,s.O)((0,o.N)(e=>{var{imageParams:t,field:r,mediaUrlPrefix:s}=e,o=c(e,["imageParams","field","mediaUrlPrefix"]);if((0,u.JE)(r))return null;delete o.editable;let l=r.src?r:r.value;if(!l)return null;l.metadata&&delete l.metadata;let d=((e,t,r)=>{var{src:i,srcSet:s}=e,o=c(e,["src","srcSet"]);if(!i)return null;(0,a.B)(o);let l=Object.assign({},o),u=n.k6(i,t,r);return s&&(l.srcSet=n.tS(u,s,t,r)),l.src=u,l})(Object.assign(Object.assign({},l),o),t,s);return d?i.createElement("img",Object.assign({},d)):null},{defaultEmptyFieldEditingComponent:l.n}));d.displayName="Image"},12363:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},12517:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});let n=["renderEmpty","render","renderEach","errorComponent","componentLoadingMessage","modifyComponentProps","componentMap","page","missingComponentComponent","hiddenRenderingComponent"]},14120:(e,t,r)=>{"use strict";let n;e=r.nmd(e);let i=(e,t)=>(...r)=>{let n=e(...r);return`\u001B[${n+t}m`},a=(e,t)=>(...r)=>{let n=e(...r);return`\u001B[${38+t};5;${n}m`},s=(e,t)=>(...r)=>{let n=e(...r);return`\u001B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},o=e=>e,l=(e,t,r)=>[e,t,r],u=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},c=(e,t,i,a)=>
13{void 0===n&&(n=r(39617));let s=10*!!a,o={};for(let[r,a]of Object.entries(n)){let n="ansi16"===r?"ansi":r;r===t?o[n]=e(i,s):"object"==typeof a&&(o[n]=e(a[t],s))}return o};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};for(let[r,n]of(t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright,Object.entries(t))){for(let[r,i]of Object.entries(n))t[r]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},n[r]=t[r],e.set(i[0],i[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1b[39m",t.bgColor.close="\x1b[49m",u(t.color,"ansi",()=>c(i,"ansi16",o,!1)),u(t.color,"ansi256",()=>c(a,"ansi256",o,!1)),u(t.color,"ansi16m",()=>c(s,"rgb",l,!1)),u(t.bgColor,"ansi",()=>c(i,"ansi16",o,!0)),u(t.bgColor,"ansi256",()=>c(a,"ansi256",o,!0)),u(t.bgColor,"ansi16m",()=>c(s,"rgb",l,!0)),t}})},14140:(e,t,r)=>{"use strict";r.d(t,{V:()=>o});var n=r(12115),i=r(83648),a=r(80695),s=r(12517);let o=async e=>{var t,r;let o=(null==(t=e.rendering)?void 0:t.params)||{},l=null==(r=e.page)?void 0:r.mode.isNormal,u=Object.fromEntries(Object.entries(e).filter(([e])=>!s.p.includes(e))),c=Object.assign(Object.assign({},await (0,i.h5)(o,l)),u);return n.createElement(a.FEaaSWrapper,Object.assign({},c))}},17494:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},18231:(e,t,r)=>{"use strict";r.d(t,{default:()=>v});var n,i=r(12115);function a(e,t,r,n){let i=null==n||"number"==typeof n||"boolean"==typeof n?n:r(n),a=t.get(i);return void 0===a&&(a=e.call(this,n),t.set(i,a)),a}function s(e,t,r){let n=Array.prototype.slice.call(arguments,3),i=r(n),a=t.get(i);return void 0===a&&(a=e.apply(this,n),t.set(i,a)),a}let o=function(){return JSON.stringify(arguments)};class l{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}let u={create:function(){return new l}},c={variadic:function(e,t){var r,n;return r=t.cache.create(),n=t.serializer,s.bind(this,e,r,n)},monadic:function(e,t){var r,n;return r=t.cache.create(),n=t.serializer,a.bind(this,e,r,n)}};var d=((n=d||{}).MISSING_MESSAGE="MISSING_MESSAGE",n.MISSING_FORMAT="MISSING_FORMAT",n.ENVIRONMENT_FALLBACK="ENVIRONMENT_FALLBACK",n.INSUFFICIENT_PATH="INSUFFICIENT_PATH",n.INVALID_MESSAGE="INVALID_MESSAGE",n.INVALID_KEY="INVALID_KEY",n.FORMATTING_ERROR="FORMATTING_ERROR",n);function h(e,t){return function(e,t){var r;let n,i;return n=(r={cache:{create:()=>({get:e=>t[e],set(e,r){t[e]=r}})},strategy:c.variadic}).cache?r.cache:u,i=r&&r.serializer?r.serializer:o,(r&&r.strategy?r.strategy:function(e,t){var r,n;let i=1===e.length?a:s;return r=t.cache.create(),n=t.serializer,i.bind(this,e,r,n)})(e,{cache:n,serializer:i})}((...t)=>new e(...t),t)}function p(e){return function(...e){return e.filter(Boolean).join(".")}(e.namespace,e.key)}function f(e){console.error(e)}var g=r(95155);let m=(0,i.createContext)(void 0);function y({children:e,formats:t,getMessageFallback:r,locale:n,messages:a,now:s,onError:o,timeZone:l}){let u=(0,i.useContext)(m),c=(0,i.useMemo)(()=>u?.cache||{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}},[n,u?.cache]),d=(0,i.useMemo)(()=>u?.formatters||{getDateTimeFormat:h(Intl.DateTimeFormat,c.dateTime),getNumberFormat:h(Intl.NumberFormat,c.number),getPluralRules:h(Intl.PluralRules,c.pluralRules),getRelativeTimeFormat:h(Intl.RelativeTimeFormat,c.relativeTime),getListFormat:h(Intl.ListFormat,c.list),getDisplayNames:h(Intl.DisplayNames,c.displayNames)},[c,u?.formatters]),v=(0,i.useMemo)(()=>({...function({formats:e,getMessageFallback:t,messages:r,onError:n,...i}){return{...i,formats:e||void 0,messages:r||void 0,onError:n||f,getMessageFallback:t||p}}({locale:n,formats:void 0===t?u?.formats:t,getMessageFallback:r||u?.getMe
13ssageFallback,messages:void 0===a?u?.messages:a,now:s||u?.now,onError:o||u?.onError,timeZone:l||u?.timeZone}),formatters:d,cache:c}),[c,t,d,r,n,a,s,o,u,l]);return(0,g.jsx)(m.Provider,{value:v,children:e})}function v({locale:e,...t}){if(!e)throw Error(void 0);return(0,g.jsx)(y,{locale:e,...t})}},18351:(e,t,r)=>{"use strict";r.d(t,{I:()=>u});var n=r(36969),i=r(2959),a=r.n(i);class s{async fetchComponentProps(e){var t;let{layoutData:r,context:n,components:i}=e,a=await this.collectRequests({placeholders:null==(t=r.sitecore.route)?void 0:t.placeholders,components:i,layoutData:r,context:n});return await this.execRequests(a)}async collectRequests(e){let{placeholders:t={},components:r,layoutData:n,context:i}=e;e.requests||(e.requests=[]);let a=this.flatRenderings(t).map(async t=>{var a;let s=null==(a=await this.getModule(r,t.componentName))?void 0:a.getComponentServerProps;s&&e.requests&&e.requests.push({fetch:s,rendering:t,layoutData:n,context:i}),t.placeholders&&await this.collectRequests(Object.assign(Object.assign({},e),{placeholders:t.placeholders}))});return await Promise.all(a),e.requests}async execRequests(e){let t={},r=e.map(e=>{let{uid:r}=e.rendering;return r?e.fetch(e.rendering,e.layoutData,e.context).then(e=>{t[r]=e}).catch(n=>{let i=`Error during preload data for component ${e.rendering.componentName} (${r}): ${n.message||n}`;console.error(a().red(i)),t[r]={error:n.message||i,componentName:e.rendering.componentName}}):void console.log(`Component ${e.rendering.componentName} doesn't have uid, can't store data for this component`)});return await Promise.all(r),t}flatRenderings(e){let t=[];return Object.values(e).forEach(e=>{t.push(...e)}),t}async getModule(e,t){var r;let n=e.get(t);return n?n.dynamicModule?await (null==(r=null==n?void 0:n.dynamicModule)?void 0:r.call(n)):n:null}}var o=r(28459),l=r(51862);class u extends n.U{constructor(e){super(e),this.initOptions=e,this.componentPropsService=this.getComponentPropsService()}getSiteNameFromPath(e){let t=super.parsePath(e);return(0,o.EP)(t,this.initOptions.defaultSite).siteName}parsePath(e){let t=super.parsePath(e);return(0,o.No)((0,l.SH)(t))}async getPage(e,t,r){let n=this.parsePath(e),i=t.personalize||(0,l.XG)(super.parsePath(e)),a=t.site||this.getSiteNameFromPath(e);return await super.getPage(n,{locale:t.locale,site:a,personalize:i},r)}async getDesignLibraryData(e,t){return super.getDesignLibraryData(e,t)}async getPreview(e,t){return super.getPreview(e,t)}async getAppRouterStaticParams(e,t,r){let n=await super.getPagePaths(e,t,r),i=[];return n.map(e=>{var t;let r=(0,o.No)(e.params.path.join("/")).split("/");i.push({locale:null!=(t=e.locale)?t:this.initOptions.defaultLanguage,site:this.getSiteNameFromPath(e.params.path),path:r})}),i}async getPagePaths(e,t,r){var n;let i=await super.getPagePaths(e,t,r);return(null==(n=this.initOptions.multisite)?void 0:n.enabled)||i.map(e=>{e.params.path=(0,o.No)(e.params.path.join("/")).split("/")}),i}async getComponentData(e,t,r){let n={};if(!e.sitecore.route)return n;let i=Object.keys(n=await this.componentPropsService.fetchComponentProps({layoutData:e,context:t,components:r})).map(e=>{let t=n[e];return t.error?` 14Unable to get component props for ${t.componentName} (${e}): ${t.error}`:""}).join("");if(i.length)throw Error(i);return n}getComponentPropsService(){return new s}}},20292:(e,t,r)=>{let n=r(51819),i={};for(let e of Object.keys(n))i[n[e]]=e;let a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(let t of(e.exports=a,Object.keys(a))){if(!("channels"in a[t]))throw Error("missing channels property: "+t);if(!("labels"in a[t]))throw Error("missing channel labels property: "+t);if(a[t].labels.length!==a[t].channels)throw Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=a[t];delete a[t].channels,delete a[t].labels,Object.defineProperty(a[t],"channels",{value:e}),Object.defineProperty(a[t],"labels",{value:r})}a.rgb.hsl=function(e){let t,r=e[0]/255,n=e[1]/255,i=e[2]/255,a=Math.min(r,n,i),s=Math.max(r,n,i),o=s-a;s===a?t=0:r===s?t=(n-i)/o:n===s?t=2+(i-r)/o:i===s&&(t=4+(r-n)/o),(t=Math.min(60*t,360))<0&&(t+=360);let l=(a+s)/2;return[t,100*(s===a?0:l<=.5?o/(s+a):o/(2-s-a)),100*l]},a.rgb.hsv=function(e){let t,r,n,i,a,s=e[0]/255,o=e[1]/255,l=e[2]/255,u=Math.max(s,o,l),c=u-Math.min(s,o,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(i=0,a=0):(a=c/u,t=d(s),r=d(o),n=d(l),s===u?i=n-r:o===u?i=1/3+t-n:l===u&&(i=2/3+r-t),i<0?
14i+=1:i>1&&(i-=1)),[360*i,100*a,100*u]},a.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(r,n))*100,100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},a.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n);return[100*((1-t-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*i]},a.rgb.keyword=function(e){let t,r=i[e];if(r)return r;let a=1/0;for(let r of Object.keys(n)){let i=n[r],s=(e[0]-i[0])**2+(e[1]-i[1])**2+(e[2]-i[2])**2;s<a&&(a=s,t=r)}return t},a.keyword.rgb=function(e){return n[e]},a.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(r=r>.04045?((r+.055)/1.055)**2.4:r/12.92)+.1805*(n=n>.04045?((n+.055)/1.055)**2.4:n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},a.rgb.lab=function(e){let t=a.rgb.xyz(e),r=t[0],n=t[1],i=t[2];return r/=95.047,n/=100,i/=108.883,[116*(n=n>.008856?n**(1/3):7.787*n+16/116)-16,500*((r=r>.008856?r**(1/3):7.787*r+16/116)-n),200*(n-(i=i>.008856?i**(1/3):7.787*i+16/116))]},a.hsl.rgb=function(e){let t,r,n,i=e[0]/360,a=e[1]/100,s=e[2]/100;if(0===a)return[n=255*s,n,n];t=s<.5?s*(1+a):s+a-s*a;let o=2*s-t,l=[0,0,0];for(let e=0;e<3;e++)(r=i+-(1/3*(e-1)))<0&&r++,r>1&&r--,n=6*r<1?o+(t-o)*6*r:2*r<1?t:3*r<2?o+(t-o)*(2/3-r)*6:o,l[e]=255*n;return l},a.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,a=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=a<=1?a:2-a;let s=(n+r)/2;return[t,100*(0===n?2*i/(a+i):2*r/(n+r)),100*s]},a.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),s=255*n*(1-r),o=255*n*(1-r*a),l=255*n*(1-r*(1-a));switch(n*=255,i){case 0:return[n,l,s];case 1:return[o,n,s];case 2:return[s,n,l];case 3:return[s,o,n];case 4:return[l,s,n];case 5:return[n,s,o]}},a.hsv.hsl=function(e){let t,r,n=e[0],i=e[1]/100,a=e[2]/100,s=Math.max(a,.01);r=(2-i)*a;let o=(2-i)*s;return[n,100*(t=(t=i*s/(o<=1?o:2-o))||0),100*(r/=2)]},a.hwb.rgb=function(e){let t,r,n,i,a=e[0]/360,s=e[1]/100,o=e[2]/100,l=s+o;l>1&&(s/=l,o/=l);let u=Math.floor(6*a),c=1-o;t=6*a-u,(1&u)!=0&&(t=1-t);let d=s+t*(c-s);switch(u){default:case 6:case 0:r=c,n=d,i=s;break;case 1:r=d,n=c,i=s;break;case 2:r=s,n=c,i=d;break;case 3:r=s,n=d,i=c;break;case 4:r=d,n=s,i=c;break;case 5:r=c,n=s,i=d}return[255*r,255*n,255*i]},a.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},a.xyz.rgb=function(e){let t,r,n,i=e[0]/100,a=e[1]/100,s=e[2]/100;return t=(t=3.2406*i+-1.5372*a+-.4986*s)>.0031308?1.055*t**(1/2.4)-.055:12.92*t,r=(r=-.9689*i+1.8758*a+.0415*s)>.0031308?1.055*r**(1/2.4)-.055:12.92*r,n=(n=.0557*i+-.204*a+1.057*s)>.0031308?1.055*n**(1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];return t/=95.047,r/=100,n/=108.883,[116*(r=r>.008856?r**(1/3):7.787*r+16/116)-16,500*((t=t>.008856?t**(1/3):7.787*t+16/116)-r),200*(r-(n=n>.008856?n**(1/3):7.787*n+16/116))]},a.lab.xyz=function(e){let t,r,n,i=e[0],a=e[1],s=e[2];t=a/500+(r=(i+16)/116),n=r-s/200;let o=r**3,l=t**3,u=n**3;return r=(o>.008856?o:(r-16/116)/7.787)*100,[t=(l>.008856?l:(t-16/116)/7.787)*95.047,r,n=(u>.008856?u:(n-16/116)/7.787)*108.883]},a.lab.lch=function(e){let t,r=e[0],n=e[1],i=e[2];return(t=360*Math.atan2(i,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+i*i),t]},a.lch.lab=function(e){let t=e[0],r=e[1],n=e[2]/360*2*Math.PI;return[t,r*Math.cos(n),r*Math.sin(n)]},a.rgb.ansi16=function(e,t=null){let[r,n,i]=e,s=null===t?a.rgb.hsv(e)[2]:t;if(0===(s=Math.round(s/50)))return 30;let o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return 2===s&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];let r=(~~(e>50)+1)*.5;return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},a.ansi256.rgb=function(e){let t;if(e>=232){let t=(e-232)*10+8;return[t,t,t]}return[Math.floor((e-=16)/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},a.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map(e=>e+e).join(""));let n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){let t,r=e[0]/255,n=e[1]/255,i=e[2]/255,a=Math.max(Math.max(r,n),i),s=Math.min(Math.min(r,n),i),o=a-s;return t=o<1?s/(1-o):0,[360*((o<=0?0:a===r?(n-i)/o%6:a===n?2+(i-r)/o:4+(r-n)/o)/6%1),100*o,100*t]},a.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],100*n,100*i]},a.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},a.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];let i=[0,0,0],a=t%1*6,s=a%1,o=1-s,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=o,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=o,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=o}return l=(1-r)*n,[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]},a.hcg.hsv=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},a.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},a.hcg.hwb=function(e){let t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],(r-t)*100,(1-r)*100]},a.hwb.hcg=function(e){let t=e[1]/100,r=1-e[2]/100,n=r-t,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=function(e){return[0,0,e[0]]},a.gray.hsv=a.gray.hsl,a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},21456:(e,t,r)=>{"use strict";r.d(t,{H:()=>n});
14class n{constructor(e={}){this.statusCodes=e.statusCodes||[429],this.errorCodes=e.errorCodes||["ECONNRESET","ETIMEDOUT","EPROTO"],this.factor=e.factor||2}shouldRetry(e,t,r){var n;let i=(null==(n=e.response)?void 0:n.status)!==void 0&&this.statusCodes.includes(e.response.status),a=void 0!==e.code&&this.errorCodes.includes(e.code);return r>0&&t<=r&&(i||a)}getDelay(e,t){var r;let n=null==(r=e.response)?void 0:r.headers,i=null==n?void 0:n.get("Retry-After");return null!=i&&""!==i.trim()?1e3*Number.parseFloat(i):1e3*Math.pow(this.factor,t-1)}}},23954:e=>{"use strict";function t(){var e=Object.create(null),t=0,r=0,n=0,i=!1;function a(t){n--,delete e[t]}this.put=function(t,r,s,o){if(i&&console.log("caching: %s = %j (@%s)",t,r,s),void 0!==s&&("number"!=typeof s||isNaN(s)||s<=0))throw Error("Cache timeout must be a positive number");if(void 0!==o&&"function"!=typeof o)throw Error("Cache timeout callback must be a function");var l=e[t];l?clearTimeout(l.timeout):n++;var u={value:r,expire:s+Date.now()};return isNaN(u.expire)||(u.timeout=setTimeout((function(){a(t),o&&o(t,r)}).bind(this),s)),e[t]=u,r},this.del=function(t){var r=!0,n=e[t];return n?(clearTimeout(n.timeout),!isNaN(n.expire)&&n.expire<Date.now()&&(r=!1)):r=!1,r&&a(t),r},this.clear=function(){for(var a in e)clearTimeout(e[a].timeout);n=0,e=Object.create(null),i&&(t=0,r=0)},this.get=function(a){var s=e[a];if(void 0!==s)if(isNaN(s.expire)||s.expire>=Date.now())return i&&t++,s.value;else i&&r++,n--,delete e[a];else i&&r++;return null},this.size=function(){return n},this.memsize=function(){var t,r=0;for(t in e)r++;return r},this.debug=function(e){i=e},this.hits=function(){return t},this.misses=function(){return r},this.keys=function(){return Object.keys(e)},this.exportJson=function(){var t={};for(var r in e){var n=e[r];t[r]={value:n.value,expire:n.expire||"NaN"}}return JSON.stringify(t)},this.importJson=function(t,r){var n=JSON.parse(t),a=Date.now(),s=r&&r.skipDuplicates;for(var o in n)if(n.hasOwnProperty(o)){if(s&&e[o]){i&&console.log("Skipping duplicate imported key '%s'",o);continue}var l=n[o],u=l.expire-a;if(u<=0){this.del(o);continue}u=u>0?u:void 0,this.put(o,l.value,u)}return this.size()}}e.exports=new t,e.exports.Cache=t},27866:function(e){e.exports=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",i="week",a="month",s="quarter",o="year",l="date",u="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|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,h=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},p="en",f={};f[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(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}};var g="$isDayjsObject",m=function(e){return e instanceof w||!(!e||!e[g])},y=function e(t,r,n){var i;if(!t)return p;if("string"==typeof t){var a=t.toLowerCase();f[a]&&(i=a),r&&(f[a]=r,i=a);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var o=t.name;f[o]=t,i=o}return!n&&i&&(p=i),i||!n&&p},v=function(e,t){if(m(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new w(r)},b={s:h,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+h(Math.floor(r/60),2,"0")+":"+h(r%60,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,a),s=r-i<0,o=t.clone().add(n+(s?-1:1),a);return+(-(n+(r-i)/(s?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return({M:a,y:o,w:i,d:"day",D:l,h:n,m:r,s:t,ms:e,Q:s})[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};b.l=y,b.i=m,b.w=function(e,t){return v(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var w=function(){function h(e){this.$L=y(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[g]=!0}var p=h.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(b.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(c);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return b},p.isValid=function(){return this.$d.toString()!==u},p.isSame=function(e,t){var r=v(e);return this.startOf(t)<=r&&r<=this.endOf(t)},p.isAfter=function(e,t){return v(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<v(e)},p.$g=function(e,t,r){return b.u(e)?this[t]:this.set(r,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,s){var u=this,c=!!b.u(s)||s,d=b.p(e),h=function(e,t){var r=b.w(u.$u?Date.UTC(u.$y,t,e):new Date(u.$y,t,e),u);return c?r:r.endOf("day")},p=function(e,t){return b.w(u.toDate()[e].apply(u.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),u)},f=this.$W,g=this.$M,m=this.$D,y="set"+(this.$u?"UTC":"");switch(d){case o:return c?h(1,0):h(31,11);case a:return c?h(1,g):h(0,g+1);case i:var v=this.$locale().weekStart||0,w=(f<v?f+7:f)-v;return h(c?m-w:m+(6-w),g);case"day":case l:return p(y+"Hours",0);case n:return p(y+"Minutes",1);case r:return p(y+"Seconds",2);case t:return p(y+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(i,s){var u,c=b.p(i),d="set"+(this.$u?"UTC":""),h=((u={}).day=d+"Date",u[l]=d+"Date",u[a]=d+"Month",u[o]=d+"FullYear",u[n]=d+"Hours",u[r]=d+"Minutes",u[t]=d+"Seconds",u[e]=d+"Milliseconds",u)[c],p="day"===c?this.$D+(s-this.$W):s;if(c===a||c===o){var f=this.clone().set(l,1);f.$d[h](p),f.init(),this.$d=f.set(l,Math.min(this.$D,f.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[b.p(e)]()},p.add=function(e,s){var l,u=this;e=Number(e);var c=b.p(s),d=function(t){var r=v(u);return b.w(r.date(r.date()+Math.round(t*e)),u)};if(c===a)return this.set(a,this.$M+e);if(c===o)return this.set(o,this.$y+e);if("day"===c)return d(1);if(c===i)return d(7);var h=((l={})[r]=6e4,l[n]=36e5,l[t]=1e3,l)[c]||1,p=this.$d.getTime()+e*h;return b.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||u;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),a=this.$H,s=this.$m,o=this.$M,l=r.weekdays,c=r.months,h=r.meri
14diem,p=function(e,r,i,a){return e&&(e[r]||e(t,n))||i[r].slice(0,a)},f=function(e){return b.s(a%12||12,e,"0")},g=h||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(d,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return b.s(t.$y,4,"0");case"M":return o+1;case"MM":return b.s(o+1,2,"0");case"MMM":return p(r.monthsShort,o,c,3);case"MMMM":return p(c,o);case"D":return t.$D;case"DD":return b.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(r.weekdaysMin,t.$W,l,2);case"ddd":return p(r.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(a);case"HH":return b.s(a,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return g(a,s,!0);case"A":return g(a,s,!1);case"m":return String(s);case"mm":return b.s(s,2,"0");case"s":return String(t.$s);case"ss":return b.s(t.$s,2,"0");case"SSS":return b.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})},p.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},p.diff=function(e,l,u){var c,d=this,h=b.p(l),p=v(e),f=(p.utcOffset()-this.utcOffset())*6e4,g=this-p,m=function(){return b.m(d,p)};switch(h){case o:c=m()/12;break;case a:c=m();break;case s:c=m()/3;break;case i:c=(g-f)/6048e5;break;case"day":c=(g-f)/864e5;break;case n:c=g/36e5;break;case r:c=g/6e4;break;case t:c=g/1e3;break;default:c=g}return u?c:b.a(c)},p.daysInMonth=function(){return this.endOf(a).$D},p.$locale=function(){return f[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=y(e,t,!0);return n&&(r.$L=n),r},p.clone=function(){return b.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},h}(),S=w.prototype;return v.prototype=S,[["$ms",e],["$s",t],["$m",r],["$H",n],["$W","day"],["$M",a],["$y",o],["$D",l]].forEach(function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),v.extend=function(e,t){return e.$i||(e(t,w,v),e.$i=!0),v},v.locale=y,v.isDayjs=m,v.unix=function(e){return v(1e3*e)},v.en=f[p],v.Ls=f,v.p={},v}()},28459:(e,t,r)=>{"use strict";r.d(t,{EP:()=>a,No:()=>s,S:()=>i});let n="_site_";function i(e,t){let r=e.startsWith("/")?e:"/"+e;return`/${n}${t.siteName}${r}`}function a(e,t){let r={siteName:t},i=(e.endsWith("/")?e:e+"/").match(`${n}(.*?)\\/`);return i&&""!==i[1]&&(r.siteName=i[1]),r}function s(e){let t=e.match(`${n}.*?(?:\\/|$)`);return null===t?e:e.replace(t[0],"")}},30772:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(12115),i=r(30907);let a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var s=r(71265);let o=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...o},l)=>(0,n.createElement)(s.default,{ref:l,iconNode:t,className:(0,i.z)(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...o}));return r.displayName=a(e),r}},30907:(e,t,r)=>{"use strict";r.d(t,{z:()=>n});let n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},35175:(e,t,r)=>{"use strict";r.d(t,{C:()=>d});var n=r(42787),i=r(21456),a=r(84723),s=r(41463);let{UU:o}=n,l=e=>{var t,r,n,i,a,s,l,u;let c="u">typeof window,d=!!(null==(r=null==(t=e.api)?void 0:t.edge)?void 0:r.contextId),h=(null==(i=null==(n=e.api)?void 0:n.edge)||i.clientContextId,!!(null==(s=null==(a=e.api)?void 0:a.local)?void 0:s.apiHost)&&!!(null==(u=null==(l=e.api)?void 0:l.local)?void 0:u.apiKey));if(!c){if(!d&&!h)throw Error(o.MV_007);return}},u={"api.edge.contextId":l,"api.local.apiKey":l};var c=r(41463);let d=e=>{var t,r,n,o,d,h,p,f,g,m,y,v,b,w,S,E,_;return(e=>{var t;let r,n=((Number.isNaN((r=function e(t,r){if(!r)return t;let n=Object.assign({},t);for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let a=t[i],s=r[i];void 0!==s&&""!==s&&("object"!=typeof s||null===s||Array.isArray(s)||Object.getPrototypeOf(s)!==Object.prototype?n[i]=s:n[i]=e(a,s))}return n}(t={api:{edge:{contextId:s.env.SITECORE_EDGE_CONTEXT_ID||"",clientContextId:"",edgeUrl:(0,a.Hk)()},local:{apiKey:s.env.SITECORE_API_KEY||"WER1Nnp1T2k5MTh6dFVWd0NTZXZXV2
14k4OXlKU1dZNVRra0VnSFlobWJBTT18YXNzb2NpYXRpb25iNWQ5LWFkbG01MWNhLXByb2RlYjNhLTgyNjQ=",apiHost:s.env.SITECORE_API_HOST||s.env.NEXT_PUBLIC_SITECORE_API_HOST||"",path:"/sitecore/api/graph/edge"}},editingSecret:s.env.SITECORE_EDITING_SECRET||"editing-secret-missing",retries:{count:3,retryStrategy:new i.H({statusCodes:[429,502,503,504,520,521,522,523,524]})},redirects:{enabled:!0,locales:["en"]},multisite:{enabled:!0,useCookieResolution:()=>!1},personalize:{enabled:!0,edgeTimeout:parseInt(s.env.PERSONALIZE_MIDDLEWARE_EDGE_TIMEOUT,10)||400,cdpTimeout:parseInt(s.env.PERSONALIZE_MIDDLEWARE_CDP_TIMEOUT,10)||400,scope:"",channel:"WEB",currency:"USD"},defaultSite:"",defaultLanguage:"en",layout:{formatLayoutQuery:null},dictionary:{caching:{enabled:!0,timeout:60}},rewriteMediaUrls:!1,disableCodeGeneration:!1},e)).personalize.cdpTimeout)||!r.personalize.cdpTimeout)&&(r.personalize.cdpTimeout=t.personalize.cdpTimeout),(Number.isNaN(r.personalize.edgeTimeout)||!r.personalize.edgeTimeout)&&(r.personalize.edgeTimeout=t.personalize.edgeTimeout),r.api.edge.edgeUrl=r.api.edge.edgeUrl?(0,a.Hk)(r.api.edge.edgeUrl):(0,a.Hk)(),r);if("true"===s.env.SITECORE_CLI_MODE){let e,t;return e=new Set,(t=(r,i="")=>new Proxy(r,{get(r,a,s){if("symbol"==typeof a)return Reflect.get(r,a,s);let o=i?`${i}.${a}`:a,l=Reflect.get(r,a,s);return(o in u&&!e.has(o)&&((0,u[o])(n),e.add(o)),"object"!=typeof l||null===l||Array.isArray(l))?l:t(l,o)}}))(n)}return l(n),n})(Object.assign(Object.assign({},e),{api:Object.assign(Object.assign({},null==e?void 0:e.api),{edge:Object.assign(Object.assign({},null==(t=null==e?void 0:e.api)?void 0:t.edge),{contextId:(null==(n=null==(r=null==e?void 0:e.api)?void 0:r.edge)?void 0:n.contextId)||"",clientContextId:(null==(d=null==(o=null==e?void 0:e.api)?void 0:o.edge)?void 0:d.clientContextId)||"FcBUwcIqfKyyc8e3HyKPa",edgeUrl:(0,a.Hk)(null!=(f=null==(p=null==(h=null==e?void 0:e.api)?void 0:h.edge)?void 0:p.edgeUrl)?f:c.env.NEXT_PUBLIC_SITECORE_EDGE_PLATFORM_HOSTNAME)}),local:Object.assign(Object.assign({},null==(g=null==e?void 0:e.api)?void 0:g.local),{apiKey:(null==(y=null==(m=null==e?void 0:e.api)?void 0:m.local)?void 0:y.apiKey)||"WER1Nnp1T2k5MTh6dFVWd0NTZXZXV2k4OXlKU1dZNVRra0VnSFlobWJBTT18YXNzb2NpYXRpb25iNWQ5LWFkbG01MWNhLXByb2RlYjNhLTgyNjQ=",apiHost:(null==(b=null==(v=null==e?void 0:e.api)?void 0:v.local)?void 0:b.apiHost)||c.env.NEXT_PUBLIC_SITECORE_API_HOST||""})}),defaultSite:(null==e?void 0:e.defaultSite)||"meeting",defaultLanguage:(null==e?void 0:e.defaultLanguage)||"en",multisite:Object.assign(Object.assign({},null==e?void 0:e.multisite),{useCookieResolution:null!=(S=null==(w=null==e?void 0:e.multisite)?void 0:w.useCookieResolution)?S:()=>"preview"===c.env.VERCEL_ENV}),personalize:Object.assign(Object.assign({},null==e?void 0:e.personalize),{scope:(null==(E=null==e?void 0:e.personalize)?void 0:E.scope)||""}),generateStaticPaths:void 0!==c.env.GENERATE_STATIC_PATHS?"true"===c.env.GENERATE_STATIC_PATHS.toLowerCase():null==(_=null==e?void 0:e.generateStaticPaths)||_,sitecoreInternalEditingHostUrl:(null==e?void 0:e.sitecoreInternalEditingHostUrl)||c.env.SITECORE_INTERNAL_EDITING_HOST_URL}))}},36969:(e,t,r)=>{"use strict";r.d(t,{M:()=>i,U:()=>en});var n,i,a=r(42787),s=r(2665),o=r(57039),l=r(84723),u=r(23954);let c=Object.freeze({cacheTimeout:60,cacheEnabled:!0});class d{constructor(e){var t;this.options=e,this.cache=new u.Cache,this.options.cacheTimeout=(null!=(t=this.options.cacheTimeout)?t:c.cacheTimeout)*1e3,void 0===this.options.cacheEnabled&&(this.options.cacheEnabled=c.cacheEnabled)}getCacheValue(e){return this.options.cacheEnabled?this.cache.get(e):null}setCacheValue(e,t){return this.options.cacheEnabled?this.cache.put(e,t,this.options.cacheTimeout):t}}var h=r(84957);let{UU:p}=a,f=` 15 query DictionarySiteQuery( 16 $siteName: String! 17 $language: String! 18 $pageSize: Int = 500 19 $after: String 20 ) { 21 site { 22 siteInfo(site: $siteName) { 23 dictionary(language: $language, first: $pageSize, after: $after) { 24 pageInfo { 25 endCursor 26 hasNext 27 } 28 results { 29 key 30 value 31 } 32 } 33 } 34 } 35 } 36`;class g{constructor(e){this.options=e,this.cache=this.getCacheClient(),this.graphQLClient=this.getGraphQLClient()}async fetchDictionaryData(e,t,r){var n,i;let a=t+e,s=this.getCacheValue(a);if(s)return h.A.dictionary("using cached dictionary data for %s %s",e,t),s;let o={};h.A.dictionary("fetching dictionary data for %s %s",e,t);let l=[],u=!0,c="";if(!t)throw RangeError(p.MV_002);if(!e)throw RangeError(p.MV_009);for(;u;){let a=await this.graphQLClient.request(f,{siteName:t,language:e,pageSize:this.options.pageSize,after:c},r);(null==(i=null==(n=null==a?void 0:a.site)?void 0:n.siteInfo)?void 0:i.dictionary)?(l=l.concat(a.site.siteInfo.dictionary.results),c=a.site.siteInfo.dictionary.pageInfo.endCursor,u=a.site.siteInfo.dictionary.pageInfo.hasNext):u=!1}
36return l.forEach(e=>o[e.key]=e.value),this.setCacheValue(a,o),o}setCacheValue(e,t){return this.cache.setCacheValue(e,t)}getCacheValue(e){return this.cache.getCacheValue(e)}getCacheClient(){return new d(this.options)}getGraphQLClient(){var e,t;if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:h.A.dictionary,retries:null==(e=this.options.retries)?void 0:e.count,retryStrategy:null==(t=this.options.retries)?void 0:t.retryStrategy})}}var m=r(4291),y=r(82169);let v=/class=".*(\bck-content\b).*"/g,b=(e,t)=>{e&&"object"==typeof e&&!t.loadStyles&&("value"in e&&"string"==typeof e.value?t.loadStyles=v.test(e.value):"fields"in e?Object.values(e.fields).forEach(e=>{b(e,t)}):Array.isArray(e)&&e.forEach(e=>{b(e,t)}))},w=(e,t)=>{if(t.loadStyles)return;"fields"in e&&e.fields&&Object.values(e.fields).forEach(e=>{b(e,t)});let r=e.placeholders||{};Object.keys(r).forEach(e=>{var n;n=r[e],t.loadStyles||n.forEach(e=>{w(e,t)})})};var S=r(92242);let E=/-library--([^\s]+)/,_=(e,t)=>
36{var r,n,i,a,s,o;let l;"params"in e&&e.params&&(l=(null==(n=null==(r=e.params.CSSStyles)?void 0:r.match(E))?void 0:n[1])||(null==(a=null==(i=e.params.Styles)?void 0:i.match(E))?void 0:a[1])||e.params.LibraryId||void 0),!l&&"fields"in e&&e.fields&&(l=(null==(s=(0,S.GR)(e.fields,"CSSStyles","").match(E))?void 0:s[1])||(null==(o=(0,S.GR)(e.fields,"Styles","").match(E))?void 0:o[1])||(0,S.GR)(e.fields,"LibraryId","")||void 0),l&&t.add(l);let u=e.placeholders||{};Object.keys(u).forEach(e=>{var r;r=u[e],r.map(e=>_(e,t))})},C=new URL(a.Cn).hostname;function k(e){try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname.toLowerCase()!==C}catch(e){return!1}}let I=RegExp(`https?://${C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"gi");function x(e,t){let r=(0,y.l)(t);return k(r)?function e(t,r){if(null==t)return t;if("string"==typeof t)return A(t,r);if(Array.isArray(t))return t.map(t=>e(t,r));if("object"==typeof t){if(Object.getPrototypeOf(t)!==Object.prototype)return t;let n={};for(let i of Object.keys(t))n[i]=e(t[i],r);return n}return t}(e,r):e}function A(e,t){return I.lastIndex=0,e.replace(I,t)}class T{constructor(e){this.serviceConfig=e,this.graphQLClient=this.getGraphQLClient()}getGraphQLClient(){var e,t;if(!this.serviceConfig.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.serviceConfig.clientFactory({debugger:this.serviceConfig.debugger||s.Ay.http,retries:null==(e=this.serviceConfig.retries)?void 0:e.count,retryStrategy:null==(t=this.serviceConfig.retries)?void 0:t.retryStrategy})}}class O extends T{constructor(e){super(e),this.serviceConfig=e}async fetchLayoutData(e,t,r){var n,i;let a=t.site,s=this.getLayoutQuery(e,a,null==t?void 0:t.locale);h.A.layout("fetching layout data for %s %s %s",e,null==t?void 0:t.locale,a);let o=await this.graphQLClient.request(s,{},r);return(null==(i=null==(n=null==o?void 0:o.layout)?void 0:n.item)?void 0:i.rendered)||{sitecore:{context:{pageEditing:!1,language:null==t?void 0:t.locale},route:null}}}getLayoutQuery(e,t,r){let n=r?`, language:"${r}"`:"",i=this.serviceConfig.formatLayoutQuery?this.serviceConfig.formatLayoutQuery(t,e,r):`layout(site:"${t}", routePath:"${e}"${n})`;return`query ContentSdkLayoutQuery { 37 ${i}{ 38 item { 39 rendered 40 } 41 } 42 }`}}var N=r(51862),R=r(34255);let D=e=>Object.assign(Object.assign({},e),{componentName:R.Y,experiences:{}});function P(e,t,r){var n;e.sitecore.context.variantId=t;let i=(null==(n=e.sitecore.route)?void 0:n.placeholders)||{};if(0===Object.keys(i).length)return;let a=e.sitecore.context.pageEditing;
42return i&&Object.keys(i).forEach(e=>{i[e]=function e(t,r,n){return t.map(t=>{if(void 0!==t.experiences){var i=t,a=r,s=n;let o=Object.keys(i.experiences).find(e=>a.includes(e)),l=o&&i.experiences[o];if(l||i.componentName)if(l&&null===l.componentName&&null===l.dataSource)if(!s)return null;else i=D(i);else l&&(i=l);else{if(!s)return null;i=D(i)}return i.experiences&&(i.experiences={}),i.placeholders&&Object.keys(null==i?void 0:i.placeholders).forEach(t=>{i.placeholders&&(i.placeholders[t]=e(i.placeholders[t],a))}),i}if(t.placeholders){let i=t.placeholders;Object.keys(i).forEach(t=>{i[t]=e(i[t],r,n)})}return t}).filter(Boolean)}(i[e],[t,...r||[]],a)}),i}let{UU:M}=a,j="sitemap",F=` 43 query SitemapQuery($siteName: String!) { 44 site { 45 siteInfo(site: $siteName) { 46 sitemap 47 } 48 } 49 } 50`;class L{constructor(e){this.options=e,this.graphQLClient=this.getGraphQLClient()}get query(){return F}async fetchSitemaps(e){let t=this.options.siteName;if(!t)throw Error(M.MV_002);let r=this.graphQLClient.request(this.query,{siteName:t},e);try{return r.then(e=>e.site.siteInfo.sitemap)}catch(e){return Promise.reject(e)}}async getSitemap(e){let t;if(void 0!==e){if(""===e)t=`${j}.xml`;else{let r=e.startsWith("-")?e.slice(1):e;t=`${j}-${r}.xml`}return(await this.fetchSitemaps()).find(e=>e.includes(t))}}getGraphQLClient(){if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:h.A.sitemap})}}let{UU:q}=a,$=` 51 query ErrorPagesQuery($siteName: String!, $language: String!) { 52 site { 53 siteInfo(site: $siteName) { 54 errorHandling(language: $language) { 55 notFoundPage { 56 rendered 57 } 58 notFoundPagePath 59 serverErrorPage { 60 rendered 61 } 62 serverErrorPagePath 63 } 64 } 65 } 66 } 67`;class U{constructor(e){this.options=e,this.graphQLClient=this.getGraphQLClient()}get query(){return $}async fetchErrorPages(e,t,r){let n=t||this.options.language;if(!e)throw Error(q.MV_002);return this.graphQLClient.request(this.query,{siteName:e,language:n},r).then(e=>{var t,r;if(!e.site.siteInfo)return null;let n=e.site.siteInfo.errorHandling,i=(null==(t=n.notFoundPage)?void 0:t.rendered)?{rendered:n.notFoundPage.rendered}:null,a=(null==(r=n.serverErrorPage)?void 0:r.rendered)?{rendered:n.serverErrorPage.rendered}:null;return Object.assign(Object.assign({},n),{notFoundPage:i,serverErrorPage:a})}).catch(e=>Promise.reject(e))}getGraphQLClient(){var e,t;if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:h.A.errorpages,retries:null==(e=this.options.retries)?void 0:e.count,retryStrategy:null==(t=this.options.retries)?void 0:t.retryStrategy})}}var V=r(28459);let{UU:z}=a;class G{constructor(e){this.options=e,this._graphQLClient=this.getGraphQLClient()}get graphQLClient(){return this._graphQLClient}get query(){let e;return e=this.options.includePersonalizedRoutes,` 68query ${e?"PersonalizeSitemapQuery":"DefaultSitemapQuery"}( 69 $siteName: String! 70 $language: String! 71 $includedPaths: [String] 72 $excludedPaths: [String] 73 $pageSize: Int = 100 74 $after: String 75) { 76 site { 77 siteInfo(site: $siteName) { 78 routes( 79 language: $language 80 includedPaths: $includedPaths 81 excludedPaths: $excludedPaths 82 first: $pageSize 83 after: $after 84 ){ 85 total 86 pageInfo { 87 endCursor 88 hasNext 89 } 90 results { 91 path: routePath 92 ${e?` 93 route { 94 personalization { 95 variantIds 96 } 97 }`:""} 98 } 99 } 100 } 101 } 102} 103`}async fetchSiteRoutes(e,t,r){let n=(e,t)=>({params:{path:e},locale:t}),i=[];if(!t.length)throw RangeError(z.MV_009);if(!e||!e.length)throw RangeError("The list of sites cannot be empty");for(let a=0;a<e.length;a++)for(let s of t){let t=await this.fetchLanguageSitePaths(s,e[a],r),o=await this.transformLanguageSitePaths(t,n,s);i.push(...o)}return[].concat(...i)}async transformLanguageSitePaths(e,t,r){let n=e=>decodeURI(e).replace(/^\/|\/$/g,"").split("/"),i=[];
103return e.forEach(e=>{var a,s,o;if(!e)return;i.push(t(n(e.path),r));let l=null==(o=null==(s=null==(a=e.route)?void 0:a.personalization)?void 0:s.variantIds)?void 0:o.filter(e=>!e.includes("_"));(null==l?void 0:l.length)&&i.push(...l.map(i=>t(n((0,N.F3)(e.path,[i])),r)))}),i}getGraphQLClient(){if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:h.A.sitemap})}async fetchLanguageSitePaths(e,t,r){var n,i,a,s;let o={siteName:t,language:e,pageSize:this.options.pageSize,includedPaths:this.options.includedPaths,excludedPaths:this.options.excludedPaths},l=[],u=!0,c="";for(h.A.sitemap("fetching sitemap data for %s %s",e,t);u;){let e=await this.graphQLClient.request(this.query,Object.assign(Object.assign({},o),{after:c}),r);if(null==(n=null==e?void 0:e.site)?void 0:n.siteInfo)l=l.concat(null==(i=e.site.siteInfo.routes)?void 0:i.results),u=null==(a=e.site.siteInfo.routes)?void 0:a.pageInfo.hasNext,c=null==(s=e.site.siteInfo.routes)?void 0:s.pageInfo.endCursor;else throw RangeError(z.IV_007(t))}return l.forEach(e=>{e&&(e.path=(0,V.S)(e.path,{siteName:t}))}),l}}var B=r(9809),Q=r(24318);let{UU:H}=a,Z=` 104 query RobotsQuery($siteName: String!) { 105 site { 106 siteInfo(site: $siteName) { 107 robots 108 } 109 } 110 } 111`;class K{constructor(e){this.options=e,this.graphQLClient=this.getGraphQLClient()}get query(){return Z}async fetchRobots(e){let t=this.options.siteName;if(!t)throw Error(H.MV_002);let r=this.graphQLClient.request(this.query,{siteName:t},e);try{return r.then(e=>{var t,r;return null==(r=null==(t=null==e?void 0:e.site)?void 0:t.siteInfo)?void 0:r.robots})}catch(e){return Promise.reject(e)}}getGraphQLClient(){if(!this.options.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.options.clientFactory({debugger:h.A.robots})}}var Y=r(60917);let W=` 112 query EditingQuery($itemId: String!, $language: String!, $version: String) { 113 item(path: $itemId, language: $language, version: $version) { 114 rendered 115 } 116 } 117`;class J{constructor(e){this.serviceConfig=e,this.graphQLClient=this.getGraphQLClient()}async fetchEditingData({itemId:e,language:t,version:r,layoutKind:n=Y.dQ.Final,mode:i},a){var s;if(h.A.editing("fetching editing data for %s %s %s %s",e,t,r,n),!t)throw RangeError("The language must be a non-empty string");let o=await this.graphQLClient.request(W,{itemId:e,version:r,language:t},Object.assign(Object.assign({},a),{headers:{sc_layoutKind:n,sc_editMode:"edit"===i?"true":"false"}}));return{layoutData:(null==(s=null==o?void 0:o.item)?void 0:s.rendered)||{sitecore:{context:{pageEditing:!0,language:t},route:null}}}}getGraphQLClient(){if(!this.serviceConfig.clientFactory)throw Error("clientFactory needs to be provided when initializing GraphQL client.");return this.serviceConfig.clientFactory({debugger:h.A.editing})}}var X=r(35762);r(41463);let{UU:ee}=a;class et{constructor(e){this.config=e}fetchComponentData(e,t){let r=this.config.contextId||this.config.clientContextId;if(!r)throw Error(ee.MV_001);let n=new o.j({debugger:h.A.layout});return h.A.layout("fetching component with uid %s for %s %s %s %s",e.componentUid,e.itemId,e.language,e.siteName,e.dataSourceId),n.get(this.getFetchUrl(e),Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},null==t?void 0:t.headers),{"x-sitecore-contextid":r,sc_editMode:`${e.mode===Y.lq.Metadata}`})})).then(e=>e.data).catch(e=>{var t;if((null==(t=e.response)?void 0:t.status)===404)return e.response.data;throw e})}getComponentFetchParams(e){return JSON.parse(JSON.stringify({item:e.itemId,uid:e.componentUid,dataSourceId:e.dataSourceId,renderingItemId:e.renderingId,version:e.version,sc_site:e.siteName,sc_lang:e.language||"en"}))}getFetchUrl(e){var t;let r=(0,y.l)(null!=(t=this.config.edgeUrl)?t:a.Ty);return function(e,t={}){if(!e)throw RangeError("url must be a non-empty string");if((0,X.A)()){let r=new URL(e);for(let e in t)({}).hasOwnProperty.call(t,e)&&r.searchParams.append(e,String(t[e]));return r.toString()}let r=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(String(t[e]))}`).join("&");return -1!==e.indexOf("?")?`${e}&${r}`:`${e}?${r}`}(`${r}/layout/component`,this.getComponentFetchParams(e))}}let{UU:er}=a;(n=i||(i={})).NotFound="404",n.InternalServerError="500";class en{constructor(e){var t,r,n,i,a,o,l,u,c,d;this.initOptions=e,this.clientFactory=this.getClientFactory(),this.graphQLClient=this.clientFactory({debugger:s.Ay.http});const h=this.getBaseServiceOptions();this.layoutService=null!=(r=null==(t=e.custom)?void 0:t.layoutService)?r:this.getLayoutService(h),this.dictionaryService=null!=(i=null==(n=e.custom)?void 0:n.dictionaryService)?i:this.getDictionaryService(h),this.editingService=null!=(o=null==(a=e.custom)?void 0:a.editingService)?o:this.getEditingService(),this.errorPagesService=null!=(u=null==(l=e.custom)?void 0:l.errorPagesService)?u:this.getErrorPagesService(),this.sitePathService=null!=(d=null==(c=e.custom)?void 0:c.sitePathService)?d:this.getSitePathService(),this.componentService=this.getComponentService()}parsePath(e){return"string"==typeof e?e.startsWith("/")?e:`/${e}`:`/${e.filter(e=>"/"!==e).map(e=>e.replace(/^\/+/,"").replace(/\/+$/,"")).join("/")}`}getData(e,t,r){return this.graphQLClient.request(e,t,r)}async getPage(e,t,r){var n,i,a,s;let o=this.parsePath(e),l=null!=(n=null==t?void 0:t.locale)?n:this.initOptions.defaultLanguage,u=null!=(i=null==t?void 0:t.site)?i:this.initOptions.defaultSite,c=await this.layoutService.fetchLayoutData(o,{locale:l,site:u},r);return c.sitecore.route?((null==(a=null==t?void 0:t.personalize)?void 0:a.variantId)&&P(c,t.personalize.variantId,t.personalize.componentVariantIds),{layout:c=this.applyContentRewrite(c),siteName:(null==(s=c.sitecore.context.site)?void 0:s.name)||u,locale:l,mode:this.getPageMode(m.IY.Normal)}):null}getHeadLinks(e,t={}){let{enableStyles:r=!0,enableThemes:n=!0}=t,{contextId:i,clientContextId:s}=this.initOptions.api.edge,o=[],u=i||s,c=(0,l.Ly)();if(r){let t=((e,t,r=a.Ty)=>{if(!e.sitecore.route)return null;let n={loadStyles:!1};return(w(e.sitecore.route,n),n.loadStyles)?{href:((e,t=a.Ty)=>`${(0,y.l)(t)}/v1/files/pages/styles/content-styles.css?sitecoreContextId=${e}`)(t,r),rel:"stylesheet"}:null})(e,u,c);t&&o.push(t)}return n&&o.push(...function(e,t,r=a.Ty){let n=new Set;return e.sitecore.route?(_(e.sitecore.route,n),[...n].map(e=>({href:((e,t,r=a.Ty)=>`${(0,y.l)(r)}/v1/files/components/styles/${e}
117.css?sitecoreContextId=${t}`)(e,t,r),rel:"stylesheet"}))):[]}(e,u,c)),o}async getDictionary(e,t){let r=(null==e?void 0:e.locale)||this.initOptions.defaultLanguage,n=(null==e?void 0:e.site)||this.initOptions.defaultSite;return await this.dictionaryService.fetchDictionaryData(r,n,t)}async getErrorPages(e,t){let r=(null==e?void 0:e.locale)||this.initOptions.defaultLanguage,n=(null==e?void 0:e.site)||this.initOptions.defaultSite;return await this.errorPagesService.fetchErrorPages(n,r,t)}async getPreview(e,t){var r;if(!e)return console.error("Preview data missing"),null;let{site:n,itemId:i,language:a,version:s,layoutKind:o,mode:l}=e,u=Array.isArray(e.variantIds)?e.variantIds:e.variantIds.split(","),c=await this.editingService.fetchEditingData({itemId:i,language:a,version:s,layoutKind:o,mode:l},t);if(!c)throw Error(`Unable to fetch editing data for preview ${JSON.stringify(e)}. ${er.CONTACT_SUPPORT}`);let d=c.layoutData,h=(0,N.Hg)(u);return P(d,h.variantId,h.componentVariantIds),{locale:a,layout:d=this.applyContentRewrite(d),siteName:(null==(r=d.sitecore.context.site)?void 0:r.name)||n,mode:this.getPageMode(l)}}async getDesignLibraryData(e,t){var r;let{itemId:n,componentUid:i,site:a,language:s,renderingId:o,dataSourceId:l,version:u,mode:c,generation:d}=e,h=await this.componentService.fetchComponentData(Object.assign({siteName:a,itemId:n,language:s,componentUid:i,renderingId:o,dataSourceId:l,version:u,mode:c},d?{generation:d}:{}),t);if(!h)throw Error(`Unable to fetch editing data for preview ${JSON.stringify(e)}. ${er.CONTACT_SUPPORT}`);let p=this.applyContentRewrite(h);return{locale:e.language,layout:p,siteName:(null==(r=p.sitecore.context.site)?void 0:r.name)||a,mode:this.getPageMode(c,d)}}async getErrorPage(e,t,r){var n,a;let s=(null==t?void 0:t.locale)||this.initOptions.defaultLanguage,o=(null==t?void 0:t.site)||this.initOptions.defaultSite,l=await this.getErrorPages({site:o,locale:s},r),u=null;switch(e){case i.NotFound:u=(null==(n=null==l?void 0:l.notFoundPage)?void 0:n.rendered)||null;break;case i.InternalServerError:u=(null==(a=null==l?void 0:l.serverErrorPage)?void 0:a.rendered)||null;break;default:return null}return u?{layout:u=this.applyContentRewrite(u),locale:s,mode:this.getPageMode(m.IY.Normal),siteName:o}:null}async getPagePaths(e,t,r){return this.sitePathService.fetchSiteRoutes(e,t||[],r)}async getSiteMap(e,t){let{reqHost:r,reqProtocol:n,id:i,siteName:a}=e,s=this.getGraphqlSitemapXMLService(a||this.initOptions.defaultSite),u=await s.getSitemap(i);if(u)try{let e=(0,l.NP)(),t=x(u,e),r=new o.j,n=await r.fetch(t);if(!n.data)throw Error("REDIRECT_404");return x(n.data,e)}catch(e){throw Error("REDIRECT_404")}let c=await s.fetchSitemaps(t);if(!c.length)throw Error("REDIRECT_404");return`<?xml version="1.0" encoding="UTF-8"?> 118 <sitemapindex xmlns="http://sitemaps.org/schemas/sitemap/0.9"> 119 ${c.map(e=>{let t=e.split("/"),i=t[t.length-1],a=`${n}://${r}/${i}`.replace(/&/g,"&");return`<sitemap><loc>${a}</loc></sitemap>`}).join("")} 120 </sitemapindex>`}async getRobots(e,t){let r=this.getRobotsService(e||this.initOptions.defaultSite);return await r.fetchRobots(t)||null}getGraphqlSitemapXMLService(e){return new L({clientFactory:this.clientFactory,siteName:e})}getRobotsService(e){return new K({clientFactory:this.clientFactory,siteName:e})}getBaseServiceOptions(){return{defaultSite:this.initOptions.defaultSite,clientFactory:this.clientFactory,retries:this.initOptions.retries}}applyContentRewrite(e){let t,r=this.initOptions.rewriteMediaUrls;if(!r)return e;let n=(0,l.NP)();return function e(t,r){if(null==t)return t;if("string"==typeof t)return r(t);if(Array.isArray(t))return t.map(t=>e(t,r));if("object"==typeof t&&Object.getPrototypeOf(t)===Object.prototype){let n={};for(let i of Object.keys(t))n[i]=e(t[i],r);return n}return t}(e,!0===r?k(t=(0,y.l)(n))?e=>A(e,t):e=>e:r)}getPageMode(e,t){let r={name:e,isNormal:!1,isPreview:!1,isEditing:!1,isDesignLibrary:!1,designLibrary:{isVariantGeneration:!1}};switch(e){case m.IY.Normal:r.isNormal=!0;break;case m.IY.Preview:r.isPreview=!0;break;case m.IY.Edit:r.isEditing=!0;break;case Y.lq.Normal:r.isDesignLibrary=!0;break;case Y.lq.Metadata:r.isDesignLibrary=!0,r.isEditing=!0}return r.isDesignLibrary&&t===Y.pM.Variant&&(r.designLibrary.isVariantGeneration=!0,r.isEditing=!0),r}getClientFactory(){return(e=>{let t,{api:r}=e,{edge:n,local:i}=null!=r?r:{},a="u">typeof window;if(null==n?void 0:n.contextId)t={endpoint:(0,Q.i)(n.edgeUrl),contextId:n.contextId};else if(a&&(null==n?void 0:n.clientContextId))t={endpoint:(0,Q.i)(n.edgeUrl),contextId:n.clientContextId};else if((null==i?void 0:i.apiKey)&&(null==i?void 0:i.apiHost))t={endpoint:`${i.apiH
120ost}${i.path}`,apiKey:i.apiKey};else if(a)console.warn("GraphQL client initialised in the browser without Edge or local API configuration; client-side requests may fail."),t={endpoint:"/api/graphql"};else throw Error(`GraphQL client misconfigured. 121 Configure one of the following in sitecore.config or your .env file: 122 Edge mode: set both sitecore.edge.contextId (server-side) and sitecore.edge.clientContextId (browser). 123 Local API mode: set api.local.apiHost and api.local.apiKey. 124 Supplying only api.edge.clientContextId will cause the application to fail at runtime.`);return B.q.createClientFactory(Object.assign(Object.assign({},t),e))})({api:this.initOptions.api,retries:this.initOptions.retries.count,retryStrategy:this.initOptions.retries.retryStrategy})}getLayoutService(e){return new O(Object.assign(Object.assign({},e),{formatLayoutQuery:this.initOptions.layout.formatLayoutQuery}))}getDictionaryService(e){return new g(Object.assign(Object.assign({},e),{cacheEnabled:this.initOptions.dictionary.caching.enabled,cacheTimeout:this.initOptions.dictionary.caching.timeout}))}getEditingService(){return new J({clientFactory:this.clientFactory})}getErrorPagesService(){return new U(Object.assign(Object.assign({},this.initOptions),{language:this.initOptions.defaultLanguage,clientFactory:this.clientFactory}))}getComponentService(){return new et(this.initOptions.api.edge)}getSitePathService(){return new G({clientFactory:this.clientFactory})}}},37028:e=>{"use strict";let t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,i=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,a=new Map([["n","\n"],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1b"],["a","\x07"]]);function s(e){let t="u"===e[0],r="{"===e[1];return t&&!r&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):a.get(e)||e}function o(e,t){let r={};for(let e of t)for(let t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(let[e,t]of Object.entries(r))if(Array.isArray(t)){if(!(e in n))throw Error(`Unknown Chalk style: ${e}`);n=t.length>0?n[e](...t):n[e]}return n}e.exports=(e,a)=>{let l=[],u=[],c=[];if(a.replace(t,(t,a,d,h,p,f)=>{if(a)c.push(s(a));else if(h){let t=c.join("");c=[],u.push(0===l.length?t:o(e,l)(t)),l.push({inverse:d,styles:function(e){let t;r.lastIndex=0;let a=[];for(;null!==(t=r.exec(e));){let e=t[1];if(t[2]){let r=function(e,t){let r,a=[];for(let o of t.trim().split(/\s*,\s*/g)){let t=Number(o);if(Number.isNaN(t))if(r=o.match(n))a.push(r[2].replace(i,(e,t,r)=>t?s(t):r));else throw Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`);else a.push(t)}return a}(e,t[2]);a.push([e].concat(r))}else a.push([e])}return a}(h)})}else if(p){if(0===l.length)throw Error("Found extraneous } in Chalk template literal");u.push(o(e,l)(c.join(""))),c=[],l.pop()}else c.push(f)}),u.push(c.join("")),l.length>0)throw Error(`Chalk template literal is missing ${l.length} closing bracket${1===l.length?"":"s"} (\`}\`)`);return u.join("")}},37310:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(66973),i=r(56307);t.DelayFactory=function(e,t){var r,a=(r=e).delayFirstAttempt?new i.AlwaysDelay(r):new n.SkipFirstDelay(r);return a.setAttemptNumber(t),a}},39617:(e,t,r)=>{let n=r(20292),i=r(74088),a={};Object.keys(n).forEach(e=>{a[e]={},Object.defineProperty(a[e],"channels",{value:n[e].channels}),Object.defineProperty(a[e],"labels",{value:n[e].labels});let t=i(e);Object.keys(t).forEach(r=>{let n,i,s=t[r];a[e][r]=(n=function(...e){let t=e[0];if(null==t)return t;t.length>1&&(e=t);let r=s(e);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r},"conversion"in s&&(n.conversion=s.conversion),n),a[e][r].raw=(i=function(...e){let t=e[0];return null==t?t:(t.length>1&&(e=t),s(e))}
124,"conversion"in s&&(i.conversion=s.conversion),i)})}),e.exports=a},42784:e=>{"use strict";e.exports={stdout:!1,stderr:!1}},46818:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("arrow-down-a-z",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]])},47370:function(e){e.exports=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,i){var a,s=function(e,r,n){void 0===n&&(n={});var i,a,s,o,l=new Date(e);return(void 0===(i=n)&&(i={}),(o=t[s=r+"|"+(a=i.timeZoneName||"short")])||(o=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:a}),t[s]=o),o).formatToParts(l)},o=function(t,r){for(var n=s(t,r),a=[],o=0;o<n.length;o+=1){var l=n[o],u=l.type,c=l.value,d=e[u];d>=0&&(a[d]=parseInt(c,10))}var h=a[3],p=a[0]+"-"+a[1]+"-"+a[2]+" "+(24===h?0:h)+":"+a[4]+":"+a[5]+":000",f=+t;return(i.utc(p).valueOf()-(f-=f%1e3))/6e4},l=n.prototype;l.tz=function(e,t){void 0===e&&(e=a);var r,n=this.utcOffset(),s=this.toDate(),o=s.toLocaleString("en-US",{timeZone:e}),l=Math.round((s-new Date(o))/1e3/60),u=-(15*Math.round(s.getTimezoneOffset()/15))-l;if(Number(u)){if(r=i(o,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(u,!0),t){var c=r.utcOffset();r=r.add(n-c,"minute")}}else r=this.utcOffset(0,t);return r.$x.$timezone=e,r},l.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),r=s(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return r&&r.value};var u=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return u.call(this,e,t);var r=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(r,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,r){var n=r&&t,s=r||t||a,l=o(+i(),s);if("string"!=typeof e)return i(e).tz(s);var u=function(e,t,r){var n=e-60*t*1e3,i=o(n,r);if(t===i)return[n,t];var a=o(n-=60*(i-t)*1e3,r);return i===a?[n,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(i.utc(e,n).valueOf(),l,s),c=u[0],d=u[1],h=i(c).utcOffset(d);return h.$x.$timezone=s,h},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}()},48411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullJitter=function(e){return Math.round(Math.random()*e)}},49737:(e,t,r)=>{"use strict";r.d(t,{v:()=>u});var n=r(12115),i=r(258),a=r(61578),s=r(99759),o=r(92242),l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let u=(0,i.O)((0,a.N)(e=>{let t;var{field:r,tag:i,render:a}=e,s=l(e,["field","tag","render"]);return(0,o.JE)(r)?null:(delete s.editable,t=a?a(r.value?new Date(r.value):null):r.value,i)?n.createElement(i||"span",Object.assign({},s),t):n.createElement(n.Fragment,null,t)},{defaultEmptyFieldEditingComponent:s.G}));u.displayName="Date"},51819:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
124ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},51862:(e,t,r)=>{"use strict";r.d(t,{E8:()=>u,F3:()=>a,Hg:()=>o,SH:()=>l,XG:()=>s});let n="_default",i="_variantId_";function a(e,t){let r=e.endsWith("/")?e.slice(0,-1):e;return`${r}${t.map(e=>`/${i}${e}`).join("")}`}function s(e){let t=e.split("/"),r=[];return t.forEach(e=>{let t=e.match(`${i}(.*$)`);t&&r.push(t[1])}),o(r)}function o(e){let t={variantId:n,componentVariantIds:[]};return e.forEach(e=>{var r;e.includes("_")?null==(r=t.componentVariantIds)||r.push(e):t.variantId=e}),t}function l(e){if(!e.includes(i))return e;let t=e.split("/");return(t=t.filter(e=>!e.includes(i))).join("/")||"/"}class u{static getPageVariantId(e,t,r,i){let a=e.replace(/[{}-]/g,""),s=t.replace("-","_"),o=i?`${this.normalizeScope(i)}_`:"",l=r;return r&&r!==n||(l="default"),`${o}${a}_${s}_${l}`.toLowerCase()}static getPageFriendlyId(e,t,r){let n=e.replace(/[{}-]/g,""),i=t.replace("-","_"),a=r?`${this.normalizeScope(r)}_`:"";return`embedded_${a}${n}_${i}`.toLowerCase()}static getComponentFriendlyId(e,t,r,n){let i=e.replace(/[{}-]/g,""),a=t.replace(/[{}-]/g,""),s=r.replace("-","_"),o=n?`${this.normalizeScope(n)}_`:"";return`component_${o}${i}_${a}_${s}*`.toLowerCase()}static normalizeScope(e){return(null==e?void 0:e.replace(/[^a-zA-Z0-9]+/g,""))||""}}},53283:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noJitter=function(e){return e}},53401:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,a){var s=i.prototype;a.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},s.utc=function(t){var r=a(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},s.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var o=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var l=s.init;s.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=s.utcOffset;s.utcOffset=function(n,i){var a=this.$utils().u;if(a(n))return this.$u?0:a(this.$offset)?u.call(this):this.$offset;if("string"==typeof n&&null===(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],a=i[0],s=60*i[1]+ +i[2];return 0===s?0:"+"===a?s:-s}(n)))return this;var s=16>=Math.abs(n)?60*n:n;if(0===s)return this.utc(i);var o=this.clone();if(i)return o.$offset=s,o.$u=!1,o;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(o=this.local().add(s+l,e)).$offset=s,o.$x.$localOffset=l,o};var c=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var d=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=s.diff;s.diff=function(e,t,r){if(e&&this.$u===e.$u)return h.call(this,e,t,r);var n=this.local(),i=a(e).local();return h.call(n,i,t,r)}}}()},54440:(e,t,r)=>{"use strict";
124Object.defineProperty(t,"__esModule",{value:!0});var n=r(48411),i=r(53283);t.JitterFactory=function(e){return"full"===e.jitter?n.fullJitter:i.noJitter}},56307:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AlwaysDelay=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(8073).Delay)},60063:function(e){e.exports=function(){"use strict";var e="month",t="quarter";return function(r,n){var i=n.prototype;i.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var a=i.add;i.add=function(r,n){return r=Number(r),this.$utils().p(n)===t?this.add(3*r,e):a.bind(this)(r,n)};var s=i.startOf;i.startOf=function(r,n){var i=this.$utils(),a=!!i.u(n)||n;if(i.p(r)===t){var o=this.quarter()-1;return a?this.month(3*o).startOf(e).startOf("day"):this.month(3*o+2).endOf(e).endOf("day")}return s.bind(this)(r,n)}}}()},64577:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},65377:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},65596:(e,t,r)=>{"use strict";r.d(t,{default:()=>i.a});var n=r(42593),i=r.n(n)},66973:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var r,n,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){var l=[a,o];if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,n=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){s.label=l[1];break}if(6===l[0]&&s.label<i[1]){s.label=i[1],i=l;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(l);break}i[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SkipFirstDelay=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.apply=function(){return a(this,void 0,void 0,function(){return s(this,function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(r(8073).Delay)},71265:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(12115),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},a=r(30907);let s=(0,n.createContext)({}),o=(0,n.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:o,className:l="",children:u,iconNode:c,...d},h)=>
124{let{size:p=24,strokeWidth:f=2,absoluteStrokeWidth:g=!1,color:m="currentColor",className:y=""}=(0,n.useContext)(s)??{},v=o??g?24*Number(r??f)/Number(t??p):r??f;return(0,n.createElement)("svg",{ref:h,...i,width:t??p??i.width,height:t??p??i.height,stroke:e??m,strokeWidth:v,className:(0,a.z)("lucide",y,l),...!u&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(u)?u:[u]])})},71849:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]])},72362:(e,t,r)=>{"use strict";r.d(t,{defaultImportEntries:()=>m});var n=r(12115),i=r(99740),a=r(6622),s=r(27861),o=r(11813),l=r(88218),u=r(11650),c=r(74883),d=r(7532),h=r(53254),p=r(88490),f=r(37845),g=r(51862);let m=[{module:"react",exports:[{name:"default",value:n},{name:"Children",value:n.Children},{name:"Fragment",value:n.Fragment},{name:"createElement",value:n.createElement},{name:"cloneElement",value:n.cloneElement},{name:"isValidElement",value:n.isValidElement},{name:"useActionState",value:n.useActionState},{name:"useCallback",value:n.useCallback},{name:"useContext",value:n.useContext},{name:"useDeferredValue",value:n.useDeferredValue},{name:"useEffect",value:n.useEffect},{name:"useId",value:n.useId},{name:"useLayoutEffect",value:n.useLayoutEffect},{name:"useMemo",value:n.useMemo},{name:"useOptimistic",value:n.useOptimistic},{name:"useReducer",value:n.useReducer},{name:"useRef",value:n.useRef},{name:"useState",value:n.useState},{name:"useSyncExternalStore",value:n.useSyncExternalStore},{name:"useTransition",value:n.useTransition},{name:"forwardRef",value:n.forwardRef},{name:"lazy",value:n.lazy},{name:"memo",value:n.memo},{name:"Suspense",value:n.Suspense}]},{module:"@sitecore-content-sdk/nextjs",exports:[{name:"Link",value:i.Link},{name:"Text",value:a.Text},{name:"RichText",value:s.RichText},{name:"Placeholder",value:o.Placeholder},{name:"NextImage",value:l.NextImage},{name:"Image",value:u._},{name:"File",value:c.Z},{name:"useSitecore",value:d.useSitecore},{name:"withSitecore",value:h.withSitecore},{name:"useComponentProps",value:p.useComponentProps},{name:"withDatasourceCheck",value:f.withDatasourceCheck},{name:"CdpHelper",value:g.E8}]}]},73497:e=>{"use strict";e.exports={stringReplaceAll:(e,t,r)=>{let n=e.indexOf(t);if(-1===n)return e;let i=t.length,a=0,s="";do s+=e.substr(a,n-a)+t+r,a=n+i,n=e.indexOf(t,a);while(-1!==n);return s+e.substr(a)},stringEncaseCRLFWithFirstIndex:(e,t,r,n)=>{let i=0,a="";do{let s="\r"===e[n-1];a+=e.substr(i,(s?n-1:n)-i)+t+(s?"\r\n":"\n")+r,i=n+1,n=e.indexOf("\n",i)}while(-1!==n);return a+e.substr(i)}}},74088:(e,t,r)=>{let n=r(20292);e.exports=function(e){let t=function(e){let t=function(){let e={},t=Object.keys(n);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;){let e=r.pop(),i=Object.keys(n[e]);for(let n=i.length,a=0;a<n;a++){let n=i[a],s=t[n];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,r.unshift(n))}}return t}(e),r={},i=Object.keys(t);for(let e=i.length,a=0;a<e;a++){let e=i[a];null!==t[e].parent&&(r[e]=function(e,t){let r=[t[e].parent,e],i=n[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)r.unshift(t[a].parent),i=function(e,t){return function(r){return t(e(r))}}(n[t[a].parent][a],i),a=t[a].parent;return i.conversion=r,i}(e,t))}return r}},74883:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(92242),i=r(12115),a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let s=e=>{var{field:t,children:r}=e,s=a(e,["field","children"]);if((0,n.JE)(t))return null;let o=t.src?t:t.value;if(!o)return null;let l=r?null:o.title||o.displayName,u={href:o.src};return i.createElement("a",Object.assign({},u,s),l,r)};s.displayName="File"},76721:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},78067:function(e,t){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};
124Object.defineProperty(t,"__esModule",{value:!0});var n={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};t.getSanitizedOptions=function(e){var t=r(r({},n),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}},78780:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},78887:(e,t,r)=>{"use strict";r.d(t,{a:()=>o});var n=r(12115),i=r(83648),a=r(30874),s=r(12517);let o=async e=>{var t;let r=(null==(t=e.rendering)?void 0:t.params)||{},o=Object.fromEntries(Object.entries(e).filter(([e])=>!s.p.includes(e))),l=Object.assign(Object.assign({},await (0,i.WT)(r)),o);return n.createElement(a.BYOCWrapper,Object.assign({},l))}},79442:(e,t,r)=>{var n="u">typeof globalThis&&globalThis||"u">typeof self&&self||void 0!==r.g&&r.g,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();(function(e){var t=void 0!==i&&i||"u">typeof self&&self||void 0!==r.g&&r.g||{},n={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(n.arrayBuffer)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function h(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function p(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){if(this.bodyUsed=this.bodyUsed,this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(n.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(n.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var t;n.arrayBuffer&&n.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e)}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(n.blob)return this.blob().then(p);throw Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,i,a=d(this);if(a)return a;
124if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?n[1]:"utf-8",t.readAsText(e,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},n.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=o(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[o(e)]},c.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},c.prototype.set=function(e,t){this.map[o(e)]=l(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),u(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),u(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),u(e)},n.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var m=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function y(e,r){if(!(this instanceof y))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,i,a=(r=r||{}).body;if(e instanceof y){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,r.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=r.credentials||this.credentials||"same-origin",(r.headers||!this.headers)&&(this.headers=new c(r.headers)),this.method=(i=(n=r.method||this.method||"GET").toUpperCase(),m.indexOf(i)>-1?i:n),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal||function(){if("AbortController"in t)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),("GET"===this.method||"HEAD"===this.method)&&("no-store"===r.cache||"no-cache"===r.cache)){var s=/([?&])_=[^&]*/;s.test(this.url)?this.url=this.url.replace(s,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function b(e,t){if(!(this instanceof b))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},g.call(y.prototype),g.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var w=[301,302,303,307,308];b.redirect=function(e,t){if(-1===w.indexOf(t))throw RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(r,i){return new Promise(function(a,s){var u=new y(r,i);if(u.signal&&u.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function h(){d.abort()}if(d.onload=function(){var e,t,r={statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}
124).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{t.append(n,i)}catch(e){console.warn("Response "+e.message)}}}),t)};0===u.url.indexOf("file://")&&(d.status<200||d.status>599)?r.status=200:r.status=d.status,r.url="responseURL"in d?d.responseURL:r.headers.get("X-Request-URL");var n="response"in d?d.response:d.responseText;setTimeout(function(){a(new b(n,r))},0)},d.onerror=function(){setTimeout(function(){s(TypeError("Network request failed"))},0)},d.ontimeout=function(){setTimeout(function(){s(TypeError("Network request timed out"))},0)},d.onabort=function(){setTimeout(function(){s(new e.DOMException("Aborted","AbortError"))},0)},d.open(u.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}(u.url),!0),"include"===u.credentials?d.withCredentials=!0:"omit"===u.credentials&&(d.withCredentials=!1),"responseType"in d&&(n.blob?d.responseType="blob":n.arrayBuffer&&(d.responseType="arraybuffer")),i&&"object"==typeof i.headers&&!(i.headers instanceof c||t.Headers&&i.headers instanceof t.Headers)){var p=[];Object.getOwnPropertyNames(i.headers).forEach(function(e){p.push(o(e)),d.setRequestHeader(e,l(i.headers[e]))}),u.headers.forEach(function(e,t){-1===p.indexOf(t)&&d.setRequestHeader(t,e)})}else u.headers.forEach(function(e,t){d.setRequestHeader(t,e)});u.signal&&(u.signal.addEventListener("abort",h),d.onreadystatechange=function(){4===d.readyState&&u.signal.removeEventListener("abort",h)}),d.send(void 0===u._bodyInit?null:u._bodyInit)})}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=c,t.Request=y,t.Response=b),e.Headers=c,e.Request=y,e.Response=b,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})})({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var a=n.fetch?n:i;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t},79942:function(e){e.exports=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/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,s={},o=function(e){return(e*=1)+(e>68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e||"Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),r=60*t[1]+(+t[2]||0);return 0===r?0:"+"===t[0]?-r:r}(e)}],c=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var r,n=s.meridiem;if(n){for(var i=1;i<=24;i+=1)if(e.indexOf(n(i,0,t))>-1){r=i>12;break}}else r=e===(t?"pm":"PM");return r},h={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[r,function(e){this.month=3*(e-1)+1}],S:[r,function(e){this.milliseconds=100*e}],SS:[n,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,l("seconds")],ss:[i,l("seconds")],m:[i,l("minutes")],mm:[i,l("minutes")],H:[i,l("hours")],h:[i,l("hours")],HH:[i,l("hours")],hh:[i,l("hours")],D:[i,l("day")],DD:[n,l("day")],Do:[a,function(e){var t=s.ordinal,r=e.match(/\d+/);if(this.day=r[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[i,l("week")],ww:[n,l("week")],M:[i,l("month")],MM:[n,l("month")],MMM:[a,function(e){var t=c("months"),r=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(r<1)throw Error();this.month=r%12||r}],MMMM:[a,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,l("year")],YY:[n,function(e){this.year=o(e)}],YYYY:[/\d{4}/,l("year")],Z:u,ZZ:u};return function(r,n,i){i.p.customParseFormat=!0,r&&r.parseTwoDigitYear&&(o=r.parseTwoDigitYear);var a=n.prototype,l=a.parse;a.parse=function(r){var n=r.date,a=r.utc,o=r.args;this.$u=a;
124var u=o[1];if("string"==typeof u){var c=!0===o[2],d=!0===o[3],p=o[2];d&&(p=o[2]),s=this.$locale(),!c&&p&&(s=i.Ls[p]),this.$d=function(r,n,i,a){try{if(["x","X"].indexOf(n)>-1)return new Date(("X"===n?1e3:1)*r);var o=(function(r){var n,i;n=r,i=s&&s.formats;for(var a=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,r,n){var a=n&&n.toUpperCase();return r||i[n]||e[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,r){return t||r.slice(1)})})).match(t),o=a.length,l=0;l<o;l+=1){var u=a[l],c=h[u],d=c&&c[0],p=c&&c[1];a[l]=p?{regex:d,parser:p}:u.replace(/^\[|\]$/g,"")}return function(e){for(var t={},r=0,n=0;r<o;r+=1){var i=a[r];if("string"==typeof i)n+=i.length;else{var s=i.regex,l=i.parser,u=e.slice(n),c=s.exec(u)[0];l.call(t,c),e=e.replace(c,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var r=e.hours;t?r<12&&(e.hours+=12):12===r&&(e.hours=0),delete e.afternoon}}(t),t}})(n)(r),l=o.year,u=o.month,c=o.day,d=o.hours,p=o.minutes,f=o.seconds,g=o.milliseconds,m=o.zone,y=o.week,v=new Date,b=c||(l||u?1:v.getDate()),w=l||v.getFullYear(),S=0;l&&!u||(S=u>0?u-1:v.getMonth());var E,_=d||0,C=p||0,k=f||0,I=g||0;return m?new Date(Date.UTC(w,S,b,_,C,k,I+60*m.offset*1e3)):i?new Date(Date.UTC(w,S,b,_,C,k,I)):(E=new Date(w,S,b,_,C,k,I),y&&(E=a(E).week(y).toDate()),E)}catch(e){return new Date("")}}(n,u,a,i),this.init(),p&&!0!==p&&(this.$L=this.locale(p).$L),(c||d)&&n!=this.format(u)&&(this.$d=new Date("")),s={}}else if(u instanceof Array)for(var f=u.length,g=1;g<=f;g+=1){o[1]=u[g-1];var m=i.apply(this,o);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}g===f&&(this.$d=new Date(""))}else l.call(this,r)}}}()},80846:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]])},83648:(e,t,r)=>{"use strict";r.d(t,{WT:()=>i,h5:()=>a});var n=r(67886);async function i(e){let t=e.ComponentDataOverride?JSON.parse(e.ComponentDataOverride):{};return{fetchedData:await n.yi.fetch(t||{})}}async function a(e,t,r){let n=t?"published":"staged",i=r||l(e,n),a="",u={},c=e.ComponentDataOverride?JSON.parse(e.ComponentDataOverride):{};try{a=await s(i,e,n),u=await o(c)}catch(e){console.error(e)}return{fetchedData:u,revisionFallback:n,template:a}}async function s(e,t,r){try{let{template:t}=await n.Sn(e);return t}catch(n){throw console.error(`Fetch FEAAS component from ${e} failed. Ensure the component revision "${t.ComponentRevision||r}" is present`),n}}async function o(e){try{return await n.yi.fetch(e||{})}catch(e){throw console.error("Fetch FEAAS component data settings failed"),e}}let l=(e,t)=>{var r;let n=e.ComponentRevision||t,i=(null==(r=e.ComponentHostName)?void 0:r.startsWith("https://"))?e.ComponentHostName:`https://${e.ComponentHostName}`;return`${i}/components/${e.LibraryId}/${e.ComponentId}/${e.ComponentVersion}/${n}`}},84723:(e,t,r)=>{"use strict";r.d(t,{Hk:()=>o,Ly:()=>u,NP:()=>l});var n=r(42787);function i(e){if(!e)return;let t=e.trim();if(!t)return;let r=t.toLowerCase();if("undefined"!==r&&"null"!==r)return t}var a=r(82169),s=r(41463);function o(e){let t=i(e);if(t)return(0,a.l)(t);let r=i(s.env.SITECORE_EDGE_PLATFORM_HOSTNAME);return r?c(r):n.Ty}function l(){let e=i(s.env.SITECORE_EXPERIENCE_EDGE_HOSTNAME);return e?c(e):n.Cn}function u(){return n.Ty}function c(e){let t=e.trim();return t.startsWith("https://")||t.startsWith("http://")?(0,a.l)(t):(0,a.l)(`https://${t}`)}},85574:(e,t,r)=>{"use strict";let n=r(2298);e.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function a(e,t){return"silent"===e?1/0:t.levels.values[e]}let s=Symbol("pino.logFuncs"),o=Symbol("pino.hierarchy"),l={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[o]};t[o]=r}function c(e){var t,r,n;let o,f,g;(e=e||{}).browser=e.browser||{};let m=e.browser.transmit;if(m&&"function"!=typeof m.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let S=e.serializers||{},E=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(S)),_=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(_=!1);let C=Object.keys(e.customLevels||{}
124),k=["error","fatal","warn","info","debug","trace"].concat(C);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let I=e.level||"info",x=Object.create(w);x.log||(x.log=y),o={},k.forEach(e=>{o[e]=w[e]?w[e]:i[e]||i[l[e]||"log"]||y}),x[s]=o,u({},x),Object.defineProperty(x,"levelVal",{get:function(){return a(this.level,this)}}),Object.defineProperty(x,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,A,x,"error"),d(this,A,x,"fatal"),d(this,A,x,"warn"),d(this,A,x,"info"),d(this,A,x,"debug"),d(this,A,x,"trace"),C.forEach(e=>{d(this,A,x,e)})}});let A={transmit:m,serialize:E,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?v:b,messageKey:e.messageKey||"msg",onChild:e.onChild||y};function T(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},E&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(E&&i){var a=Object.assign({},S,i),s=!0===e.browser.serialize?Object.keys(a):E;delete r.serializers,h([r],s,a,this._stdErrSerialize)}function o(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,a&&(this.serializers=a,this._serialize=s),m&&(this._logEvent=p([].concat(e._logEvent.bindings,r)))}o.prototype=this;let l=new o(this);return u(this,l),l.child=function(...e){return T.call(this,t,...e)},l.level=n.level||this.level,t.onChild(l),l}return f=e.customLevels||{},x.levels={values:Object.assign({},c.levels.values,f),labels:Object.assign({},c.levels.labels,(g={},Object.keys(n=f).forEach(function(e){g[n[e]]=e}),g))},x.level=I,x.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},x.setMaxListeners=x.getMaxListeners=x.emit=x.addListener=x.on=x.prependListener=x.once=x.prependOnceListener=x.removeListener=x.removeAllListeners=x.listeners=x.listenerCount=x.eventNames=x.write=x.flush=y,x.serializers=S,x._serialize=E,x._stdErrSerialize=_,x.child=function(...e){return T.call(this,A,...e)},m&&(x._logEvent=p()),x}function d(e,t,r,l){var u,c,d,f,g,m,v;if(Object.defineProperty(e,l,{value:a(e.level,r)>a(l,r)?y:r[s][l],writable:!0,enumerable:!0,configurable:!0}),e[l]===y){if(!t.transmit)return;let n=a(t.transmit.level||e.level,r);if(a(l,r)<n)return}e[l]=(u=e,c=t,d=r,f=l,g=u[s][f],function(){let e=c.timestamp(),t=Array(arguments.length),r=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var s=0;s<t.length;s++)t[s]=arguments[s];var o=!1;if(c.serialize&&(h(t,this._serialize,this.serializers,this._stdErrSerialize),o=!0),c.asObject||c.formatters){let i=function(e,t,r,i,a){let{level:s,log:o=e=>e}=a.formatters||{},l=r.slice(),u=l[0],c={},d=(0|e._childLevel)+1;if(d<1&&(d=1),i&&(c.time=i),s?Object.assign(c,s(t,e.levels.values[t])):c.level=e.levels.values[t],a.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;d--&&"object"==typeof l[0];)Object.assign(c,l.shift());return[o(c),...l]}if(null!==u&&"object"==typeof u){for(;d--&&"object"==typeof l[0];)Object.assign(c,l.shift());u=l.length?n(l.shift(),l):void 0}else"string"==typeof u&&(u=n(l.shift(),l));return void 0!==u&&(c[a.messageKey]=u),[o(c)]}(this,f,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}g.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}g.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=a(r,d),i=a(f,d);if(i<n)return;!function(e,t,r,n=!1){let i=t.send,a=t.ts,s=t.methodLevel,o=t.methodValue,l=t.val,u=e._logEvent.bindings;n||h(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(e){return -1===u.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=o,i(s,e._logEvent,l),e._logEvent=p(u)}(this,{ts:e,methodLevel:f,methodValue:i,transmitLevel:r,transmitValue:d.levels.values[c.transmit.level||u._level],send:c.transmit.send,val:a(u._level,d)},t,o)}});let b=function(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[o];for(;r.parent;)(r=r.parent).logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==b.length&&(e[l]=(m=b,v=e[l],function(){return v.apply(this,[...m,...arguments])}))}function h(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=c.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i])&&t)for(let n in e[i])t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function p(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function f(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function g(){return{}}function m(e){return e}function y(){}function v(){return!1}function b(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e<t.length;e++){let r=t[e].trim();if(/(^at\s+)?(createWrap|LOG|set\s*\(|asObject|Object\.apply|Function\.apply)/.test(r)||-1!==r.indexOf("browser.js")||-1!==r.indexOf("node:internal")||-1!==r.indexOf("node_modules"))continue;let n=r.match(/\((.*?):(\d+):(\d+)\)/);if(n||(n=r.match(/at\s+(.*?):(\d+):(\d+)/)),n)return n[1]+":"+n[2]+":"+n[3]}return null}c.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"}},c.stdSerializers={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:m,wrapResponseSerializer:m,wrapErrorSerializer:m,req:g,res:g,err:f,errWithCause:f},c.stdTimeFunctions=Object.assign({},{nullTime:v,epochTime:b,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=c,e.exports.pino=c},86272:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594
1241.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])},89190:(e,t,r)=>{"use strict";let n;r.d(t,{A:()=>ee});let i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",a=RegExp("^"+("["+i+"]["+i)+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(e,t){let r=[],n=t.exec(e);for(;n;){let i=[];i.startIndex=t.lastIndex-n[0].length;let a=n.length;for(let e=0;e<a;e++)i.push(n[e]);r.push(i),n=t.exec(e)}return r}let o=function(e){return null!=a.exec(e)},l=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],u=["__proto__","constructor","prototype"],c=e=>l.includes(e)?"__"+e:e,d={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:c},h=function(e){let t=Object.assign({},d,e);for(let{value:e,name:r}of[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}])e&&function(e,t){if("string"!=typeof e)return;let r=e.toLowerCase();if(l.some(e=>r===e.toLowerCase())||u.some(e=>r===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}(e,r);return null===t.onDangerousProperty&&(t.onDangerousProperty=c),t.processEntities=function e(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:e(!0)}(t.processEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>"string"==typeof e&&e.startsWith("*.")?".."+e.substring(2):e)),t};n="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class p{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),void 0!==t&&(this.child[this.child.length-1][n]={startIndex:t})}static getMetaDataSymbol(){return n}}class f{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let r=Object.create(null),n=0;if("O"===e[t+3]&&"C"===e[t+4]&&"T"===e[t+5]&&"Y"===e[t+6]&&"P"===e[t+7]&&"E"===e[t+8]){t+=9;let i=1,a=!1,s=!1;for(;t<e.length;t++)if("<"!==e[t]||s)if(">"===e[t]){if(s?"-"===e[t-1]&&"-"===e[t-2]&&(s=!1,i--):i--,0===i)break}else"["===e[t]?a=!0:e[t];else{if(a&&m(e,"!ENTITY",t)){let i,a;if(t+=7,[i,a,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),-1===a.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&n>=this.options.maxEntityCount)throw Error(`Entity count (${n+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let e=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r[i]={regx:RegExp(`&${e};`,"g"),val:a},n++}}else if(a&&m(e,"!ELEMENT",t)){t+=8;let{index:r}=this.readElementExp(e,t+1);t=r}else if(a&&m(e,"!ATTLIST",t))t+=8;else if(a&&m(e,"!NOTATION",t)){t+=9;let{index:r}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=r}else if(m(e,"!--",t))s=!0;else throw Error("Invalid DOCTYPE");i++}if(0!==i)throw Error("Unclosed DOCTYPE")}else throw Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:t}}readEntityExp(e,t){let r=t=g(e,t);for(;t<e.length&&!/\s/.test(e[t])&&'"'!==e[t]&&"'"!==e[t];)t++;let n=e.substring(r,t);if(y(n),t=g(e,t),!this.suppressValidationErr){if("SYSTEM"===e.substring(t,t+6).toUpperCase())throw Error("External entities are not supported");else if("%"===e[t])throw Error("Parameter entities are not supported")}let i="";if([t,i]=this.readIdentifierVal(e,t,"entity"),!1!==this.options.enabled&&null!=this.options.maxEntitySize&&i.length>this.options.maxEntitySize)throw Error(`Entity "${n}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,i,--t]}readNotationExp(e,t){let r=t=g(e,t);for(;t<e.length&&!/\s/.test(e[t]);)t++;let n=e.substring(r,t);this.suppressValidationErr||y(n),t=g(e,t);let i=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==i&&"PUBLIC"!==i)throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);t+=i.length,t=g(e,t);let a=null,s=null;if("PUBLIC"===i)[t,a]=this.readIdentifierVal(e,t,"publicIdentifier"),t=g(e,t),('"'===e[t]||"'"===e[t])&&([t,s]=this.readIdentifierVal(e,t,"systemIdentifier"));else if("SYSTEM"===i&&([t,s]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!s))throw Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:a,systemIdentifier:s,index:--t}}readIdentifierVal(e,t,r){let n="",i=e[t];if('"'!==i&&"'"!==i)throw Error(`Expected quoted string, found "${i}"`);let a=++t;for(;t<e.length&&e[t]!==i;)t++;if(n=e.substring(a,t),e[t]!==i)throw Error(`Unterminated ${r} value`);return[++t,n]}readElementExp(e,t){let r=t=g(e,t);for(;t<e.length&&!/\s/.test(e[t]);)t++;let n=e.substring(r,t);if(!this.suppressValidationErr&&!o(n))throw Error(`Invalid element name: "${n}"`);t=g(e,t);let i="";if("E"===e[t]&&m(e,"MPTY",t))t+=4;else if("A"===e[t]&&m(e,"NY",t))t+=2;else if("("===e[t]){let r=++t;
124for(;t<e.length&&")"!==e[t];)t++;if(i=e.substring(r,t),")"!==e[t])throw Error("Unterminated content model")}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:n,contentModel:i.trim(),index:t}}readAttlistExp(e,t){let r=t=g(e,t);for(;t<e.length&&!/\s/.test(e[t]);)t++;let n=e.substring(r,t);for(y(n),r=t=g(e,t);t<e.length&&!/\s/.test(e[t]);)t++;let i=e.substring(r,t);if(!y(i))throw Error(`Invalid attribute name: "${i}"`);t=g(e,t);let a="";if("NOTATION"===e.substring(t,t+8).toUpperCase()){if(a="NOTATION",t+=8,t=g(e,t),"("!==e[t])throw Error(`Expected '(', found "${e[t]}"`);t++;let r=[];for(;t<e.length&&")"!==e[t];){let n=t;for(;t<e.length&&"|"!==e[t]&&")"!==e[t];)t++;let i=e.substring(n,t);if(!y(i=i.trim()))throw Error(`Invalid notation name: "${i}"`);r.push(i),"|"===e[t]&&(t=g(e,++t))}if(")"!==e[t])throw Error("Unterminated list of notations");t++,a+=" ("+r.join("|")+")"}else{let r=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;if(a+=e.substring(r,t),!this.suppressValidationErr&&!["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"].includes(a.toUpperCase()))throw Error(`Invalid attribute type: "${a}"`)}t=g(e,t);let s="";return"#REQUIRED"===e.substring(t,t+8).toUpperCase()?(s="#REQUIRED",t+=8):"#IMPLIED"===e.substring(t,t+7).toUpperCase()?(s="#IMPLIED",t+=7):[t,s]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:n,attributeName:i,attributeType:a,defaultValue:s,index:t}}}let g=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function m(e,t,r){for(let n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function y(e){if(o(e))return e;throw Error(`Invalid entity name ${e}`)}let v=/^[-+]?0x[a-fA-F0-9]+$/,b=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,w={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"},S=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/,E=new Set(["push","pop","reset","updateCurrent","restore"]);class _{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._frozenPathCache=null,this._frozenSiblingsCache=null}push(e,t=null,r=null){this._pathStringCache=null,this._frozenPathCache=null,this._frozenSiblingsCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);let i=this.siblingStacks[n],a=r?`${r}:${e}`:e,s=i.get(a)||0,o=0;for(let e of i.values())o+=e;i.set(a,s+1);let l={tag:e,position:o,counter:s};null!=r&&(l.namespace=r),null!=t&&(l.values=t),this.path.push(l)}pop(){if(0===this.path.length)return;this._pathStringCache=null,this._frozenPathCache=null,this._frozenSiblingsCache=null;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];null!=e&&(t.values=e,this._frozenPathCache=null)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(0===this.path.length)return;let t=this.path[this.path.length-1];return t.values?.[e]}hasAttr(e){if(0===this.path.length)return!1;let t=this.path[this.path.length-1];return void 0!==t.values&&e in t.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let r=e||this.separator;if(r===this.separator&&!0===t){if(null!==this._pathStringCache&&void 0!==this._pathStringCache)return this._pathStringCache;let e=this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(r);return this._pathStringCache=e,e}return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(r)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this._frozenPathCache=null,this._frozenSiblingsCache=null,this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return 0!==t.length&&(e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t))}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++){let r=e[t],n=this.path[t],i=t===this.path.length-1;if(!this._matchSegment(r,n,i))return!1}return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,r=e.length-1;for(;r>=0&&t>=0;){let n=e[r];if("deep-wildcard"===n.type){if(--r<0)return!0;let n=e[r],i=!1;for(let e=t;e>=0;e--){let a=e===this.path.length-1;if(this._matchSegment(n,this.path[e],a)){t=e-1,r--,i=!0;break}}if(!i)return!1}else{let e=t===this.path.length-1;if(!this._matchSegment(n,this.path[t],e))return!1;t--,r--}}return r<0}_matchSegment(e,t,r){if("*"!==e.tag&&e.tag!==t.tag||void 0!==e.namespace&&"*"!==e.namespace&&e.namespace!==t.namespace)return!1;if(void 0!==e.attrName&&(!r||!t.values||!(e.attrName in t.values)||void 0!==e.attrValue&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(void 0!==e.position){if(!r)return!1;let n=t.counter??0;if("first"===e.position&&0!==n)return!1;if("odd"===e.position&&n%2!=1)return!1;if("even"===e.position&&n%2!=0)return!1;else if("nth"===e.position&&n!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}
124snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this._pathStringCache=null,this._frozenPathCache=null,this._frozenSiblingsCache=null,this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return new Proxy(this,{get(e,t,r){if(E.has(t))return()=>{throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};if("path"===t)return null===e._frozenPathCache&&(e._frozenPathCache=Object.freeze(e.path.map(e=>Object.freeze({...e})))),e._frozenPathCache;if("siblingStacks"===t)return null===e._frozenSiblingsCache&&(e._frozenSiblingsCache=Object.freeze(e.siblingStacks.map(e=>Object.freeze(new Map(e))))),e._frozenSiblingsCache;let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n},set(e,t){throw TypeError(`Cannot set property '${String(t)}' on a read-only Matcher.`)},deleteProperty(e,t){throw TypeError(`Cannot delete property '${String(t)}' from a read-only Matcher.`)}})}}class C{constructor(e,t={},r){this.pattern=e,this.separator=t.separator||".",this.segments=this._parse(e),this.data=r,this._hasDeepWildcard=this.segments.some(e=>"deep-wildcard"===e.type),this._hasAttributeCondition=this.segments.some(e=>void 0!==e.attrName),this._hasPositionSelector=this.segments.some(e=>void 0!==e.position)}_parse(e){let t=[],r=0,n="";for(;r<e.length;)e[r]===this.separator?r+1<e.length&&e[r+1]===this.separator?(n.trim()&&(t.push(this._parseSegment(n.trim())),n=""),t.push({type:"deep-wildcard"}),r+=2):(n.trim()&&t.push(this._parseSegment(n.trim())),n="",r++):(n+=e[r],r++);return n.trim()&&t.push(this._parseSegment(n.trim())),t}_parseSegment(e){let t,r,n={type:"tag"},i=null,a=e,s=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(a=s[1]+s[3],s[2])){let e=s[2].slice(1,-1);e&&(i=e)}let o=a;if(a.includes("::")){let r=a.indexOf("::");if(t=a.substring(0,r).trim(),o=a.substring(r+2).trim(),!t)throw Error(`Invalid namespace in pattern: ${e}`)}let l=null;if(o.includes(":")){let e=o.lastIndexOf(":"),t=o.substring(0,e).trim(),n=o.substring(e+1).trim();["first","last","odd","even"].includes(n)||/^nth\(\d+\)$/.test(n)?(r=t,l=n):r=o}else r=o;if(!r)throw Error(`Invalid segment pattern: ${e}`);if(n.tag=r,t&&(n.namespace=t),i)if(i.includes("=")){let e=i.indexOf("=");n.attrName=i.substring(0,e).trim(),n.attrValue=i.substring(e+1).trim()}else n.attrName=i.trim();if(l){let e=l.match(/^nth\((\d+)\)$/);e?(n.position="nth",n.positionValue=parseInt(e[1],10)):n.position=l}return n}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class k{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(e){if(this._sealed)throw TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard())return this._deepWildcards.push(e),this;let t=e.length,r=e.segments[e.segments.length-1],n=r?.tag;if(n&&"*"!==n){let r=`${t}:${n}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(e)}else this._wildcardByDepth.has(t)||this._wildcardByDepth.set(t,[]),this._wildcardByDepth.get(t).push(e);return this}addAll(e){for(let t of e)this.add(t);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(e){return null!==this.findMatch(e)}findMatch(e){let t=e.getDepth(),r=e.getCurrentTag(),n=`${t}:${r}`,i=this._byDepthAndTag.get(n);if(i){for(let t=0;t<i.length;t++)if(e.matches(i[t]))return i[t]}let a=this._wildcardByDepth.get(t);if(a){for(let t=0;t<a.length;t++)if(e.matches(a[t]))return a[t]}for(let t=0;t<this._deepWildcards.length;t++)if(e.matches(this._deepWildcards[t]))return this._deepWildcards[t];return null}}class I{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xa2"},pound:{regex:/&(pound|#163);/g,val:"\xa3"},yen:{regex:/&(yen|#165);/g,val:"\xa5"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"\xa9"},reg:{regex:/&(reg|#174);/g,val:"\xae"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>U(t,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>U(t,16,"&#x")}},this.addExternalEntities=x,this.parseXml=R,this.parseTextData=A,this.resolveNameSpace=T,this.buildAttributesMap=N,this.isItStopNode=j,this.replaceEntitiesValue=P,this.readStopNodeData=q,this.saveTextToParentTag=M,this.addChild=D,this.ignoreAttributesFn=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(let r of e)if("string"==typeof r&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new _,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new k;const t=this.options.stopNodes;if(t&&t.length>0){for(let e=0;e<t.length;e++){const r=t[e];"string"==typeof r?this.stopNodeExpressionsSet.add(new C(r)):r instanceof C&&this.stopNodeExpressionsSet.add(r)}this.stopNodeExpressionsSet.seal()}}}function x(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r],i=n.replace(/[.\-+*:]/g,"\\.");this.lastEntities[n]={regex:RegExp("&"+i+";","g"),val:e[n]}}}function A(e,t,r,n,i,a,s){let o=this.options;if(void 0!==e&&(o.trimValues&&!n&&(e=e.trim()),e.length>0)){s||(e=this.replaceEntitiesValue(e,t,r));let n=o.jPath?r.toString():r,l=o.tagValueProcessor(t,e,n,i,a);return null==l?e:typeof l!=typeof e||l!==e?l:o.trimValues||e.trim()===e?$(e,o.parseTagValue,o.numberParseOptions):e}}function T(e){if(this.options.removeNSPrefix){let t=e.split(":"),r="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=r+t[1])}return e}let O=RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function N(e,t,r){let n=this.options;if(!0!==n.ignoreAttributes&&"string"==typeof e){let i=s(e,O),a=i.length,o={},l=Array(a),u=!1,c={};for(let e=0;e<a;e++){let t=this.resolveNameSpace(i[e][1]),a=i[e][4];if(t.length&&void 0!==a){let i=a;n.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i,r,this.readonlyMatcher),l[e]=i,c[t]=i,u=!0}}u&&"object"==typeof t&&t.updateCurrent&&t.updateCurrent(c);let d=n.jPath?t.toString():this.readonlyMatcher,h=!1;for(let e=0;e<a;e++){let t=this.resolveNameSpace(i[e][1]);if(this.ignoreAttributesFn(t,d))continue;let r=n.attributeNamePrefix+t;if(t.length)if(n.transformAttributeName&&(r=n.transformAttributeName(r)),r=z(r,n),void 0!==i[e][4]){let i=l[e],a=n.attributeValueProcessor(t,i,d);null==a?o[r]=i:typeof a!=typeof i||a!==i?o[r]=a:o[r]=$(i,n.parseAttributeValue,n.numberParseOptions),h=!0}else n.allowBooleanAttributes&&(o[r]=!0,h=!0)}if(!h)return;if(n.attributesGroupName){let e={};return e[n.attributesGroupName]=o,e}return o}}let R=function(e){e=e.replace(/\r\n?/g,"\n");let t=new p("!xml"),r=t,n="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0,this.docTypeEntitiesKeys=[],this.lastEntitiesKeys=Object.keys(this.lastEntities),this.htmlEntitiesKeys=this.options.htmlEntities?Object.keys(this.htmlEntities):[];let i=this.options,a=new f(i.processEntities),s=e.length;for(let o=0;o<s;o++)if("<"===e[o]){let l=e.charCodeAt(o+1);if(47===l){let t=F(e,">",o,"Closing Tag is not closed."),a=e.substring(o+2,t).trim();if(i.removeNSPrefix){let e=a.indexOf(":");-1!==e&&(a=a.substr(e+1))}a=V(i.transformTagName,a,"",i).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));let s=this.matcher.getCurrentTag();if(a&&i.unpairedTagsSet.has(a))throw Error(`Unpaired tag can not be used as closing tag: </${a}>`);s&&i.unpairedTagsSet.has(s)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),n="",o=t}else if(63===l){let t=L(e,o,!1,"?>");if(!t)throw Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,this.readonlyMatcher),i.ignoreDeclaration&&"?xml"===t.tagName||i.ignorePiTags);else{let e=new p(t.tagName);e.add(i.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName)),this.addChild(r,e,this.readonlyMatcher,o)}o=t.closeIndex+1}else if(33===l&&45===e.charCodeAt(o+2)&&45===e.charCodeAt(o+3)){let t=F(e,"--\x3e",o+4,"Comment is not closed.");if(i.commentPropName){let a=e.substring(o+4,t-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(i.commentPropName,[{[i.textNodeName]:a}])}o=t}else if(33===l&&68===e.charCodeAt(o+2)){let t=a.readDocType(e,o);this.docTypeEntities=t.entities,this.docTypeEntitiesKeys=Object.keys(this.docTypeEntities)||[],o=t.i}else if(33===l&&91===e.charCodeAt(o+2)){let t=F(e,"]]>",o,"CDATA is not closed.")-2,a=e.substring(o+9,t);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);let s=this.parseTextData(a,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);void 0==s&&(s=""),i.cdataPropName?r.add(i.cdataPropName,[{[i.textNodeName]:a}]):r.add(i.textNodeName,s),o=t+2}else{let a,l=L(e,o,i.removeNSPrefix);if(!l){let t=e.substring(Math.max(0,o-50),Math.min(s,o+50));throw Error(`readTagExp returned undefined at position ${o}. Context: "${t}"`)}let u=l.tagName,c=l.rawTagName,d=l.tagExp,h=l.attrExpPresent,f=l.closeIndex;if({tagName:u,tagExp:d}=V(i.transformTagName,u,d,i),i.strictReservedNames&&(u===i.commentPropName||u===i.cdataPropName||u===i.textNodeName||u===i.attributesGroupName))throw Error(`Invalid tag name: ${u}`);r&&n&&"!xml"!==r.tagname&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));let g=r;g&&i.unpairedTagsSet.has(g.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());let m=!1;d.length>0&&d.lastIndexOf("/")===d.length-1&&(m=!0,d="/"===u[u.length-1]?u=u.substr(0,u.length-1):d.substr(0,d.length-1),h=u!==d);let y=null;a=function(e){if(!e||"string"!=typeof e)return;let t=e.indexOf(":");if(-1!==t&&t>0){let r=e.substring(0,t);if("xmlns"!==r)return r}}
124(c),u!==t.tagname&&this.matcher.push(u,{},a),u!==d&&h&&(y=this.buildAttributesMap(d,this.matcher,u))&&function(e,t){if(!e)return;let r=t.attributesGroupName?e[t.attributesGroupName]:e;if(!r)return;let n={};for(let e in r)e.startsWith(t.attributeNamePrefix)?n[e.substring(t.attributeNamePrefix.length)]=r[e]:n[e]=r[e]}(y,i),u!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let v=o;if(this.isCurrentNodeStopNode){let t="";if(m)o=l.closeIndex;else if(i.unpairedTagsSet.has(u))o=l.closeIndex;else{let r=this.readStopNodeData(e,c,f+1);if(!r)throw Error(`Unexpected end of ${c}`);o=r.i,t=r.tagContent}let n=new p(u);y&&(n[":@"]=y),n.add(i.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,n,this.readonlyMatcher,v)}else{if(m){({tagName:u,tagExp:d}=V(i.transformTagName,u,d,i));let e=new p(u);y&&(e[":@"]=y),this.addChild(r,e,this.readonlyMatcher,v),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(u)){let e=new p(u);y&&(e[":@"]=y),this.addChild(r,e,this.readonlyMatcher,v),this.matcher.pop(),this.isCurrentNodeStopNode=!1,o=l.closeIndex;continue}else{let e=new p(u);if(this.tagsNodeStack.length>i.maxNestedTags)throw Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),y&&(e[":@"]=y),this.addChild(r,e,this.readonlyMatcher,v),r=e}n="",o=f}}}else n+=e[o];return t.child};function D(e,t,r,n){this.options.captureMetaData||(n=void 0);let i=this.options.jPath?r.toString():r,a=this.options.updateTag(t.tagname,i,t[":@"]);!1===a||("string"==typeof a&&(t.tagname=a),e.addChild(t,n))}function P(e,t,r){let n=this.options.processEntities;if(!n||!n.enabled)return e;if(n.allowedTags){let i=this.options.jPath?r.toString():r;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(t):n.allowedTags(t,i)))return e}if(n.tagFilter){let i=this.options.jPath?r.toString():r;if(!n.tagFilter(t,i))return e}for(let t of this.docTypeEntitiesKeys){let r=this.docTypeEntities[t],i=e.match(r.regx);if(i){if(this.entityExpansionCount+=i.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions)throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);let t=e.length;if(e=e.replace(r.regx,r.val),n.maxExpandedLength&&(this.currentExpandedLength+=e.length-t,this.currentExpandedLength>n.maxExpandedLength))throw Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${n.maxExpandedLength}`)}}if(-1===e.indexOf("&"))return e;for(let t of this.lastEntitiesKeys){let r=this.lastEntities[t],i=e.match(r.regex);if(i&&(this.entityExpansionCount+=i.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);e=e.replace(r.regex,r.val)}if(-1===e.indexOf("&"))return e;for(let t of this.htmlEntitiesKeys){let r=this.htmlEntities[t],i=e.match(r.regex);if(i&&(this.entityExpansionCount+=i.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);e=e.replace(r.regex,r.val)}return e.replace(this.ampEntity.regex,this.ampEntity.val)}function M(e,t,r,n){return e&&(void 0===n&&(n=0===t.child.length),void 0!==(e=this.parseTextData(e,t.tagname,r,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,n))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function j(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function F(e,t,r,n){let i=e.indexOf(t,r);if(-1!==i)return i+t.length-1;throw Error(n)}function L(e,t,r,n=">"){let i=function(e,t,r=">"){let n=0,i=[],a=e.length,s=r.charCodeAt(0),o=r.length>1?r.charCodeAt(1):-1;for(let r=t;r<a;r++){let t=e.charCodeAt(r);if(n)t===n&&(n=0);else if(34===t||39===t)n=t;else if(t===s){if(-1===o)return{data:String.fromCharCode(...i),index:r};else if(e.charCodeAt(r+1)===o)return{data:String.fromCharCode(...i),index:r}}else if(9===t){i.push(32);continue}i.push(t)}}(e,t+1,n);if(!i)return;let a=i.data,s=i.index,o=a.search(/\s/),l=a,u=!0;-1!==o&&(l=a.substring(0,o),a=a.substring(o+1).trimStart());let c=l;if(r){let e=l.indexOf(":");-1!==e&&(u=(l=l.substr(e+1))!==i.data.substr(e+1))}return{tagName:l,tagExp:a,closeIndex:s,attrExpPresent:u,rawTagName:c}}function q(e,t,r){let n=r,i=1,a=e.length;for(;r<a;r++)if("<"===e[r]){let a=e.charCodeAt(r+1);if(47===a){let a=function(e,t,r){let n=e.indexOf(">",t);if(-1===n)throw Error(r);return n}(e,r,`${t} is not closed`);if(e.substring(r+2,a).trim()===t&&0==--i)return{tagContent:e.substring(n,r),i:a};r=a}else if(63===a)r=F(e,"?>",r+1,"StopNode is not closed.");else if(33===a&&45===e.charCodeAt(r+2)&&45===e.charCodeAt(r+3))r=F(e,"--\x3e",r+3,"StopNode is not closed.");else if(33===a&&91===e.charCodeAt(r+2))r=F(e,"]]>",r,"StopNode is not closed.")-2;else{let n=L(e,r,">");n&&((n&&n.tagName)===t&&"/"!==n.tagExp[n.tagExp.length-1]&&i++,r=n.closeIndex)}}}function $(e,t,r){if(t&&"string"==typeof e){let t=e.trim();return"true"===t||"false"!==t&&function(e,t={}){if(t=Object.assign({},w,t),!e||"string"!=typeof e)return e;let r=e.trim();if(0===r.length)return e;{if(void 0!==t.skipLike&&t.skipLike.test(r))return e;if("0"===r)return 0;if(t.hex&&v.test(r)){var n,i=r;if(parseInt)return parseInt(i,16);if(Number.parseInt)return Number.parseInt(i,16);if(window&&window.parseInt)return window.parseInt(i,16);throw Error("parseInt, Number.parseInt, window.parseInt are not supported")}if(!isFinite(r)){var a=e,s=Number(r),o=t;switch(o.infinity.toLowerCase()){case"null":return null;case"infinity":return s;case"string":return s===1/0?"Infinity":"-Infinity";default:return a}}if(r.includes("e")||r.includes("E"))return function(e,t,r){if(!r.eNotation)return e;let n=t.match(S);if(!n)return e;{let i=n[1]||"",a=-1===n[3].indexOf("e")?"E":"e",s=n[2],o=i?e[s.length+1]===a:e[s.length]===a;if(s.length>1&&o)return e;if(1===s.length&&(n[3].startsWith(`.${a}`)||n[3][0]===a))return Number(t);if(!(s.length>0))return Number(t);else if(r.leadingZeros&&!o)return Number(t=(n[1]||"")+n[3]);else return e}}(e,r,t);let l=b.exec(r);if(!l)return e;{let i=l[1]||"",a=l[2],s=((n=l[3])&&-1!==n.indexOf(".")&&("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1))),n),o=i?"."===e[a.length+1]:"."===e[a.length];if(!t.leadingZeros&&(a.length>1||1===a.length&&!o))return e;{let n=Number(r),o=String(n);if(0===n)return n;if(-1!==o.search(/[eE]/))if(t.eNotation)return n;else return e;if(-1!==r.indexOf("."))if("0"===o)return n;else if(o===s)return n;else if(o===`${i}${s}`)return n;else return e;let l=a?s:r;return a?l===o||i+l===o?n:e:l===o||l===i+o?n:e}}}}(e,r)}return void 0!==e?e:""}function U(e,t,r){let n=Number.parseInt(e,t);return n>=0&&n<=1114111?String.fromCodePoint(n):r+e+";"}function V(e,t,r,n){if(e){let n=e(t);r===t&&(r=n),t=n}return{tagName:t=z(t,n),tagExp:r}}function z(e,t){if(u.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return l.includes(e)?t.onDangerousProperty(e):e}let G=p.getMetaDataSymbol(),B={allowBooleanAttributes:!1,unpairedTags:[]};function Q(e){return" "===e||" "===e||"\n"===e||"\r"===e}function H(e,t){let r=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){let n=e.substr(r,t-r);if(t>5&&"xml"===n)return W("InvalidXml","XML declaration allowed only at the start of the document.",J(e,t));if("?"!=e[t]||">"!=e[t+1])continue;t++;break}return t}function Z(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let r=1;for(t+=8;t<e.length;t++)if("<"===e[t])r++;else if(">"===e[t]&&0==--r)break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7]){for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}}return t}let K=RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Y(e,t){let r=s(e,K),n={};for(let e=0;e<r.length;e++){if(0===r[e][1].length)return W("InvalidAttr","Attribute '"+r[e][2]+"' has no space in starting.",X(r[e]));if(void 0!==r[e][3]&&void 0===r[e][4])return W("InvalidAttr","Attribute '"+r[e][2]+"' is without value.",X(r[e]));if(void 0===r[e][3]&&!t.allowBooleanAttributes)return W("InvalidAttr","boolean attribute '"+r[e][2]+"' is not allowed.",X(r[e]));let i=r[e][2];
124if(!o(i))return W("InvalidAttr","Attribute '"+i+"' is an invalid name.",X(r[e]));if(Object.prototype.hasOwnProperty.call(n,i))return W("InvalidAttr","Attribute '"+i+"' is repeated.",X(r[e]));n[i]=1}return!0}function W(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function J(e,t){let r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function X(e){return e.startIndex+e[1].length}class ee{constructor(e){this.externalEntities={},this.options=h(e)}parse(e,t){var r;if("string"!=typeof e&&e.toString)e=e.toString();else if("string"!=typeof e)throw Error("XML data is accepted in String or Bytes[] form.");if(t){!0===t&&(t={});let r=function(e,t){t=Object.assign({},B,t);let r=[],n=!1,i=!1;"\uFEFF"===e[0]&&(e=e.substr(1));for(let a=0;a<e.length;a++)if("<"===e[a]&&"?"===e[a+1]){if(a+=2,(a=H(e,a)).err)return a}else if("<"===e[a]){let s=a;if("!"===e[++a]){a=Z(e,a);continue}{let l=!1;"/"===e[a]&&(l=!0,a++);let u="";for(;a<e.length&&">"!==e[a]&&" "!==e[a]&&" "!==e[a]&&"\n"!==e[a]&&"\r"!==e[a];a++)u+=e[a];if("/"===(u=u.trim())[u.length-1]&&(u=u.substring(0,u.length-1),a--),!o(u))return W("InvalidTag",0===u.trim().length?"Invalid space after '<'.":"Tag '"+u+"' is an invalid name.",J(e,a));let c=function(e,t){let r="",n="",i=!1;for(;t<e.length;t++){if('"'===e[t]||"'"===e[t])""===n?n=e[t]:n!==e[t]||(n="");else if(">"===e[t]&&""===n){i=!0;break}r+=e[t]}return""===n&&{value:r,index:t,tagClosed:i}}(e,a);if(!1===c)return W("InvalidAttr","Attributes for '"+u+"' have open quote.",J(e,a));let d=c.value;if(a=c.index,"/"===d[d.length-1]){let r=a-d.length,i=Y(d=d.substring(0,d.length-1),t);if(!0!==i)return W(i.err.code,i.err.msg,J(e,r+i.err.line));n=!0}else if(l)if(!c.tagClosed)return W("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",J(e,a));else{if(d.trim().length>0)return W("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",J(e,s));if(0===r.length)return W("InvalidTag","Closing tag '"+u+"' has not been opened.",J(e,s));let t=r.pop();if(u!==t.tagName){let r=J(e,t.tagStartPos);return W("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+r.line+", col "+r.col+") instead of closing tag '"+u+"'.",J(e,s))}0==r.length&&(i=!0)}else{let o=Y(d,t);if(!0!==o)return W(o.err.code,o.err.msg,J(e,a-d.length+o.err.line));if(!0===i)return W("InvalidXml","Multiple possible root nodes found.",J(e,a));-1!==t.unpairedTags.indexOf(u)||r.push({tagName:u,tagStartPos:s}),n=!0}for(a++;a<e.length;a++)if("<"===e[a])if("!"===e[a+1]){a=Z(e,++a);continue}else if("?"===e[a+1]){if((a=H(e,++a)).err)return a}else break;else if("&"===e[a]){let t=function(e,t){if(";"===e[++t])return -1;if("#"===e[t]){var r=++t;let n=/\d/;for("x"===e[r]&&(r++,n=/[\da-fA-F]/);r<e.length;r++){if(";"===e[r])return r;if(!e[r].match(n))break}return -1}let n=0;for(;t<e.length;t++,n++)if(!e[t].match(/\w/)||!(n<20)){if(";"===e[t])break;return -1}return t}(e,a);if(-1==t)return W("InvalidChar","char '&' is not expected.",J(e,a));a=t}else if(!0===i&&!Q(e[a]))return W("InvalidXml","Extra text at the end",J(e,a));"<"===e[a]&&a--}}else{if(Q(e[a]))continue;return W("InvalidChar","char '"+e[a]+"' is not expected.",J(e,a))}return n?1==r.length?W("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",J(e,r[0].tagStartPos)):!(r.length>0)||W("InvalidXml","Invalid '"+JSON.stringify(r.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):W("InvalidXml","Start tag expected.",1)}(e,t);if(!0!==r)throw Error(`${r.err.msg}:${r.err.line}:${r.err.col}`)}let n=new I(this.options);n.addExternalEntities(this.externalEntities);let i=n.parseXml(e);return this.options.preserveOrder||void 0===i?i:(r=this.options,function e(t,r,n,i){let a,s={};for(let o=0;o<t.length;o++){let l=t[o],u=function(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let r=t[e];if(":@"!==r)return r}}(l);if(void 0!==u&&u!==r.textNodeName){let e=function(e,t){if(!e||"object"!=typeof e)return{};if(!t)return e;let r={};for(let n in e)n.startsWith(t)?r[n.substring(t.length)]=e[n]:r[n]=e[n];return r}(l[":@"]||{},r.attributeNamePrefix);n.push(u,e)}if(u===r.textNodeName)void 0===a?a=l[u]:a+=""+l[u];else if(void 0===u)continue;else if(l[u]){let t=e(l[u],r,n,i),a=function(e,t){let{textNodeName:r}=t,n=Object.keys(e).length;return 0===n||1===n&&(!!e[r]||"boolean"==typeof e[r]||0===e[r])}(t,r);if(l[":@"]?function(e,t,r,n){if(t){let i=Object.keys(t),a=i.length;for(let s=0;s<a;s++){let a=i[s],o=a.startsWith(n.attributeNamePrefix)?a.substring(n.attributeNamePrefix.length):a,l=n.jPath?r.toString()+"."+o:r;n.isArray(a,l,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}(t,l[":@"],i,r):1!==Object.keys(t).length||void 0===t[r.textNodeName]||r.alwaysCreateTextNode?0===Object.keys(t).length&&(r.alwaysCreateTextNode?t[r.textNodeName]="":t=""):t=t[r.textNodeName],void 0!==l[G]&&"object"==typeof t&&null!==t&&(t[G]=l[G]),void 0!==s[u]&&Object.prototype.hasOwnProperty.call(s,u))Array.isArray(s[u])||(s[u]=[s[u]]),s[u].push(t);else{let e=r.jPath?i.toString():i;r.isArray(u,e,a)?s[u]=[t]:s[u]=t}void 0!==u&&u!==r.textNodeName&&n.pop()}}return"string"==typeof a?a.length>0&&(s[r.textNodeName]=a):void 0!==a&&(s[r.textNodeName]=a),s}(i,r,n.matcher,n.readonlyMatcher))}addEntity(e,t){if(-1!==t.indexOf("&"))throw Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return p.getMetaDataSymbol()}}},91161:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])},94088:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},94407:(e,t,r)=>{"use strict";let n,i,a,s,o,l;r.d(t,{xB:()=>z,_P:()=>w7,xA:()=>Se,wn:()=>b_,St:()=>wK,me:()=>aB,iZ:()=>E$,bs:()=>EU,r7:()=>aG,Y4:()=>E2,Dr:()=>E5,Er:()=>_p,XD:()=>vn,PT:()=>_O,fY:()=>_9,n_:()=>C_,wL:()=>CT,fM:()=>CD,T:()=>CR,as:()=>CP,_X:()=>CO});var u,c,d,h,p,f,g,m,y,v,b,w,S,E,_,C,k,I,x,A,T,O,N,R,D,P,M,j,F,L,q,$,U,V,z,G,B,Q,H,Z,K,Y,W,J,X,ee,et,er={};r.r(er),r.d(er,{JsonPatchError:()=>hG,_areEquals:()=>h0,applyOperation:()=>hK,applyPatch:()=>hY,applyReducer:()=>hW,deepClone:()=>hB,getValueByPointer:()=>hZ,validate:()=>hX,validator:()=>hJ});var en={};r.r(en),r.d(en,{compare:()=>h8,generate:()=>h6,observe:()=>h4,unobserve:()=>h5});
124var ei=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ea=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let e in this.definition){let t=this.definition[e].validate(r[e]);t&&n.push(`${e}: ${t}`)}if(n.length)throw new ei(` 125 The following properties are invalid: 126 127 ${n.join("\n ")} 128 129 ${t} 130 `);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;void 0!==r&&(e[t]=r)}return e}},es=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&el(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return!0===this.baseConfig.required}};function eo(e){return void 0===e}function el(e){return eo(e)||null===e}var eu=class{value;constructor(e={}){this.value=new es(e)}validate(e){var t;let r=this.value.validate(e);return r||(eo(t=e)||ec(t)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function ec(e){return"boolean"==typeof e}var ed=class{constructor(e={}){this.config=e,this.value=new es(e)}value;validate(e){var t;let r=this.value.validate(e);return r||(eo(t=e)||eh(t)?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 eh(e){return"number"==typeof e&&!Number.isNaN(e)}var ep=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,ef=class{value;config;constructor(e={}){this.config={emptyAllowed:!0,url:!1,...e},this.value=new es(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:a}=this.config,s=this.value.validate(e);if(s)return s;if(eo(e))return null;if(!eg(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch(e){return"value is not a valid URL."}if(n&&!n.test(e))return`value did not match provided regex ${n}`;if(i&&!i.includes(e)){let e=i.join(", ");return`value should be one of: ${e}.`}return a&&!(ep.test(e)&&"Invalid Date"!==new Date(e).toString())?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function eg(e){return"[object String]"===Object.prototype.toString.call(e)}var em=class{config;constructor(e={}){this.config={options:{required:!1},values:{},...e}}validate(e){if(eo(e))return this.config.options.required?"value is required and is currently undefined":null;if(!ey(e))return"value is not an object";for(let[t,r]of Object.entries(this.config.values))if(r.required&&el(e[t]))return`value does not contain ${t}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],a=n.validate(i);null!==a&&(t+=` ${a}`)}return""===t?null:t}get default(){}get required(){return!!this.config.options.required}};function ey(e){return void 0!==e&&"object"==typeof e}var ev=class{constructor(e={}){this.config=e,this.value=new es(this.config)}value;validate(e){if(!el(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(null!==t)return t;if(el(e))return null;if(void 0!==this.config.max&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(void 0!==this.config.min&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(void 0!==this.config.each){let t="";return e.forEach(r=>{this.config.each.required&&el(r)&&(t=`value is null or undefined: ${e.join(",")}`);let n=this.validatePrimitiveValue(r,this.config.each);null!==n&&(t+=` ${n}`)}),""===t?null:t}return null}validatePrimitiveValue(e,t){return ec(e)||eg(e)?t.validate(e):eh(e)?t.validate(e):ey(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function eb(e){return Array.isArray(e)}var ew=class{constructor(e){this.config=e,this.value=new es(e)}value;validate(e){let t=this.value.validate(e);return null!==t?t:eo(e)||Object.values(this.config.enum).find(t=>t===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};function eS(e){return Array.isArray(e)}let eE=new Set(["1",1,"yes",!0]);function e_(e){if("object"!=typeof e||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){return e}}function eC(e,t){return t?t.open+e+t.close:e}async function ek(e,t){let r,n=e.getReader();for(;!(r=await n.read()).done;)t(r.value)}function eI(){return{data:"",event:"",id:"",retry:void 0}}(u=M||(M={}))[u.NewLine=10]="NewLine",u[u.CarriageReturn=13]="CarriageReturn",u[u.Space=32]="Space",u[u.Colon=58]="Colon";let ex="text/event-stream",eA="last-event-id";function eT(){return"u">typeof window}function eO(e,{signal:t,headers:r,onopen:n,onmessage:i,onclose:a,onerror:s,openWhenHidden:o,fetch:l,...u}){return new Promise((c,d)=>{let h,p,f={...r};function g(){h?.abort(),document.hidden||w()}f.accept||(f.accept=ex),!o&&eT()&&document.addEventListener("visibilitychange",g);let m=1e3;function y(){eT()&&document.removeEventListener("visibilitychange",g),clearTimeout(p),h?.abort()}t?.addEventListener("abort",()=>{y(),c()});let v=l??fetch,b=n??eN;async function w(){h=AbortController?new AbortController:null;try{var t,r,n;
130let s,o,l,d,p,g,w=await v(e,{...u,headers:f,signal:h?.signal});await b(w),await ek(w.body,(t=e=>{e?f[eA]=e:delete f[eA]},r=e=>{m=e},s=eI(),o=new TextDecoder,n=function(e,n){if(0===e.length)i?.(s),s=eI();else if(n>0){let i=o.decode(e.subarray(0,n)),c=n+(e[n+1]===M.Space?2:1),d=o.decode(e.subarray(c));switch(i){case"data":s.data=s.data?`${s.data} 131${d}`:d;break;case"event":s.event=d;break;case"id":t(s.id=d);break;case"retry":var a,l,u;let h;a=d,l=s,u=r,h=parseInt(a,10),Number.isNaN(h)||u(l.retry=h)}}},g=!1,function(e){var t,r;let i;void 0===l?(l=e,d=0,p=-1):(t=l,r=e,(i=new Uint8Array(t.length+r.length)).set(t),i.set(r,t.length),l=i);let a=l.length,s=0;for(;d<a;){g&&(l[d]===M.NewLine&&(s=++d),g=!1);let e=-1;for(;d<a&&-1===e;++d)switch(l[d]){case M.Colon:-1===p&&(p=d-s);break;case M.CarriageReturn:g=!0,e=d;break;case M.NewLine:e=d}if(-1===e)break;n(l.subarray(s,e),p),s=d,p=-1}s===a?l=void 0:0!==s&&(l=l.subarray(s),d-=s)})),a?.(),y(),c()}catch(e){if(!h?.signal?.aborted)try{let t=s?.(e)??m;clearTimeout(p),p=setTimeout(w,t)}catch(e){y(),d(e)}}}w()})}function eN(e){let t=e.headers.get("content-type");if(!t?.startsWith(ex))throw Error(`Expected content-type to be ${ex}, Actual: ${t}`)}class eR{constructor(e){this._params={},this._basePath=e}addParam(e,t){this._params={...this.params,[e]:t}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join("&")}`:this.basePath}}class eD extends Error{}class eP extends Error{constructor(e){super(e.message),this.payload=e}}class eM{add(e){this.timeouts.add(e)}remove(e){clearTimeout(e),this.timeouts.delete(e)}isActive(e){return this.timeouts.has(e)}constructor(){this.timeouts=new Set}}class ej{constructor(e){this.logger=e.logger}streamGeneratedAnswer(e,t){let r,{url:n,organizationId:i,streamId:a,accessToken:s}=e,{write:o,abort:l,close:u,resetAnswer:c}=t,d=new eM;if(!a)return void this.logger.error("No stream ID found");let h=0,p=()=>{r&&!d.isActive(r)&&(f?.abort(),c(),g())},f=new AbortController,g=()=>eO(new eR(`${n}/rest/organizations/${i}/machinelearning/streaming/${a}`).href,{method:"GET",fetch,headers:{Authorization:`Bearer ${s}`,accept:"*/*"},openWhenHidden:!0,signal:f?.signal,async onopen(e){if(!e.ok||"text/event-stream"!==e.headers.get("content-type")){if(e.status>=400&&e.status<500&&429!==e.status)throw new eP({message:"Error opening stream",code:e.status});throw new eD}},onmessage:e=>{if(f?.signal.aborted)return;let t=JSON.parse(e.data);if("ERROR"===t.finishReason){d.remove(r),f?.abort(),l({message:t.errorMessage,code:t.statusCode});return}if(o(t),h=0,"COMPLETED"===t.finishReason)d.remove(r),u();else d.remove(r),clearTimeout(r),r=setTimeout(p,5e3),d.add(r)},onerror:e=>{if(!f?.signal.aborted){if(d.remove(r),e instanceof eP)throw f?.abort(),l(e),e;if(++h>3){this.logger.info("Maximum retry exceeded.");let e={message:"Failed to complete stream.",code:1};throw f?.abort(),l(e),new eP(e)}this.logger.info(`Retrying...(${h}/3)`),c()}}});return g(),f}}let eF=e=>e;function eL(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function eq(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:eL(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:eL(),extendedResults:{},searchAction:void 0}}function e$(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...a}=e;return a}let eU=e=>{let{response:t}=e;return t.body?eV(e):ez(t)},eV=e=>void 0!==e.body.exception?eG(e):void 0!==e.body.statusCode?e.body:{message:"unknown",statusCode:0,type:"unknown"},ez=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}},eG=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});var eB=r(96897);let eQ=Error("Failed to load reducers.");
131class eH extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}}class eZ extends Error{constructor(e,t){super(),this.name="Disconnected",this.message=`Client could not connect to the following URL: ${e}`,this.statusCode=t??0}}function eK(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}class eY{static async call(e){let t=function(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:a,signal:s}=e,o="POST"===e.method||"PUT"===e.method,l=function(e,t){if("application/x-www-form-urlencoded"===t)return"object"==typeof e&&e&&Object.values(e).every(eK)?function(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}(e):"";return JSON.stringify(e)}(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${a}`,...e.headers},...o&&{body:l},signal:s}}(e),{logger:r}=e,n=await eY.preprocessRequest(t,e);r.info(n,"Platform request");let{url:i,...a}=n,s=async()=>{let e=await fetch(i,a);if(429===e.status)throw e;return e};try{let e=await (0,eB.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:async e=>{var t;let n=e&&(t=e.status,429===t);return n&&(r.info("Platform retrying request"),await new Promise(e=>setTimeout(e,1e3))),n}});switch(e.status){case 419:case 401:throw r.info("Platform renewing token"),new eH;case 404:throw new eZ(i,e.status);default:return r.info({response:e,requestInfo:n},"Platform response"),e}}catch(e){if("Failed to fetch"===e.message)return new eZ(i);return e}}static async preprocessRequest(e,t){let{origin:r,preprocessRequest:n,logger:i,requestMetadata:a}=t,{signal:s,...o}=e,l=e_(o);try{let t=await n(e,r,a);return{...e,...t}}catch(e){i.error(e,"Platform request preprocessing failed. Returning default request options.")}return l}}function eW(e,t="prod",r="platform"){let n="platform"===r?"":`.${r}`;return`https://${e}${n}.org${"prod"===t?"":t}.coveo.com`}function eJ(e,t="prod"){let r=eW(e,t);return`${r}/rest/search/v2`}class eX{async enqueue(e,t){let r=this.currentAbortController;this.currentAbortController=new AbortController;let n=this.currentAbortController;r&&(t.warnOnAbort&&t.logger.warn("Cancelling current pending search query"),r.abort());try{return await e(n?.signal??null)}finally{this.currentAbortController===n&&(this.currentAbortController=null)}}constructor(){this.currentAbortController=null}}let e0=(e,t,r,n)=>{let i=new eR(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}},e1=async(e,t)=>{let r=await eY.call({...e0(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:e$(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=((r.headers.get("content-type")||"").split(";").find(e=>-1!==e.indexOf("charset="))||"").split("=")[1]||"UTF-8",i=await r.arrayBuffer(),a=new TextDecoder(n).decode(i);return"string"==typeof a?{success:a}:{error:eU({response:r,body:a})}};function e2(e,t){if(t&&"AbortError"===e.name)return{error:{statusCode:e.code,type:e.name,message:e.message,ignored:!0}};if(e instanceof eZ)return{error:{statusCode:e.statusCode,type:e.name,message:e.message}};throw e}class e3{constructor(e){this.apiCallsQueues={unknown:new eX,mainSearch:new eX,facetValues:new eX,foldingCollection:new eX,instantResults:new eX},this.options=e}async plan(e){let t=await eY.call({...e0(e,"POST","application/json","/plan"),requestParams:e$(e),requestMetadata:{method:"plan"},...this.options});if(t instanceof Error)return e2(t);let r=await t.json();return void 0!==r.preprocessingOutput?{success:r}:{error:eU({response:t,body:r})}}async querySuggest(e){let t=await eY.call({...e0(e,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:e$(e),...this.options});if(t instanceof Error)return e2(t);let r=await t.json(),n={response:t,body:r};return void 0!==r.completions?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(n)).body}:{error:eU(n)}}async search(e,t){let r=t?.origin??"unknown",n=await this.apiCallsQueues[r].enqueue(r=>
131eY.call({...e0(e,"POST","application/json",""),requestParams:e$(e),requestMetadata:{method:"search",origin:t?.origin},...this.options,signal:r??void 0}),{logger:this.options.logger,warnOnAbort:!t?.disableAbortWarning});if(n instanceof Error)return e2(n,t?.disableAbortWarning);let i=await n.json(),a={response:n,body:i};return e5(i)?(a.body=e4(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:eU(a)}}async facetSearch(e){let t=await eY.call({...e0(e,"POST","application/json","/facet"),requestParams:e$(e),requestMetadata:{method:"facetSearch"},...this.options});if(t instanceof Error)throw t;let r=await t.json();return(await this.options.postprocessFacetSearchResponseMiddleware({response:t,body:r})).body}async recommendations(e){let t=await eY.call({...e0(e,"POST","application/json",""),requestParams:e$(e),requestMetadata:{method:"recommendations"},...this.options});if(t instanceof Error)throw t;let r=await t.json();if(e5(r)){let e={response:t,body:r};return e.body=e4(r),{success:(await this.options.postprocessSearchResponseMiddleware(e)).body}}return{error:eU({response:t,body:r})}}async html(e){return e1(e,{...this.options})}async fieldDescriptions(e){let t=await eY.call({...e0(e,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(t instanceof Error)throw t;let r=await t.json();return void 0!==r.fields?{success:r}:{error:eU({response:t,body:r})}}}function e5(e){return void 0!==e.results}function e4(e){let t=eL();return el(e.questionAnswer)?e.questionAnswer=t:e.questionAnswer={...t,...e.questionAnswer},e}let e6=e=>e,e9=e=>e,e8=e=>e,e7=new ef({required:!0,emptyAllowed:!1}),te=new ef({required:!1,emptyAllowed:!1}),tt=new ef({required:!0,emptyAllowed:!0});new ef({required:!1,emptyAllowed:!0});let tr=new ev({each:e7,required:!0}),tn=new ef({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),ti=new ef({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/});new ef({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/});let ta=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),ts=(e,t)=>{if("required"in t)return{payload:new ea({value:t}
131).validate({value:e}).value};let r=new em({options:{required:!0},values:t}).validate(e);if(r)throw new ei(r);return{payload:e}},to=(e,t)=>{try{return ts(e,t)}catch(t){return{payload:e,error:ta(t)}}},tl=(e,t,r,n)=>tc(e,t,r,`Check the initialState of ${n}`,"Controller initialization error"),tu=(e,t,r,n)=>tc(e,t,r,`Check the options of ${n}`,"Controller initialization error"),tc=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(t){throw e.logger.error(t,i),t}};var td=Symbol.for("immer-nothing"),th=Symbol.for("immer-draftable"),tp=Symbol.for("immer-state");function tf(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tg=Object,tm=tg.getPrototypeOf,ty="constructor",tv="prototype",tb="configurable",tw="enumerable",tS="writable",tE="value",t_=e=>!!e&&!!e[tp];function tC(e){return!!e&&(tx(e)||tD(e)||!!e[th]||!!e[ty]?.[th]||tP(e)||tM(e))}var tk=tg[tv][ty].toString(),tI=new WeakMap;function tx(e){if(!e||!tj(e))return!1;let t=tm(e);if(null===t||t===tg[tv])return!0;let r=tg.hasOwnProperty.call(t,ty)&&t[ty];if(r===Object)return!0;if(!tF(r))return!1;let n=tI.get(r);return void 0===n&&(n=Function.toString.call(r),tI.set(r,n)),n===tk}function tA(e,t,r=!0){0===tT(e)?(r?Reflect.ownKeys(e):tg.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function tT(e){let t=e[tp];return t?t.type_:tD(e)?1:tP(e)?2:3*!!tM(e)}var tO=(e,t,r=tT(e))=>2===r?e.has(t):tg[tv].hasOwnProperty.call(e,t),tN=(e,t,r=tT(e))=>2===r?e.get(t):e[t],tR=(e,t,r,n=tT(e))=>{2===n?e.set(t,r):3===n?e.add(r):e[t]=r},tD=Array.isArray,tP=e=>e instanceof Map,tM=e=>e instanceof Set,tj=e=>"object"==typeof e,tF=e=>"function"==typeof e,tL=e=>e.modified_?e.copy_:e.base_;function tq(e,t){if(tP(e))return new Map(e);if(tM(e))return new Set(e);if(tD(e))return Array[tv].slice.call(e);let r=tx(e);if(!0!==t&&("class_only"!==t||r)){let t=tm(e);if(null!==t&&r)return{...e};let n=tg.create(t);return tg.assign(n,e)}{let t=tg.getOwnPropertyDescriptors(e);delete t[tp];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){let i=r[n],a=t[i];!1===a[tS]&&(a[tS]=!0,a[tb]=!0),(a.get||a.set)&&(t[i]={[tb]:!0,[tS]:!0,[tw]:a[tw],[tE]:e[i]})}return tg.create(tm(e),t)}}function t$(e,t=!1){return tV(e)||t_(e)||!tC(e)||(tT(e)>1&&tg.defineProperties(e,{set:tU,add:tU,clear:tU,delete:tU}),tg.freeze(e),t&&tA(e,(e,t)=>{t$(t,!0)},!1)),e}var tU={[tE]:function(){tf(2)}};function tV(e){return!(null!==e&&tj(e))||tg.isFrozen(e)}var tz="MapSet",tG="Patches",tB="ArrayMethods",tQ={};function tH(e){let t=tQ[e];return t||tf(0,e),t}var tZ=e=>!!tQ[e];function tK(e,t){t&&(e.patchPlugin_=tH(tG),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function tY(e){tW(e),e.drafts_.forEach(tX),e.drafts_=null}function tW(e){e===j&&(j=e.parent_)}var tJ=e=>j={drafts_:[],parent_:j,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:tZ(tz)?tH(tz):void 0,arrayMethodsPlugin_:tZ(tB)?tH(tB):void 0};function tX(e){let t=e[tp];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function t0(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(void 0!==e&&e!==r){r[tp].modified_&&(tY(t),tf(4)),tC(e)&&(e=t1(t,e));let{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[tp].base_,e,t)}else e=t1(t,r);return function(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&t$(t,r)}(t,e,!0),tY(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==td?e:void 0}function t1(e,t){if(tV(t))return t;let r=t[tp];if(!r)return t9(t,e.handledSet_,e);if(!t3(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:t}=r;if(t)for(;t.length>0;)t.pop()(e);t6(r,e)}return r.copy_}function t2(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var t3=(e,t)=>e.scope_===t,t5=[];function t4(e,t,r,n){let i=e.copy_||e.base_,a=e.type_;if(void 0!==n&&tN(i,n,a)===t)return void tR(i,n,r,a);if(!e.draftLocations_){let t=e.draftLocations_=new Map;tA(i,(e,r)=>{if(t_(r)){let n=t.get(r)||[];n.push(e),t.set(r,n)}})}for(let n of e.draftLocations_.get(t)??t5)tR(i,n,r,a)}function t6(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:r}=t;if(r){let n=r.getPath(e);n&&r.generatePatches_(e,n,t)}t2(e)}}function t9(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||t_(e)||t.has(e)||!tC(e)||tV(e)||(t.add(e),tA(e,(n,i)=>{if(t_(i)){let t=i[tp];t3(t,r)&&(tR(e,n,tL(t),e.type_),t2(t))}else tC(i)&&t9(i,t,r)})),e}var t8={get(e,t){let r;if(t===tp)return e;let n=e.scope_.arrayMethodsPlugin_,i=1===e.type_&&"string"==typeof t;if(i&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=e.copy_||e.base_;if(!tO(a,t,e.type_)){var s;let r;return s=e,(r=rt(a,t))?tE in r?r[tE]:r.get?.call(s.draft_):void 0}let o=a[t];if(e.finalized_||!tC(o)||i&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(r=+t)&&String(r)===t)return o;if(o===re(e.base_,t)){rn(e);let r=1===e.type_?+t:t,n=ri(e.scope_,o,e,r);return e.copy_[r]=n}return o},has:(e,t)=>t in(e.copy_||e.base_),ownKeys:e=>Reflect.ownKeys(e.copy_||e.base_),set(e,t,r){let n=rt(e.copy_||e.base_,t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=re(e.copy_||e.base_,t),i=n?.[tp];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if((r===n?0!==r||1/r==1/n:r!=r&&n!=n)&&(void 0!==r||tO(e.base_,t,e.type_)))return!0;rn(e),rr(e)}return!!(e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t]))||
131(e.copy_[t]=r,e.assigned_.set(t,!0),!function(e,t,r){let{scope_:n}=e;if(t_(r)){let i=r[tp];t3(i,n)&&i.callbacks_.push(function(){rn(e),t4(e,r,tL(i),t)})}else tC(r)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(r)&&t9(r,n.handledSet_,n):tN(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&t9(tN(e.copy_,t,e.type_),n.handledSet_,n)})}(e,t,r),!0)},deleteProperty:(e,t)=>(rn(e),void 0!==re(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),rr(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=e.copy_||e.base_,n=Reflect.getOwnPropertyDescriptor(r,t);return n?{[tS]:!0,[tb]:1!==e.type_||"length"!==t,[tw]:n[tw],[tE]:r[t]}:n},defineProperty(){tf(11)},getPrototypeOf:e=>tm(e.base_),setPrototypeOf(){tf(12)}},t7={};for(let e in t8){let t=t8[e];t7[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function re(e,t){let r=e[tp];return(r?r.copy_||r.base_:e)[t]}function rt(e,t){if(!(t in e))return;let r=tm(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=tm(r)}}function rr(e){!e.modified_&&(e.modified_=!0,e.parent_&&rr(e.parent_))}function rn(e){e.copy_||(e.assigned_=new Map,e.copy_=tq(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function ri(e,t,r,n){let[i,a]=tP(t)?tH(tz).proxyMap_(t,r):tM(t)?tH(tz).proxySet_(t,r):function(e,t){let r=tD(e),n={type_:+!!r,scope_:t?t.scope_:j,modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=n,a=t8;r&&(i=[n],a=t7);let{revoke:s,proxy:o}=Proxy.revocable(i,a);return n.draft_=o,n.revoke_=s,[o,n]}(t,r);if((r?.scope_??j).drafts_.push(i),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&void 0!==n)r.callbacks_.push(function(e){if(!a||!t3(a,e))return;e.mapSetPlugin_?.fixSetContents(a);let t=tL(a);t4(r,a.draft_??a,t,n),t6(a,e)});else a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)});return i}function ra(e){return t_(e)||tf(10,e),function e(t){let r;if(!tC(t)||tV(t))return t;let n=t[tp],i=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=tq(t,n.scope_.immer_.useStrictShallowCopy_),i=n.scope_.immer_.shouldUseStrictIteration()}else r=tq(t,!0);return tA(r,(t,n)=>{tR(r,t,e(n))},i),n&&(n.finalized_=!1),r}(e)}t7.deleteProperty=function(e,t){return t7.set.call(this,e,t,void 0)},t7.set=function(e,t,r){return t8.set.call(this,e[0],t,r,e[0])};var rs=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{let n;if(tF(e)&&!tF(t)){let r=t;t=e;let n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}if(tF(t)||tf(6),void 0===r||tF(r)||tf(7),tC(e)){let i=tJ(this),a=ri(i,e,void 0),s=!0;try{n=t(a),s=!1}finally{s?tY(i):tW(i)}return tK(i,r),t0(n,i)}if(e&&tj(e))tf(1,e);else{if(void 0===(n=t(e))&&(n=e),n===td&&(n=void 0),this.autoFreeze_&&t$(n,!0),r){let t=[],i=[];tH(tG).generateReplacementPatches_(e,n,{patches_:t,inversePatches_:i}),r(t,i)}return n}},this.produceWithPatches=(e,t)=>{let r,n;return tF(e)?(t,...r)=>this.produceWithPatches(t,t=>e(t,...r)):[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},(e=>"boolean"==typeof e)(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),(e=>"boolean"==typeof e)(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),(e=>"boolean"==typeof e)(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){tC(e)||tf(8),t_(e)&&(e=ra(e));let t=tJ(this),r=ri(t,e,void 0);return r[tp].isManual_=!0,tW(t),r}finishDraft(e,t){let r=e&&e[tp];r&&r.isManual_||tf(9);let{scope_:n}=r;return tK(n,t),t0(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=tH(tG).applyPatches_;return t_(e)?n(e,t):this.produce(e,e=>n(e,t))}},ro=rs.produce,rl=rs.produceWithPatches.bind(rs),ru=rs.applyPatches.bind(rs);function rc(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 rd="function"==typeof Symbol&&Symbol.observable||"@@observable",rh=()=>Math.random().toString(36).substring(7).split("").join("."),rp={INIT:`@@redux/INIT${rh()}`,REPLACE:`@@redux/REPLACE${rh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${rh()}`};function rf(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function rg(e){let t,r=Object.keys(e),n={};for(let t=0;t<r.length;t++){let i=r[t];"function"==typeof e[i]&&(n[i]=e[i])}let i=Object.keys(n);
131try{Object.keys(n).forEach(e=>{let t=n[e];if(void 0===t(void 0,{type:rp.INIT}))throw Error(rc(12));if(void 0===t(void 0,{type:rp.PROBE_UNKNOWN_ACTION()}))throw Error(rc(13))})}catch(e){t=e}return function(e={},r){if(t)throw t;let a=!1,s={};for(let t=0;t<i.length;t++){let o=i[t],l=n[o],u=e[o],c=l(u,r);if(void 0===c)throw r&&r.type,Error(rc(14));s[o]=c,a=a||c!==u}return(a=a||i.length!==Object.keys(e).length)?s:e}}function rm(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function ry(e){return rf(e)&&"type"in e&&"string"==typeof e.type}function rv(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var rb=rv(),rw=(r(41463),"u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?rm:rm.apply(null,arguments)});function rS(e,t){function r(...n){if(t){let r=t(...n);if(!r)throw Error(nm(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>ry(t)&&t.type===e,r}"u">typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var rE=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function r_(e){return tC(e)?ro(e,()=>{}):e}function rC(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var rk="RTK_autoBatch",rI=()=>e=>({payload:e,meta:{[rk]:!0}}),rx=e=>t=>{setTimeout(t,e)};function rA(e){let t,r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw Error(nm(28));if(n in r)throw Error(nm(29));return r[n]=t,i},addAsyncThunk:(e,t)=>(t.pending&&(r[e.pending.type]=t.pending),t.rejected&&(r[e.rejected.type]=t.rejected),t.fulfilled&&(r[e.fulfilled.type]=t.fulfilled),t.settled&&n.push({matcher:e.settled,reducer:t.settled}),i),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(t=e,i)};return e(i),[r,n,t]}function rT(e,t){let r,[n,i,a]=rA(t);if("function"==typeof e)r=()=>r_(e());else{let t=r_(e);r=()=>t}function s(e=r(),t){let o=[n[t.type],...i.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===o.filter(e=>!!e).length&&(o=[a]),o.reduce((e,r)=>{if(r)if(t_(e)){let n=r(e,t);return void 0===n?e:n}else{if(tC(e))return ro(e,e=>r(e,t));let n=r(e,t);if(void 0===n){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return e},e)}return s.getInitialState=r,s}var rO=(e,t)=>e&&"function"==typeof e.match?e.match(t):e(t);function rN(...e){return t=>e.some(e=>rO(e,t))}function rR(...e){return t=>e.every(e=>rO(e,t))}function rD(e,t){if(!e||!e.meta)return!1;let r="string"==typeof e.meta.requestId,n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function rP(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function rM(...e){return 0===e.length?e=>rD(e,["pending"]):rP(e)?rN(...e.map(e=>e.pending)):rM()(e[0])}function rj(...e){return 0===e.length?e=>rD(e,["rejected"]):rP(e)?rN(...e.map(e=>e.rejected)):rj()(e[0])}function rF(...e){let t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||rP(e)?rR(rj(...e),t):rF()(e[0])}function rL(...e){return 0===e.length?e=>rD(e,["fulfilled"]):rP(e)?rN(...e.map(e=>e.fulfilled)):rL()(e[0])}function rq(...e){return 0===e.length?e=>rD(e,["pending","fulfilled","rejected"]):rP(e)?rN(...e.flatMap(e=>[e.pending,e.rejected,e.fulfilled])):rq()(e[0])}var r$=(e=21)=>{let t="",r=e;for(;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},rU=["name","message","stack","code"],rV=class{constructor(e,t){this.payload=e,this.meta=t}_type},rz=class{constructor(e,t){this.payload=e,this.meta=t}_type},rG="External signal was aborted",rB=(()=>{function e(e,t,r){let n=rS(e+"/fulfilled",(e,t,r,n)=>({payload:e,meta:{...n||{},arg:r,requestId:t,requestStatus:"fulfilled"}})),i=rS(e+"/pending",(e,t,r)=>({payload:void 0,meta:{...r||{},arg:t,requestId:e,requestStatus:"pending"}})),a=rS(e+"/rejected",(e,t,n,i,a)=>({payload:i,error:(r&&r.serializeError||(e=>{if("object"==typeof e&&null!==e){let t={};for(let r of rU)"string"==typeof e[r]&&(t[r]=e[r]);return t}return{message:String(e)}}))(e||"Rejected"),meta:{...a||{},arg:n,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:e?.name==="AbortError",condition:e?.name==="ConditionError"}}));return Object.assign(function(e,{signal:s}={}){return(o,l,u)=>{let c,d,h=r?.idGenerator?r.idGenerator(e):r$(),p=new AbortController;function f(e){d=e,p.abort()}s&&(s.aborted?f(rG):s.addEventListener("abort",()=>f(rG),{once:!0}));let g=async function(){let s;try{var g;let a=r?.condition?.(e,{getState:l,extra:u});if(g=a,null!==g&&"object"==typeof g&&"function"==typeof g.then&&(a=await a),!1===a||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let m=new Promise((e,t)=>
131{c=()=>{t({name:"AbortError",message:d||"Aborted"})},p.signal.addEventListener("abort",c,{once:!0})});o(i(h,e,r?.getPendingMeta?.({requestId:h,arg:e},{getState:l,extra:u}))),s=await Promise.race([m,Promise.resolve(t(e,{dispatch:o,getState:l,extra:u,requestId:h,signal:p.signal,abort:f,rejectWithValue:(e,t)=>new rV(e,t),fulfillWithValue:(e,t)=>new rz(e,t)})).then(t=>{if(t instanceof rV)throw t;return t instanceof rz?n(t.payload,h,e,t.meta):n(t,h,e)})])}catch(t){s=t instanceof rV?a(null,h,e,t.payload,t.meta):a(t,h,e)}finally{c&&p.signal.removeEventListener("abort",c)}return r&&!r.dispatchConditionRejection&&a.match(s)&&s.meta.condition||o(s),s}();return Object.assign(g,{abort:f,requestId:h,arg:e,unwrap:()=>g.then(rQ)})}},{pending:i,rejected:a,fulfilled:n,settled:rN(a,n),typePrefix:e})}return e.withTypes=()=>e,e})();function rQ(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var rH=Symbol.for("rtk-slice-createasyncthunk"),rZ=((c=rZ||{}).reducer="reducer",c.reducerWithPrepare="reducerWithPrepare",c.asyncThunk="asyncThunk",c),rK=function({creators:e}={}){let t=e?.asyncThunk?.[rH];return function(e){let r,{name:n,reducerPath:i=n}=e;if(!n)throw Error(nm(11));let a=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},s=Object.keys(a),o={},l={},u={},c=[],d={addCase(e,t){let r="string"==typeof e?e:e.type;if(!r)throw Error(nm(12));if(r in l)throw Error(nm(13));return l[r]=t,d},addMatcher:(e,t)=>(c.push({matcher:e,reducer:t}),d),exposeAction:(e,t)=>(u[e]=t,d),exposeCaseReducer:(e,t)=>(o[e]=t,d)};function h(){let[t={},r=[],n]="function"==typeof e.extraReducers?rA(e.extraReducers):[e.extraReducers],i={...t,...l};return rT(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of c)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)})}s.forEach(r=>{let i=a[r],s={reducerName:r,type:`${n}/${r}`,createNotation:"function"==typeof e.reducers};"asyncThunk"===i._reducerDefinitionType?function({type:e,reducerName:t},r,n,i){if(!i)throw Error(nm(18));let{payloadCreator:a,fulfilled:s,pending:o,rejected:l,settled:u,options:c}=r,d=i(e,a,c);n.exposeAction(t,d),s&&n.addCase(d.fulfilled,s),o&&n.addCase(d.pending,o),l&&n.addCase(d.rejected,l),u&&n.addMatcher(d.settled,u),n.exposeCaseReducer(t,{fulfilled:s||rY,pending:o||rY,rejected:l||rY,settled:u||rY})}(s,i,d,t):function({type:e,reducerName:t,createNotation:r},n,i){let a,s;if("reducer"in n){if(r&&"reducerWithPrepare"!==n._reducerDefinitionType)throw Error(nm(17));a=n.reducer,s=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?rS(e,s):rS(e))}(s,i,d)});let p=e=>e,f=new Map,g=new WeakMap;function m(e,t){return r||(r=h()),r(e,t)}function y(){return r||(r=h()),r.getInitialState()}function v(t,r=!1){function n(e){let i=e[t];return void 0===i&&r&&(i=rC(g,n,y)),i}function i(t=p){let n=rC(f,r,()=>new WeakMap);return rC(n,t,()=>{let n={};for(let[i,a]of Object.entries(e.selectors??{}))n[i]=function(e,t,r,n){function i(a,...s){let o=t(a);return void 0===o&&n&&(o=r()),e(o,...s)}return i.unwrapped=e,i}(a,t,()=>rC(g,t,y),r);return n})}return{reducerPath:t,getSelectors:i,get selectors(){return i(n)},selectSlice:n}}let b={name:n,reducer:m,actions:u,caseReducers:o,getInitialState:y,...v(i),injectInto(e,{reducerPath:t,...r}={}){let n=t??i;return e.inject({reducerPath:n,reducer:m},r),{...b,...v(n,!0)}}};return b}}();function rY(){}var rW="listener",rJ="completed",rX="cancelled",r0=`task-${rX}`,r1=`task-${rJ}`,r2=`${rW}-${rX}`,r3=`${rW}-${rJ}`,r5=class{constructor(e){this.code=e,this.message=`task ${rX} (reason: ${e})`}name="TaskAbortError";message},r4=(e,t)=>{if("function"!=typeof e)throw TypeError(nm(32))},r6=()=>{},r9=(e,t=r6)=>(e.catch(t),e),r8=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),r7=e=>{if(e.aborted)throw new r5(e.reason)};function ne(e,t){let r=r6;return new Promise((n,i)=>{let a=()=>i(new r5(e.reason));e.aborted?a():(r=r8(e,a),t.finally(()=>r()).then(n,i))}).finally(()=>{r=r6})}var nt=async(e,t)=>{try{await Promise.resolve();let t=await e();return{status:"ok",value:t}}catch(e){return{status:e instanceof r5?"cancelled":"rejected",error:e}}finally{t?.()}},nr=e=>t=>r9(ne(e,t).then(t=>(r7(e),t))),nn=e=>{let t=nr(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:ni}=Object,na={},ns="listenerMiddleware",no=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=rS(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(i);else throw Error(nm(21));return r4(a,"options.listener"),{predicate:i,type:t,effect:a}},nl=ni(e=>{let{type:t,predicate:r,effect:n}=no(e);
131return{id:r$(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw Error(nm(22))}}},{withTypes:()=>nl}),nu=(e,t)=>{let{type:r,effect:n,predicate:i}=no(t);return Array.from(e.values()).find(e=>("string"==typeof r?e.type===r:e.predicate===i)&&e.effect===n)},nc=e=>{e.pending.forEach(e=>{e.abort(r2)})},nd=(e,t,r)=>{try{e(t,r)}catch(e){setTimeout(()=>{throw e},0)}},nh=ni(rS(`${ns}/add`),{withTypes:()=>nh}),np=rS(`${ns}/removeAll`),nf=ni(rS(`${ns}/remove`),{withTypes:()=>nf}),ng=(...e)=>{console.error(`${ns}/error`,...e)};function nm(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. `}Symbol.for("rtk-state-proxy-original");let ny=/^(?:[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,nv="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nb=new Uint8Array(16),nw=[];for(let e=0;e<256;++e)nw.push((e+256).toString(16).slice(1));let nS=function(e,t,r){if(nv&&!t&&!e)return nv();var i=e,a=r;let s=(i=i||{}).random??i.rng?.()??function(){if(!n){if("u"<typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(nb)}();if(s.length<16)throw Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){if((a=a||0)<0||a+16>t.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[a+e]=s[e];return t}return function(e,t=0){return(nw[e[t+0]]+nw[e[t+1]]+nw[e[t+2]]+nw[e[t+3]]+"-"+nw[e[t+4]]+nw[e[t+5]]+"-"+nw[e[t+6]]+nw[e[t+7]]+"-"+nw[e[t+8]]+nw[e[t+9]]+"-"+nw[e[t+10]]+nw[e[t+11]]+nw[e[t+12]]+nw[e[t+13]]+nw[e[t+14]]+nw[e[t+15]]).toLowerCase()}(s)};async function nE({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:a,mode:s}=e;if("disabled"!==s)return n.call(r),t.send(i,a,r)}let n_="2.1.1";function nC(e,t,r){let{getReferrer:n,getLocation:i,getUserAgent:a}=r,s=function(e){let{trackingId:t}=e;return{trackingId:t}}(t),o=r.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:(t.source||[]).concat([`relay@${n_}`]),clientId:o,userAgent:a(),referrer:nk(n()),location:nk(i())})}function nk(e){return null!==e?function(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&"%"==e.charAt(r-3);){let n=Number.parseInt(e.substring(r-2,r),16);if((128&n)!=128)break;if(r-=3,(192&n)!=128){t-r>=3*((248&n)==240?4:(240&n)==224?3:(224&n)==192?2:1)&&(r=t);break}}return e.substring(0,r)}(e,1024):null}function nI({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}})}let nx=(l="coveo_",{getItem(e){let t=`${l}${e}=`;for(let e of document.cookie.split(";")){let r=e.replace(/^\s+/,"");if(0===r.lastIndexOf(t,0))return r.substring(t.length,r.length)}return null},setItem(e,t,r){let n,i=2==(n=window.location.hostname.split(".").slice(-2)).length?n.join("."):"",a=`;expires=${new Date(new Date().getTime()+r).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${l}${e}=${t}${a}${s};path=/;SameSite=Lax`},removeItem(e){this.setItem(e,"",-1)}}),nA="visitorId";function nT(){let e={getItem:e=>nx.getItem(e)||localStorage.getItem(e),removeItem(e){nx.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),nx.setItem(e,t,31556952e3)}};return{runtime:"browser",send:async(e,t,r)=>{let n,i=fetch(e,{method:"POST",body:JSON.stringify([r]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});(n="u">typeof window,{sendMessage(e){n&&window.postMessage(e,"*")}}).sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t});let a=await i;if(a?.ok){let e;try{e=await a.json()}catch{return}for(let t of e.events)if(!t.accepted)throw Error(`Received event was rejected for processing: ${t.errorMessage}`)}else throw Error(`Error ${a.status}: Failed to send the event(s).`)},getReferrer:()=>{let e;return""===(e=document.referrer)?null:e},getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{var t;let r=e.getItem(nA);if(r&&"string"==typeof(t=r)&&ny.test(t))return r;let n=nS();return e.setItem(nA,n),n}}}var nO=e=>Array.isArray(e)?e:[e],nN=0,nR=class{revision=nN;_value;
131_lastValue;_isEqual=nD;constructor(e,t=nD){this._value=this._lastValue=e,this._isEqual=t}get value(){return this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++nN)}};function nD(e,t){return e===t}function nP(e){return e instanceof nR||console.warn("Not a valid cell! ",e),e.value}var nM=(e,t)=>!1;function nj(){return function(e=nD){return new nR(null,e)}(nM)}var nF=e=>{let t=e.collectionTag;null===t&&(t=e.collectionTag=nj()),nP(t)};Symbol();var nL=0,nq=Object.getPrototypeOf({}),n$=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,nU);tag=nj();tags={};children={};collectionTag=null;id=nL++},nU={get:(e,t)=>(function(){let{value:r}=e,n=Reflect.get(r,t);if("symbol"==typeof t||t in nq)return n;if("object"==typeof n&&null!==n){var i;let r=e.children[t];return void 0===r&&(r=e.children[t]=Array.isArray(i=n)?new nV(i):new n$(i)),r.tag&&nP(r.tag),r.proxy}{let r=e.tags[t];return void 0===r&&((r=e.tags[t]=nj()).value=n),nP(r),n}})(),ownKeys:e=>(nF(e),Reflect.ownKeys(e.value)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e.value,t),has:(e,t)=>Reflect.has(e.value,t)},nV=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],nz);tag=nj();tags={};children={};collectionTag=null;id=nL++},nz={get:([e],t)=>("length"===t&&nF(e),nU.get(e,t)),ownKeys:([e])=>nU.ownKeys(e),getOwnPropertyDescriptor:([e],t)=>nU.getOwnPropertyDescriptor(e,t),has:([e],t)=>nU.has(e,t)},nG="u">typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function nB(){return{s:0,v:void 0,o:null,p:null}}function nQ(e,t={}){let r,n=nB(),{resultEqualityCheck:i}=t,a=0;function s(){let t,s=n,{length:o}=arguments;for(let e=0;e<o;e++){let t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=s.o;null===e&&(s.o=e=new WeakMap);let r=e.get(t);void 0===r?(s=nB(),e.set(t,s)):s=r}else{let e=s.p;null===e&&(s.p=e=new Map);let r=e.get(t);void 0===r?(s=nB(),e.set(t,s)):s=r}}let l=s;if(1===s.s)t=s.v;else if(t=e.apply(null,arguments),a++,i){let e=r?.deref?.()??r;null!=e&&i(e,t)&&(t=e,0!==a&&a--),r="object"==typeof t&&null!==t||"function"==typeof t?new nG(t):t}return l.s=1,l.v=t,t}return s.clearCache=()=>{n=nB(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}var nH=function(e,...t){let r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,n=(...e)=>{let t,n,i=0,a=0,s={},o=e.pop();"object"==typeof o&&(s=o,o=e.pop()),function(e,t=`expected a function, instead received ${typeof e}`){if("function"!=typeof e)throw TypeError(t)}(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:l,memoizeOptions:u=[],argsMemoize:c=nQ,argsMemoizeOptions:d=[],devModeChecks:h={}}={...r,...s},p=nO(u),f=nO(d),g=(!function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let r=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw TypeError(`${t}[${r}]`)}}(t=Array.isArray(e[0])?e[0]:e,"createSelector expects all input-selectors to be functions, but received the following types: "),t),m=l(function(){return i++,o.apply(null,arguments)},...p);return Object.assign(c(function(){a++;let e=function(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}(g,arguments);return n=m.apply(null,e)},...f),{resultFunc:o,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>n,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:l,argsMemoize:c})};return Object.assign(n,{withTypes:()=>n}),n}(nQ),nZ=Object.assign((e,t=nH)=>{!function(e,t=`expected an object, instead received ${typeof e}`){if("object"!=typeof e)throw TypeError(t)}(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e);return t(r.map(t=>e[t]),(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}))},{withTypes:()=>nZ});let nK="3.50.1",nY=nH(e=>e.source,e=>Object.entries(e).map(([e,t])=>`${e}@${t}`).concat(`@coveo/headless@${nK}`)),nW=nH(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>nY(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:i,enabled:a},s,o)=>{let l=nX(o);return function(e){let t,r=(t=nI(e),{get:()=>t,update:e=>{t=nI({...t,...e})}}),n=function(){let e=[];function t({type:r,callback:n}){return e.findIndex(e=>e.type===r&&e.callback===n)}function r(r,n){if(n){let i;(i=t({type:r,callback:n}))>=0&&e.splice(i,1)}else if("*"===r)e.length=0;else for(let t=e.length-1;t>=0;t--)e[t].type===r&&e.splice(t,1)}return{add:function(n){return 0>t(n)&&e.push(n),()=>r(n.type,n.callback)}
131,call:function(t){e.forEach(e=>{var r;if(r=t.meta.type,"*"===e.type||r===e.type)try{e.callback(t)}catch(e){console.error(e)}})},remove:r}}(),i={get:()=>{let e,t;return Object.freeze((e="disabled"!==r.get().mode,t=r.get().environment,e&&t?{...t,runtime:"custom"}:e&&function(){try{return"object"==typeof window}catch{return!1}}()&&function(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name&&localStorage&&0!==localStorage.length}}()?nT():{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}))}};return{emit:async(e,t)=>{let a=r.get(),s=i.get(),o={...t,meta:nC(e,a,s)};return nE({config:a,environment:s,event:o,listenerManager:n})},getMeta:e=>nC(e,r.get(),i.get()),on:(e,t)=>n.add({type:e,callback:t}),off:(e,t)=>n.remove(e,t),updateConfig:e=>r.update(e),version:n_}}({mode:a?"emit":"disabled",url:i??function(e,t="prod"){let r=eW(e,t,"analytics");return`${r}/rest/organizations/${e}/events/v1`}(e,t),token:r,trackingId:n??null,source:s,environment:l})}),nJ={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:async()=>{}},nX=e=>{if(!e)return;let t=e();return{..."u">typeof window&&"u">typeof document?nT():nJ,getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};function n0(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function n1(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})}function n2(){return"u">typeof window}function n3(){return"u">typeof navigator}function n5(){return"u">typeof document}function n4(){try{return"u">typeof localStorage}catch(e){return!1}}function n6(){return n3()&&navigator.cookieEnabled}"function"==typeof SuppressedError&&SuppressedError,(d=F||(F={})).search="search",d.click="click",d.custom="custom",d.view="view",d.collect="collect";let n9=[F.click,F.custom,F.search,F.view],n8=(e,t)=>-1!==n9.indexOf(e)?Object.assign({language:n5()?document.documentElement.lang:"unknown",userAgent:n3()?navigator.userAgent:"unknown"},t):t;class n7{static set(e,t,r){var n,i,a;r&&(n=new Date).setTime(n.getTime()+r),-1===(a=window.location.hostname).indexOf(".")?ie(e,t,n):ie(e,t,n,(i=a.split("."))[i.length-2]+"."+i[i.length-1])}static get(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var i=r[n];if(0===(i=i.replace(/^\s+/,"")).lastIndexOf(t,0))return i.substring(t.length,i.length)}return null}static erase(e){n7.set(e,"",-1)}}function ie(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}class it{getItem(e){return n7.get(`${it.prefix}${e}`)}removeItem(e){n7.erase(`${it.prefix}${e}`)}setItem(e,t,r){n7.set(`${it.prefix}${e}`,t,r)}}it.prefix="coveo_";class ir{constructor(){this.cookieStorage=new it}getItem(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)}removeItem(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)}setItem(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t,31556926e3)}}class ii{getItem(e){return null}removeItem(e){}setItem(e,t){}}let ia="__coveo.analytics.history";class is{constructor(e){this.store=e||(n4()?localStorage:n6()?new it:!function(){try{return"u">typeof sessionStorage}catch(e){return!1}}()?new ii:sessionStorage)}addElement(e){e.internalTime=new Date().getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])}addElementAsync(e){return n1(this,void 0,void 0,function*(){e.internalTime=new Date().getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=yield this.getHistoryWithInternalTimeAsync();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])})}getHistory(){let e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))}getHistoryAsync(){return n1(this,void 0,void 0,function*(){let e=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(e))})}getHistoryWithInternalTime(){try{let e=this.store.getItem(ia);if(e&&"string"==typeof e)return JSON.parse(e);return[]}catch(e){return[]}}getHistoryWithInternalTimeAsync(){return n1(this,void 0,void 0,function*(){try{let e=yield this.store.getItem(ia);if(e)return JSON.parse(e);return[]}catch(e){return[]}})}setHistory(e){try{this.store.setItem(ia,JSON.stringify(e.slice(0,20)))}catch(e){}}clear(){try{this.store.removeItem(ia)}catch(e){}}getMostRecentElement(){let e=this.getHistoryWithInternalTime();return Array.isArray(e)?e.sort((e,t)=>
131(t.internalTime||0)-(e.internalTime||0))[0]:null}cropQueryElement(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e}isValidEntry(e){let t=this.getMostRecentElement();return!t||t.value!=e.value||(e.internalTime||0)-(t.internalTime||0)>6e4}stripInternalTime(e){return Array.isArray(e)?e.map(e=>{let{name:t,time:r,value:n}=e;return{name:t,time:r,value:n}}):[]}stripEmptyQuery(e){let{name:t,time:r,value:n}=e;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e}stripEmptyQueries(e){return e.map(e=>this.stripEmptyQuery(e))}}let io=(e,t)=>n1(void 0,void 0,void 0,function*(){return e===F.view?(yield il(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),il=e=>n1(void 0,void 0,void 0,function*(){let t=new is,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),iu=new Uint8Array(16);var ic=/^(?:[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 id(e){return"string"==typeof e&&ic.test(e)}let ih=[];for(let e=0;e<256;++e)ih.push((e+256).toString(16).slice(1));function ip(e,t=0){return ih[e[t+0]]+ih[e[t+1]]+ih[e[t+2]]+ih[e[t+3]]+"-"+ih[e[t+4]]+ih[e[t+5]]+"-"+ih[e[t+6]]+ih[e[t+7]]+"-"+ih[e[t+8]]+ih[e[t+9]]+"-"+ih[e[t+10]]+ih[e[t+11]]+ih[e[t+12]]+ih[e[t+13]]+ih[e[t+14]]+ih[e[t+15]]}var ig="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function im(e,t,r){if(ig&&!t&&!e)return ig();let n=(e=e||{}).random||(e.rng||function(){if(!i&&!(i="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(iu)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return ip(n)}function iy(e,t){return e<<t|e>>>32-t}let iv=function(e){function t(t,r,n,i){var a;if("string"==typeof t&&(t=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(t)),"string"==typeof r&&(r=function(e){let t;if(!id(e))throw TypeError("Invalid UUID");let r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/0x10000000000&255,r[11]=t/0x100000000&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}(r)),(null==(a=r)?void 0:a.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(r),s.set(t,r.length),(s=e(s))[6]=15&s[6]|80,s[8]=63&s[8]|128,n){i=i||0;for(let e=0;e<16;++e)n[i+e]=s[e];return n}return ip(s)}try{t.name="v5"}catch(e){}return t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t}(function(e){let t=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=Math.ceil((e.length/4+2)/16),i=Array(n);for(let t=0;t<n;++t){let r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];i[t]=r}i[n-1][14]=(e.length-1)*8/0x100000000,i[n-1][14]=Math.floor(i[n-1][14]),i[n-1][15]=(e.length-1)*8|0;for(let e=0;e<n;++e){let n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=i[e][t];for(let e=16;e<80;++e)n[e]=iy(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let a=r[0],s=r[1],o=r[2],l=r[3],u=r[4];for(let e=0;e<80;++e){let r=Math.floor(e/20),i=iy(a,5)+function(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}(r,s,o,l)+u+t[r]+n[e]>>>0;u=l,l=o,o=iy(s,30)>>>0,s=a,a=i}r[0]=r[0]+a>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+o>>>0,r[3]=r[3]+l>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}),ib="2.30.55",iw=e=>`${e.protocol}//${e.hostname}${0===e.pathname.indexOf("/")?e.pathname:`/${e.pathname}`}${e.search}`,iS={pageview:"pageview",event:"event"};class iE{constructor({client:e,uuidGenerator:t=im}){this.client=e,this.uuidGenerator=t}}class i_ extends iE{constructor({client:e,uuidGenerator:t=im}){super({client:e,uuidGenerator:t}),this.actionData={},this.pageViewId=t(),this.nextPageViewId=this.pageViewId,this.currentLocation=iw(window.location),this.lastReferrer=n5()?document.referrer:"",this.addHooks()}getApi(e){return"setAction"===e?this.setAction:null}setAction(e,t){this.action=e,this.actionData=t}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(e,t){return Object.assign({hitType:e},this.getNextValues(e,t))}updateLocationInformation(e,t){this.updateLocationForNextPageView(e,t)}getDefaultContextInformation(e){let t={title:n5()?document.title:"",encoding:n5()?document.characterSet:"UTF-8"},r={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},n={language:navigator.language,userAgent:navigator.userAgent};return Object.assign(Object.assign(Object.assign(Object.assign({},{time:Date.now(),eventId:this.uuidGenerator()}),r),n),t)}updateLocationForNextPageView(e,t){let{pageViewId:r,referrer:n,location:i}=this.getNextValues(e,t);this.lastReferrer=n,this.pageViewId=r,this.currentLocation=i,e===iS.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(e,t){return{pageViewId:e===iS.pageview?this.nextPageViewId:this.pageViewId,referrer:e===iS.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===iS.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}}getCurrentLocationFromPayload(e){return e.page?`${this.currentLocation.split("/").slice(0,3).join("/")}${e.page.replace(/^\/?(.*)$/,"/$1")}`:iw(window.location)}}class iC{constructor(e,t){if(!id(e))throw Error("Not a valid uuid");this.clientId=e,this.creationDate=Math.floor(t/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let e=Math.floor(Date.now()/1e3)-this.creationDate;return e<0||e>iC.expirationTime}validate(e,t){return!this.expired&&this.matchReferrer(e,t)}matchReferrer(e,t){try{let r=new URL(e);return t.some(e=>RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(r.host))}catch(e){return!1}}static fromString(e){let t=e.split(".");if(2!==t.length)return null;let[r,n]=t;if(32!==r.length||isNaN(parseInt(n)))return null;let i=r.substring(0,8)+"-"+r.substring(8,12)+"-"+r.substring(12,16)+"-"+r.substring(16,20)+"-"+r.substring(20,32);return id(i)?new iC(i,1e3*Number.parseInt(n)):null}}iC.cvo_cid="cvo_cid",iC.expirationTime=120;class ik extends iE{constructor({client:e,uuidGenerator:t=im}){super({client:e,uuidGenerator:t})}getApi(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(e){return n1(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw Error("Could not retrieve current clientId");try{let t=new URL(e),r=yield this.client.getCurrentVisitorId();return t.searchParams.set(iC.cvo_cid,new iC(r,Date.now()).toString()),t.toString()}catch(e){throw Error("Invalid URL provided")}})}acceptFrom(e){this.client.setAcceptedLinkReferrers(e)}}ik.Id="link";let iI=Object.keys;function ix(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}let iA={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"},iT=[...iI(iA).map(e=>iA[e])].join("|"),iO=RegExp(`^(${iT}$)`),iN=[e=>iO.test(e)],iR={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},iD={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},iP={action:"pa",list:"pal",listSource:"pls"},iM={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},ij={id:"quoteId",affiliation:"quoteAffiliation"},iF={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},iL={add:iP,bookmark_add:iP,bookmark_remove:iP,click:iP,checkout:iP,checkout_option:iP,detail
131:iP,impression:iP,remove:iP,refund:Object.assign(Object.assign({},iP),iM),purchase:Object.assign(Object.assign({},iP),iM),quickview:iP,quote:Object.assign(Object.assign({},iP),ij),review:Object.assign(Object.assign({},iP),iF)},iq=iI(iR).map(e=>iR[e]),i$=iI(iD).map(e=>iD[e]),iU=iI(iP).map(e=>iP[e]),iV=iI(iM).map(e=>iM[e]),iz=iI(iF).map(e=>iF[e]),iG=iI(ij).map(e=>ij[e]),iB=[...iq,"custom"].join("|"),iQ=[...i$,"custom"].join("|"),iH="(pr[0-9]+)",iZ="(il[0-9]+pi[0-9]+)",iK=RegExp(`^${iH}(${iB})$`),iY=RegExp(`^(${iZ}(${iQ}))|(il[0-9]+nm)$`),iW=RegExp(`^(${iU.join("|")})$`),iJ=RegExp(`^(${iV.join("|")})$`),iX=RegExp(`^${iH}custom$`),i0=RegExp(`^${iZ}custom$`),i1=RegExp(`^(${["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit",...iz,...iG].join("|")})$`),i2=[e=>iY.test(e),e=>iK.test(e),e=>iW.test(e),e=>iJ.test(e),e=>i1.test(e)],i3=[iX,i0],i5=Object.assign(Object.assign({},Object.assign(Object.assign(Object.assign(Object.assign({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"].reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{}))),{svcAction:"svc_action",svcActionData:"svc_action_data"}),i4=iI(i5).map(e=>i5[e]),i6=e=>-1!==i4.indexOf(e),i9=e=>"custom"===e;class i8{constructor(e){this.opts=e}sendEvent(e,t){return n1(this,void 0,void 0,function*(){if(!this.isAvailable())throw Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:r,preprocessRequest:n}=this.opts,i=yield this.getQueryParamsForEventType(e),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${r}/analytics/${e}?${i}`,t,n),o=new Blob([this.encodeForEventType(e,s)],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,o)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(e,t,r){return n1(this,void 0,void 0,function*(){let n=e,i=t;if(r){let{url:a,body:s}=yield r({url:e,body:JSON.stringify(t)},"analyticsBeacon");n=a||e;try{i=JSON.parse(s)}catch(e){console.error("Unable to process the request body as a JSON string",e)}}return{payload:i,url:n}})}encodeForEventType(e,t){return this.isEventTypeLegacy(e)?this.encodeEventToJson(e,t):this.encodeEventToJson(e,t,this.opts.token)}getQueryParamsForEventType(e){return n1(this,void 0,void 0,function*(){let{token:t,visitorIdProvider:r}=this.opts,n=yield r.getCurrentVisitorId();return[t&&this.isEventTypeLegacy(e)?`access_token=${t}`:"",n?`visitorId=${n}`:"","discardVisitInfo=true"].filter(e=>!!e).join("&")})}isEventTypeLegacy(e){return -1!==[F.click,F.custom,F.search,F.view].indexOf(e)}encodeEventToJson(e,t,r){let n=`${e}Event=${encodeURIComponent(JSON.stringify(t))}`;return r&&(n=`access_token=${encodeURIComponent(r)}&${n}`),n}}class i7{sendEvent(e,t){return n1(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return n1(this,void 0,void 0,function*(){return Promise.resolve()})}}let ae=globalThis.fetch;class at{constructor(e){this.opts=e}sendEvent(e,t){return n1(this,void 0,void 0,function*(){let r,{baseUrl:n,visitorIdProvider:i,preprocessRequest:a}=this.opts,s=this.shouldAppendVisitorId(e)?yield this.getVisitorIdParam():"",o={url:`${n}/analytics/${e}${s}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},l=Object.assign(Object.assign({},o),a?yield a(o,"analyticsFetch"):{}),{url:u}=l,c=n0(l,["url"]);try{r=yield ae(u,c)}catch(e){console.error("An error has occured when sending the event.",e);return}if(r.ok){let e=yield r.json();return e.visitorId&&i.setCurrentVisitorId(e.visitorId),e}try{r.json()}catch(e){}throw console.error(`An error has occured when sending the "${e}" event.`,r,t),Error(`An error has occurred when sending the "${e}" event. Check the console logs for more details.`)})}deleteHttpCookieVisitorId(){return n1(this,void 0,void 0,function*(){let{baseUrl:e}=this.opts,t=`${e}/analytics/visit`;yield ae(t,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(e){return -1!==[F.click,F.custom,F.search,F.view].indexOf(e)}getVisitorIdParam(){return n1(this,void 0,void 0,function*(){let{visitorIdProvider:e}=this.opts,t=yield e.getCurrentVisitorId();return t?`?visitor=${t}`:""})}getHeaders(){let{token:e}=this.opts;return Object.assign(Object.assign({},e?{Authorization:`Bearer ${e}`}:{}),{"Content-Type":"application/json"})}}class ar{constructor(e,t){n4()&&n6()?this.storage=new ir:n4()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new ii),this.client=new at(e),this.beaconClient=new i8(e),window.addEventListener("beforeunload",()=>{for(let{eventType:e,payload:r}of t())this.beaconClient.sendEvent(e,r)})}
131getClientDependingOnEventType(e){return"click"===e&&this.beaconClient.isAvailable()?this.beaconClient:this.client}}class an{constructor(e,t){this.storage=t||new ii,this.client=new at(e)}getClientDependingOnEventType(e){return this.client}}class ai{constructor(){this.storage=new ii,this.client=new i7}getClientDependingOnEventType(e){return this.client}}let aa=` 132 We've detected you're using React Native but have not provided the corresponding runtime, 133 for an optimal experience please use the "coveo.analytics/react-native" subpackage. 134 Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native 135 `,as=["1",1,"yes",!0];function ao(){let e=[];return n2()&&e.push(window.doNotTrack),n3()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(e=>-1!==as.indexOf(e))}let al="https://analytics.cloud.coveo.com/rest/ua";class au{get defaultOptions(){return{endpoint:al,isCustomEndpoint:!1,token:"",version:"v15",beforeSendHooks:[],afterSendHooks:[]}}get version(){return ib}constructor(e){if(this.acceptedLinkReferrers=[],!e)throw Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[io,n8].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};const t={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};ao()?this.runtime=new ai:this.runtime=this.options.runtimeEnvironment||this.initRuntime(t),this.addEventTypeMapping(F.view,{newEventType:F.view,addClientIdParameter:!0}),this.addEventTypeMapping(F.click,{newEventType:F.click,addClientIdParameter:!0}),this.addEventTypeMapping(F.custom,{newEventType:F.custom,addClientIdParameter:!0}),this.addEventTypeMapping(F.search,{newEventType:F.search,addClientIdParameter:!0})}initRuntime(e){return n2()&&n5()?new ar(e,()=>{let e=[...this.bufferedRequests];return this.bufferedRequests=[],e}):("u">typeof navigator&&"ReactNative"==navigator.product&&console.warn(aa),new an(e))}get storage(){return this.runtime.storage}determineVisitorId(){return n1(this,void 0,void 0,function*(){try{return n2()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||im()}catch(e){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",e),im()}})}getCurrentVisitorId(){return n1(this,void 0,void 0,function*(){if(!this.visitorId){let e=yield this.determineVisitorId();yield this.setCurrentVisitorId(e)}return this.visitorId})}setCurrentVisitorId(e){return n1(this,void 0,void 0,function*(){this.visitorId=e,yield this.storage.setItem("visitorId",e)})}setClientId(e,t){return n1(this,void 0,void 0,function*(){if(id(e))this.setCurrentVisitorId(e.toLowerCase());else{if(!t)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(iv(e,iv(t,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}})}getParameters(e,...t){return n1(this,void 0,void 0,function*(){return yield this.resolveParameters(e,...t)})}getPayload(e,...t){return n1(this,void 0,void 0,function*(){let r=yield this.resolveParameters(e,...t);return yield this.resolvePayloadForParameters(e,r)})}get currentVisitorId(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(im()),this.visitorId}set currentVisitorId(e){this.visitorId=e,this.storage.setItem("visitorId",e)}extractClientIdFromLink(e){if(ao())return null;try{let t=new URL(e).searchParams.get(iC.cvo_cid);if(null==t)return null;let r=iC.fromString(t);if(!r||!n5()||!r.validate(document.referrer,this.acceptedLinkReferrers))return null;return r.clientId}catch(e){}return null}resolveParameters(e,...t){return n1(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:r=[],addVisitorIdParameter:n=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[e]||{},s=e=>r.length>0?this.parseVariableArgumentsPayload(r,e):e[0],o=e=>n1(this,void 0,void 0,function*(){return Object.assign(Object.assign({},e),{visitorId:n?yield this.getCurrentVisitorId():""})}),l=e=>n1(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},e),{clientId:yield this.getCurrentVisitorId()}):e}),u=e=>i?this.ensureAnonymousUserWhenUsingApiKey(e):e,c=t=>this.beforeSendHooks.reduce((t,r)=>n1(this,void 0,void 0,function*(){let n=yield t;return yield r(e,n)}),t);return yield[s,o,l,u,c].reduce((e,t)=>
135n1(this,void 0,void 0,function*(){let r=yield e;return yield t(r)}),Promise.resolve(t))})}resolvePayloadForParameters(e,t){return n1(this,void 0,void 0,function*(){let{usesMeasurementProtocol:r=!1}=this.eventTypeMapping[e]||{},n=e=>this.setTrackingIdIfTrackingIdNotPresent(e),i=t=>this.removeEmptyPayloadValues(t,e),a=t=>this.validateParams(t,e),s=e=>r?this.removeUnknownParameters(e):e,o=e=>r?this.processCustomParameters(e):this.mapCustomParametersToCustomData(e);return yield[n,i,a,e=>{let t;return r?(t=!!e.action&&iL[e.action]||{},iI(e).reduce((r,n)=>{let i=t[n]||i5[n]||n;return Object.assign(Object.assign({},r),{[i]:e[n]})},{})):e},s,o].reduce((e,t)=>n1(this,void 0,void 0,function*(){let r=yield e;return yield t(r)}),Promise.resolve(t))})}makeEvent(e,...t){return n1(this,void 0,void 0,function*(){let{newEventType:r=e}=this.eventTypeMapping[e]||{},n=yield this.resolveParameters(e,...t),i=yield this.resolvePayloadForParameters(e,n);return{eventType:r,payload:i,log:t=>n1(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:r,payload:Object.assign(Object.assign({},i),t)}),yield Promise.all(this.afterSendHooks.map(r=>r(e,Object.assign(Object.assign({},n),t)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(e,...t){return n1(this,void 0,void 0,function*(){return(yield this.makeEvent(e,...t)).log({})})}deferExecution(){return new Promise(e=>setTimeout(e,0))}sendFromBuffer(){return n1(this,void 0,void 0,function*(){let e=this.bufferedRequests.shift();if(e){let{eventType:t,payload:r}=e;return this.runtime.getClientDependingOnEventType(t).sendEvent(t,r)}})}clear(){this.storage.removeItem("visitorId"),new is().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(e){return n1(this,void 0,void 0,function*(){return this.makeEvent(F.search,e)})}sendSearchEvent(e){return n1(this,void 0,void 0,function*(){var{searchQueryUid:t}=e,r=n0(e,["searchQueryUid"]);return(yield this.makeSearchEvent(r)).log({searchQueryUid:t})})}makeClickEvent(e){return n1(this,void 0,void 0,function*(){return this.makeEvent(F.click,e)})}sendClickEvent(e){return n1(this,void 0,void 0,function*(){var{searchQueryUid:t}=e,r=n0(e,["searchQueryUid"]);return(yield this.makeClickEvent(r)).log({searchQueryUid:t})})}makeCustomEvent(e){return n1(this,void 0,void 0,function*(){return this.makeEvent(F.custom,e)})}sendCustomEvent(e){return n1(this,void 0,void 0,function*(){var{lastSearchQueryUid:t}=e,r=n0(e,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(r)).log({lastSearchQueryUid:t})})}makeViewEvent(e){return n1(this,void 0,void 0,function*(){return this.makeEvent(F.view,e)})}sendViewEvent(e){return n1(this,void 0,void 0,function*(){return(yield this.makeViewEvent(e)).log({})})}getVisit(){return n1(this,void 0,void 0,function*(){let e=yield fetch(`${this.baseUrl}/analytics/visit`),t=yield e.json();return this.visitorId=t.visitorId,t})}getHealth(){return n1(this,void 0,void 0,function*(){let e=yield fetch(`${this.baseUrl}/analytics/monitoring/health`);return yield e.json()})}registerBeforeSendEventHook(e){this.beforeSendHooks.push(e)}registerAfterSendEventHook(e){this.afterSendHooks.push(e)}addEventTypeMapping(e,t){this.eventTypeMapping[e]=t}setAcceptedLinkReferrers(e){if(Array.isArray(e)&&e.every(e=>"string"==typeof e))this.acceptedLinkReferrers=e;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(e,t){let r={};for(let n=0,i=t.length;n<i;n++){let i=t[n];if("string"==typeof i)r[e[n]]=i;else if("object"==typeof i)return Object.assign(Object.assign({},r),i)}return r}isKeyAllowedEmpty(e,t){return -1!==(({[F.search]:["queryText"]})[e]||[]).indexOf(t)}removeEmptyPayloadValues(e,t){return Object.keys(e).filter(r=>{let n;return this.isKeyAllowedEmpty(t,r)||null!=(n=e[r])&&""!==n}).reduce((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]}),{})}removeUnknownParameters(e){return Object.keys(e).filter(e=>{if([...i2,...iN,i6,i9].some(t=>t(e)))return!0;console.log(e,"is not processed by coveoua")}).reduce((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]}),{})}processCustomParameters(e){let{custom:t}=e,r=n0(e,["custom"]),n={};t&&ix(t)&&(n=this.lowercaseKeys(t));let i=iI(r).reduce((e,t)=>
135{var n;let i,a,s,o=(n=t,[...i3].every(e=>{var t;return!(i=null==(t=e.exec(n))?void 0:t[1])}),i);return o?Object.assign(Object.assign({},e),(a=o,iI(s=r[t]).reduce((e,t)=>Object.assign(Object.assign({},e),{[`${a}${t}`]:s[t]}),{}))):Object.assign(Object.assign({},e),{[t]:r[t]})},{});return Object.assign(Object.assign({},n),i)}mapCustomParametersToCustomData(e){let{custom:t}=e,r=n0(e,["custom"]);if(!(t&&ix(t)))return e;{let n=this.lowercaseKeys(t);return Object.assign(Object.assign({},r),{customData:Object.assign(Object.assign({},n),e.customData)})}}lowercaseKeys(e){let t=Object.keys(e),r={};return t.forEach(t=>{r[t.toLowerCase()]=e[t]}),r}validateParams(e,t){let{anonymizeIp:r}=e,n=n0(e,["anonymizeIp"]);return void 0!==r&&-1==["0","false","undefined","null","{}","[]",""].indexOf(`${r}`.toLowerCase())&&(n.anonymizeIp=1),(t==F.view||t==F.click||t==F.search||t==F.custom)&&(n.originLevel3=this.limit(n.originLevel3,1024)),t==F.view&&(n.location=this.limit(n.location,1024)),("pageview"==t||"event"==t)&&(n.referrer=this.limit(n.referrer,2048),n.location=this.limit(n.location,2048),n.page=this.limit(n.page,2048)),n}ensureAnonymousUserWhenUsingApiKey(e){let t,{userId:r}=e,n=n0(e,["userId"]);return(null==(t=this.options.token)?void 0:t.startsWith("xx"))&&!r?(n.userId="anonymous",n):e}setTrackingIdIfTrackingIdNotPresent(e){let{trackingId:t}=e,r=n0(e,["trackingId"]);return t?e:(r.hasOwnProperty("custom")&&ix(r.custom)&&(r.custom.hasOwnProperty("context_website")||r.custom.hasOwnProperty("siteName"))&&(r.trackingId=r.custom.context_website||r.custom.siteName),r.hasOwnProperty("customData")&&ix(r.customData)&&(r.customData.hasOwnProperty("context_website")||r.customData.hasOwnProperty("siteName"))&&(r.trackingId=r.customData.context_website||r.customData.siteName),r)}limit(e,t){return"string"==typeof e?function(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&"%"==e.charAt(r-3);){let n=Number.parseInt(e.substring(r-2,r),16);if((128&n)!=128)break;if(r-=3,(192&n)!=128){t-r>=3*((248&n)==240?4:(240&n)==224?3:(224&n)==192?2:1)&&(r=t);break}}return e.substring(0,r)}(e,t):e}get baseUrl(){return function(e=al,t="v15",r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}}(h=L||(L={})).contextChanged="contextChanged",h.expandToFullUI="expandToFullUI",h.openUserActions="openUserActions",h.showPrecedingSessions="showPrecedingSessions",h.showFollowingSessions="showFollowingSessions",h.clickViewedDocument="clickViewedDocument",h.clickPageView="clickPageView",h.createArticle="createArticle",(p=q||(q={})).interfaceLoad="interfaceLoad",p.interfaceChange="interfaceChange",p.didyoumeanAutomatic="didyoumeanAutomatic",p.didyoumeanClick="didyoumeanClick",p.resultsSort="resultsSort",p.searchboxSubmit="searchboxSubmit",p.searchboxClear="searchboxClear",p.searchboxAsYouType="searchboxAsYouType",p.breadcrumbFacet="breadcrumbFacet",p.breadcrumbResetAll="breadcrumbResetAll",p.documentQuickview="documentQuickview",p.documentOpen="documentOpen",p.omniboxAnalytics="omniboxAnalytics",p.omniboxFromLink="omniboxFromLink",p.searchFromLink="searchFromLink",p.triggerNotify="notify",p.triggerExecute="execute",p.triggerQuery="query",p.undoTriggerQuery="undoQuery",p.triggerRedirect="redirect",p.pagerResize="pagerResize",p.pagerNumber="pagerNumber",p.pagerNext="pagerNext",p.pagerPrevious="pagerPrevious",p.pagerScrolling="pagerScrolling",p.staticFilterClearAll="staticFilterClearAll",p.staticFilterSelect="staticFilterSelect",p.staticFilterDeselect="staticFilterDeselect",p.facetClearAll="facetClearAll",p.facetSearch="facetSearch",p.facetSelect="facetSelect",p.facetSelectAll="facetSelectAll",p.facetDeselect="facetDeselect",p.facetExclude="facetExclude",p.facetUnexclude="facetUnexclude",p.facetUpdateSort="facetUpdateSort",p.facetShowMore="showMoreFacetResults",p.facetShowLess="showLessFacetResults",p.queryError="query",p.queryErrorBack="errorBack",p.queryErrorClear="errorClearQuery",p.queryErrorRetry="errorRetry",p.recommendation="recommendation",p.recommendationInterfaceLoad="recommendationInterfaceLoad",p.recommendationOpen="recommendationOpen",p.likeSmartSnippet="likeSmartSnippet",p.dislikeSmartSnippet="dislikeSmartSnippet",p.exp
135andSmartSnippet="expandSmartSnippet",p.collapseSmartSnippet="collapseSmartSnippet",p.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",p.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",p.sendSmartSnippetReason="sendSmartSnippetReason",p.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",p.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",p.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",p.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",p.openSmartSnippetSource="openSmartSnippetSource",p.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",p.openSmartSnippetInlineLink="openSmartSnippetInlineLink",p.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",p.recentQueryClick="recentQueriesClick",p.clearRecentQueries="clearRecentQueries",p.recentResultClick="recentResultClick",p.clearRecentResults="clearRecentResults",p.noResultsBack="noResultsBack",p.showMoreFoldedResults="showMoreFoldedResults",p.showLessFoldedResults="showLessFoldedResults",p.copyToClipboard="copyToClipboard",p.caseSendEmail="Case.SendEmail",p.feedItemTextPost="FeedItem.TextPost",p.caseAttach="caseAttach",p.caseDetach="caseDetach",p.retryGeneratedAnswer="retryGeneratedAnswer",p.likeGeneratedAnswer="likeGeneratedAnswer",p.dislikeGeneratedAnswer="dislikeGeneratedAnswer",p.openGeneratedAnswerSource="openGeneratedAnswerSource",p.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",p.generatedAnswerStreamEnd="generatedAnswerStreamEnd",p.generatedAnswerSourceHover="generatedAnswerSourceHover",p.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",p.generatedAnswerHideAnswers="generatedAnswerHideAnswers",p.generatedAnswerShowAnswers="generatedAnswerShowAnswers",p.generatedAnswerExpand="generatedAnswerExpand",p.generatedAnswerCollapse="generatedAnswerCollapse",p.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",p.rephraseGeneratedAnswer="rephraseGeneratedAnswer",p.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",p.generatedAnswerCitationClick="generatedAnswerCitationClick",p.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach";let ac={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[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.generatedAnswerOpenInlineLink]:"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",[L.expandToFullUI]:"interface",[L.openUserActions]:"User Actions",[L.showPrecedingSessions]:"User Actions",[L.showFollowingSessions]:"User Actions",[L.clickViewedDocument]:"User Actions",[L.clickPageView]:"User Actions",[L.createArticle]:"createArticle"};class ad{constructor(){this.runtime=new ai,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(e){return Promise.resolve({eventType:e,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(F.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(F.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(F.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(F.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return ib}}let ah=e=>{let t,r=e.map(e=>e.replace(/;/g,""));return function e(t){let r=t.join(";");return r.length<=256?r:e(t.slice(1))}((t="",r.filter(e=>{let r=e!==t;return t=e,r})))};function ap(e){let t="string"==typeof e.partialQueries?e.partialQueries:ah(e.partialQueries),r="string"==typeof e.suggestions?e.suggestions:ah(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}class af{constructor(e,t){this.opts=e,this.provider=t;const r=!1===e.enableAnalytics||ao();this.coveoAnalyticsClient=r?new ad:new au(e)}disable(){this.coveoAnalyticsClient=new ad}enable(){this.coveoAnalyticsClient=new au(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(q.interfaceLoad)}logInterfaceLoad(){return n1(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(q.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return n1(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(q.recommendation)}logRecommendation(){return n1(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(e,t){return this.makeClickEvent(q.recommendationOpen,e,t)}logRecommendationOpen(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(e){return this.makeSearchEvent(q.staticFilterClearAll,e)}logStaticFilterClearAll(e){return n1(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(e)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(e){return this.makeSearchEvent(q.staticFilterSelect,e)}logStaticFilterSelect(e){return n1(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(e)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(e){return this.makeSearchEvent(q.staticFilterDeselect,e)}logStaticFilterDeselect(e){return n1(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(e)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(q.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return n1(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(e){return this.makeSearchEvent(q.interfaceChange,e)}logInterfaceChange(e){return n1(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(e)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(q.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return n1(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(q.didyoumeanClick)}logDidYouMeanClick(){return n1(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(e){return this.makeSearchEvent(q.resultsSort,e)}logResultsSort(e){return n1(this,void 0,void 0,function*(){return(yield this.makeResultsSort(e)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(q.searchboxSubmit)}logSearchboxSubmit(){return n1(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(q.searchboxClear)}logSearchboxClear(){return n1(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(q.searchboxAsYouType)}logSearchboxAsYouType(){return n1(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(e){return this.makeSearchEvent(q.breadcrumbFacet,e)}logBreadcrumbFacet(e){return n1(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(e)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(q.breadcrumbResetAll)}logBreadcrumbResetAll(){return n1(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(e,t){return this.makeClickEvent(q.documentQuickview,e,t)}logDocumentQuickview(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(e,t){return this.makeClickEvent(q.documentOpen,e,t)}logDocumentOpen(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(e){return this.makeSearchEvent(q.omniboxAnalytics,ap(e))}logOmniboxAnalytics(e){return n1(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(e)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(e){return this.makeSearchEvent(q.omniboxFromLink,ap(e))}logOmniboxFromLink(e){return n1(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(e)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(q.searchFromLink)}logSearchFromLink(){return n1(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(e){return this.makeCustomEvent(q.triggerNotify,e)}logTriggerNotify(e){return n1(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(e)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(e){return this.makeCustomEvent(q.triggerExecute,e)}logTriggerExecute(e){return n1(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(e)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(q.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return n1(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(e){return this.makeSearchEvent(q.undoTriggerQuery,e)}logUndoTriggerQuery(e){return n1(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(e)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(e){return this.makeCustomEvent(q.triggerRedirect,Object.assign(Object.assign({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(e){return n1(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(e){return this.makeCustomEvent(q.pagerResize,e)}logPagerResize(e){return n1(this,void 0,void 0,function*(){return(yield this.makePagerResize(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(e){return this.makeCustomEvent(q.pagerNumber,e)}logPagerNumber(e){return n1(this,void 0,void 0,function*(){return(yield this.makePagerNumber(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(e){return this.makeCustomEvent(q.pagerNext,e)}logPagerNext(e){return n1(this,void 0,void 0,function*(){return(yield this.makePagerNext(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(e){return this.makeCustomEvent(q.pagerPrevious,e)}logPagerPrevious(e){return n1(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(q.pagerScrolling)}logPagerScrolling(){return n1(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(e){return this.makeSearchEvent(q.facetClearAll,e)}logFacetClearAll(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(e){return this.makeSearchEvent(q.facetSearch,e)}logFacetSearch(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(e){return this.makeSearchEvent(q.facetSelect,e)}logFacetSelect(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(e){return this.makeSearchEvent(q.facetDeselect,e)}logFacetDeselect(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(e){return this.makeSearchEvent(q.facetExclude,e)}logFacetExclude(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(e){return this.makeSearchEvent(q.facetUnexclude,e)}logFacetUnexclude(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(e){return this.makeSearchEvent(q.facetSelectAll,e)}logFacetSelectAll(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(e){return this.makeSearchEvent(q.facetUpdateSort,e)}
135logFacetUpdateSort(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(e){return this.makeCustomEvent(q.facetShowMore,e)}logFacetShowMore(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(e){return this.makeCustomEvent(q.facetShowLess,e)}logFacetShowLess(e){return n1(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(e)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(e){return this.makeCustomEvent(q.queryError,e)}logQueryError(e){return n1(this,void 0,void 0,function*(){return(yield this.makeQueryError(e)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return n1(this,void 0,void 0,function*(){let e=yield this.makeCustomEvent(q.queryErrorBack);return{description:e.description,log:()=>n1(this,void 0,void 0,function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorBack)})}})}logQueryErrorBack(){return n1(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return n1(this,void 0,void 0,function*(){let e=yield this.makeCustomEvent(q.queryErrorRetry);return{description:e.description,log:()=>n1(this,void 0,void 0,function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorRetry)})}})}logQueryErrorRetry(){return n1(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return n1(this,void 0,void 0,function*(){let e=yield this.makeCustomEvent(q.queryErrorClear);return{description:e.description,log:()=>n1(this,void 0,void 0,function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorClear)})}})}logQueryErrorClear(){return n1(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(q.likeSmartSnippet)}logLikeSmartSnippet(){return n1(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(q.dislikeSmartSnippet)}logDislikeSmartSnippet(){return n1(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(q.expandSmartSnippet)}logExpandSmartSnippet(){return n1(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(q.collapseSmartSnippet)}logCollapseSmartSnippet(){return n1(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return n1(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return n1(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(e,t){return this.makeCustomEvent(q.sendSmartSnippetReason,{reason:e,details:t})}logSmartSnippetFeedbackReason(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(e){return this.makeCustomEvent(q.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})}logExpandSmartSnippetSuggestion(e){return n1(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(e){return this.makeCustomEvent(q.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})}logCollapseSmartSnippetSuggestion(e){return n1(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(e){return this.makeCustomEvent(q.showMoreSmartSnippetSuggestion,e)}logShowMoreSmartSnippetSuggestion(e){return n1(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(e){return this.makeCustomEvent(q.showLessSmartSnippetSuggestion,e)}logShowLessSmartSnippetSuggestion(e){return n1(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(e,t){return this.makeClickEvent(q.openSmartSnippetSource,e,t)}logOpenSmartSnippetSource(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(e,t){return this.makeClickEvent(q.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)}makeCopyToClipboard(e,t){return this.makeClickEvent(q.copyToClipboard,e,t)}logCopyToClipboard(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(e,t)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(e,t){return this.makeClickEvent(q.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)}logOpenSmartSnippetInlineLink(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(e,t){return this.makeClickEvent(q.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)}logOpenSmartSnippetSuggestionInlineLink(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(q.recentQueryClick)}logRecentQueryClick(){return n1(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(q.clearRecentQueries)}logClearRecentQueries(){return n1(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(e,t){return this.makeCustomEvent(q.recentResultClick,{info:e,identifier:t})}logRecentResultClick(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(q.clearRecentResults)}logClearRecentResults(){return n1(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(q.noResultsBack)}logNoResultsBack(){return n1(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(e,t){return this.makeClickEvent(q.showMoreFoldedResults,e,t)}logShowMoreFoldedResults(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(q.showLessFoldedResults)}logShowLessFoldedResults(){return n1(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(e,t){var r;return{actionCause:t,customData:null==(r=e.payload)?void 0:r.customData}}makeCustomEvent(e,t){return n1(this,arguments,void 0,function*(e,t,r=ac[e]){this.coveoAnalyticsClient.getParameters;let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t),i=Object.assign(Object.assign({},(yield this.getBaseEventRequest(n))),{eventType:r,eventValue:e}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({lastSearchQueryUid:e})}})}logCustomEvent(e,t){return n1(this,arguments,void 0,function*(e,t,r=ac[e]){return(yield this.makeCustomEvent(e,t,r)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(e,t,r){return n1(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},(yield this.getBaseEventRequest(n))),{eventType:t,eventValue:e}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({lastSearchQueryUid:e})}})}logCustomEventWithType(e,t,r){return n1(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(e,t,r)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(e,t){return n1(this,void 0,void 0,function*(){let r=yield this.getBaseSearchEventRequest(e,t),n=yield this.coveoAnalyticsClient.makeSearchEvent(r);return{description:this.makeEventDescription(n,e),log:({searchUID:e})=>n.log({searchQueryUid:e})}})}makeClickEvent(e,t,r,n){return n1(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},t),(yield this.getBaseEventRequest(Object.assign(Object.assign({},r),n)))),{queryPipeline:this.provider.getPipeline(),actionCause:e}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({searchQueryUid:e})}})}logClickEvent(e,t,r,n){return n1(this,void 0,void 0,function*(){return(yield this.makeClickEvent(e,t,r,n)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(e,t){return n1(this,void 0,void 0,function*(){var r,n;return Object.assign(Object.assign(Object.assign({},(yield this.getBaseEventRequest(Object.assign(Object.assign({},t),null==(n=(r=this.provider).getGeneratedAnswerMetadata)?void 0:n.call(r))))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:e})})}getBaseEventRequest(e){return n1(this,void 0,void 0,function*(){let t=Object.assign(Object.assign({},this.provider.getBaseMetadata()),e);return Object.assign(Object.assign(Object.assign({}
vendor: 4,589 bytes, line 135
135,this.getOrigins()),this.getSplitTestRun()),{customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var e,t;return{originContext:null==(t=(e=this.provider).getOriginContext)?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof au?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})}makeLikeGeneratedAnswer(e){return this.makeCustomEvent(q.likeGeneratedAnswer,e)}logLikeGeneratedAnswer(e){return n1(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(e){return this.makeCustomEvent(q.dislikeGeneratedAnswer,e)}logDislikeGeneratedAnswer(e){return n1(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(e){return this.makeCustomEvent(q.openGeneratedAnswerSource,e)}logOpenGeneratedAnswerSource(e){return n1(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(e){return this.makeCustomEvent(q.generatedAnswerOpenInlineLink,e)}logGeneratedAnswerOpenInlineLink(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(e,t){return this.makeClickEvent(q.generatedAnswerCitationClick,Object.assign(Object.assign({},e),{documentPosition:1}),{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)}logGeneratedAnswerCitationClick(e,t){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(e){return this.makeCustomEvent(q.generatedAnswerSourceHover,e)}logGeneratedAnswerSourceHover(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(e){return this.makeCustomEvent(q.generatedAnswerCopyToClipboard,e)}logGeneratedAnswerCopyToClipboard(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(e){return this.makeCustomEvent(q.generatedAnswerHideAnswers,e)}logGeneratedAnswerHideAnswers(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(e){return this.makeCustomEvent(q.generatedAnswerShowAnswers,e)}logGeneratedAnswerShowAnswers(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(e){return this.makeCustomEvent(q.generatedAnswerExpand,e)}logGeneratedAnswerExpand(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(e){return this.makeCustomEvent(q.generatedAnswerCollapse,e)}logGeneratedAnswerCollapse(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(e){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmit,e)}logGeneratedAnswerFeedbackSubmit(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(e){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmitV2,e)}logGeneratedAnswerFeedbackSubmitV2(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(e)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(e){return this.makeSearchEvent(q.rephraseGeneratedAnswer,e)}
135logRephraseGeneratedAnswer(e){return n1(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(q.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return n1(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(e){return this.makeCustomEvent(q.generatedAnswerStreamEnd,e)}logGeneratedAnswerStreamEnd(e){return n1(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(e)).log({searchUID:this.provider.getSearchUID()})})}}let ag=Object.assign({},iS),am=Object.keys(ag).map(e=>ag[e]);class ay extends i_{constructor({client:e,uuidGenerator:t=im}){super({client:e,uuidGenerator:t}),this.ticket={}}getApi(e){let t=super.getApi(e);return null!==t?t:"setTicket"===e?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(e){this.ticket=e}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((e,...[t])=>-1!==am.indexOf(e)?this.addSVCDataToPayload(e,t):t),this.client.registerAfterSendEventHook((e,...[t])=>(-1!==am.indexOf(e)&&this.updateLocationInformation(e,t),t))}addHooksForPageView(){this.client.addEventTypeMapping(ag.pageview,{newEventType:F.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(ag.event,{newEventType:F.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(e,t){var r;let n=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!=(r=this.actionData)?r:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),n),t)}getTicketPayload(){let e;return iI(e=this.ticket).filter(t=>void 0!==e[t]).reduce((t,r)=>{let n=iA[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{})}}ay.Id="svc",(f=$||($={})).click="click",f.flowStart="flowStart",(g=U||(U={})).enterInterface="ticket_create_start",g.fieldUpdate="ticket_field_update",g.fieldSuggestionClick="ticket_classification_click",g.documentSuggestionClick="documentSuggestionClick",g.documentSuggestionQuickview="documentSuggestionQuickview",g.suggestionRate="suggestion_rate",g.nextCaseStep="ticket_next_stage",g.caseCancelled="ticket_cancel",g.caseSolved="ticket_cancel",g.caseCreated="ticket_create",(m=V||(V={})).quit="Quit",m.solved="Solved";class av{constructor(e,t){var r;this.options=e,this.provider=t;const n=(null==(r=e.enableAnalytics)||r)&&!ao();this.coveoAnalyticsClient=n?new au(e):new ad,this.svc=new ay({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new ad,this.svc=new ay({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new au(this.options),this.svc=new ay({client:this.coveoAnalyticsClient})}logEnterInterface(e){return this.svc.setAction(U.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()}logUpdateCaseField(e){return this.svc.setAction(U.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logSelectFieldSuggestion(e){return this.svc.setAction(U.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(e){return this.logClickEvent(U.documentSuggestionClick,e.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:e.suggestion.permanentId})}logQuickviewDocumentSuggestion(e){return this.logClickEvent(U.documentSuggestionQuickview,e.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:e.suggestion.permanentId})}logRateDocumentSuggestion(e){return this.svc.setAction(U.suggestionRate,Object.assign({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()}
135logMoveToNextCaseStep(e){return this.svc.setAction(U.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logCaseCancelled(e){return this.svc.setAction(U.caseCancelled,{reason:V.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logCaseSolved(e){return this.svc.setAction(U.caseSolved,{reason:V.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logCaseCreated(e){return this.svc.setAction(U.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",$.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",$.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(e){return n1(this,void 0,void 0,function*(){var t,r;let n=Object.assign({},e);return Object.assign(Object.assign({},this.getOrigins()),{customData:n,language:null==(t=this.provider)?void 0:t.getLanguage(),anonymous:null==(r=this.provider)?void 0:r.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof au?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var e,t,r,n,i;return{originContext:null==(t=null==(e=this.provider)?void 0:e.getOriginContext)?void 0:t.call(e),originLevel1:null==(r=this.provider)?void 0:r.getOriginLevel1(),originLevel2:null==(n=this.provider)?void 0:n.getOriginLevel2(),originLevel3:null==(i=this.provider)?void 0:i.getOriginLevel3()}}logClickEvent(e,t,r,n){return n1(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},t),(yield this.getBaseEventRequest(Object.assign(Object.assign({},r),n)))),{searchQueryUid:null!=(a=null==(i=this.provider)?void 0:i.getSearchUID())?a:"",actionCause:e});return this.coveoAnalyticsClient.sendClickEvent(s)})}}class ab{constructor(e){this.getState=e,this.state=e()}getLanguage(){let e;return(e=this.state.configuration.search.locale.split("-")[0])&&2===e.length?e:"en"}getBaseMetadata(){let{context:e,configuration:t}=this.state,r=e?.contextValues||{},n={};for(let[e,t]of Object.entries(r))n[`context_${e}`]=t;return"legacy"===t.analytics.analyticsMode&&(n.coveoHeadlessVersion=nK),n}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||"default"}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}}let aw=(e,t)=>"function"==typeof t?(...r)=>{let n=e_(r[0]);try{return t.apply(t,r)}catch(t){return e.error(t,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,aS=(e,t)=>(...r)=>{let n=e_(r[1]);try{return t.apply(t,r)}catch(t){return e.error(t,"Error in analytics hook. Returning original request."),n}};class aE extends ab{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}}let a_=e=>e.configuration?.knowledge?.agentId,aC=e=>ak(e)||aI(e)?e.generatedAnswer?.answerId:ax(e)?e.search?.response?.extendedResults?.generativeQuestionAnsweringId:void 0,ak=e=>"answer"in e&&"generatedAnswer"in e&&!el(e.generatedAnswer?.answerConfigurationId),aI=e=>{let t=a_(e);return"generatedAnswer"in e&&"string"==typeof t&&t.trim().length>0},ax=e=>"search"in e&&void 0!==e.search&&"object"==typeof e.search,aA=e=>e.generatedAnswer?.fieldsToIncludeInCitations,aT=nH(e=>e.followUpAnswers?.followUpAnswers,e=>e?.flatMap(e=>e.citations));function aO(){return{desiredCount:5,numberOfValues:8,set:{}}}function aN(e){let{activeValue:t,ancestryMap:r}=function(e){let t=[...e],r=new Map;for(;t.length>0;){let e=t.shift();if("selected"===e.state)return{activeValue:e,ancestryMap:r};if(r)for(let t of e.children)r.set(t,e);t.unshift(...e.children)}return{}}(e);return t?function(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}(t,r):[]}nH(e=>e.generatedAnswer?.citations,aT,(e,t)=>t,(e,t,r)=>e?.find(e=>e.id===r)??t?.find(e=>e.id===r));let aR=(e,t)=>{let r=e.categoryFacetSet[t]?.request;return aN(r?.currentValues??[])},aD=(e,t)=>{let r=a$(t,e),n=r?r.field:"",i=aq(n,e);return{facetId:e,facetField:n,facetTitle:i}};function aP(e,t){let{facetId:r,facetValue:n}=e,i=aD(r,t),a=aU(t,r);return{...i,facetValue:"hierarchical"===a?aL(t,r):n}}function aM(e){return{facetSet:e.facetSet??{},categoryFacetSet:e.categoryFacetSet??{},dateFacetSet:e.dateFacetSet??{},numericFacetSet:e.numericFacetSet??{},automaticFacetSet:e.automaticFacetSet??aO()}}let aj=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),aF=e=>({displayValue:e.value,value:e.value}),aL=(e,t)=>aR(e,t).map(e=>e.value).join(";"),aq=(e,t)=>`${e}_${t}`,a$=(e,t)=>
135e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,aU=(e,t)=>{let r=a$(e,t);return r?r.type:"specific"},aV=()=>({q:"",enableQuerySyntax:!1});(y=z||(z={})).Ascending="ascending",y.Descending="descending",(v=G||(G={})).Relevancy="relevancy",v.QRE="qre",v.Date="date",v.Field="field",v.NoSort="nosort";let az=e=>{if(eb(e))return e.map(e=>az(e)).join(",");switch(e.by){case G.Relevancy:case G.QRE:case G.NoSort:return e.by;case G.Date:return`date ${e.order}`;case G.Field:return`@${e.field} ${e.order}`;default:return""}},aG=()=>({by:G.Relevancy}),aB=(e,t)=>({by:G.Field,order:t,field:e}),aQ=new em({values:{by:new ew({enum:G,required:!0}),order:new ew({enum:z}),field:new ef}});function aH(){return az(aG())}class aZ{static set(e,t,r){let n,i;r&&(n=new Date).setTime(n.getTime()+r);let a=window.location.hostname;/^(\d{1,3}\.){3}\d{1,3}$/.test(a)||/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/.test(a)||-1===a.indexOf(".")?aK(e,t,n):aK(e,t,n,(i=a.split("."))[i.length-2]+"."+i[i.length-1])}static get(e){let t=e+"=",r=document.cookie.split(";");for(let e=0;e<r.length;e++){let n=r[e];if(0===(n=n.replace(/^\s+/,"")).lastIndexOf(t,0))return n.substring(t.length,n.length)}return null}static erase(e){aZ.set(e,"",-1)}}function aK(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+("https:"===window.location.protocol?";Secure":"")}class aY{static{this.prefix="coveo_"}getItem(e){return aZ.get(`${aY.prefix}${e}`)}removeItem(e){aZ.erase(`${aY.prefix}${e}`)}setItem(e,t,r){aZ.set(`${aY.prefix}${e}`,t,r)}}class aW{getItem(e){return null}removeItem(e){}setItem(e,t){}}let aJ="__coveo.analytics.history";class aX{static{this.instance=null}static getInstance(e){return aX.instance||(aX.instance=new aX(e)),aX.instance}constructor(e){this.store=e||(!function(){try{return"u">typeof localStorage}catch(e){return!1}}()?"u">typeof navigator&&navigator.cookieEnabled?new aY:!function(){try{return"u">typeof sessionStorage}catch(e){return!1}}()?new aW:sessionStorage:localStorage)}addElement(e){e.internalTime=new Date().getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=this.getHistoryWithInternalTime();null!==t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])}async addElementAsync(e){e.internalTime=new Date().getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=await this.getHistoryWithInternalTimeAsync();null!==t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])}getHistory(){let e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))}async getHistoryAsync(){let e=await this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(e))}getHistoryWithInternalTime(){try{let e=this.store.getItem(aJ);if(e&&"string"==typeof e)return JSON.parse(e);return[]}catch(e){return[]}}async getHistoryWithInternalTimeAsync(){try{let e=await this.store.getItem(aJ);if(e)return JSON.parse(e);return[]}catch(e){return[]}}setHistory(e){try{this.store.setItem(aJ,JSON.stringify(e.slice(0,20)))}catch(e){}}clear(){try{this.store.removeItem(aJ)}catch(e){}}getMostRecentElement(){let e=this.getHistoryWithInternalTime();return Array.isArray(e)?e.sort((e,t)=>(t.internalTime||0)-(e.internalTime||0))[0]:null}cropQueryElement(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e}isValidEntry(e){let t=this.getMostRecentElement();return!t||t.value!==e.value||(e.internalTime||0)-(t.internalTime||0)>6e4}stripInternalTime(e){return Array.isArray(e)?e.map(e=>{let{name:t,time:r,value:n}=e;return{name:t,time:r,value:n}}):[]}stripEmptyQuery(e){let{name:t,time:r,value:n}=e;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e}stripEmptyQueries(e){return e.map(e=>this.stripEmptyQuery(e))}}class a0 extends ab{static{this.fallbackPipelineName="default"}getFacetState(){var e;let t,r;return e=aM(this.getState()),t=[],[...Object.values((r=e).facetSet),...Object.values(r.categoryFacetSet),...Object.values(r.dateFacetSet),...Object.values(r.numericFacetSet)].map(e=>e.request).forEach((r,n)=>{let i,a,s=aU(e,r.facetId),o=(i=r,a=n+1,{title:aq(i.field,i.facetId),field:i.field,id:i.facetId,facetPosition:a});if("hierarchical"===r.type){let n;if(!aR(e,r.facetId).length)return;t.push({...o,...{value:n=aL(e,r.facetId),valuePosition:1,displayValue:n},facetType:s,state:"selected"});return}
135r.currentValues.forEach((e,n)=>{let i;if("idle"===e.state)return;let a=aj(e,n+1,s),l="specific"===r.type?aF(e):(i=e,{displayValue:`${i.start}..${i.end}`,value:`${i.start}..${i.end}`,start:i.start,end:i.end,endInclusive:i.endInclusive});t.push({...o,...a,...l})})}),[...Object.values(e.automaticFacetSet.set)].map(e=>e.response).forEach((e,r)=>{let n,i,a=(n=e,i=r+1,{title:aq(n.field,n.field),field:n.field,id:n.field,facetPosition:i});e.values.forEach((e,r)=>{if("idle"===e.state)return;let n=aj(e,r+1,"specific"),i=aF(e);t.push({...a,...n,...i})})}),t}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||a0.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let e=this.getState();return e.search?.searchResponseId||e.search?.response.searchUid||eq().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let e=!!this.getSplitTestRunName(),t=this.state.search?.response.pipeline||this.state.pipeline||a0.fallbackPipelineName;return e?t:void 0}getBaseMetadata(){let e=this.getState(),t=super.getBaseMetadata(),r=aC(e);return r&&(t.generativeQuestionAnsweringId=r),t}getFacetMetadata(e,t){let r=this.getFacetRequest(e),n=r?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:n,facetValue:t,facetTitle:`${n}_${e}`}}getFacetClearAllMetadata(e){let t=this.getFacetRequest(e),r=t?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:r,facetTitle:`${r}_${e}`}}getFacetUpdateSortMetadata(e,t){let r=this.getFacetRequest(e),n=r?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:n,criteria:t,facetTitle:`${n}_${e}`}}getRangeBreadcrumbFacetMetadata(e,t){let r=this.getFacetRequest(e),n=r?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:n,facetRangeEnd:t.end,facetRangeEndInclusive:t.endInclusive,facetRangeStart:t.start,facetTitle:`${n}_${e}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??aH()}}getStaticFilterToggleMetadata(e,t){return{...this.getBaseMetadata(),staticFilterId:e,staticFilterValue:t}}getStaticFilterClearAllMetadata(e){return{...this.getBaseMetadata(),staticFilterId:e}}getUndoTriggerQueryMetadata(e){return{...this.getBaseMetadata(),undoneQuery:e}}getCategoryBreadcrumbFacetMetadata(e,t){let r=this.getFacetRequest(e),n=r?.field??"";return{...this.getBaseMetadata(),categoryFacetId:e,categoryFacetField:n,categoryFacetPath:t,categoryFacetTitle:`${n}_${e}`}}getOmniboxAnalyticsMetadata(e,t){let r=this.state.querySuggest?.[e],n=r.completions.map(e=>e.expression),i=r.partialQueries.length-1,a=r.partialQueries[i]||"",s=r.responseId;return{...this.getBaseMetadata(),suggestionRanking:n.indexOf(t),partialQuery:a,partialQueries:r.partialQueries.length>0?r.partialQueries:"",suggestions:n.length>0?n:"",querySuggestResponseId:s}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(e){return{...this.getBaseMetadata(),...e}}getGeneratedAnswerMetadata(){let e=this.getState(),t={};return e.generatedAnswer?.isVisible!==void 0&&(t.showGeneratedAnswer=e.generatedAnswer.isVisible),t}get resultURIs(){return this.results?.map(e=>({documentUri:e.uri,documentUriHash:e.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||aV().q}get responseTime(){return this.state.search?.duration||eq().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||eq().response.totalCountFiltered}constructor(...e){super(...e),this.getFacetRequest=e=>this.state.facetSet?.[e]?.request||this.state.categoryFacetSet?.[e]?.request||this.state.dateFacetSet?.[e]?.request||this.state.numericFacetSet?.[e]?.request||this.state.automaticFacetSet?.set[e]?.response}}let a1=()=>{let e=aX.getInstance().getHistory().reverse().find(e=>"PageView"===e.name&&e.value);return e?e.value:""},a2=(e,t,r)=>function(...n){return a3(1===n.length?{...n[0],__legacy__getBuilder:t(n[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:n[0],__legacy__getBuilder:t(n[1]),__legacy__provider:n[2],analyticsConfigurator:e,providerClass:r})},a3=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:i,analyticsConfigurator:a,providerClass:s})=>{var o;let l,u;return r??=e=>new s(e),o=async({getState:e,analyticsClientMiddleware:s,preprocessRequest:o,logger:l})=>{let u=[],c={log:async({state:e})=>{for(let t of u)await t(e)}},d=e(),h=a({getState:e,logger:l,analyticsClientMiddleware:s,preprocessRequest:o,provider:r(e)}),p=await t(h,e());c.description=p?.description,u.push(async e=>{"legacy"===e.configuration.analytics.analyticsMode&&await a5(p,r,e,l,h.coveoAnalyticsClient)});let{emit:f}=nW(d);return u.push(async e=>{if("next"===e.configuration.analytics.analyticsMode&&i&&n){let t=n(e);await a7(f,i,t)}}),c}
135,Object.assign(u=(l=t=>{let r=rB(e,t);return Object.assign(Object.assign(r,{type:r.typePrefix}),{instantlyCallable:!0})})(async(e,{getState:t,extra:r})=>{let{analyticsClientMiddleware:n,preprocessRequest:i,logger:a}=r;return await (await o({getState:t,analyticsClientMiddleware:n,preprocessRequest:i,logger:a})).log({state:t(),extra:r})}),{prepare:async({getState:e,analyticsClientMiddleware:t,preprocessRequest:r,logger:n})=>{let{description:i,log:a}=await o({getState:e,analyticsClientMiddleware:t,preprocessRequest:r,logger:n});return{description:i,action:l(async(e,{getState:t,extra:r})=>await a({state:t(),extra:r}))}}}),u};async function a5(e,t,r,n,i){t(()=>r);let a=await e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:i,response:a},"Analytics response")}let a4=a2(e=>(({logger:e,getState:t,analyticsClientMiddleware:r=(e,t)=>t,preprocessRequest:n,provider:i})=>{let a=t(),s=a.configuration.accessToken,o=a.configuration.analytics.apiBaseUrl??eW(a.configuration.organizationId,a.configuration.environment,"analytics"),l=a.configuration.analytics.runtimeEnvironment,u=a.configuration.analytics.enabled,c=new af({token:s,endpoint:o,runtimeEnvironment:l,preprocessRequest:aw(e,n),beforeSendHooks:[aS(e,r),(t,r)=>(e.info({...r,type:t,endpoint:o,token:s},"Analytics request"),r)]},i);return u||c.disable(),c})({...e,provider:e.provider||new a0(e.getState)}),e=>e,a0);a2(({logger:e,getState:t,analyticsClientMiddleware:r=(e,t)=>t,preprocessRequest:n,provider:i=new aE(t)})=>{let a=t(),s=a.configuration.accessToken,o=a.configuration.analytics.apiBaseUrl??eW(a.configuration.organizationId,a.configuration.environment,"analytics"),l=a.configuration.analytics.runtimeEnvironment,u=a.configuration.analytics.enabled,c=new av({enableAnalytics:u,token:s,endpoint:o,runtimeEnvironment:l,preprocessRequest:aw(e,n),beforeSendHooks:[aS(e,r),(t,r)=>(e.info({...r,type:t,endpoint:o,token:s},"Analytics request"),r)]},i);return u||c.disable(),c},e=>(t,r)=>Promise.resolve({description:{actionCause:"caseAssist"},log:async n=>{e(t,r)}}),aE);let a6=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||""}),a9={urihash:new ef,sourcetype:new ef,permanentid:new ef},a8={uniqueId:e7,raw:new em({values:a9}),title:e7,uri:e7,clickUri:e7,rankingModifier:new ef({required:!1,emptyAllowed:!0})};async function a7(e,t,r){await e(t,r)}(b=B||(B={})).interfaceLoad="interfaceLoad",b.interfaceChange="interfaceChange",b.didYouMeanAutomatic="didYouMeanAutomatic",b.didYouMeanClick="didYouMeanClick",b.resultsSort="resultsSort",b.searchboxSubmit="searchboxSubmit",b.searchboxAsYouType="searchboxAsYouType",b.breadcrumbFacet="breadcrumbFacet",b.breadcrumbResetAll="breadcrumbResetAll",b.documentOpen="documentOpen",b.omniboxAnalytics="omniboxAnalytics",b.omniboxFromLink="omniboxFromLink",b.searchFromLink="searchFromLink",b.triggerQuery="query",b.browseResults="browseResults",b.staticFilterDeselect="staticFilterDeselect",b.facetClearAll="facetClearAll",b.facetSelect="facetSelect",b.facetDeselect="facetDeselect",b.facetExclude="facetExclude",b.facetUnexclude="facetUnexclude",b.facetUpdateSort="facetUpdateSort",b.documentSuggestion="documentSuggestion",b.facetShowMore="showMoreFacetResults",b.facetShowLess="showLessFacetResults",b.queryError="query",b.recommendationInterfaceLoad="recommendationInterfaceLoad",b.likeSmartSnippet="likeSmartSnippet",b.dislikeSmartSnippet="dislikeSmartSnippet",b.expandSmartSnippet="expandSmartSnippet",b.collapseSmartSnippet="collapseSmartSnippet",b.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",b.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",b.sendSmartSnippetReason="sendSmartSnippetReason",b.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",b.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",b.openSmartSnippetSource="openSmartSnippetSource",b.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",b.showMoreFoldedResults="showMoreFoldedResults",b.showLessFoldedResults="showLessFoldedResults",b.copyToClipboard="copyToClipboard",b.caseSendEmail="Case.SendEmail",b.feedItemTextPost="FeedItem.TextPost",b.caseAttach="caseAttach",b.caseDetach="caseDetach",b.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach",b.retryGeneratedAnswer="retryGeneratedAnswer",b.likeGeneratedAnswer="likeGeneratedAnswer",b.dislikeGeneratedAnswer="dislikeGeneratedAnswer",b.openGeneratedAnswerSource="openGeneratedAnswerSource",b.generatedAnswerStreamEnd="generatedAnswerStreamEnd",b.contextChanged="contextChanged",b.generatedAnswerSourceHover="generatedAnswerSourceHover",b.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",b.generatedAnswerHideAnswers="generatedAnswerHideAnswers",b.generatedAnswerShowAnswers="generatedAnswerShowAnswers",b.generatedAnswerExpand="generatedAnswerExpand",b.generatedAnswerCollapse="generatedAnswerCollapse",b.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",b.expandToFullUI="expandToFullUI",b.createArticle="createArticle",b.recentQueriesClick="recentQueriesClick",b.clearRecentQueries="clearRecentQueries";let se=()=>a4("analytics/interface/load",e=>e.makeInterfaceLoad()),st=()=>a4("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),sr=()=>a4("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),sn=e=>a4("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),si=()=>({actionCause:B.interfaceChange}),sa=rS("configuration/updateBasicConfiguration",e=>to(e,{accessToken:te,environment:new ef({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:te})),ss=rS("configuration/updateSearchConfiguration",e=>to(e,{proxyBaseUrl:new ef({required:!1,url:!0}),pipeline:new ef({required:!1,emptyAllowed:!0}),searchHub:te,timezone:te,locale:te,authenticationProviders:new ev({required:!1,each:e7})})),so={enabled:new eu({default:!0}),originContext:te,originLevel2:te,originLevel3:te,proxyBaseUrl:new ef({required:!1,url:!0}),runtimeEnvironment:new es,anonymous:new eu({default:!1}),deviceId:te,userDisplayName:te,documentLocation:te,trackingId:ti,analyticsMode:new ef({constrainTo:["legacy","
135next"],required:!1,default:"next"}),source:new em({options:{required:!1},values:["@coveo/atomic","@coveo/quantic"].reduce((e,t)=>(e[t]=tn,e),{})})},sl=rS("configuration/updateAnalyticsConfiguration",e=>to(e,so)),su=rS("configuration/analytics/disable"),sc=rS("configuration/analytics/enable"),sd=rS("configuration/analytics/originlevel2",e=>to(e,{originLevel2:e7})),sh=rS("configuration/analytics/originlevel3",e=>to(e,{originLevel3:e7})),sp=rS("knowledge/setAgentId",e=>to(e,new ef({required:!0}))),sf={q:new ef,enableQuerySyntax:new eu,aq:new ef,cq:new ef,firstResult:new ed({min:0}),numberOfResults:new ed({min:0}),sortCriteria:new ef,f:new em,fExcluded:new em,cf:new em,nf:new em,mnf:new em,df:new em,debug:new eu,sf:new em,tab:new ef,af:new em},sg=rS("searchParameters/restore",e=>to(e,sf)),sm=rS("searchParameters/restoreTab",e=>to(e,e7)),sy=rS("debug/enable"),sv=rS("debug/disable"),sb=rT(!1,e=>{e.addCase(sy,()=>!0).addCase(sv,()=>!1).addCase(sg,(e,t)=>t.payload.debug??e)}),sw=rS("history/undo"),sS=rS("history/redo"),sE=rS("history/snapshot");rB("history/back",async(e,{dispatch:t})=>{t(sw()),await t(s_())}),rB("history/forward",async(e,{dispatch:t})=>{t(sS()),await t(s_())});let s_=rB("history/change",async(e,{getState:t})=>t().history.present),sC=rS("pipeline/set",e=>to(e,new ef({required:!0,emptyAllowed:!0}))),sk=rT("",e=>{e.addCase(sC,(e,t)=>t.payload).addCase(s_.fulfilled,(e,t)=>t.payload?.pipeline??e).addCase(ss,(e,t)=>t.payload.pipeline||e)}),sI=rS("breadcrumb/deselectAll"),sx=rS("breadcrumb/deselectAllNonBreadcrumbs"),sA=rS("facet/updateFacetAutoSelection",e=>to(e,{allow:new eu({required:!0})}));class sT extends a0{constructor(e){super(e),this.getState=e}get activeInstantResultQuery(){let e=this.getState().instantResults;for(let t in e)for(let r in e[t].cache)if(e[t].cache[r].isActive)return e[t].q;return null}get activeInstantResultCache(){let e=this.getState().instantResults;for(let t in e)for(let r in e[t].cache)if(e[t].cache[r].isActive)return e[t].cache[r];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??aV().q}get responseTime(){return this.activeInstantResultCache?.duration??eq().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??eq().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}}let sO={id:e7},sN={...sO,q:tt},sR=rS("instantResults/register",e=>to(e,sO)),sD=rS("instantResults/updateQuery",e=>to(e,sN)),sP=rS("instantResults/clearExpired",e=>to(e,sO)),sM=new ed({required:!0,min:0}),sj=rS("pagination/registerNumberOfResults",e=>to(e,sM)),sF=rS("pagination/updateNumberOfResults",e=>to(e,sM)),sL=rS("pagination/registerPage",e=>to(e,sM)),sq=rS("pagination/updatePage",e=>to(e,sM)),s$=rS("pagination/nextPage"),sU=rS("pagination/previousPage"),sV=rS("query/updateQuery",e=>to(e,{q:new ef,enableQuerySyntax:new eu})),sz=(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:nY(e)}}}),sG=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??eJ(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&&sz(e.configuration.analytics,t,r),...e.excerptLength&&!el(e.excerptLength.length)&&{excerptLength:e.excerptLength.length},...e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}}),sB=async(e,t)=>{let r="next"===e.analyticsMode;return{analytics:{clientId:await new au(e).getCurrentVisitorId(),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},...a1()&&{pageId:a1()},...r&&e.trackingId&&{trackingId:e.trackingId},...{capture:r},...r&&{source:nY(e)}}}},sQ=async(e,t)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??eJ(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:aX.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&&await sB(e.configuration.analytics,t),...e.excerptLength&&!el(e.excerptLength.length)&&{excerptLength:e.excerptLength.length},...e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}}),sH=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}}),sZ=()=>a4("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),sK=e=>a4("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||aV().q,aq:r.advancedSearchQueries?.aq||sH().aq,cq:r.advancedSearchQueries?.cq||sH().cq,dq:r.advancedSearchQueries?.dq||sH().dq,errorType:e.type,errorMessage:e.message}));var sY=r(27866),sW=r(60063),sJ=r(79942);sY.extend(sJ);let sX="YYYY/MM/DD@HH:mm:ss";function s0(e,t){let r=sY(e,t);return r.isValid()||t?r:sY(e,sX)}function s1(e){return e.format(sX)}function s2(e,t){let r=s0(e,t);if(!r.isValid()){let r=` with the format "${t}"`;throw Error(`Could not parse the provided date "${e}
135"${t?r:". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information."}`)}s3(r)}function s3(e){if(e.isBefore("1401-01-01"))throw Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}sY.extend(sW);let s5=["past","now","next"],s4=["minute","hour","day","week","month","quarter","year"];function s6(e){let t;if("string"==typeof e&&!oe(e))throw Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let r="string"==typeof e?ot(e):e;new ea({amount:new ed({required:!(t="now"===r.period),min:1}),unit:new ef({required:!t,constrainTo:s4}),period:new ef({required:!0,constrainTo:s5})}).validate(r);let n=s9(r),i=JSON.stringify(r);if(!n.isValid())throw Error(`Date is invalid: ${i}`);s3(n)}function s9(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return sY().subtract(r,n);case"next":return sY().add(r,n);case"now":return sY()}}function s8(e){return s1(s9(ot(e)))}function s7(e){return e.toLocaleLowerCase().split("-")}function oe(e){let[t,r,n]=s7(e);if("now"===t)return!0;if(!s5.includes(t)||!s4.includes(n))return!1;let i=parseInt(r,10);return!Number.isNaN(i)&&!(i<=0)}function ot(e){let[t,r,n]=s7(e);return"now"===t?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}let or=()=>({dateFacetValueMap:{}});function on(e,t){if("dateRange"===e.type){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(e=>{var n,i,a,s,o;let l,u;return n=e,i=r,a=t,l=n.start,u=n.end,oe(l)&&(l=s8(l),a.dateFacetValueMap[i][s=l,`start${s}`]=n.start),oe(u)&&(u=s8(u),a.dateFacetValueMap[i][o=u,`end${o}`]=n.end),{...n,start:l,end:u}})}}return e}function oi(e){let t=or();return{request:{...e,facets:e.facets?.map(e=>on(e,t))},mappings:t}}function oa(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(e=>e.facetId in t.dateFacetValueMap?{...e,values:e.values.map(r=>{var n,i,a;return n=e.facetId,{...r,start:t.dateFacetValueMap[n][i=r.start,`start${i}`]||r.start,end:t.dateFacetValueMap[n][a=r.end,`end${a}`]||r.end}})}:e)}}:e}let os=rS("didYouMean/enable"),oo=rS("didYouMean/disable"),ol=rS("didYouMean/automaticCorrections/disable"),ou=rS("didYouMean/automaticCorrections/enable"),oc=rS("didYouMean/correction",e=>to(e,e7)),od=rS("didYouMean/automaticCorrections/mode",e=>to(e,new ef({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0}))),oh=()=>a4("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),op=()=>a4("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());function of(){return{contextValues:{}}}function og(){return{contextValues:{}}}function om(){return{enabled:!0,tabs:{}}}function oy(){return{freezeFacetOrder:!1,facets:{}}}function ov(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}function ob(e){return{context:e.context||of(),dictionaryFieldContext:e.dictionaryFieldContext||og(),facetSet:e.facetSet||{},numericFacetSet:e.numericFacetSet||{},dateFacetSet:e.dateFacetSet||{},categoryFacetSet:e.categoryFacetSet||{},automaticFacetSet:e.automaticFacetSet??aO(),pagination:e.pagination||ov(),query:e.query||aV(),tabSet:e.tabSet||{},advancedSearchQueries:e.advancedSearchQueries||sH(),staticFilterSet:e.staticFilterSet||{},querySet:e.querySet||{},sortCriteria:e.sortCriteria||aH(),pipeline:e.pipeline||"",searchHub:e.searchHub||"default",facetOptions:e.facetOptions||oy(),facetOrder:e.facetOrder??[],debug:e.debug??!1}}let ow=new em({values:{undoneQuery:tt},options:{required:!0}}),oS=()=>a4("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),oE=e=>a4("analytics/trigger/query/undo",t=>(to(e,ow),t.makeUndoTriggerQuery(e))),o_=()=>a4("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),oC=()=>a4("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),ok=()=>a4("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null),oI=rS("trigger/query/ignore",e=>to(e,new ef({emptyAllowed:!0,required:!0}))),ox=rS("trigger/query/modification",e=>to(e,new em({values:{originalQuery:te,modification:te}})));function oA(e){return Object.values(e).map(e=>e.request)}function oT(e,t){let r={};
135e.forEach(e=>{r[e.facetId]=e});let n=[];return t.forEach(e=>{e in r&&(n.push(r[e]),delete r[e])}),[...n,...Object.values(r)]}function oO(e){return oA(e).map(e=>{let t=e.currentValues.some(({state:e})=>"idle"!==e);return e.generateAutomaticRanges&&!t?{...e,currentValues:[]}:e})}let oN={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function oR(e){var t;return oT([...oA((t=e).facetSet??{}).map(e=>{let t=oN[e.sortCriteria];return t?{...e,sortCriteria:t}:e}),...oO(t.numericFacetSet??{}),...oO(t.dateFacetSet??{}),...oA(t.categoryFacetSet??{})].filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0),e.facetOrder??[])}let oD=async(e,t)=>{var r,n;let i,a,s,o=(r=e,i=r.advancedSearchQueries?.cq.trim()||"",a=Object.values(r.tabSet||{}).find(e=>e.isActive),[i,a?.expression.trim()||"",...Object.values(r.staticFilterSet||{}).map(e=>{let t=e.values.filter(e=>"selected"===e.state&&!!e.expression.trim()),r=t.map(e=>e.expression).join(" OR ");return t.length>1?`(${r})`:r})].filter(e=>!!e).join(" AND ")),l=oR(e),u=(n=e,(s=n.automaticFacetSet?.set)?Object.values(s).map(e=>e.response).map(oP).filter(e=>e.currentValues.length>0):void 0);return oi({...await sQ(e,t),...e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&"next"===e.didYouMean.queryCorrectionMode,options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&"legacy"===e.didYouMean.queryCorrectionMode},...o&&{cq:o},...l.length&&{facets:l},...e.pagination&&{numberOfResults:e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,firstResult:e.pagination.firstResult},...e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}},...e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange},...e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:u}},...e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}}})};function oP(e){let{field:t,label:r,values:n}=e;return{field:t,label:r,currentValues:n.filter(e=>"selected"===e.state)}}class oM{constructor(e,t=e=>{this.dispatch(sV({q:e}))}){this.config=e,this.onUpdateQueryForCorrection=t}async fetchFromAPI({mappings:e,request:t},r){let n=Date.now(),i=oa(await this.extra.apiClient.search(t,r),e);return{response:i,duration:Date.now()-n,queryExecuted:this.getState().query?.q||"",requestExecuted:t}}async process(e){return this.processQueryErrorOrContinue(e)??await this.processQueryCorrectionsOrContinue(e)??await this.processQueryTriggersOrContinue(e)??this.processSuccessResponse(e)}processQueryErrorOrContinue(e){return void 0!==e.response.error?(this.dispatch(sK(e.response.error)),this.rejectWithValue(e.response.error)):null}async processQueryCorrectionsOrContinue(e){let t=this.getState(),r=this.getSuccessResponse(e);if(!r||!t.didYouMean)return null;let{enableDidYouMean:n,automaticallyCorrectQuery:i}=t.didYouMean,{results:a,queryCorrections:s,queryCorrection:o}=r;if(!n||!i)return null;let l=0===a.length&&s&&0!==s.length,u=!el(o)&&!el(o.correctedQuery);if(!l&&!u)return null;let c=l?await this.processLegacyDidYouMeanAutoCorrection(e):this.processModernDidYouMeanAutoCorrection(e);return this.dispatch(sE(ob(this.getState()))),c}async processLegacyDidYouMeanAutoCorrection(e){let t=this.getCurrentQuery(),r=this.getSuccessResponse(e);if(!r.queryCorrections)return null;let{correctedQuery:n}=r.queryCorrections[0],i=await this.automaticallyRetryQueryWithCorrection(n);return void 0!==i.response.error?(this.dispatch(sK(i.response.error)),this.rejectWithValue(i.response.error)):(this.logOriginalAnalyticsQueryBeforeAutoCorrection(e),this.dispatch(sE(ob(this.getState()))),{...i,response:{...i.response.success,queryCorrections:r.queryCorrections},automaticallyCorrected:!0,originalQuery:t,analyticsAction:op()})}processModernDidYouMeanAutoCorrection(e){let t=this.getSuccessResponse(e),{correctedQuery:r,originalQuery:n}=t.queryCorrection;return this.onUpdateQueryForCorrection(r),{...e,response:{...t},queryExecuted:r,automaticallyCorrected:!0,originalQuery:n,analyticsAction:op()}}logOriginalAnalyticsQueryBeforeAutoCorrection(e){let t=this.getState(),r=this.getSuccessResponse(e);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(e.queryExecuted,e.duration,t,r),this.extra)}async processQueryTriggersOrContinue(e){let t=this.getSuccessResponse(e);if(!t)return null;let r=t.triggers.find(e=>"query"===e.type)?.content||"";if(!r)return null;if(this.getState().triggers?.queryModification.queryToIgnore===r)return this.dispatch(oI("")),null;this.analyticsAction&&await this.dispatch(this.analyticsAction);let n=this.getCurrentQuery(),i=await this.automaticallyRetryQueryWithTriggerModification(r);return void 0!==i.response.error?(this.dispatch(sK(i.response.error)),this.rejectWithValue(i.response.error)):(this.dispatch(sE(ob(this.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:n,analyticsAction:oS()})}getStateAfterResponse(e,t,r,n){return{...r,query:{q:e,enableQuerySyntax:r.query?.enableQuerySyntax??aV().enableQuerySyntax},search:{...eq(),duration:t,response:n,results:n.results}}}processSuccessResponse(e){return this.dispatch(sE(ob(this.getState()))),{...e,response:this.getSuccessResponse(e),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(e){return void 0!==e.response.success?e.response.success:null}async automaticallyRetryQueryWithCorrection(e){this.onUpdateQueryForCorrection(e);let t=await this.fetchFromAPI(await oD(this.getState()),{origin:"mainSearch"});return this.dispatch(oc(e)),t}async automaticallyRetryQueryWithTriggerModification(e){return this.dispatch(ox({newQuery:e,originalQuery:this.getCurrentQuery()})),this.onUpdateQueryForCorrection(e),await this.fetchFromAPI(await oD(this.getState()),{origin:"mainSearch"})}getCurrentQuery(){let e=this.getState();return e.query?.q!==void 0?e.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}}let oj=rB("search/executeSearch",async(e,t)=>{let r=t.getState();return await oK(r,t,e)}),oF=rB("search/fetchPage",async(e,t)=>{let r=t.getState();return await oQ(r,t,e)}),oL=rB("search/fetchMoreResults",async(e,t)=>{let r=t.getState();return await oH(t,r)}
135),oq=rB("search/fetchFacetValues",async(e,t)=>{let r=t.getState();return await oZ(t,e,r)}),o$=rB("search/fetchInstantResults",async(e,t)=>oB(e,t)),oU=async(e,t)=>{let r=await oD(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r},oV=async(e,t,r)=>oi({...await sQ(e),...e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean},numberOfResults:r,q:t}),oz=async(e,t)=>{let r=await oD(e,t);return r.request.numberOfResults=0,r},oG=e=>{e.configuration.analytics.enabled&&aX.getInstance().addElement({name:"Query",...e.query?.q&&{value:e.query.q},time:JSON.stringify(new Date)})};async function oB(e,t){to(e,{id:e7,q:e7,maxResultsPerQuery:new ed({required:!0,min:1}),cacheTimeout:new ed});let{q:r,maxResultsPerQuery:n}=e,i=t.getState(),a=new oM({...t,analyticsAction:a4("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new sT(e))},r=>{t.dispatch(sD({q:r,id:e.id}))}),s=await oV(i,r,n),o=await a.fetchFromAPI(s,{origin:"instantResults",disableAbortWarning:!0}),l=await a.process(o);return"response"in l?{results:l.response.results,searchUid:l.response.searchUid,analyticsAction:l.analyticsAction,totalCountFiltered:l.response.totalCountFiltered,duration:l.duration}:l}async function oQ(e,t,r){oG(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:a}=t.extra,{description:s}=await r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:a}),o=new oM({...t,analyticsAction:r}),l=await oD(e,s),u=await o.fetchFromAPI(l,{origin:"mainSearch"});return await o.process(u)}async function oH(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:i}=e.extra,{description:a}=await sZ().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:i}),s=new oM({...e,analyticsAction:sZ()}),o=await oU(t,a),l=await s.fetchFromAPI(o,{origin:"mainSearch"});return await s.process(l)}async function oZ(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:i,logger:a}=e.extra,{description:s}=await t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:a}),o=new oM({...e,analyticsAction:t}),l=await oz(r,s),u=await o.fetchFromAPI(l,{origin:"facetValues"});return await o.process(u)}async function oK(e,t,r){oG(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:a}=t.extra,{description:s}=await r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:a}),o=await oD(e,s),l=new oM({...t,analyticsAction:r}),u=await l.fetchFromAPI(o,{origin:"mainSearch"});return await l.process(u)}let oY=nH(e=>e.staticFilterSet,e=>Object.values(e||{}).map(e=>{let t=e.values.filter(e=>"selected"===e.state&&!!e.expression.trim()),r=t.map(e=>e.expression).join(" OR ");return t.length>1?`(${r})`:r})),oW=async(e,t,r)=>{var n,i,a,s;let o,l=o1(e),u=oT([...oA((a=i=n=e).facetSet??{}).map(e=>{let t=oN[e.sortCriteria];return t?{...e,sortCriteria:t}:e}),...o0(a.numericFacetSet??{}),...o0(a.dateFacetSet??{}),...oA(a.categoryFacetSet??{})].filter(({facetId:e})=>i.facetOptions?.facets[e]?.enabled??!0),n.facetOrder??[]),c=(s=e,(o=s.automaticFacetSet?.set)?Object.values(o).map(e=>e.response).map(oX).filter(e=>e.currentValues.length>0):void 0);return oi({..."legacy"===e.configuration.analytics.analyticsMode?await sQ(e,r):sG(e,t,r),...e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&"next"===e.didYouMean.queryCorrectionMode,options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&"legacy"===e.didYouMean.queryCorrectionMode},...l&&{cq:l},...u.length&&{facets:u},...e.pagination&&{numberOfResults:oJ(e),firstResult:e.pagination.firstResult},...e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}},...e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange},...e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:c}},...e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}}})};function oJ(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function oX(e){let{field:t,label:r,values:n}=e;return{field:t,label:r,currentValues:n.filter(e=>"selected"===e.state)}}function o0(e){return oA(e).map(e=>{let t=e.currentValues,r=t.some(({state:e})=>"idle"!==e),n=t.some(e=>e.previousState);return!e.generateAutomaticRanges||r||n?e:{...e,currentValues:[]}})}function o1(e){let t=e.advancedSearchQueries?.cq.trim()||"",r=Object.values(e.tabSet||{}).find(e=>e.isActive);return[t,r?.expression.trim()||"",...oY(e)].filter(e=>!!e).join(" AND ")}class o2{constructor(e,t=e=>{this.dispatch(sV({q:e}))}){this.config=e,this.onUpdateQueryForCorrection=t}async fetchFromAPI({mappings:e,request:t},r){let n=Date.now(),i=oa(await this.extra.apiClient.search(t,r),e);return{response:i,duration:Date.now()-n,queryExecuted:this.getState().query?.q||"",requestExecuted:t}}async process(e){return this.processQueryErrorOrContinue(e)??await this.processQueryCorrectionsOrContinue(e)??await this.processQueryTriggersOrContinue(e)??this.processSuccessResponse(e)}processQueryErrorOrContinue(e){return void 0!==e.response.error?(this.dispatch(sK(e.response.error)),this.rejectWithValue(e.response.error)):null}async processQueryCorrectionsOrContinue(e){let t=this.getState(),r=this.getSuccessResponse(e);if(!r||!t.didYouMean)return null;let{enableDidYouMean:n,automaticallyCorrectQuery:i}=t.didYouMean,{results:a,queryCorrections:s,queryCorrection:o}=r;if(!n||!i)return null;let l=0===a.length&&s&&0!==s.length,u=!el(o)&&!el(o.correctedQuery);if(!l&&!u)return null;
135let c=l?await this.processLegacyDidYouMeanAutoCorrection(e):this.processModernDidYouMeanAutoCorrection(e);return this.dispatch(sE(ob(this.getState()))),c}async processLegacyDidYouMeanAutoCorrection(e){let t=this.getCurrentQuery(),r=this.getSuccessResponse(e);if(!r.queryCorrections)return null;let{correctedQuery:n}=r.queryCorrections[0],i=await this.automaticallyRetryQueryWithCorrection(n);return void 0!==i.response.error?(this.dispatch(sK(i.response.error)),this.rejectWithValue(i.response.error)):(this.dispatch(sE(ob(this.getState()))),{...i,response:{...i.response.success,queryCorrections:r.queryCorrections},automaticallyCorrected:!0,originalQuery:t})}processModernDidYouMeanAutoCorrection(e){let t=this.getSuccessResponse(e),{correctedQuery:r,originalQuery:n}=t.queryCorrection;return this.onUpdateQueryForCorrection(r),{...e,response:{...t},queryExecuted:r,automaticallyCorrected:!0,originalQuery:n}}async processQueryTriggersOrContinue(e){let t=this.getSuccessResponse(e);if(!t)return null;let r=t.triggers.find(e=>"query"===e.type)?.content||"";if(!r)return null;if(this.getState().triggers?.queryModification.queryToIgnore===r)return this.dispatch(oI("")),null;let n=this.getCurrentQuery(),i=await this.automaticallyRetryQueryWithTriggerModification(r);return void 0!==i.response.error?(this.dispatch(sK(i.response.error)),this.rejectWithValue(i.response.error)):(this.dispatch(sE(ob(this.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:n})}processSuccessResponse(e){return this.dispatch(sE(ob(this.getState()))),{...e,response:this.getSuccessResponse(e),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(e){return void 0!==e.response.success?e.response.success:null}async automaticallyRetryQueryWithCorrection(e){this.onUpdateQueryForCorrection(e);let t=this.getState(),{actionCause:r}={actionCause:B.didYouMeanAutomatic},n=await this.fetchFromAPI(await oW(t,this.extra.navigatorContext,{actionCause:r}),{origin:"mainSearch"});return this.dispatch(oc(e)),n}async automaticallyRetryQueryWithTriggerModification(e){return this.dispatch(ox({newQuery:e,originalQuery:this.getCurrentQuery()})),this.onUpdateQueryForCorrection(e),await this.fetchFromAPI(await oW(this.getState(),this.extra.navigatorContext),{origin:"mainSearch"})}getCurrentQuery(){let e=this.getState();return e.query?.q!==void 0?e.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}}let o3=rB("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;to(e,{q:new ef,enableQuerySyntax:new eu,clearFilters:new eu}),e.clearFilters&&(r(sI()),r(sx())),r(sA({allow:!0})),r(sV({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(sq(1))}),o5=rS("search/updateSearchAction"),o4=rB("search/executeSearch",async(e,t)=>{let r=t.getState();if("legacy"===r.configuration.analytics.analyticsMode)return oK(r,t,e.legacy);ln(r);let n=e.next?li(e.next):void 0,i=await oW(r,t.extra.navigatorContext,n),a=new o2({...t,analyticsAction:n??{}}),s=await a.fetchFromAPI(i,{origin:"mainSearch"});return await a.process(s)}),o6=rB("search/fetchPage",async(e,t)=>{let r=t.getState();if(ln(r),"legacy"===r.configuration.analytics.analyticsMode||!e.next)return oQ(r,t,e.legacy);let n=new o2({...t,analyticsAction:e.next}),i=await oW(r,t.extra.navigatorContext,e.next),a=await n.fetchFromAPI(i,{origin:"mainSearch"});return await n.process(a)}),o9=rB("search/fetchMoreResults",async(e,t)=>{var r;let n=t.getState();if("legacy"===n.configuration.analytics.analyticsMode)return oH(t,n);let i=(r=B.browseResults,{...new a0(t.getState).getBaseMetadata(),actionCause:r,type:r}),a=new o2({...t,analyticsAction:i}),s=await le(n,t.extra.navigatorContext,i),o=await a.fetchFromAPI(s,{origin:"mainSearch"});return await a.process(o)}),o8=rB("search/fetchFacetValues",async(e,t)=>{let r=t.getState();if("legacy"===r.configuration.analytics.analyticsMode)return oK(r,t,e.legacy);let n=new o2({...t,analyticsAction:{}}),i=await lr(r,t.extra.navigatorContext),a=await n.fetchFromAPI(i,{origin:"facetValues"});return await n.process(a)}
135),o7=rB("search/fetchInstantResults",async(e,t)=>{let r=t.getState();if("legacy"===r.configuration.analytics.analyticsMode)return oB(e,t);to(e,{id:e7,q:e7,maxResultsPerQuery:new ed({required:!0,min:1}),cacheTimeout:new ed});let{q:n,maxResultsPerQuery:i}=e,a=li({actionCause:B.searchboxAsYouType}),s=await lt(r,t.extra.navigatorContext,n,i,a),o=new o2({...t,analyticsAction:a},r=>{t.dispatch(sD({q:r,id:e.id}))}),l=await o.fetchFromAPI(s,{origin:"instantResults",disableAbortWarning:!0}),u=await o.process(l);return"response"in u?{results:u.response.results,searchUid:u.response.searchUid,totalCountFiltered:u.response.totalCountFiltered,duration:u.duration}:u}),le=async(e,t,r)=>{let n=await oW(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n},lt=async(e,t,r,n,i)=>oi({...sG(e,t,i),...e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean},numberOfResults:n,q:r}),lr=async(e,t,r)=>{let n=await oW(e,t,r);return n.request.numberOfResults=0,n},ln=e=>{e.configuration.analytics.enabled&&aX.getInstance().addElement({name:"Query",...e.query?.q&&{value:e.query.q},time:JSON.stringify(new Date)})},li=e=>({actionCause:e.actionCause,type:e.actionCause}),la=(e,t)=>el(e[t])?el(e.raw[t])?null:e.raw[t]:e[t];function ls(e){return""!==e.search.response.searchUid}let lo=nH(e=>e.search,e=>e?.searchAction?.actionCause||""),ll=rS("app/setError");function lu(e,t){let r=t.payload??null;r&&(e.response=eq().response,e.results=[],e.questionAnswer=eL()),e.error=r,e.isLoading=!1}function lc(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function ld(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function lh(e,t){e.isLoading=!0,e.searchAction={actionCause:B.browseResults},e.requestId=t.meta.requestId}let lp=rT(eq(),e=>{e.addCase(o4.rejected,(e,t)=>lu(e,t)),e.addCase(o9.rejected,(e,t)=>lu(e,t)),e.addCase(o6.rejected,(e,t)=>lu(e,t)),e.addCase(o4.fulfilled,(e,t)=>{lc(e,t),e.results=t.payload.response.results.map(e=>({...e,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}),e.addCase(o9.fulfilled,(e,t)=>{lc(e,t),e.results=[...e.results,...t.payload.response.results.map(e=>({...e,searchUid:t.payload.response.searchUid}))]}),e.addCase(o6.fulfilled,(e,t)=>{lc(e,t),e.results=[...t.payload.response.results.map(e=>({...e,searchUid:t.payload.response.searchUid}))]}),e.addCase(o8.fulfilled,(e,t)=>{e.response.facets=t.payload.response.facets,e.response.searchUid=t.payload.response.searchUid}),e.addCase(o4.pending,ld),e.addCase(o9.pending,lh),e.addCase(o6.pending,ld),e.addCase(o5,(e,t)=>{e.searchAction=t.payload}),e.addCase(ll,(e,t)=>{e.error=t.payload,e.isLoading=!1})}),lf=rS("searchHub/set",e=>to(e,new ef({required:!0,emptyAllowed:!0}))),lg=rT("default",e=>{e.addCase(lf,(e,t)=>t.payload).addCase(s_.fulfilled,(e,t)=>t.payload?.searchHub??e).addCase(ss,(e,t)=>t.payload.searchHub||e)});nH(e=>e.query?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,i)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:i})),nH(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);let lm=(e,t,r)=>a4({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,i)=>{let a,s=t??aC(i);if(!s)return null;let o=(a=i,a.followUpAnswers?.conversationId);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:s,answerGenerated:e,answerTextIsEmpty:r,...o&&{conversationId:o}})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:r=>({answerId:t??aC(r)??"",answerGenerated:e??!1})}),ly=e=>a4({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??aC(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),lv=nH(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:i}=e;return{...t&&{aq:t}
135,...r&&{cq:r},...n&&{dq:n},...i&&{lq:i}}}),lb=nH(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""});nH(e=>e,e=>{let t=lb(e);return t&&e?e[t].expression:""});let lw=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,lS=async e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:eW(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}),lE=e=>oR(e)?.map(e=>on(e,or())).sort((e,t)=>e.facetId>t.facetId?1:t.facetId>e.facetId?-1:0),l_=["searching","thinking","answering"];function lC(e){return e.toLowerCase()}function lk(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}let lI=new ef({required:!0}),lx=new ef,lA=new eu({required:!0}),lT={id:lI,title:lI,uri:lI,permanentid:lI,clickUri:lx},lO=new ef({required:!0,constrainTo:["text/plain","text/markdown"]}),lN=new ef({required:!0,constrainTo:l_}),lR=e=>({...e,name:lC(e.name)}),lD=rS("generatedAnswer/setIsVisible",e=>to(e,lA)),lP=rS("generatedAnswer/setAnswerId",e=>to(e,e7)),lM=rS("generatedAnswer/setAnswerGenerationMode",e=>to(e,new ef({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),lj=rS("generatedAnswer/setIsEnabled",e=>to(e,lA)),lF=rS("generatedAnswer/updateMessage",e=>to(e,{textDelta:lI})),lL=rS("generatedAnswer/updateCitations",e=>to(e,{citations:new ev({required:!0,each:new em({values:lT})})})),lq=rS("generatedAnswer/updateError",e=>to(e,{message:lx,code:new ed({min:0})})),l$=rS("generatedAnswer/resetAnswer"),lU=rS("generatedAnswer/like"),lV=rS("generatedAnswer/dislike"),lz=rS("generatedAnswer/feedbackModal/open"),lG=rS("generatedAnswer/expand"),lB=rS("generatedAnswer/collapse"),lQ=rS("generatedAnswer/setId",e=>to(e,{id:new ef({required:!0})})),lH=rS("generatedAnswer/feedbackModal/close"),lZ=rS("generatedAnswer/sendFeedback"),lK=rS("generatedAnswer/setIsLoading",e=>to(e,lA)),lY=rS("generatedAnswer/setIsStreaming",e=>to(e,lA)),lW=rS("generatedAnswer/setAnswerContentFormat",e=>to(e,lO)),lJ=rS("generatedAnswer/updateResponseFormat",e=>to(e,{contentFormat:new ev({each:lO,default:["text/plain"]})})),lX=rS("knowledge/updateAnswerConfigurationId",e=>to(e,lI)),l0=rS("generatedAnswer/registerFieldsToIncludeInCitations",e=>to(e,tr)),l1=rS("generatedAnswer/setIsAnswerGenerated",e=>to(e,lA)),l2=rS("generatedAnswer/setCannotAnswer",e=>to(e,lA)),l3=rS("generatedAnswer/setAnswerApiQueryParams",e=>to(e,new em({}))),l5=rS("generatedAnswer/startStep",e=>to(lR(e),{name:lN,startedAt:new ed({min:0,required:!0})})),l4=rS("generatedAnswer/finishStep",e=>to(lR(e),{name:lN,finishedAt:new ed({min:0,required:!0})}));rB("generatedAnswer/streamAnswer",async(e,t)=>{let r=t.getState(),{dispatch:n,extra:i,getState:a}=t,{search:s}=a(),{queryExecuted:o}=s,{setAbortControllerRef:l}=e,u=await lS(r);n(lK(!0));let c=e=>e.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,d=i.streamingClient?.streamGeneratedAnswer(u,{write:e=>{c(u)&&(n(lK(!1)),e.payload&&e.payloadType&&((e,t)=>{switch(e){case"genqa.headerMessageType":n(lW(JSON.parse(t).contentFormat));break;case"genqa.messageType":n(lF(JSON.parse(t)));break;case"genqa.citationsType":n(lL(JSON.parse(t)));break;case"genqa.endOfStreamType":{let e=JSON.parse(t).answerGenerated,{answerId:r,answer:i}=a().generatedAnswer,s=0!==o.length&&!e,l=!i?.trim();n(l2(s)),n(lY(!1)),n(l1(e)),n(lm(e,r,e?l:void 0)),n(ly());break}default:r.debug&&i.logger.warn(`Unknown payloadType: "${e}"`)}})(e.payloadType,e.payload))},abort:e=>{c(u)&&n(lq(e))},close:()=>{c(u)&&n(lY(!1))},resetAnswer:()=>{c(u)&&n(l$())}});d?l(d):n(lK(!1))}),rB("generatedAnswer/generateAnswer",async(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:i}})=>{r(l$());let a=t();if(a.generatedAnswer.answerConfigurationId){let e=((e,t)=>{var r;let n,i,a=e.query?.q,{aq:s,cq:o,dq:l,lq:u}=(n=lv(r=e),i=o1(r),{...n,...i&&{cq:i}}),c=e.context,d=sz(e.configuration.analytics,t,{actionCause:lo(e)}),h=e.searchHub,p=e.pipeline,f=aA(e)??[],g=lE(e),m=lb(e.tabSet)||"default",y=e.configuration.search.locale,v=e.configuration.search.timezone,b=t.referrer||"",w=(e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return void 0!==t?{freezeFacetOrder:t}:void 0})(e),S=e.sortCriteria,E={actionsHistory:e.configuration.analytics.enabled?aX.getInstance().getHistory():[]},_=e.excerptLength?.length,C=(e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}})(e),k=(e=>{if(e.dictionaryFieldContext&&Object.keys(e.dictionaryFieldContext.contextValues).length)return e.dictionaryFieldContext.contextValues})(e);return{q:a,...s&&{aq:s},...o&&{cq:o},...l&&{dq:l},...u&&{lq:u},...e.query&&{enableQuerySyntax:e.query?.enableQuerySyntax},...c?.contextValues&&{context:c.contextValues},pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...h?.length&&{searchHub:h},...p?.length&&{pipeline:p},...g.length&&{facets:g},...e.fields&&{fieldsToInclude:e.fields.fieldsToInclude},...e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&"next"===e.didYouMean.queryCorrectionMode,options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&"legacy"===e.didYouMean.queryCorrectionMode},...e.pagination&&{numberOfResults:oJ(e),firstResult:e.pagination.firstResult},tab:m,locale:y,timezone:v,...void 0!==e.debug&&{debug:e.debug},referrer:b,...E,...C??{},..._&&{excerptLength:_},...k&&{dictionaryFieldContext:k},sortCriteria:S,...w&&{facetOptions:w},...d,...e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext}}})(a,n);r(l3(e)),await r(u7(e))}else i.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});
135var l6=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},l9=(r(41463),(w=l9||{}).uninitialized="uninitialized",w.pending="pending",w.fulfilled="fulfilled",w.rejected="rejected",w),l8="uninitialized",l7="pending",ue="fulfilled",ut="rejected";function ur(e){return{status:e,isUninitialized:e===l8,isLoading:e===l7,isSuccess:e===ue,isError:e===ut}}function un(e,t,r){return e.reduce((e,n,i)=>(t(n,i)&&e.push(r(n,i)),e),[]).flat()}function ui(e){return null!=e}function ua(e){return[...e?.values()??[]].filter(ui)}function us(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var uo=()=>new Map,ul=(...e)=>fetch(...e),uu=e=>e.status>=200&&e.status<=299;function uc(e){if(!rf(e))return e;let t={...e};for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return t}var ud=class{constructor(e,t){this.value=e,this.meta=t}};async function uh(e=0,t=5,r){let n=~~((Math.random()+.4)*(300<<Math.min(e,t)));await new Promise((e,t)=>{let i=setTimeout(()=>e(),n);r&&(r.aborted?(clearTimeout(i),t(Error("Aborted"))):r.addEventListener("abort",()=>{clearTimeout(i),t(Error("Aborted"))},{once:!0}))})}function up(e,t){throw Object.assign(new ud({error:e,meta:t}),{throwImmediately:!0})}function uf(e){e.aborted&&up({status:"CUSTOM_ERROR",error:"Aborted"})}var ug={},um=Object.assign((e,t)=>async(r,n,i)=>{let[a]=[5,(t||ug).maxRetries,(i||ug).maxRetries].filter(e=>void 0!==e).slice(-1),s={maxRetries:a,backoff:uh,retryCondition:(e,t,{attempt:r})=>r<=a,...t,...i},o=0;for(;;){uf(n.signal);try{let t=await e(r,n,i);if(t.error)throw new ud(t);return t}catch(e){if(o++,e.throwImmediately){if(e instanceof ud)return e.value;throw e}if(e instanceof ud){if(!s.retryCondition(e.value.error,r,{attempt:o,baseQueryApi:n,extraOptions:i}))return e.value}else if(o>s.maxRetries)return{error:e};uf(n.signal);try{await s.backoff(o,s.maxRetries,n.signal)}catch(e){throw uf(n.signal),e}}}},{fail:up}),uy="__rtkq/",uv="focused",ub=rS(`${uy}${uv}`),uw=rS(`${uy}un${uv}`),uS=rS(`${uy}online`),uE=rS(`${uy}offline`),u_="query",uC="mutation",uk="infinitequery";function uI(e){return e.type===u_}function ux(e){return e.type===uk}function uA(e){return uI(e)||ux(e)}function uT(e,t,r,n,i,a){let s="function"==typeof e?e(t,r,n,i):e;return s?un(s,ui,e=>a(uO(e))):[]}function uO(e){return"string"==typeof e?{type:e}:e}var uN=(e,t)=>e.endpointDefinitions[t],uR=Symbol("forceQueryFn"),uD=e=>"function"==typeof e[uR],uP=class extends l6{constructor(e,t,r,n){super(e),this.value=t,this.schemaName=r,this._bqMeta=n}},uM=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function uj(e,t,r,n){let i=await e["~standard"].validate(t);if(i.issues)throw new uP(i.issues,t,r,n);return i.value}function uF(e){return e}var uL=(e={})=>({...e,[rk]:!0});function uq(e,{pages:t,pageParams:r},n){let i=t.length-1;return e.getNextPageParam(t[i],t,r[i],r,n)}function u$(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function uU(e,t,r,n){return uT(r[e.meta.arg.endpointName][t],rL(e)?e.payload:void 0,rF(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function uV(e,t,r){let n=e[t];n&&r(n)}function uz(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function uG(e,t,r){let n=e[uz(t)];n&&r(n)}var uB={},uQ=Symbol.for("RTKQ/skipToken"),uH={status:l8},uZ=ro(uH,()=>{}),uK=ro(uH,()=>{}),uY=WeakMap?new WeakMap:void 0,uW=({endpointName:e,queryArgs:t})=>{let r="",n=uY?.get(t);if("string"==typeof n)r=n;else{let e=JSON.stringify(t,(e,t)=>t=rf(t="bigint"==typeof t?{$bigint:t.toString()}:t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t);rf(t)&&uY?.set(t,e),r=e}return`${e}(${r})`};function uJ(e,...t){return Object.assign(e,...t)}var uX=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i,selectors:{selectQueryEntry:a,selectConfig:s},getRunningQueryThunk:o,mwApi:l})=>{let{removeQueryResult:u,unsubscribeQueryResult:c,cacheEntriesUpserted:d}=t.internalActions,h=rN(c.match,r.fulfilled,r.rejected,d.match);function p(e){let t=i.currentSubscriptions.get(e);return!!t&&t.size>0}let f={};function g(e){for(let t of e.values())t?.abort?.()}function m(e,t,r){let i=t.getState();for(let s of e){let e=a(i,s);e?.endpointName&&function(e,t,r,i){let s=uN(n,t),l=s?.keepUnusedData
135For??i.keepUnusedDataFor;if(l===1/0)return;let c=Math.max(0,Math.min(l,2147482.647));if(!p(e)){let t=f[e];t&&clearTimeout(t),f[e]=setTimeout(()=>{if(!p(e)){let t=a(r.getState(),e);if(t?.endpointName){let e=r.dispatch(o(t.endpointName,t.originalArgs));e?.abort()}r.dispatch(u({queryCacheKey:e}))}delete f[e]},1e3*c)}}(s,e.endpointName,t,r)}}return(e,r)=>{let a=s(r.getState());if(h(e)){let t;if(d.match(e))t=e.payload.map(e=>e.queryDescription.queryCacheKey);else{let{queryCacheKey:r}=c.match(e)?e.payload:e.meta.arg;t=[r]}m(t,r,a)}if(t.util.resetApiState.match(e)){for(let[e,t]of Object.entries(f))t&&clearTimeout(t),delete f[e];g(i.runningQueries),g(i.runningMutations)}if(n.hasRehydrationInfo(e)){let{queries:t}=n.extractRehydrationInfo(e);m(Object.keys(t),r,a)}}},u0=Error("Promise never resolved before cacheEntryRemoved."),u1=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:a,selectors:{selectQueryEntry:s,selectApiState:o}})=>{let l=rq(n),u=rq(i),c=rL(n,i),d={},{removeQueryResult:h,removeMutationResult:p,cacheEntriesUpserted:f}=e.internalActions;function g(e,t,r){let n=d[e];n?.valueResolved&&(n.valueResolved({data:t,meta:r}),delete n.valueResolved)}function m(e){let t=d[e];t&&(delete d[e],t.cacheEntryRemoved())}function y(e){let{arg:t,requestId:r}=e.meta,{endpointName:n,originalArgs:i}=t;return[n,i,r]}function v(t,n,i,a,s){let o=uN(r,t),l=o?.onCacheEntryAdded;if(!l)return;let u={},c=new Promise(e=>{u.cacheEntryRemoved=e}),h=Promise.race([new Promise(e=>{u.valueResolved=e}),c.then(()=>{throw u0})]);h.catch(()=>{}),d[i]=u;let p=e.endpoints[t].select(uA(o)?n:i),f=a.dispatch((e,t,r)=>r),g={...a,getCacheEntry:()=>p(a.getState()),requestId:s,extra:f,updateCachedData:uA(o)?r=>a.dispatch(e.util.updateQueryData(t,n,r)):void 0,cacheDataLoaded:h,cacheEntryRemoved:c};Promise.resolve(l(n,g)).catch(e=>{if(e!==u0)throw e})}return(r,a,o)=>{var b;let w=l(b=r)?b.meta.arg.queryCacheKey:u(b)?b.meta.arg.fixedCacheKey??b.meta.requestId:h.match(b)?b.payload.queryCacheKey:p.match(b)?uz(b.payload):"";function S(e,t,r,n){let i=s(o,t),l=s(a.getState(),t);!i&&l&&v(e,n,t,a,r)}if(n.pending.match(r)){let[e,t,n]=y(r);S(e,w,n,t)}else if(f.match(r))for(let{queryDescription:e,value:t}of r.payload){let{endpointName:n,originalArgs:i,queryCacheKey:a}=e;S(n,a,r.meta.requestId,i),g(a,t,{})}else if(i.pending.match(r)){if(a.getState()[t].mutations[w]){let[e,t,n]=y(r);v(e,t,w,a,n)}}else if(c(r))g(w,r.payload,r.meta.baseQueryMeta);else if(h.match(r)||p.match(r))m(w);else if(e.util.resetApiState.match(r))for(let e of Object.keys(d))m(e)}},u2=({api:e,context:{apiUid:t},reducerPath:r})=>(r,n)=>{e.util.resetApiState.match(r)&&n.dispatch(e.internalActions.middlewareRegistered(t))},u3=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:a,assertTagType:s,refetchQuery:o,internalState:l})=>{let{removeQueryResult:u}=a.internalActions,c=rN(rL(n),rF(n)),d=rN(rL(i,n),rj(i,n)),h=[],p=0;function f(r,n){let i=n.getState(),s=i[e];if(h.push(...r),"delayed"===s.config.invalidationBehavior&&p>0)return;let c=h;if(h=[],0===c.length)return;let d=a.util.selectInvalidatedBy(i,c);t.batch(()=>{for(let{queryCacheKey:e}of Array.from(d.values())){let t=s.queries[e],r=us(l.currentSubscriptions,e,uo);t&&(0===r.size?n.dispatch(u({queryCacheKey:e})):t.status!==l8&&n.dispatch(o(t)))}})}return(e,t)=>{(i.pending.match(e)||n.pending.match(e))&&p++,d(e)&&(p=Math.max(0,p-1)),c(e)?f(uU(e,"invalidatesTags",r,s),t):d(e)?f([],t):a.util.invalidateTags.match(e)&&f(uT(e.payload,void 0,void 0,void 0,void 0,s),t)}},u5=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{let{currentPolls:a,currentSubscriptions:s}=i,o=new Set,l=null;function u(t,r){o.add(t),l||(l=setTimeout(()=>{for(let t of o)!function({queryCacheKey:t},r){let n=r.getState()[e].queries[t],i=s.get(t);if(!n||n.status===l8)return;let{lowestPollingInterval:o}=h(i);if(!Number.isFinite(o))return d(t);let l=a.get(t),u=Date.now()+o;(!l||u<l.nextPollTimestamp)&&c({queryCacheKey:t},r)}({queryCacheKey:t},r);o.clear(),l=null},0))}function c({queryCacheKey:t},r){let i=r.getState()[e],o=i.queries[t],l=s.get(t);if(!o||o.status===l8)return;let{lowestPollingInterval:u,skipPollingIfUnfocused:d}=h(l);if(!Number.isFinite(u))return;let p=a.get(t);p?.timeout&&(clearTimeout(p.timeout),p.timeout=void 0);
135let f=Date.now()+u;a.set(t,{nextPollTimestamp:f,pollingInterval:u,timeout:setTimeout(()=>{(i.config.focused||!d)&&r.dispatch(n(o)),c({queryCacheKey:t},r)},u)})}function d(e){let t=a.get(e);t?.timeout&&clearTimeout(t.timeout),a.delete(e)}function h(e=new Map){let t=!1,r=1/0;for(let n of e.values())n.pollingInterval&&(r=Math.min(n.pollingInterval,r),t=n.skipPollingIfUnfocused||t);return{lowestPollingInterval:r,skipPollingIfUnfocused:t}}return(e,n)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&u(e.payload.queryCacheKey,n),(t.pending.match(e)||t.rejected.match(e)&&e.meta.condition)&&u(e.meta.arg.queryCacheKey,n),(t.fulfilled.match(e)||t.rejected.match(e)&&!e.meta.condition)&&c(e.meta.arg,n),r.util.resetApiState.match(e)&&(function(){for(let e of a.keys())d(e)}(),l&&(clearTimeout(l),l=null),o.clear())}},u4=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let i=rM(r,n),a=rj(r,n),s=rL(r,n),o={};return(r,n)=>{if(i(r)){let{requestId:i,arg:{endpointName:a,originalArgs:s}}=r.meta,l=uN(t,a),u=l?.onQueryStarted;if(u){let t={},r=new Promise((e,r)=>{t.resolve=e,t.reject=r});r.catch(()=>{}),o[i]=t;let c=e.endpoints[a].select(uA(l)?s:i),d=n.dispatch((e,t,r)=>r),h={...n,getCacheEntry:()=>c(n.getState()),requestId:i,extra:d,updateCachedData:uA(l)?t=>n.dispatch(e.util.updateQueryData(a,s,t)):void 0,queryFulfilled:r};u(s,h)}}else if(s(r)){let{requestId:e,baseQueryMeta:t}=r.meta;o[e]?.resolve({data:r.payload,meta:t}),delete o[e]}else if(a(r)){let{requestId:e,rejectedWithValue:t,baseQueryMeta:n}=r.meta;o[e]?.reject({error:r.payload??r.error,isUnhandledError:!t,meta:n}),delete o[e]}}},u6=Symbol();let u9=(function(...e){return function(t){let r=nQ(e=>t.extractRehydrationInfo?.(e,{reducerPath:t.reducerPath??"api"})),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=uW;if("serializeQueryArgs"in e.endpointDefinition){let t=e.endpointDefinition.serializeQueryArgs;r=e=>{let r=t(e);return"string"==typeof r?r:uW({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},i={endpointDefinitions:{},batch(e){e()},apiUid:r$(),extractRehydrationInfo:r,hasRehydrationInfo:nQ(e=>null!=r(e))},a={injectEndpoints:function(e){for(let[t,r]of Object.entries(e.endpoints({query:e=>({...e,type:u_}),mutation:e=>({...e,type:uC}),infiniteQuery:e=>({...e,type:uk})}))){if(!0!==e.overrideExisting&&t in i.endpointDefinitions){if("throw"===e.overrideExisting)throw Error(nm(39));continue}for(let e of(i.endpointDefinitions[t]=r,s))e.injectEndpoint(t,r)}return a},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(let t of e)n.tagTypes.includes(t)||n.tagTypes.push(t);if(t)for(let[e,r]of Object.entries(t))"function"==typeof r?r(uN(i,e)):Object.assign(uN(i,e)||{},r);return a}},s=e.map(e=>e.init(a,n,i));return a.injectEndpoints({endpoints:t.endpoints})}})((({createSelector:e=nH}={})=>({name:u6,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:a,keepUnusedDataFor:s,refetchOnMountOrArgChange:o,refetchOnFocus:l,refetchOnReconnect:u,invalidationBehavior:c,onSchemaFailure:d,catchSchemaFailure:h,skipSchemaValidation:p},f){!function(){let e="replace",t="remove";function r(e){if(!tC(e))return e;if(tD(e))return e.map(r);if(tP(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,r(t)]));if(tM(e))return new Set(Array.from(e).map(r));let t=Object.create(tm(e));for(let n in e)t[n]=r(e[n]);return tO(e,th)&&(t[th]=e[th]),t}function n(e){return t_(e)?r(e):e}tQ[tG]||(tQ[tG]={applyPatches_:function(n,i){return i.forEach(i=>{let{path:a,op:s}=i,o=n;for(let e=0;e<a.length-1;e++){let t=tT(o),r=a[e];"string"!=typeof r&&"number"!=typeof r&&(r=""+r),(0===t||1===t)&&("__proto__"===r||r===ty)&&tf(19),tF(o)&&r===tv&&tf(19),tj(o=tN(o,r))||tf(18,a.join("/"))}let l=tT(o),u=r(i.value),c=a[a.length-1];switch(s){case e:switch(l){case 2:return o.set(c,u);case 3:tf(16);default:return o[c]=u}case"add":switch(l){case 1:return"-"===c?o.push(u):o.splice(c,0,u);case 2:return o.set(c,u);case 3:return o.add(u);default:return o[c]=u}case t:switch(l){case 1:return o.splice(c,1);case 2:return o.delete(c);case 3:return o.delete(i.value);default:return delete o[c]}default:tf(17,s)}}),n},generatePatches_:function(r,i,a){if(r.scope_.processedForPatches_.has(r))return;r.scope_.processedForPatches_.add(r);let{patches_:s,inversePatches_:o}=a;switch(r.type_){case 0:case 2:return function(r,i,a,s){let{base_:o,copy_:l,type_:u}=r;tA(r.assigned_,(r,c)=>{let d=tN(o,r,u),h=tN(l,r,u),p=c?tO(o,r)?e:"add":t;if(d===h&&p===e)return;let f=i.concat(r);a.push(p===t?{op:p,path:f}:{op:p,path:f,value:n(h)}),s.push("add"===p?{op:t,path:f}:p===t?{op:"add",path:f,value:n(d)}:{op:e,path:f,value:n(d)})})}(r,i,s,o);case 1:return function(r,i,a,s){let{base_:o,assigned_:l}=r,u=r.copy_;u.length<o.length&&([o,u]=[u,o],[a,s]=[s,a]);let c=!0===r.allIndicesReassigned_;for(let t=0;t<o.length;t++){let r=u[t],d=o[t];if((c||l?.get(t.toString()))&&r!==d){let o=r?.[tp];if(o&&o.modified_)continue;let l=i.concat([t]);a.push({op:e,path:l,value:n(r)}),s.push({op:e,path:l,value:n(d)})}}for(let e=o.length;e<u.length;e++){let t=i.concat([e]);a.push({op:"add",path:t,value:n(u[e])})}for(let e=u.length-1;o.length<=e;--e){let r=i.concat([e]);s.push({op:t,path:r})}}(r,i,s,o);case 3:return function(e,r,n,i){let{base_:a,copy_:s}
135=e,o=0;a.forEach(e=>{if(!s.has(e)){let a=r.concat([o]);n.push({op:t,path:a,value:e}),i.unshift({op:"add",path:a,value:e})}o++}),o=0,s.forEach(e=>{if(!a.has(e)){let a=r.concat([o]);n.push({op:"add",path:a,value:e}),i.unshift({op:t,path:a,value:e})}o++})}(r,i,s,o)}},generateReplacementPatches_:function(t,r,n){let{patches_:i,inversePatches_:a}=n;i.push({op:e,path:[],value:r===td?void 0:r}),a.push({op:e,path:[],value:t})},getPath:function e(t,r=[]){if(void 0!==t.key_){var n;let e,i=t.parent_.copy_??t.parent_.base_,a=tj(n=tN(i,t.key_))?n?.[tp]:null,s=tN(i,t.key_);if(void 0===s||s!==t.draft_&&s!==t.base_&&s!==t.copy_||null!=a&&a.base_!==t.base_)return null;let o=3===t.parent_.type_;if(e=o?Array.from(t.parent_.drafts_.keys()).indexOf(t.key_):t.key_,!(o&&i.size>e||tO(i,e)))return null;r.push(e)}if(t.parent_)return e(t.parent_,r);r.reverse();try{var i=t.copy_,a=r;let e=i;for(let t=0;t<a.length-1;t++)if(!tj(e=tN(e,a[t]))||null===e)throw Error(`Cannot resolve path at '${a.join("/")}'`)}catch(e){return null}return r}})}();let g=e=>e;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:uS,onOffline:uE,onFocus:ub,onFocusLost:uw},util:{}});let m=function({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=e=>uZ,i=e=>uK;return{buildQuerySelector:function(e,t){return u(e,t,a)},buildInfiniteQuerySelector:function(e,t){let{infiniteQueryOptions:r}=t;return u(e,t,function(e){var t,n,i,a,s,o;let l={...e,...ur(e.status)},{isLoading:u,isError:c,direction:d}=l,h="forward"===d,p="backward"===d;return{...l,hasNextPage:(t=r,n=l.data,i=l.originalArgs,!!n&&null!=uq(t,n,i)),hasPreviousPage:(a=r,s=l.data,o=l.originalArgs,!!s&&!!a.getPreviousPageParam&&null!=u$(a,s,o)),isFetchingNextPage:u&&h,isFetchingPreviousPage:u&&p,isFetchNextPageError:c&&h,isFetchPreviousPageError:c&&p}})},buildMutationSelector:function(){return e=>{let n;return r((n="object"==typeof e?uz(e)??uQ:e)===uQ?i:e=>(function(e){return e[t]})(e)?.mutations?.[n]??uK,a)}},selectInvalidatedBy:function(e,r){let n=e[t],i=new Set;for(let e of un(r,ui,uO)){let t=n.provided.tags[e.type];if(t)for(let r of(void 0!==e.id?t[e.id]:Object.values(t).flat())??[])i.add(r)}return Array.from(i.values()).flatMap(e=>{let t=n.queries[e];return t?{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}:[]})},selectCachedArgsForQuery:function(e,t){return un(Object.values(o(e)),e=>e?.endpointName===t&&e.status!==l8,e=>e.originalArgs)},selectApiState:s,selectQueries:o,selectMutations:function(e){return function(e){return e[t]}(e)?.mutations},selectQueryEntry:l,selectConfig:function(e){return function(e){return e[t]}(e)?.config}};function a(e){return{...e,...ur(e.status)}}function s(e){return e[t]}function o(e){return e[t]?.queries}function l(e,t){return o(e)?.[t]}function u(t,i,a){return s=>{if(s===uQ)return r(n,a);let o=e({queryArgs:s,endpointDefinition:i,endpointName:t});return r(e=>l(e,o)??uZ,a)}}}({serializeQueryArgs:a,reducerPath:i,createSelector:e}),{selectInvalidatedBy:y,selectCachedArgsForQuery:v,buildQuerySelector:b,buildInfiniteQuerySelector:w,buildMutationSelector:S}=m;uJ(t.util,{selectInvalidatedBy:y,selectCachedArgsForQuery:v});let{queryThunk:E,infiniteQueryThunk:_,mutationThunk:C,patchQueryData:k,updateQueryData:I,upsertQueryData:x,prefetch:A,buildMatchThunkActions:T}=function({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:a,selectors:s,onSchemaFailure:o,catchSchemaFailure:l,skipSchemaValidation:u}){function c(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}function d(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}let h=(e,t)=>e.query&&e[t]?e[t]:uF,p=async(e,{signal:n,abort:i,rejectWithValue:a,fulfillWithValue:p,dispatch:g,getState:m,extra:y})=>{let v=r[e.endpointName],{metaSchema:b,skipSchemaValidation:w=u}=v,S=e.type===u_;try{let r,a=uF,o={signal:n,abort:i,dispatch:g,getState:m,extra:y,endpoint:e.endpointName,type:e.type,forced:S?f(e,m()):void 0,queryCacheKey:S?e.queryCacheKey:void 0},l=S?e[uR]:void 0,u=async(t,r,n,i)=>{if(null==r&&t.pages.length)return Promise.resolve({data:t});let a={queryArg:e.originalArgs,pageParam:r},s=await E(a),o=i?c:d;return{data:{pages:o(t.pages,s.data,n),pageParams:o(t.pageParams,r,n)},meta:s.meta}};async function E(e){let r,{extraOptions:n,argSchema:i,rawResponseSchema:s,responseSchema:u}=v;if(i&&!uM(w,"arg")&&(e=await uj(i,e,"argSchema",{})),l?r=l():v.query?(a=h(v,"transformResponse"),r=await t(v.query(e),o,n)):r=await v.queryFn(e,o,n,e=>t(e,o,n)),r.error)throw new ud(r.error,r.meta);let{data:c}=r;s&&!uM(w,"rawResponse")&&(c=await uj(s,r.data,"rawResponseSchema",r.meta));let d=await a(c,r.meta,e);return u&&!uM(w,"response")&&(d=await uj(u,d,"responseSchema",r.meta)),{...r,data:d}}if(S&&"infiniteQueryOptions"in v){let t,{infiniteQueryOptions:n}=v,{maxPages:i=1/0}=n,a=e.refetchCachedPages??n.refetchCachedPages??!0,o=s.selectQueryEntry(m(),e.queryCacheKey)?.data,c=(!f(e,m())||e.direction)&&o?o:{pages:[],pageParams:[]};if("direction"in e&&e.direction&&c.pages.length){let r="backward"===e.direction,a=(r?u$:uq)(n,c,e.originalArgs);t=await u(c,a,i,r)}else{let{initialPageParam:r=n.initialPageParam}=e,s=o?.pageParams??[],d=s[0]??r,h=s.length;if(t=await u(c,d,i),l&&(t={data:t.data.pages[0]}),a)for(let r=1;r<h;r++){let r=uq(n,t.data,e.originalArgs);t=await u(t.data,r,i)}}r=t}else r=await E(e.originalArgs);return b&&!uM(w,"meta")&&r.meta&&(r.meta=await uj(b,r.meta,"metaSchema",r.meta)),p(r.data,uL({fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta}
135))}catch(r){let t=r;if(t instanceof ud){let r=h(v,"transformErrorResponse"),{rawErrorResponseSchema:n,errorResponseSchema:i}=v,{value:s,meta:o}=t;try{n&&!uM(w,"rawErrorResponse")&&(s=await uj(n,s,"rawErrorResponseSchema",o)),b&&!uM(w,"meta")&&(o=await uj(b,o,"metaSchema",o));let t=await r(s,o,e.originalArgs);return i&&!uM(w,"errorResponse")&&(t=await uj(i,t,"errorResponseSchema",o)),a(t,uL({baseQueryMeta:o}))}catch(e){t=e}}try{if(t instanceof uP){let r={endpoint:e.endpointName,arg:e.originalArgs,type:e.type,queryCacheKey:S?e.queryCacheKey:void 0};v.onSchemaFailure?.(t,r),o?.(t,r);let{catchSchemaFailure:n=l}=v;if(n)return a(n(t,r),uL({baseQueryMeta:t._bqMeta}))}}catch(e){t=e}throw console.error(t),t}};function f(e,t){let r=s.selectQueryEntry(t,e.queryCacheKey),n=s.selectConfig(t).refetchOnMountOrArgChange,i=r?.fulfilledTimeStamp,a=e.forceRefetch??(e.subscribe&&n);return!!a&&(!0===a||(Number(new Date)-Number(i))/1e3>=a)}let g=()=>rB(`${e}/executeQuery`,p,{getPendingMeta({arg:e}){let t=r[e.endpointName];return uL({startedTimeStamp:Date.now(),...ux(t)?{direction:e.direction}:{}})},condition(e,{getState:t}){let n=t(),i=s.selectQueryEntry(n,e.queryCacheKey),a=i?.fulfilledTimeStamp,o=e.originalArgs,l=i?.originalArgs,u=r[e.endpointName],c=e.direction;return!!uD(e)||i?.status!=="pending"&&(!!(f(e,n)||uI(u)&&u?.forceRefetch?.({currentArg:o,previousArg:l,endpointState:i,state:n}))||!a||!!c)},dispatchConditionRejection:!0}),m=g(),y=g();function v(e){return t=>t?.meta?.arg?.endpointName===e}return{queryThunk:m,mutationThunk:rB(`${e}/executeMutation`,p,{getPendingMeta:()=>uL({startedTimeStamp:Date.now()})}),infiniteQueryThunk:y,prefetch:(e,t,r={})=>(n,a)=>{let s="force"in r&&r.force,o="ifOlderThan"in r&&r.ifOlderThan,l=(r=!0)=>i.endpoints[e].initiate(t,{forceRefetch:r,subscribe:!1}),u=i.endpoints[e].select(t)(a());if(s)n(l());else if(o){let e=u?.fulfilledTimeStamp;if(!e)return void n(l());(Number(new Date)-Number(new Date(e)))/1e3>=o&&n(l())}else n(l(!1))},updateQueryData:(e,t,r,n=!0)=>(a,s)=>{let o,l=i.endpoints[e].select(t)(s()),u={patches:[],inversePatches:[],undo:()=>a(i.util.patchQueryData(e,t,u.inversePatches,n))};if(l.status===l8)return u;if("data"in l)if(tC(l.data)){let[e,t,n]=rl(l.data,r);u.patches.push(...t),u.inversePatches.push(...n),o=e}else o=r(l.data),u.patches.push({op:"replace",path:[],value:o}),u.inversePatches.push({op:"replace",path:[],value:l.data});return 0===u.patches.length||a(i.util.patchQueryData(e,t,u.patches,n)),u},upsertQueryData:(e,t,r)=>n=>n(i.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[uR]:()=>({data:r})})),patchQueryData:(e,t,s,o)=>(l,u)=>{let c=r[e],d=n({queryArgs:t,endpointDefinition:c,endpointName:e});if(l(i.internalActions.queryResultPatched({queryCacheKey:d,patches:s})),!o)return;let h=i.endpoints[e].select(t)(u()),p=uT(c.providesTags,h.data,void 0,t,{},a);l(i.internalActions.updateProvidedBy([{queryCacheKey:d,providedTags:p}]))},buildMatchThunkActions:function(e,t){return{matchPending:rR(rM(e),v(t)),matchFulfilled:rR(rL(e),v(t)),matchRejected:rR(rj(e),v(t))}}}}({baseQuery:r,reducerPath:i,context:f,api:t,serializeQueryArgs:a,assertTagType:g,selectors:m,onSchemaFailure:d,catchSchemaFailure:h,skipSchemaValidation:p}),{reducer:O,actions:N}=function({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:i,apiUid:a,extractRehydrationInfo:s,hasRehydrationInfo:o},assertTagType:l,config:u}){let c=rS(`${e}/resetApiState`);function d(e,t,r,n){e[t.queryCacheKey]??={status:l8,endpointName:t.endpointName},uV(e,t.queryCacheKey,e=>{e.status=l7,e.requestId=r&&e.requestId?e.requestId:n.requestId,void 0!==t.originalArgs&&(e.originalArgs=t.originalArgs),e.startedTimeStamp=n.startedTimeStamp,ux(i[n.arg.endpointName])&&"direction"in t&&(e.direction=t.direction)})}function h(e,t,r,n){uV(e,t.arg.queryCacheKey,e=>{if(e.requestId!==t.requestId&&!n)return;let{merge:a}=i[t.arg.endpointName];if(e.status=ue,a)if(void 0!==e.data){let{fulfilledTimeStamp:n,arg:i,baseQueryMeta:s,requestId:o}=t,l=ro(e.data,e=>a(e,r,{arg:i.originalArgs,baseQueryMeta:s,fulfilledTimeStamp:n,requestId:o}));e.data=l}else e.data=r;else{var s;e.data=i[t.arg.endpointName].structuralSharing??!0?function e(t,r){if(t===r||!(rf(t)&&rf(r)||Array.isArray(t)&&Array.isArray(r)))return r;let n=Object.keys(r),i=Object.keys(t),a=n.length===i.length,s=Array.isArray(r)?[]:{};for(let i of n)s[i]=e(t[i],r[i]),a&&(a=t[i]===s[i]);return a?t:s}
135(t_(e.data)?(t_(s=e.data)||tf(15,s),s[tp].base_):e.data,r):r}delete e.error,e.fulfilledTimeStamp=t.fulfilledTimeStamp})}let p=rK({name:`${e}/queries`,initialState:uB,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:rI()},cacheEntriesUpserted:{reducer(e,t){for(let r of t.payload){let{queryDescription:n,value:i}=r;d(e,n,!0,{arg:n,requestId:t.meta.requestId,startedTimeStamp:t.meta.timestamp}),h(e,{arg:n,requestId:t.meta.requestId,fulfilledTimeStamp:t.meta.timestamp,baseQueryMeta:{}},i,!0)}},prepare:e=>({payload:e.map(e=>{let{endpointName:t,arg:r,value:a}=e,s=i[t];return{queryDescription:{type:u_,endpointName:t,originalArgs:e.arg,queryCacheKey:n({queryArgs:r,endpointDefinition:s,endpointName:t})},value:a}}),meta:{[rk]:!0,requestId:r$(),timestamp:Date.now()}})},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:r}}){uV(e,t,e=>{e.data=ru(e.data,r.concat())})},prepare:rI()}},extraReducers(e){e.addCase(t.pending,(e,{meta:t,meta:{arg:r}})=>{let n=uD(r);d(e,r,n,t)}).addCase(t.fulfilled,(e,{meta:t,payload:r})=>{let n=uD(t.arg);h(e,t,r,n)}).addCase(t.rejected,(e,{meta:{condition:t,arg:r,requestId:n},error:i,payload:a})=>{uV(e,r.queryCacheKey,e=>{if(t);else{if(e.requestId!==n)return;e.status=ut,e.error=a??i}})}).addMatcher(o,(e,t)=>{let{queries:r}=s(t);for(let[t,n]of Object.entries(r))(n?.status===ue||n?.status===ut)&&(e[t]=n)})}}),f=rK({name:`${e}/mutations`,initialState:uB,reducers:{removeMutationResult:{reducer(e,{payload:t}){let r=uz(t);r in e&&delete e[r]},prepare:rI()}},extraReducers(e){e.addCase(r.pending,(e,{meta:t,meta:{requestId:r,arg:n,startedTimeStamp:i}})=>{n.track&&(e[uz(t)]={requestId:r,status:l7,endpointName:n.endpointName,startedTimeStamp:i})}).addCase(r.fulfilled,(e,{payload:t,meta:r})=>{r.arg.track&&uG(e,r,e=>{e.requestId===r.requestId&&(e.status=ue,e.data=t,e.fulfilledTimeStamp=r.fulfilledTimeStamp)})}).addCase(r.rejected,(e,{payload:t,error:r,meta:n})=>{n.arg.track&&uG(e,n,e=>{e.requestId===n.requestId&&(e.status=ut,e.error=t??r)})}).addMatcher(o,(e,t)=>{let{mutations:r}=s(t);for(let[t,n]of Object.entries(r))(n?.status===ue||n?.status===ut)&&t!==n?.requestId&&(e[t]=n)})}}),g=rK({name:`${e}/invalidation`,initialState:{tags:{},keys:{}},reducers:{updateProvidedBy:{reducer(e,t){for(let{queryCacheKey:r,providedTags:n}of t.payload){for(let{type:t,id:i}of(m(e,r),n)){let n=(e.tags[t]??={})[i||"__internal_without_id"]??=[];n.includes(r)||n.push(r)}e.keys[r]=n}},prepare:rI()}},extraReducers(e){e.addCase(p.actions.removeQueryResult,(e,{payload:{queryCacheKey:t}})=>{m(e,t)}).addMatcher(o,(e,t)=>{let{provided:r}=s(t);for(let[t,n]of Object.entries(r.tags??{}))for(let[i,a]of Object.entries(n)){let n=(e.tags[t]??={})[i||"__internal_without_id"]??=[];for(let t of a)n.includes(t)||n.push(t),e.keys[t]=r.keys[t]}}).addMatcher(rN(rL(t),rF(t)),(e,t)=>{y(e,[t])}).addMatcher(p.actions.cacheEntriesUpserted.match,(e,t)=>{y(e,t.payload.map(({queryDescription:e,value:t})=>({type:"UNKNOWN",payload:t,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:e}})))})}});function m(e,t){var r;for(let n of t_(r=e.keys[t]??[])?ra(r):r){let r=n.type,i=n.id??"__internal_without_id",a=e.tags[r]?.[i];a&&(e.tags[r][i]=(t_(a)?ra(a):a).filter(e=>e!==t))}delete e.keys[t]}function y(e,t){let r=t.map(e=>{let t=uU(e,"providesTags",i,l),{queryCacheKey:r}=e.meta.arg;return{queryCacheKey:r,providedTags:t}});g.caseReducers.updateProvidedBy(e,g.actions.updateProvidedBy(r))}let v=rK({name:`${e}/subscriptions`,initialState:uB,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_getRTKQSubscriptions(){}}}),b=rK({name:`${e}/internalSubscriptions`,initialState:uB,reducers:{subscriptionsUpdated:{reducer:(e,t)=>ru(e,t.payload),prepare:rI()}}}),w=rK({name:`${e}/config`,initialState:{online:"u"<typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"u"<typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1,...u},reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&a===t||"conflict"}},extraReducers:e=>{e.addCase(uS,e=>{e.online=!0}).addCase(uE,e=>{e.online=!1}).addCase(ub,e=>{e.focused=!0}).addCase(uw,e=>{e.focused=!1}).addMatcher(o,e=>({...e}))}}),S=rg({queries:p.reducer,mutations:f.reducer,provided:g.reducer,subscriptions:b.reducer,config:w.reducer});return{reducer:(e,t)=>S(c.match(t)?void 0:e,t),actions:{...w.actions,...p.actions,...v.actions,...b.actions,...f.actions,...g.actions,resetApiState:c}}}({context:f,queryThunk:E,infiniteQueryThunk:_,mutationThunk:C,serializeQueryArgs:a,reducerPath:i,assertTagType:g,config:{refetchOnFocus:l,refetchOnReconnect:u,refetchOnMountOrArgChange:o,keepUnusedData
135For:s,reducerPath:i,invalidationBehavior:c}});uJ(t.util,{patchQueryData:k,updateQueryData:I,upsertQueryData:x,prefetch:A,resetApiState:N.resetApiState,upsertQueryEntries:N.cacheEntriesUpserted}),uJ(t.internalActions,N);let R=new WeakMap,D=e=>us(R,e,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:P,buildInitiateInfiniteQuery:M,buildInitiateMutation:j,getRunningMutationThunk:F,getRunningMutationsThunk:L,getRunningQueriesThunk:q,getRunningQueryThunk:$}=function({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:i,context:a,getInternalState:s}){let o=e=>s(e)?.runningQueries,l=e=>s(e)?.runningMutations,{unsubscribeQueryResult:u,removeMutationResult:c,updateSubscriptionOptions:d}=i.internalActions;return{buildInitiateQuery:function(e,t){return h(e,t)},buildInitiateInfiniteQuery:function(e,t){return h(e,t)},buildInitiateMutation:function(e){return(t,{track:r=!0,fixedCacheKey:i}={})=>(a,s)=>{var o,u;let d=a(n({type:"mutation",endpointName:e,originalArgs:t,track:r,fixedCacheKey:i})),{requestId:h,abort:p,unwrap:f}=d,g=Object.assign((o=d.unwrap().then(e=>({data:e})),u=e=>({error:e}),o.catch(u)),{arg:d.arg,requestId:h,abort:p,unwrap:f,reset:()=>{a(c({requestId:h,fixedCacheKey:i}))}}),m=l(a);return m.set(h,g),g.then(()=>{m.delete(h)}),i&&(m.set(i,g),g.then(()=>{m.get(i)===g&&m.delete(i)})),g}},getRunningQueryThunk:function(t,r){return n=>{let i=e({queryArgs:r,endpointDefinition:uN(a,t),endpointName:t});return o(n)?.get(i)}},getRunningMutationThunk:function(e,t){return e=>l(e)?.get(t)},getRunningQueriesThunk:function(){return e=>ua(o(e))},getRunningMutationsThunk:function(){return e=>ua(l(e))}};function h(n,a){let s=(l,{subscribe:c=!0,forceRefetch:h,subscriptionOptions:p,[uR]:f,...g}={})=>(m,y)=>{let v,b=e({queryArgs:l,endpointDefinition:a,endpointName:n}),w={...g,type:u_,subscribe:c,forceRefetch:h,subscriptionOptions:p,endpointName:n,originalArgs:l,queryCacheKey:b,[uR]:f};if(uI(a))v=t(w);else{let{direction:e,initialPageParam:t,refetchCachedPages:n}=g;v=r({...w,direction:e,initialPageParam:t,refetchCachedPages:n})}let S=i.endpoints[n].select(l),E=m(v),_=S(y()),{requestId:C,abort:k}=E,I=_.requestId!==C,x=o(m)?.get(b),A=()=>S(y()),T=Object.assign(f?E.then(A):I&&!x?Promise.resolve(_):Promise.all([x,E]).then(A),{arg:l,requestId:C,subscriptionOptions:p,queryCacheKey:b,abort:k,async unwrap(){let e=await T;if(e.isError)throw e.error;return e.data},refetch:e=>m(s(l,{subscribe:!1,forceRefetch:!0,...e})),unsubscribe(){c&&m(u({queryCacheKey:b,requestId:C}))},updateSubscriptionOptions(e){T.subscriptionOptions=e,m(d({endpointName:n,requestId:C,queryCacheKey:b,options:e}))}});if(!x&&!I&&!f){let e=o(m);e.set(b,T),T.then(()=>{e.delete(b)})}return T};return s}}({queryThunk:E,mutationThunk:C,infiniteQueryThunk:_,api:t,serializeQueryArgs:a,context:f,getInternalState:D});uJ(t.util,{getRunningMutationThunk:F,getRunningMutationsThunk:L,getRunningQueryThunk:$,getRunningQueriesThunk:q});let{middleware:U,actions:V}=function(e){let{reducerPath:t,queryThunk:r,api:n,context:i,getInternalState:a}=e,{apiUid:s}=i,o={invalidateTags:rS(`${t}/invalidateTags`)},l=e=>e.type.startsWith(`${t}/`),u=[u2,uX,u3,u5,u1,u4];return{middleware:r=>{let o=!1,d=a(r.dispatch),h={...e,internalState:d,refetchQuery:c,isThisApiSliceAction:l,mwApi:r},p=u.map(e=>e(h)),f=(({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let i=`${e.reducerPath}/subscriptions`,a=null,s=null,{updateSubscriptionOptions:o,unsubscribeQueryResult:l}=e.internalActions,u=()=>r.currentSubscriptions,c={getSubscriptions:u,getSubscriptionCount:e=>{let t=u().get(e);return t?.size??0},isRequestSubscribed:(e,t)=>{let r=u();return!!r?.get(e)?.get(t)}};function d(e){return JSON.parse(JSON.stringify(Object.fromEntries([...e].map(([e,t])=>[e,Object.fromEntries(t)]))))}return(n,u)=>{if(a||(a=d(r.currentSubscriptions)),e.util.resetApiState.match(n))return a={},r.currentSubscriptions.clear(),s=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(n))return[!1,c];let h=((r,n)=>{if(o.match(n)){let{queryCacheKey:e,requestId:t,options:i}=n.payload,a=r.get(e);return a?.has(t)&&a.set(t,i),!0}if(l.match(n)){let{queryCacheKey:e,requestId:t}=n.payload,i=r.get(e);return i&&i.delete(t),!0}if(e.internalActions.removeQueryResult.match(n))return r.delete(n.payload.queryCacheKey),!0;if(t.pending.match(n)){let{meta:{arg:e,requestId:t}}=n,i=us(r,e.queryCacheKey,uo);return e.subscribe&&i.set(t,e.subscriptionOptions??i.get(t)??{}),!0}let i=!1;if(t.rejected.match(n)){let{meta:{condition:e,arg:t,requestId:a}}=n;if(e&&t.subscribe){let e=us(r,t.queryCacheKey,uo);e.set(a,t.subscriptionOptions??e.get(a)??{}),i=!0}}return i})(r.currentSubscriptions,n),p=!0;if(h){s||(s=setTimeout(()=>{let t=d(r.currentSubscriptions),[,n]=rl(a,()=>t);u.next(e.internalActions.subscriptionsUpdated(n)),a=t,s=null},500));let o="string"==typeof n.type&&!!n.type.startsWith(i),l=t.rejected.match(n)&&n.meta.condition&&!!n.meta.arg.subscribe;p=!o&&!l}return[p,!1]}})(h),g=(({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{let{removeQueryResult:a}=r.internalActions;function s(r,s){let o=r.getState()[e],l=o.queries,u=i.currentSubscriptions;t.batch(()=>{for(let e of u.keys()){let t=l[e],i=u.get(e);if(!i||!t)continue;let c=[...i.values()];(c.some(e=>!0===e[s])||c.every(e=>void 0===e[s])&&o.config[s])&&(0===i.size?r.dispatch(a({queryCacheKey:e})):t.status!==l8&&r.dispatch(n(t)))}})}return(e,t)=>{ub.match(e)&&s(t,"refetchOnFocus"),uS.match(e)&&s(t,"refetchOnReconnect")}})(h);return e=>a=>{let u;if(!ry(a))return e(a);o||(o=!0,r.dispatch(n.internalActions.middlewareRegistered(s)));let c={...r,next:e},d=r.getState(),[h,m]=f(a,c,d);if(u=h?e(a):m,r.getState()[t]&&(g(a,c,d),l(a)||i.hasRehydrationInfo(a)))for(let e of p)e(a,c,d);return u}},actions:o};function c(t){return e.api.endpoints[t.endpointName].initiate(t.originalArgs,{subscribe:!1,forceRefetch:!0})}}({reducerPath:i,context:f,queryThunk:E,mutationThunk:C,infiniteQueryThunk:_,api:t,assertTagType:g,selectors:m,getRunningQueryThunk:$,getInternalState:D});return uJ(t.util,V),uJ(t,{reducer:O,middleware:U}),{name:u6,injectEndpoint(e,r){let n=t.endpoints[e]??={};uI(r)&&uJ(n,{name:e,select:b(e,r),initiate:P(e,r)},T(E,e)),r.type===uC&&uJ(n,{name:e,select:S(),initiate:j(e)},T(C,e)),ux(r)&&uJ(n,{name:e,select:w(e,r),initiate:M(e,r)},T(E,e))}}}}))())({reducerPath:"answer",baseQuery:um(async(e,t,r)=>{let n=t.getState(),{accessToken:i,environment:a,organizationId:s}=n.configuration,o=n.generatedAnswer.answerConfigurationId,l={...e,headers:{...e?.headers||{},Authorization:`Bearer ${i}`}};try{let e=eW(s,a);return{data:(function({baseUrl:e,prepareHeaders:t=e=>e,fetchFn:r=ul,paramsSerializer:n,isJsonContentType:i=e=>
135/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||""),jsonContentType:a="application/json",jsonReplacer:s,timeout:o,responseHandler:l,validateStatus:u,...c}={}){return"u"<typeof fetch&&r===ul&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(h,p,f)=>{let g,m,y,v,b,{getState:w,extra:S,endpoint:E,forced:_,type:C}=p,{url:k,headers:I=new Headers(c.headers),params:x,responseHandler:A=l??"json",validateStatus:T=u??uu,timeout:O=o,...N}="string"==typeof h?{url:h}:h,R={...c,signal:O?((...e)=>{for(let t of e)if(t.aborted)return AbortSignal.abort(t.reason);let t=new AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal})(p.signal,(v=new AbortController,setTimeout(()=>{let e="signal timed out",t="TimeoutError";v.abort("u">typeof DOMException?new DOMException(e,t):Object.assign(Error(e),{name:t}))},O),v.signal)):p.signal,...N};I=new Headers(uc(I)),R.headers=await t(I,{getState:w,arg:h,extra:S,endpoint:E,forced:_,type:C,extraOptions:f})||I;let D="object"==typeof(b=R.body)&&(rf(b)||Array.isArray(b)||"function"==typeof b.toJSON);if(null==R.body||D||"string"==typeof R.body||R.headers.delete("content-type"),!R.headers.has("content-type")&&D&&R.headers.set("content-type",a),D&&i(R.headers)&&(R.body=JSON.stringify(R.body,s)),R.headers.has("accept")||("json"===A?R.headers.set("accept","application/json"):"text"===A&&R.headers.set("accept","text/plain, text/html, */*")),x){let e=~k.indexOf("?")?"&":"?";k+=e+(n?n(x):new URLSearchParams(uc(x)))}let P=new Request(k=function(e,t){var r;if(!e)return t;if(!t)return e;if(r=t,RegExp("(^|:)//").test(r))return t;let n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=e.replace(/\/$/,""),t=t.replace(/^\//,""),`${e}${n}${t}`}(e,k),R);g={request:new Request(k,R)};try{m=await r(P)}catch(e){return{error:{status:(e instanceof Error||"u">typeof DOMException&&e instanceof DOMException)&&"TimeoutError"===e.name?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(e)},meta:g}}let M=m.clone();g.response=M;let j="";try{let e;if(await Promise.all([d(m,A).then(e=>y=e,t=>e=t),M.text().then(e=>j=e,()=>{})]),e)throw e}catch(e){return{error:{status:"PARSING_ERROR",originalStatus:m.status,data:j,error:String(e)},meta:g}}return T(m,y)?{data:y,meta:g}:{error:{status:m.status,data:y},meta:g}};async function d(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=i(e.headers)?"json":"text"),"json"===t){let t=await e.text();return t.length?JSON.parse(t):null}return e.text()}})({baseUrl:`${e}/rest/organizations/${s}/answer/v1/configs/${o}`})(l,t,r)}}catch(e){return{error:e}}},{maxRetries:3}),endpoints:()=>({})}),u8=u9.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:e,queryArgs:t})=>{let{analytics:r,...n}=t;return`${e}(${JSON.stringify(n)})`},async onCacheEntryAdded(e,{getState:t,cacheDataLoaded:r,updateCachedData:n,dispatch:i}){await r;let{configuration:a,generatedAnswer:s,insightConfiguration:o}=t(),{organizationId:l,environment:u,accessToken:c}=a,d=((e,t,r,n)=>{if(!e||!t||!r)throw Error("Missing required parameters for answer endpoint");let i=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${i}/${a}/${r}/generate`})(eW(l,u),l,s.answerConfigurationId,o?.insightId);await eO(d,{method:"POST",body:JSON.stringify(e),headers:{Authorization:`Bearer ${c}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch,onopen:async e=>{let t=e.headers.get("x-answer-id");t&&n(e=>{e.answerId=t,i(lP(t))})},onmessage:e=>{n(t=>{((e,t,r)=>{let n,i=JSON.parse(e.data);"ERROR"===i.finishReason&&i.errorMessage&&(t.error={message:n=i.errorMessage||"Unknown error occurred",code:i.code},t.isStreaming=!1,t.isLoading=!1,console.error(`Generated answer error: ${n} (code: ${i.code})`));let a=i.payload.length?JSON.parse(i.payload):{};switch(i.payloadType){case"genqa.headerMessageType":a.contentFormat&&(((e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1})(t,a),r(lW(a.contentFormat)));break;case"genqa.messageType":"string"==typeof a.textDelta&&(((e,t)=>{let{textDelta:r}=t;if("string"!=typeof r)return;let n=e.answer;(n?.trim()||r.trim())&&(e.answer=n?.trim()?n.concat(r):r)})(t,a),r(lF({textDelta:a.textDelta})));break;case"genqa.citationsType":a.citations&&(t.citations=a.citations,r(lL({citations:a.citations})));break;case"genqa.endOfStreamType":{t.generated=a.answerGenerated,t.isStreaming=!1;let e=t.answerId,n=a.answerGenerated??!1,i=n?!t.answer?.trim():void 0;r(lm(n,e,i)),r(ly())}}})(e,t,i)})},onerror:e=>{throw e},onclose:()=>{n(e=>{i(l2(!e.generated))})}})}})})}),u7=e=>u8.endpoints.getAnswer.initiate(e),ce=rT(nK,e=>e),ct=e=>t=>r=>{let n,i;i=r.payload?.analyticsAction,"type"in r&&!el(i)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let a=t(r);return"type"in r&&("search/executeSearch/fullfilled"===r.type&&void 0===n&&console.error("No anal
135ytics action associated with search:",r),"recommendation/get/fullfilled"===r.type&&void 0===n&&console.error("No analytics action associated with recommendation:",r),"productRecommendations/get/fullfilled"===r.type&&void 0===n&&console.error("No analytics action associated with product recommendation:",r)),void 0!==n&&e.dispatch(n),a},cr=rS("tab/register",e=>to(e,new em({values:{id:e7,expression:tt}}))),cn=rS("tab/updateActiveTab",e=>to(e,e7));var ci=r(47370),ca=r(53401);sY.extend(ca),sY.extend(ci);let cs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:sY.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"}),co=/(^|; )Coveo-Pendragon=([^;]*)/,cl=/(^|; )Coveo-SearchAgentDebug=([^;]*)/,cu=rT(cs(),e=>e.addCase(sa,(e,t)=>{var r,n;r=e,el((n=t.payload).accessToken)||(r.accessToken=n.accessToken),r.environment=n.environment??"prod",el(n.organizationId)||(r.organizationId=n.organizationId)}).addCase(ss,(e,t)=>{var r,n;r=e,el((n=t.payload).proxyBaseUrl)||(r.search.apiBaseUrl=n.proxyBaseUrl),el(n.locale)||(r.search.locale=n.locale),el(n.timezone)||(r.search.timezone=n.timezone),el(n.authenticationProviders)||(r.search.authenticationProviders=n.authenticationProviders)}).addCase(sl,(e,t)=>{var r=e,n=t.payload;el(n.enabled)||(r.analytics.enabled=n.enabled),el(n.originContext)||(r.analytics.originContext=n.originContext),el(n.originLevel2)||(r.analytics.originLevel2=n.originLevel2),el(n.originLevel3)||(r.analytics.originLevel3=n.originLevel3),el(n.proxyBaseUrl)||(r.analytics.apiBaseUrl=n.proxyBaseUrl),el(n.trackingId)||(r.analytics.trackingId=n.trackingId),el(n.analyticsMode)||(r.analytics.analyticsMode=n.analyticsMode),el(n.source)||(r.analytics.source=n.source);try{let e=!("u"<typeof window)&&(co.exec(document.cookie)?.pop()||null);e&&(r.analytics.analyticsMode="next",r.analytics.trackingId=e)}catch(e){}el(n.runtimeEnvironment)||(r.analytics.runtimeEnvironment=n.runtimeEnvironment),el(n.anonymous)||(r.analytics.anonymous=n.anonymous),el(n.deviceId)||(r.analytics.deviceId=n.deviceId),el(n.userDisplayName)||(r.analytics.userDisplayName=n.userDisplayName),el(n.documentLocation)||(r.analytics.documentLocation=n.documentLocation)}).addCase(su,e=>{e.analytics.enabled=!1}).addCase(sc,e=>{e.analytics.enabled=!0}).addCase(sd,(e,t)=>{e.analytics.originLevel2=t.payload.originLevel2}).addCase(sh,(e,t)=>{e.analytics.originLevel3=t.payload.originLevel3}).addCase(cn,(e,t)=>{e.analytics.originLevel2=t.payload}).addCase(sm,(e,t)=>{e.analytics.originLevel2=t.payload}).addCase(sg,(e,t)=>{el(t.payload.tab)||(e.analytics.originLevel2=t.payload.tab)}).addCase(sp,(e,{payload:t})=>{var r=e,n=t;r.knowledge.agentId=n;try{let e=!("u"<typeof window)&&cl.test(document.cookie);el(e)||(r.knowledge.debugAgentSession=!0)}catch(e){}})),cc=()=>e=>t=>e(t.instantlyCallable?t():t),cd="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ch=new Uint8Array(16),cp=[];for(let e=0;e<256;++e)cp.push((e+256).toString(16).slice(1));let cf=function(e,t,r){if(cd&&!t&&!e)return cd();let n=(e=e||{}).random??e.rng?.()??function(){if(!a){if("u"<typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");a=crypto.getRandomValues.bind(crypto)}return a(ch)}();if(n.length<16)throw Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){if((r=r||0)<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return(cp[e[t+0]]+cp[e[t+1]]+cp[e[t+2]]+cp[e[t+3]]+"-"+cp[e[t+4]]+cp[e[t+5]]+"-"+cp[e[t+6]]+cp[e[t+7]]+"-"+cp[e[t+8]]+cp[e[t+9]]+"-"+cp[e[t+10]]+cp[e[t+11]]+cp[e[t+12]]+cp[e[t+13]]+cp[e[t+14]]+cp[e[t+15]]).toLowerCase()}(n)};(S=Q||(Q={})).assertEqual=e=>{},S.assertIs=function(e){},S.assertNever=function(e){throw Error()},S.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},S.getValidEnumValues=e=>{let t=S.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return S.objectValues(r)},S.objectValues=e=>S.objectKeys(e).map(function(t){return e[t]}),S.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},S.find=(e,t)=>{for(let r of e)if(t(r))return r},S.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,S.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},S.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(H||(H={})).mergeShapes=(e,t)=>({...e,...t});let cg=Q.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cm=e=>{switch(typeof e){case"undefined":return cg.undefined;case"string":return cg.string;case"number":return Number.isNaN(e)?cg.nan:cg.number;case"boolean":return cg.boolean;case"function":return cg.function;case"bigint":return cg.bigint;case"symbol":return cg.symbol;case"object":if(Array.isArray(e))return cg.array;if(null===e)return cg.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return cg.promise;if("u">typeof Map&&e instanceof Map)return cg.map;if("u">typeof Set&&e instanceof Set)return cg.set;if("u">typeof Date&&e instanceof Date)return cg.date;return cg.object;default:return cg.unknown}}
135,cy=Q.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class cv extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof cv))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Q.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}cv.create=e=>new cv(e);let cb=(e,t)=>{let r;switch(e.code){case cy.invalid_type:r=e.received===cg.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case cy.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Q.jsonStringifyReplacer)}`;break;case cy.unrecognized_keys:r=`Unrecognized key(s) in object: ${Q.joinValues(e.keys,", ")}`;break;case cy.invalid_union:r="Invalid input";break;case cy.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Q.joinValues(e.options)}`;break;case cy.invalid_enum_value:r=`Invalid enum value. Expected ${Q.joinValues(e.options)}, received '${e.received}'`;break;case cy.invalid_arguments:r="Invalid function arguments";break;case cy.invalid_return_type:r="Invalid function return type";break;case cy.invalid_date:r="Invalid date";break;case cy.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Q.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case cy.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case cy.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case cy.custom:r="Invalid input";break;case cy.invalid_intersection_types:r="Intersection results could not be merged";break;case cy.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case cy.not_finite:r="Number must be finite";break;default:r=t.defaultError,Q.assertNever(e)}return{message:r}};(E=Z||(Z={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},E.toString=e=>"string"==typeof e?e:e?.message;
vendor: 4,290 bytes, line 135
135let cw=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};if(void 0!==i.message)return{...i,path:a,message:i.message};let o="";for(let e of n.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}};function cS(e,t){let r=cw({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,cb,void 0].filter(e=>!!e)});e.common.issues.push(r)}class cE{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return c_;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return cE.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return c_;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}}let c_=Object.freeze({status:"aborted"}),cC=e=>({status:"dirty",value:e}),ck=e=>({status:"valid",value:e}),cI=e=>"u">typeof Promise&&e instanceof Promise;class cx{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let cA=(e,t)=>{if("valid"===t.status)return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new cv(e.common.issues);return this._error=t,this._error}}};function cT(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return"invalid_enum_value"===t.code?{message:a??i.defaultError}:void 0===i.data?{message:a??n??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:a??r??i.defaultError}},description:i}}class cO{get description(){return this._def.description}_getType(e){return cm(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:cm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cE,ctx:{common:e.parent.common,data:e.data,parsedType:cm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(cI(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cm(e)},n=this._parseSync({data:e,path:r.path,parent:r});return cA(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cm(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return"valid"===r.status?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>"valid"===e.status?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cm(e)},n=this._parse({data:e,path:r.path,parent:r});return cA(r,await (cI(n)?n:Promise.resolve(n)))}refine(e,t){return this._refinement((r,n)=>{let i=e(r),a=()=>
vendor: 29,000 bytes, line 135
135n.addIssue({code:cy.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new df({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return dg.create(this,this._def)}nullable(){return dm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return c6.create(this)}promise(){return dp.create(this,this._def)}or(e){return c8.create([this,e],this._def)}and(e){return dt.create(this,e,this._def)}transform(e){return new df({...cT(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new dy({...cT(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:K.ZodDefault})}brand(){return new dw({typeName:K.ZodBranded,type:this,...cT(this._def)})}catch(e){return new dv({...cT(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return dS.create(this,e)}readonly(){return dE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let cN=/^c[^\s-]{8,}$/i,cR=/^[0-9a-z]+$/,cD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cP=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cM=/^[a-z0-9_-]{21}$/i,cj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,cF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,c$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,cU=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cV=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,cB="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cQ=RegExp(`^${cB}$`);function cH(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}class cZ extends cO{_parse(e){var t,r,n,i;let a;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==cg.string){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.string,received:t.parsedType}),c_}let o=new cE;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(cS(a=this._getOrReturnCtx(e,a),{code:cy.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(cS(a=this._getOrReturnCtx(e,a),{code:cy.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,r=e.data.length<l.value;(t||r)&&(a=this._getOrReturnCtx(e,a),t?cS(a,{code:cy.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):r&&cS(a,{code:cy.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)cL.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"email",code:cy.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)s||(s=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),s.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"emoji",code:cy.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)cP.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"uuid",code:cy.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)cM.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"nanoid",code:cy.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)cN.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"cuid",code:cy.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)cR.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"cuid2",code:cy.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)cD.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"ulid",code:cy.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{cS(a=this._getOrReturnCtx(e,a),{validation:"url",code:cy.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"regex",code:cy.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(cS(a=this._getOrReturnCtx(e,a),{code:cy.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(cS(a=this._getOrReturnCtx(e,a),{code:cy.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(cS(a=this._getOrReturnCtx(e,a),{code:cy.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?(function(e){let t=`${cB}T${cH(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{code:cy.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?cQ.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{code:cy.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${cH(l)}$`).test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{code:cy.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?cF.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"duration",code:cy.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(t=e.data,!(("v4"===(r=l.version)||!r)&&cq.test(t)||("v6"===r||!r)&&cU.test(t))&&1&&(cS(a=this._getOrReturnCtx(e,a),{validation:"ip",code:cy.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!cj.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if("object"!=typeof i||null===i||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(cS(a=this._getOrReturnCtx(e,a),{validation:"jwt",code:cy.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(n=e.data,!(("v4"===(i=l.version)||!i)&&c$.test(n)||("v6"===i||!i)&&cV.test(n))&&1&&(cS(a=this._getOrReturnCtx(e,a),{validation:"cidr",code:cy.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?cz.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"base64",code:cy.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?cG.test(e.data)||(cS(a=this._getOrReturnCtx(e,a),{validation:"base64url",code:cy.invalid_string,message:l.message}),o.dirty()):Q.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:cy.invalid_string,...Z.errToObj(r)})}_addCheck(e){return new cZ({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...Z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Z.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Z.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Z.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Z.errToObj(t)})}nonempty(e){return this.min(1,Z.errToObj(e))}trim(){return new cZ({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cZ({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cZ({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}cZ.create=e=>new cZ({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...cT(e)});class cK extends cO{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==cg.number){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.number,received:t.parsedType}),c_}let r=new cE;for(let n of this._def.checks)"int"===n.kind?Q.isInteger(e.data)||(cS(t=this._getOrReturnCtx(e,t),{code:cy.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(e.data,n.value)&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(cS(t=this._getOrReturnCtx(e,t),{code:cy.not_finite,message:n.message}),r.dirty()):Q.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(e,t,r,n){return new cK({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Z.toString(n)}]})}_addCheck(e){return new cK({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&Q.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}cK.create=e=>new cK({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...cT(e)});class cY extends cO{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==cg.bigint)return this._getInvalidInput(e);let r=new cE;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):Q.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.bigint,received:t.parsedType}),c_}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(e,t,r,n){return new cY({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Z.toString(n)}]})}_addCheck(e){return new cY({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}cY.create=e=>new cY({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...cT(e)});class cW extends cO{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==cg.boolean){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.boolean,received:t.parsedType}),c_}return ck(e.data)}}cW.create=e=>new cW({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...cT(e)});class cJ extends cO{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==cg.date){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.date,received:t.parsedType}),c_}if(Number.isNaN(e.data.getTime()))return cS(this._getOrReturnCtx(e),{code:cy.invalid_date}),c_;let r=new cE;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(cS(t=this._getOrReturnCtx(e,t),{code:cy.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):Q.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new cJ({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Z.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Z.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}cJ.create=e=>new cJ({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...cT(e)});class cX extends cO{_parse(e){if(this._getType(e)!==cg.symbol){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.symbol,received:t.parsedType}),c_}return ck(e.data)}}cX.create=e=>new cX({typeName:K.ZodSymbol,...cT(e)});class c0 extends cO{_parse(e){if(this._getType(e)!==cg.undefined){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.undefined,received:t.parsedType}),c_}return ck(e.data)}}c0.create=e=>new c0({typeName:K.ZodUndefined,...cT(e)});class c1 extends cO{_parse(e){if(this._getType(e)!==cg.null){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.null,received:t.parsedType}),c_}return ck(e.data)}}c1.create=e=>new c1({typeName:K.ZodNull,...cT(e)});class c2 extends cO{constructor(){super(...arguments),this._any=!0}_parse(e){return ck(e.data)}}c2.create=e=>new c2({typeName:K.ZodAny,...cT(e)});class c3 extends cO{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ck(e.data)}}c3.create=e=>new c3({typeName:K.ZodUnknown,...cT(e)});class c5 extends cO{_parse(e){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.never,received:t.parsedType}),c_}}c5.create=e=>new c5({typeName:K.ZodNever,...cT(e)});class c4 extends cO{_parse(e){if(this._getType(e)!==cg.undefined){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.void,received:t.parsedType}),c_}return ck(e.data)}}c4.create=e=>new c4({typeName:K.ZodVoid,...cT(e)});class c6 extends cO{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==cg.array)return cS(t,{code:cy.invalid_type,expected:cg.array,received:t.parsedType}),c_;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(cS(t,{code:e?cy.too_big:cy.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(cS(t,{code:cy.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(cS(t,{code:cy.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new cx(t,e,t.path,r)))).then(e=>cE.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new cx(t,e,t.path,r)));return cE.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new c6({...this._def,minLength:{value:e,message:Z.toString(t)}})}max(e,t){return new c6({...this._def,maxLength:{value:e,message:Z.toString(t)}})}length(e,t){return new c6({...this._def,exactLength:{value:e,message:Z.toString(t)}})}nonempty(e){return this.min(1,e)}}c6.create=(e,t)=>new c6({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...cT(t)});class c9 extends cO{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=Q.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==cg.object){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.object,received:t.parsedType}),c_}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof c5&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||a.push(e);let s=[];for(let e of i){let t=n[e],i=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new cx(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof c5){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(cS(r,{code:cy.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new cx(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>cE.mergeObjectSync(t,e)):cE.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return Z.errToObj,new c9({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:Z.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new c9({...this._def,unknownKeys:"strip"})}passthrough(){return new c9({...this._def,unknownKeys:"passthrough"})}extend(e){return new c9({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new c9({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new c9({...this._def,catchall:e})}pick(e){let t={};for(let r of Q.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new c9({...this._def,shape:()=>t})}omit(e){let t={};for(let r of Q.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new c9({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof c9){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=dg.create(e(i))}return new c9({...t._def,shape:()=>r})}if(t instanceof c6)return new c6({...t._def,type:e(t.element)});if(t instanceof dg)return dg.create(e(t.unwrap()));if(t instanceof dm)return dm.create(e(t.unwrap()));if(t instanceof dr)return dr.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of Q.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new c9({...this._def,shape:()=>t})}required(e){let t={};for(let r of Q.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof dg;)e=e._def.innerType;t[r]=e}return new c9({...this._def,shape:()=>t})}keyof(){return dc(Q.objectKeys(this.shape))}}c9.create=(e,t)=>new c9({shape:()=>e,unknownKeys:"strip",catchall:c5.create(),typeName:K.ZodObject,...cT(t)}),c9.strictCreate=(e,t)=>new c9({shape:()=>e,unknownKeys:"strict",catchall:c5.create(),typeName:K.ZodObject,...cT(t)}),c9.lazycreate=(e,t)=>new c9({shape:e,unknownKeys:"strip",catchall:c5.create(),typeName:K.ZodObject,...cT(t)});class c8 extends cO{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new cv(e.ctx.common.issues));return cS(t,{code:cy.invalid_union,unionErrors:r}),c_});{let e,n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=n.map(e=>new cv(e));return cS(t,{code:cy.invalid_union,unionErrors:i}),c_}}
135get options(){return this._def.options}}c8.create=(e,t)=>new c8({options:e,typeName:K.ZodUnion,...cT(t)});let c7=e=>{if(e instanceof dl)return c7(e.schema);if(e instanceof df)return c7(e.innerType());if(e instanceof du)return[e.value];if(e instanceof dd)return e.options;if(e instanceof dh)return Q.objectValues(e.enum);else if(e instanceof dy)return c7(e._def.innerType);else if(e instanceof c0)return[void 0];else if(e instanceof c1)return[null];else if(e instanceof dg)return[void 0,...c7(e.unwrap())];else if(e instanceof dm)return[null,...c7(e.unwrap())];else if(e instanceof dw)return c7(e.unwrap());else if(e instanceof dE)return c7(e.unwrap());else if(e instanceof dv)return c7(e._def.innerType);else return[]};class de extends cO{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==cg.object)return cS(t,{code:cy.invalid_type,expected:cg.object,received:t.parsedType}),c_;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(cS(t,{code:cy.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),c_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=c7(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new de({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...cT(r)})}}class dt extends cO{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if("aborted"===e.status||"aborted"===n.status)return c_;let i=function e(t,r){let n=cm(t),i=cm(r);if(t===r)return{valid:!0,data:t};if(n===cg.object&&i===cg.object){let n=Q.objectKeys(r),i=Q.objectKeys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};a[n]=i.data}return{valid:!0,data:a}}if(n===cg.array&&i===cg.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let a=e(t[i],r[i]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}if(n===cg.date&&i===cg.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,n.value);return i.valid?(("dirty"===e.status||"dirty"===n.status)&&t.dirty(),{status:t.value,value:i.data}):(cS(r,{code:cy.invalid_intersection_types}),c_)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}dt.create=(e,t,r)=>new dt({left:e,right:t,typeName:K.ZodIntersection,...cT(r)});class dr extends cO{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==cg.array)return cS(r,{code:cy.invalid_type,expected:cg.array,received:r.parsedType}),c_;if(r.data.length<this._def.items.length)return cS(r,{code:cy.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c_;!this._def.rest&&r.data.length>this._def.items.length&&(cS(r,{code:cy.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new cx(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>cE.mergeArray(t,e)):cE.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new dr({...this._def,rest:e})}}dr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new dr({items:e,typeName:K.ZodTuple,rest:null,...cT(t)})};class dn extends cO{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==cg.object)return cS(r,{code:cy.invalid_type,expected:cg.object,received:r.parsedType}),c_;let n=[],i=this._def.keyType,a=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new cx(r,e,r.path,e)),value:a._parse(new cx(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?cE.mergeObjectAsync(t,n):cE.mergeObjectSync(t,n)}
135get element(){return this._def.valueType}static create(e,t,r){return new dn(t instanceof cO?{keyType:e,valueType:t,typeName:K.ZodRecord,...cT(r)}:{keyType:cZ.create(),valueType:e,typeName:K.ZodRecord,...cT(t)})}}class di extends cO{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==cg.map)return cS(r,{code:cy.invalid_type,expected:cg.map,received:r.parsedType}),c_;let n=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new cx(r,e,r.path,[a,"key"])),value:i._parse(new cx(r,t,r.path,[a,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of a){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return c_;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of a){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return c_;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}di.create=(e,t,r)=>new di({valueType:t,keyType:e,typeName:K.ZodMap,...cT(r)});class da extends cO{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==cg.set)return cS(r,{code:cy.invalid_type,expected:cg.set,received:r.parsedType}),c_;let n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(cS(r,{code:cy.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(cS(r,{code:cy.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let r=new Set;for(let n of e){if("aborted"===n.status)return c_;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>i._parse(new cx(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>a(e)):a(s)}min(e,t){return new da({...this._def,minSize:{value:e,message:Z.toString(t)}})}max(e,t){return new da({...this._def,maxSize:{value:e,message:Z.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}da.create=(e,t)=>new da({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...cT(t)});class ds extends cO{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==cg.function)return cS(t,{code:cy.invalid_type,expected:cg.function,received:t.parsedType}),c_;function r(e,r){return cw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cb,cb].filter(e=>!!e),issueData:{code:cy.invalid_arguments,argumentsError:r}})}function n(e,r){return cw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cb,cb].filter(e=>!!e),issueData:{code:cy.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof dp){let e=this;return ck(async function(...t){let s=new cv([]),o=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(r(t,e)),s}),l=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(l,i).catch(e=>{throw s.addIssue(n(l,e)),s})})}{let e=this;return ck(function(...t){let s=e._def.args.safeParse(t,i);if(!s.success)throw new cv([r(t,s.error)]);let o=Reflect.apply(a,this,s.data),l=e._def.returns.safeParse(o,i);if(!l.success)throw new cv([n(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ds({...this._def,args:dr.create(e).rest(c3.create())})}returns(e){return new ds({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ds({args:e||dr.create([]).rest(c3.create()),returns:t||c3.create(),typeName:K.ZodFunction,...cT(r)})}}class dl extends cO{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}dl.create=(e,t)=>
vendor: 4,682 bytes, line 135
135new dl({getter:e,typeName:K.ZodLazy,...cT(t)});class du extends cO{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return cS(t,{received:t.data,code:cy.invalid_literal,expected:this._def.value}),c_}return{status:"valid",value:e.data}}get value(){return this._def.value}}function dc(e,t){return new dd({values:e,typeName:K.ZodEnum,...cT(t)})}du.create=(e,t)=>new du({value:e,typeName:K.ZodLiteral,...cT(t)});class dd extends cO{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return cS(t,{expected:Q.joinValues(r),received:t.parsedType,code:cy.invalid_type}),c_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return cS(t,{received:t.data,code:cy.invalid_enum_value,options:r}),c_}return ck(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return dd.create(e,{...this._def,...t})}exclude(e,t=this._def){return dd.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}dd.create=dc;class dh extends cO{_parse(e){let t=Q.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==cg.string&&r.parsedType!==cg.number){let e=Q.objectValues(t);return cS(r,{expected:Q.joinValues(e),received:r.parsedType,code:cy.invalid_type}),c_}if(this._cache||(this._cache=new Set(Q.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=Q.objectValues(t);return cS(r,{received:r.data,code:cy.invalid_enum_value,options:e}),c_}return ck(e.data)}get enum(){return this._def.values}}dh.create=(e,t)=>new dh({values:e,typeName:K.ZodNativeEnum,...cT(t)});class dp extends cO{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==cg.promise&&!1===t.common.async?(cS(t,{code:cy.invalid_type,expected:cg.promise,received:t.parsedType}),c_):ck((t.parsedType===cg.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}dp.create=(e,t)=>new dp({type:e,typeName:K.ZodPromise,...cT(t)});class df extends cO{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{cS(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return c_;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?c_:"dirty"===n.status||"dirty"===t.value?cC(n.value):n});{if("aborted"===t.value)return c_;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?c_:"dirty"===n.status||"dirty"===t.value?cC(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?c_:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?c_:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>"valid"!==e.status?c_:Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})));else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if("valid"!==e.status)return c_;let a=n.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}Q.assertNever(n)}}df.create=(e,t,r)=>new df({schema:e,typeName:K.ZodEffects,effect:t,...cT(r)}),df.createWithPreprocess=(e,t,r)=>new df({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...cT(r)});class dg extends cO{_parse(e){return this._getType(e)===cg.undefined?ck(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dg.create=(e,t)=>
135new dg({innerType:e,typeName:K.ZodOptional,...cT(t)});class dm extends cO{_parse(e){return this._getType(e)===cg.null?ck(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dm.create=(e,t)=>new dm({innerType:e,typeName:K.ZodNullable,...cT(t)});class dy extends cO{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===cg.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}dy.create=(e,t)=>new dy({innerType:e,typeName:K.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...cT(t)});class dv extends cO{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return cI(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new cv(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new cv(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dv.create=(e,t)=>new dv({innerType:e,typeName:K.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...cT(t)});class db extends cO{_parse(e){if(this._getType(e)!==cg.nan){let t=this._getOrReturnCtx(e);return cS(t,{code:cy.invalid_type,expected:cg.nan,received:t.parsedType}),c_}return{status:"valid",value:e.data}}}db.create=e=>new db({typeName:K.ZodNaN,...cT(e)}),Symbol("zod_brand");class dw extends cO{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class dS extends cO{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?c_:"dirty"===e.status?(t.dirty(),cC(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?c_:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new dS({in:e,out:t,typeName:K.ZodPipeline})}}class dE extends cO{_parse(e){let t=this._def.innerType._parse(e),r=e=>("valid"===e.status&&(e.value=Object.freeze(e.value)),e);return cI(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}dE.create=(e,t)=>new dE({innerType:e,typeName:K.ZodReadonly,...cT(t)}),c9.lazycreate,(_=K||(K={})).ZodString="ZodString",_.ZodNumber="ZodNumber",_.ZodNaN="ZodNaN",_.ZodBigInt="ZodBigInt",_.ZodBoolean="ZodBoolean",_.ZodDate="ZodDate",_.ZodSymbol="ZodSymbol",_.ZodUndefined="ZodUndefined",_.ZodNull="ZodNull",_.ZodAny="ZodAny",_.ZodUnknown="ZodUnknown",_.ZodNever="ZodNever",_.ZodVoid="ZodVoid",_.ZodArray="ZodArray",_.ZodObject="ZodObject",_.ZodUnion="ZodUnion",_.ZodDiscriminatedUnion="ZodDiscriminatedUnion",_.ZodIntersection="ZodIntersection",_.ZodTuple="ZodTuple",_.ZodRecord="ZodRecord",_.ZodMap="ZodMap",_.ZodSet="ZodSet",_.ZodFunction="ZodFunction",_.ZodLazy="ZodLazy",_.ZodLiteral="ZodLiteral",_.ZodEnum="ZodEnum",_.ZodEffects="ZodEffects",_.ZodNativeEnum="ZodNativeEnum",_.ZodOptional="ZodOptional",_.ZodNullable="ZodNullable",_.ZodDefault="ZodDefault",_.ZodCatch="ZodCatch",_.ZodPromise="ZodPromise",_.ZodBranded="ZodBranded",_.ZodPipeline="ZodPipeline",_.ZodReadonly="ZodReadonly";let d_=cZ.create,dC=cK.create;db.create,cY.create;let dk=cW.create;cJ.create,cX.create,c0.create,c1.create;let dI=c2.create,dx=c3.create;c5.create,c4.create;let dA=c6.create,dT=c9.create;c9.strictCreate;let dO=c8.create,dN=de.create;dt.create,dr.create;let dR=dn.create;di.create,da.create,ds.create,dl.create;let dD=du.create;dd.create;let dP=dh.create;dp.create,df.create,dg.create,dm.create,df.createWithPreprocess,dS.create;let dM=dT({name:d_(),arguments:d_()}),dj=dT({id:d_(),type:dD("function"),function:dM,encryptedValue:d_().optional()}),dF=dT({id:d_(),role:d_(),content:d_().optional(),name:d_().optional(),encryptedValue:d_().optional()}),dL=dT({type:dD("text"),text:d_()}),dq=dN("type",[dT({type:dD("data"),value:d_(),mimeType:d_()}),dT({type:dD("url"),value:d_(),mimeType:d_().optional()})]),d$=dT({type:dD("image"),source:dq,metadata:dx().optional()}),dU=dT({type:dD("audio"),source:dq,metadata:dx().optional()}),dV=dT({type:dD("video"),source:dq,metadata:dx().optional()}),dz=dT({type:dD("document"),source:dq,metadata:dx().optional()}),dG=dT({type:dD("binary"),mimeType:d_(),id:d_().optional(),url:d_().optional(),data:d_().optional(),filename:d_().optional()}),dB=(e,t)=>
135{e.id||e.url||e.data||t.addIssue({code:cy.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})};dG.superRefine((e,t)=>{dB(e,t)});let dQ=dN("type",[dL,d$,dU,dV,dz,dG]).superRefine((e,t)=>{"binary"===e.type&&dB(e,t)}),dH=dN("role",[dF.extend({role:dD("developer"),content:d_()}),dF.extend({role:dD("system"),content:d_()}),dF.extend({role:dD("assistant"),content:d_().optional(),toolCalls:dA(dj).optional()}),dF.extend({role:dD("user"),content:dO([d_(),dA(dQ)])}),dT({id:d_(),content:d_(),role:dD("tool"),toolCallId:d_(),error:d_().optional(),encryptedValue:d_().optional()}),dT({id:d_(),role:dD("activity"),activityType:d_(),content:dR(dI())}),dT({id:d_(),role:dD("reasoning"),content:d_(),encryptedValue:d_().optional()})]);dO([dD("developer"),dD("system"),dD("assistant"),dD("user"),dD("tool"),dD("activity"),dD("reasoning")]);let dZ=dT({description:d_(),value:d_()}),dK=dT({name:d_(),description:d_(),parameters:dI(),metadata:dR(dI()).optional()}),dY=dT({threadId:d_(),runId:d_(),parentRunId:d_().optional(),state:dI(),messages:dA(dH),tools:dA(dK),context:dA(dZ),forwardedProps:dI()}),dW=dI();var dJ=class extends Error{constructor(e){super(e)}},dX=class extends dJ{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}};let d0=dT({name:d_(),description:d_().optional()}),d1=dT({name:d_().optional(),type:d_().optional(),description:d_().optional(),version:d_().optional(),provider:d_().optional(),documentationUrl:d_().optional(),metadata:dR(dx()).optional()}),d2=dT({streaming:dk().optional(),websocket:dk().optional(),httpBinary:dk().optional(),pushNotifications:dk().optional(),resumable:dk().optional()}),d3=dT({supported:dk().optional(),items:dA(dK).optional(),parallelCalls:dk().optional(),clientProvided:dk().optional()}),d5=dT({structuredOutput:dk().optional(),supportedMimeTypes:dA(d_()).optional()}),d4=dT({snapshots:dk().optional(),deltas:dk().optional(),memory:dk().optional(),persistentState:dk().optional()}),d6=dT({supported:dk().optional(),delegation:dk().optional(),handoffs:dk().optional(),subAgents:dA(d0).optional()}),d9=dT({supported:dk().optional(),streaming:dk().optional(),encrypted:dk().optional()}),d8=dT({image:dk().optional(),audio:dk().optional(),video:dk().optional(),pdf:dk().optional(),file:dk().optional()}),d7=dT({image:dk().optional(),audio:dk().optional()}),he=dT({input:d8.optional(),output:d7.optional()}),ht=dT({codeExecution:dk().optional(),sandboxed:dk().optional(),maxIterations:dC().optional(),maxExecutionTime:dC().optional()}),hr=dT({supported:dk().optional(),approvals:dk().optional(),interventions:dk().optional(),feedback:dk().optional()});dT({identity:d1.optional(),transport:d2.optional(),tools:d3.optional(),output:d5.optional(),state:d4.optional(),multiAgent:d6.optional(),reasoning:d9.optional(),multimodal:he.optional(),execution:ht.optional(),humanInTheLoop:hr.optional(),custom:dR(dx()).optional()});let hn=dO([dD("developer"),dD("system"),dD("assistant"),dD("user")]),hi=((C={}).TEXT_MESSAGE_START="TEXT_MESSAGE_START",C.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",C.TEXT_MESSAGE_END="TEXT_MESSAGE_END",C.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",C.TOOL_CALL_START="TOOL_CALL_START",C.TOOL_CALL_ARGS="TOOL_CALL_ARGS",C.TOOL_CALL_END="TOOL_CALL_END",C.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",C.TOOL_CALL_RESULT="TOOL_CALL_RESULT",C.THINKING_START="THINKING_START",C.THINKING_END="THINKING_END",C.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",C.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",C.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",C.STATE_SNAPSHOT="STATE_
135SNAPSHOT",C.STATE_DELTA="STATE_DELTA",C.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",C.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",C.ACTIVITY_DELTA="ACTIVITY_DELTA",C.RAW="RAW",C.CUSTOM="CUSTOM",C.RUN_STARTED="RUN_STARTED",C.RUN_FINISHED="RUN_FINISHED",C.RUN_ERROR="RUN_ERROR",C.STEP_STARTED="STEP_STARTED",C.STEP_FINISHED="STEP_FINISHED",C.REASONING_START="REASONING_START",C.REASONING_MESSAGE_START="REASONING_MESSAGE_START",C.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",C.REASONING_MESSAGE_END="REASONING_MESSAGE_END",C.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",C.REASONING_END="REASONING_END",C.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",C),ha=dT({type:dP(hi),timestamp:dC().optional(),rawEvent:dI().optional()}).passthrough(),hs=ha.extend({type:dD(hi.TEXT_MESSAGE_START),messageId:d_(),role:hn.default("assistant"),name:d_().optional()}),ho=ha.extend({type:dD(hi.TEXT_MESSAGE_CONTENT),messageId:d_(),delta:d_()}),hl=ha.extend({type:dD(hi.TEXT_MESSAGE_END),messageId:d_()}),hu=ha.extend({type:dD(hi.TEXT_MESSAGE_CHUNK),messageId:d_().optional(),role:hn.optional(),delta:d_().optional(),name:d_().optional()}),hc=ha.extend({type:dD(hi.THINKING_TEXT_MESSAGE_START)}),hd=ho.omit({messageId:!0,type:!0}).extend({type:dD(hi.THINKING_TEXT_MESSAGE_CONTENT)}),hh=ha.extend({type:dD(hi.THINKING_TEXT_MESSAGE_END)}),hp=ha.extend({type:dD(hi.TOOL_CALL_START),toolCallId:d_(),toolCallName:d_(),parentMessageId:d_().optional()}),hf=ha.extend({type:dD(hi.TOOL_CALL_ARGS),toolCallId:d_(),delta:d_()}),hg=ha.extend({type:dD(hi.TOOL_CALL_END),toolCallId:d_()}),hm=ha.extend({messageId:d_(),type:dD(hi.TOOL_CALL_RESULT),toolCallId:d_(),content:d_(),role:dD("tool").optional()}),hy=ha.extend({type:dD(hi.TOOL_CALL_CHUNK),toolCallId:d_().optional(),toolCallName:d_().optional(),parentMessageId:d_().optional(),delta:d_().optional()}),hv=ha.extend({type:dD(hi.THINKING_START),title:d_().optional()}),hb=ha.extend({type:dD(hi.THINKING_END)}),hw=ha.extend({type:dD(hi.STATE_SNAPSHOT),snapshot:dW}),hS=ha.extend({type:dD(hi.STATE_DELTA),delta:dA(dI())}),hE=ha.extend({type:dD(hi.MESSAGES_SNAPSHOT),messages:dA(dH)}),h_=ha.extend({type:dD(hi.ACTIVITY_SNAPSHOT),messageId:d_(),activityType:d_(),content:dR(dI()),replace:dk().optional().default(!0)}),hC=ha.extend({type:dD(hi.ACTIVITY_DELTA),messageId:d_(),activityType:d_(),patch:dA(dI())}),hk=ha.extend({type:dD(hi.RAW),event:dI(),source:d_().optional()}),hI=ha.extend({type:dD(hi.CUSTOM),name:d_(),value:dI()}),hx=ha.extend({type:dD(hi.RUN_STARTED),threadId:d_(),runId:d_(),parentRunId:d_().optional(),input:dY.optional()}),hA=ha.extend({type:dD(hi.RUN_FINISHED),threadId:d_(),runId:d_(),result:dI().optional()}),hT=ha.extend({type:dD(hi.RUN_ERROR),message:d_(),code:d_().optional()}),hO=ha.extend({type:dD(hi.STEP_STARTED),stepName:d_()}),hN=ha.extend({type:dD(hi.STEP_FINISHED),stepName:d_()}),hR=dO([dD("tool-call"),dD("message")]),hD=dN("type",[hs,ho,hl,hu,hv,hb,hc,hd,hh,hp,hf,hg,hy,hm,hw,hS,hE,h_,hC,hk,hI,hx,hA,hT,hO,hN,ha.extend({type:dD(hi.REASONING_START),messageId:d_()}),ha.extend({type:dD(hi.REASONING_MESSAGE_START),messageId:d_(),role:dD("reasoning")}),ha.extend({type:dD(hi.REASONING_MESSAGE_CONTENT),messageId:d_(),delta:d_()}),ha.extend({type:dD(hi.REASONING_MESSAGE_END),messageId:d_()}),ha.extend({type:dD(hi.REASONING_MESSAGE_CHUNK),messageId:d_().optional(),delta:d_().optional()}),ha.extend({type:dD(hi.REASONING_END),messageId:d_()}),ha.extend({type:dD(hi.REASONING_ENCRYPTED_VALUE),subtype:hR,entityId:d_(),encryptedValue:d_()})]);var hP=(k=function(e,t){return(k=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}k(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),hM=Object.prototype.hasOwnProperty;function hj(e,t){return hM.call(e,t)}function hF(e){if(Array.isArray(e)){for(var t=Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var i in e)hj(e,i)&&n.push(i);return n}function hL(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function hq(e){for(var t,r=0,n=e.length;r<n;){if((t=e.charCodeAt(r))>=48&&t<=57){r++;continue}return!1}return!0}function h$(e){return -1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function hU(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function hV(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}var hz=function(e){function t(t,r,n,i,a){var s=this.constructor,o=e.call(this,hV(t,{name:r,index:n,operation:i,tree:a}))||this;return o.name=r,o.index=n,o.operation=i,o.tree=a,Object.setPrototypeOf(o,s.prototype),o.message=hV(t,{name:r,index:n,operation:i,tree:a}),o}return hP(t,e),t}(Error),hG=hz,hB=hL,hQ={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=hZ(r,this.path);n&&(n=hL(n));var i=hK(r,{op:"remove",path:this.from}).removed;return hK(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=hZ(r,this.from);return hK(r,{op:"add",path:this.path,value:hL(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:h0(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},hH={add:function(e,t,r){return hq(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:hQ.move,copy:hQ.copy,test:hQ.test,_get:hQ._get};function hZ(e,t){if(""==t)return e;var r={op:"_get",path:t};return hK(e,r),r.value}function hK(e,t,r,n,i,a){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===a&&(a=0),r&&("function"==typeof r?r(t,0,e,t.path):hJ(t,0)),""===t.path){var s={newDocument:e};if("add"===t.op)return s.newDocument=t.value,s;if("replace"===t.op)return s.newDocument=t.value,s.removed=e,s;if("move"===t.op||"copy"===t.op)return s.newDocument=hZ(e,t.from),"move"===t.op&&(s.removed=e),s;else if("test"===t.op){if(s.test=h0(e,t.value),!1===s.test)throw new hG("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return s.newDocument=e,s}else if("remove"===t.op)return s.removed=e,s.newDocument=null,s;else if("_get"===t.op)return t.value=e,s;else if(!r)return s;else throw new hG("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e)}n||(e=hL(e));var o=(t.path||"").split("/"),l=e,u=1,c=o.length,d=void 0,h=void 0,p=void 0;for(p="function"==typeof r?r:hJ;;){if((h=o[u])&&-1!=h.indexOf("~")&&(h=hU(h)),i&&("__proto__"==h||"prototype"==h&&u>0&&"constructor"==o[u-1]))throw TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===d&&(void 0===l[h]?d=o.slice(0,u).join("/"):u==c-1&&(d=t.path),void 0!==d&&p(t,0,e,d)),u++,Array.isArray(l)){if("-"===h)h=l.length;
135else if(r&&!hq(h))throw new hG("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);else hq(h)&&(h=~~h);if(u>=c){if(r&&"add"===t.op&&h>l.length)throw new hG("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var s=hH[t.op].call(t,l,h,e);if(!1===s.test)throw new hG("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return s}}else if(u>=c){var s=hQ[t.op].call(t,l,h,e);if(!1===s.test)throw new hG("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return s}if(l=l[h],r&&u<c&&(!l||"object"!=typeof l))throw new hG("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}function hY(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!0),r&&!Array.isArray(t))throw new hG("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=hL(e));for(var a=Array(t.length),s=0,o=t.length;s<o;s++)a[s]=hK(e,t[s],r,!0,i,s),e=a[s].newDocument;return a.newDocument=e,a}function hW(e,t,r){var n=hK(e,t);if(!1===n.test)throw new hG("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function hJ(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new hG("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);
135if(hQ[e.op]){if("string"!=typeof e.path)throw new hG("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);else if(0!==e.path.indexOf("/")&&e.path.length>0)throw new hG('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);else if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new hG("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);else if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new hG("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);else if(("add"===e.op||"replace"===e.op||"test"===e.op)&&function e(t){if(void 0===t)return!0;if(t){if(Array.isArray(t)){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return!0}else if("object"==typeof t){for(var i=hF(t),a=i.length,s=0;s<a;s++)if(e(t[i[s]]))return!0}}return!1}(e.value))throw new hG("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);else if(r){if("add"==e.op){var i=e.path.split("/").length,a=n.split("/").length;if(i!==a+1&&i!==a)throw new hG("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new hG("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var s=hX([{op:"_get",path:e.from,value:void 0}],r);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new hG("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new hG("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function hX(e,t,r){try{if(!Array.isArray(e))throw new hG("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)hY(hL(t),hL(e),r||!0);else{r=r||hJ;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof hG)return e;throw e}}function h0(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,i,a=Array.isArray(e),s=Array.isArray(t);if(a&&s){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!h0(e[r],t[r]))return!1;return!0}if(a!=s)return!1;var o=Object.keys(e);if((n=o.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(o[r]))return!1;for(r=n;0!=r--;)if(!h0(e[i=o[r]],t[i]))return!1;return!0}return e!=e&&t!=t}var h1=new WeakMap,h2=function(e){this.observers=new Map,this.obj=e},h3=function(e,t){this.callback=e,this.observer=t};function h5(e,t){t.unobserve()}function h4(e,t){var r=h1.get(e);if(r){var n,i=r.observers.get(t);n=i&&i.observer}else r=new h2(e),h1.set(e,r);if(n)return n;if(n={},r.value=hL(e),t){n.callback=t,n.next=null;var a=function(){h6(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(a)};"u">typeof window&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=[],n.object=e,n.unobserve=function(){var e,t;h6(n),clearTimeout(n.next),e=r,t=n,e.observers.delete(t.callback),"u">typeof window&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},r.observers.set(t,new h3(t,n)),n}function h6(e,t){void 0===t&&(t=!1);var r=h1.get(e.object);h9(r.value,e.object,e.patches,"",t),e.patches.length&&hY(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function h9(e,t,r,n,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var a=hF(t),s=hF(e),o=!1,l=s.length-1;l>=0;l--){var u=s[l],c=e[u];if(hj(t,u)&&(void 0!==t[u]||void 0===c||!1!==Array.isArray(t))){var d=t[u];"object"==typeof c&&null!=c&&"object"==typeof d&&null!=d&&Array.isArray(c)===Array.isArray(d)?h9(c,d,r,n+"/"+h$(u),i):c!==d&&(i&&r.push({op:"test",path:n+"/"+h$(u),value:hL(c)}),r.push({op:"replace",path:n+"/"+h$(u),value:hL(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+h$(u),value:hL(c)}),r.push({op:"remove",path:n+"/"+h$(u)}),o=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}))}if(o||a.length!=s.length)for(var l=0;l<a.length;l++){var u=a[l];hj(e,u)||void 0===t[u]||r.push({op:"add",path:n+"/"+h$(u),value:hL(t[u])})}}}function h8(e,t,r){void 0===r&&(r=!1);var n=[];return h9(e,t,n,"",r),n}function h7(e){return"function"==typeof e}Object.assign({},er,en,{JsonPatchError:hz,deepClone:hL,escapePathComponent:h$,unescapePathComponent:hU});var pe=function(e,t){return(pe=Object.setPrototypeOf||({__proto__:[]}
135)instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function pt(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function pr(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){var u=[o,l];if(r)throw TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function pn(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function pi(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return s}function pa(e,t,r){if(r||2==arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function ps(e){return this instanceof ps?(this.v=e,this):new ps(e)}var po=("function"==typeof SuppressedError&&SuppressedError,function(e){return e&&"number"==typeof e.length&&"function"!=typeof e});function pl(e){return h7(null==e?void 0:e.then)}function pu(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var pc=pu(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function pd(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ph=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,n,i,a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=pn(a),o=s.next();!o.done;o=s.next())o.value.remove(this)}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else a.remove(this);var l=this.initialTeardown;if(h7(l))try{l()}catch(e){i=e instanceof pc?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var c=pn(u),d=c.next();!d.done;d=c.next()){var h=d.value;try{pg(h)}catch(e){i=null!=i?i:[],e instanceof pc?i=pa(pa([],pi(i)),pi(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}}if(i)throw new pc(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)pg(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(r=this._finalizers)?r:[]).push(e)}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&pd(t,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&pd(r,e),e instanceof t&&e._removeParent(this)},(e=new t).closed=!0,t.EMPTY=e,t}(),pp=ph.EMPTY;function pf(e){return e instanceof ph||e&&"closed"in e&&h7(e.remove)&&h7(e.add)&&h7(e.unsubscribe)}function pg(e){h7(e)?e():e.unsubscribe()}var pm=void 0,py={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=py.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,pa([e,t],pi(r))):setTimeout.apply(void 0,pa([e,t],pi(r)))},clearTimeout:function(e){var t=py.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function pv(e){py.setTimeout(function(){!1;throw e})}function pb(){}var pw=pS("C",void 0,void 0);function pS(e,t,r){return{kind:e,value:t,error:r}}var pE=null;function p_(e){var t,r,n,i;1;e()}var pC=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,pf(t)&&t.add(r)):r.destination=pN,r}return pt(t,e),t.create=function(e,t,r){return new pA(e,t,r)},t.prototype.next=function(e){this.isStopped?pO(pS("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?pO(pS("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?pO(pw,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ph),pk=Function.prototype.bind;function pI(e,t){return pk.call(e,t)}var px=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){pT(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){pT(e)}else pT(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){pT(e)}},e}(),pA=function(e){function t(t,r,n){var i,a,s=e.call(this)||this;return h7(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:i=t,s.destination=new px(i),s}return pt(t,e),t}(pC);function pT(e){1;pv(e)}function pO(e,t){}var pN={closed:!0,next:pb,error:function(e){throw e},complete:pb},pR="function"==typeof Symbol&&Symbol.observable||"@@observable";function pD(e){return e}function pP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pM(e)}function pM(e){return 0===e.length?pD:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var pj=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this,i=!function(e){return e&&e instanceof pC||e&&h7(e.next)&&h7(e.error)&&h7(e.complete)&&pf(e)}(e)?new pA(e,t,r):e;return p_(function(){var e=n.operator,t=n.source;i.add(e?e.call(i,t):t?n._subscribe(i):n._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=pF(t))(function(t,n){var i=new pA({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},e.prototype[pR]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pM(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=pF(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function pF(e){var t;return null!=(t=null!=e?e:pm)?t:Promise}function pL(e){return Symbol.asyncIterator&&h7(null==e?void 0:e[Symbol.asyncIterator])}function pq(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invali
135d object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var p$="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function pU(e){return h7(null==e?void 0:e[p$])}function pV(e){return function(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),a=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){i[e]&&(n[e]=function(t){return new Promise(function(r,n){a.push([e,t,r,n])>1||o(e,t)})},t&&(n[e]=t(n[e])))}function o(e,t){try{var r;(r=i[e](t)).value instanceof ps?Promise.resolve(r.value.v).then(l,u):c(a[0][2],r)}catch(e){c(a[0][3],e)}}function l(e){o("next",e)}function u(e){o("throw",e)}function c(e,t){e(t),a.shift(),a.length&&o(a[0][0],a[0][1])}}(this,arguments,function(){var t,r,n;return pr(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,ps(t.read())];case 3:if(n=(r=i.sent()).value,!r.done)return[3,5];return[4,ps(void 0)];case 4:return[2,i.sent()];case 5:return[4,ps(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function pz(e){return h7(null==e?void 0:e.getReader)}function pG(e){if(e instanceof pj)return e;if(null!=e){var t,r,n,i;if(h7(e[pR])){return t=e,new pj(function(e){var r=t[pR]();if(h7(r.subscribe))return r.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")})}if(po(e)){return r=e,new pj(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}if(pl(e)){return n=e,new pj(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,pv)})}if(pL(e))return pB(e);if(pU(e)){return i=e,new pj(function(e){var t,r;try{for(var n=pn(i),a=n.next();!a.done;a=n.next()){var s=a.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e.complete()})}if(pz(e))return pB(pV(e))}throw pq(e)}function pB(e){return new pj(function(t){(function(e,t){var r,n,i,a,s,o,l,u;return s=this,o=void 0,l=void 0,u=function(){var s;return pr(this,function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),r=function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=pn(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){var a,s,o;a=n,s=i,o=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){a({value:e,done:o})},s)})}}}(e),o.label=1;case 1:return[4,r.next()];case 2:if((n=o.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i={error:o.sent()},[3,11];case 6:if(o.trys.push([6,,9,10]),!(n&&!n.done&&(a=r.return)))return[3,8];return[4,a.call(r)];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})},new(l||(l=Promise))(function(e,t){function r(e){try{i(u.next(e))}catch(e){t(e)}}function n(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):((i=t.value)instanceof l?i:new l(function(e){e(i)})).then(r,n)}i((u=u.apply(s,o||[])).next())})})(e,t).catch(function(e){return t.error(e)})})}function pQ(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var a=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!i)return a}function pH(e){return function(t){if(h7(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}function pZ(e,t,r,n,i){return new pK(e,t,r,n,i)}var pK=function(e){function t(t,r,n,i,a,s){var o=e.call(this,t)||this;return o.onFinalize=a,o.shouldUnsubscribe=s,o._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return pt(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),r||null==(t=this.onFinalize)||t.call(this)}},t}(pC);function pY(e,t){return void 0===t&&(t=0),pH(function(r,n){r.subscribe(pZ(n,function(r){return pQ(n,e,function(){return n.next(r)},t)},function(){return pQ(n,e,function(){return n.complete()},t)},function(r){return pQ(n,e,function(){return n.error(r)},t)}
135))})}function pW(e,t){return void 0===t&&(t=0),pH(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function pJ(e,t){if(!e)throw Error("Iterable cannot be null");return new pj(function(r){pQ(r,t,function(){var n=e[Symbol.asyncIterator]();pQ(r,t,function(){n.next().then(function(e){e.done?r.complete():r.next(e.value)})},0,!0)})})}function pX(e,t){return t?function(e,t){if(null!=e){if(h7(e[pR]))return pG(e).pipe(pW(t),pY(t));if(po(e))return new pj(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})});if(pl(e))return pG(e).pipe(pW(t),pY(t));if(pL(e))return pJ(e,t);if(pU(e))return new pj(function(r){var n;return pQ(r,t,function(){n=e[p$](),pQ(r,t,function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){r.error(e);return}i?r.complete():r.next(t)},0,!0)}),function(){return h7(null==n?void 0:n.return)&&n.return()}});if(pz(e))return pJ(pV(e),t)}throw pq(e)}(e,t):pG(e)}function p0(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=(e=t[t.length-1])&&h7(e.schedule)?t.pop():void 0;return pX(t,n)}var p1=new pj(function(e){return e.complete()});function p2(e,t){var r=h7(e)?e:function(){return e},n=function(e){return e.error(r())};return new pj(t?function(e){return t.schedule(n,0,e)}:n)}function p3(e){return new pj(function(t){pG(e()).subscribe(t)})}var p5=pu(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),p4=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return pt(t,e),t.prototype.lift=function(e){var t=new p6(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new p5},t.prototype.next=function(e){var t=this;p_(function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=pn(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;p_(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;p_(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,i=this.observers;return r||n?pp:(this.currentObservers=null,i.push(e),new ph(function(){t.currentObservers=null,pd(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new pj;return e.source=this,e},t.create=function(e,t){return new p6(e,t)},t}(pj),p6=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return pt(t,e),t.prototype.next=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.next)||r.call(t,e)},t.prototype.error=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.error)||r.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!=(r=null==(t=this.source)?void 0:t.subscribe(e))?r:pp},t}(p4),p9={now:function(){return(p9.delegate||Date).now()},delegate:void 0},p8=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=p9);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return pt(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,i=this._infiniteTimeWindow,a=this._timestampProvider,s=this._windowTime;!r&&(n.push(t),i||n.push(a.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){for(var a=t.now(),s=0,o=1;o<r.length&&r[o]<=a;o+=2)s=o;s&&r.splice(0,s+1)}},t}(p4);function p7(e,t){return pH(function(r,n){var i=0;r.subscribe(pZ(n,function(r){n.next(e.call(t,r,i++))}))})}function fe(e,t,r){return(void 0===r&&(r=1/0),h7(t))?fe(function(r,n){return p7(function(e,i){return t(r,e,n,i)})(pG(e(r,n)))},r):("number"==typeof t&&(r=t),pH(function(t,n){var i,a,s,o,l,u,c,d;return i=r,a=[],s=0,o=0,l=!1,u=function(){!l||a.length||s||n.complete()},c=function(e){return s<i?d(e):a.push(e)},d=function(t){s++;var r=!1;pG(e(t,o++)).subscribe(pZ(n,function(e){n.next(e)},function(){r=!0},void 0,function(){if(r)try{for(s--;a.length&&s<i;)!function(){var e=a.shift();d(e)}();u()}catch(e){n.error(e)}}))},t.subscribe(pZ(n,c,function(){l=!0,u()})),function(){}}))}function ft(e){return pH(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}var fr=pu(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function fn(e,t){var r="object"==typeof t;return new Promise(function(n,i){var a,s=!1;e.subscribe({next:function(e){a=e,s=!0},error:i,complete:function(){s?n(a):r?n(t.defaultValue):i(new fr)}})})}function fi(e,t){return h7(t)?fe(e,t,1):fe(e,1)}function fa(e){return pH(function(t,r){pG(e).subscribe(pZ(r,function(){return r.complete()},pb)),r.closed||t.subscribe(r)})}function fs(e){return pH(function(t,r){var n,i=null,a=!1;i=t.subscribe(pZ(r,void 0,void 0,function(s){n=pG(e(s,fs(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):a=!0})),a&&(i.unsubscribe(),i=null,n.subscribe(r))})}function fo(e){return" \r\n ".indexOf(e)>=0}function fl(e){for(var t,r,n,i=["topLevel"],a=0,s=function(e){return i.push(e)},o=function(e){return i[i.length-1]=e},l=function(e){null==t&&(t=a,r=i.length,n=e)},u=function(e){e===n&&(t=void 0,r=void 0,n=void 0)},c=function(){return i.pop()},d=function(){return a--},h=function(e){if("0"<=e&&e<="9")return void s("number");switch(e){case'"':s("string");return;case"-":s("numberNeedsDigit");return;case"t":s("true");return;case"f":s("false");return;case"n":s("null");return;case"[":s("arrayNeedsValue");return;case"{":s("objectNeedsKey");return}},p=e.length;a<p;a++){var f=e[a];switch(i[i.length-1]){case"topLevel":h(f);break;case"string":switch(f){case'"':c();break;case"\\":l("stringEscape"),s("stringEscaped")}break;case"stringEscaped":"u"===f?s("stringUnicode"):(u("stringEscape"),c());break;case"stringUnicode":a-e.lastIndexOf("u",a)==4&&(u("stringEscape"),c());break;case"number":"."===f?o("numberNeedsDigit"):"e"===f||"E"===f?o("numberNeedsExponent"):(f<"0"||f>"9")&&(d(),c());break;case"numberNeedsDigit":o("number");break;case"numberNeedsExponent":o("+"===f||"-"===f?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(f<"a"||f>"z")&&(d(),c());break;case"arrayNeedsValue":"]"===f?c():fo(f)||(u("collectionItem"),o("arrayNeedsComma"),h(f));break;case"arrayNeedsComma":"]"===f?c():","===f&&(l("collectionItem"),o("arrayNeedsValue"));break;case"objectNeedsKey":"}"===f?c():'"'===f&&(l("collectionItem"),o("objectNeedsColon"),s("string"));break;case"objectNeedsColon":":"===f&&o("objectNeedsValue");break;case"objectNeedsValue":fo(f)||(u("collectionItem"),o("objectNeedsComma"),h(f));break;case"objectNeedsComma":"}"===f?c():","===f&&(l("collectionItem"),o("objectNeedsKey"))}}null!=r&&(i.length=r);for(var g=[null!=t?e.slice(0,t):e],m=function(t){return g.push(t.slice(e.length-e.lastIndexOf(t[0])))},y=i.length-1;y>=0;y--)switch(i[y]){case"string":g.push('"');break;case"numberNeedsDigit":case"numberNeedsExponent":g.push("0");break;case"true":m("true");break;case"false":m("false");break;case"null":m("null");break;case"arrayNeedsValue":case"arrayNeedsComma":g.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":g.push("}")}return g.join("")}function fu(){let e=0,t=0;for(let r=0;r<28;r+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<r,(128&n)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(15&r)<<28,t=(112&r)>>4,(128&r)==0)return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<r,(128&n)==0)return this.assertBounds(),[e,t]}throw Error("invalid varint")}function fc(e,t,r){for(let n=0;n<28;n+=7){let i=e>>>n,a=i>>>7!=0||0!=t,s=(a?128|i:i)&255;if(r.push(s),!a)return}let n=e>>>28&15|(7&t)<<4,i=t>>3!=0;if(r.push((i?128|n:n)&255),i){for(let e=3;e<31;e+=7){let n=t>>>e,i=n>>>7!=0,a=(i?128|n:n)&255;if(r.push(a),!i)return}r.push(t>>>31&1)}}function fd(e){let t="-"===e[0];t&&(e=e.slice(1));let r=0,n=0;function i(t,i){let a=Number(e.slice(t,i));n*=1e6,(r=1e6*r+a)>=0x100000000&&(n+=r/0x100000000|0,r%=0x100000000)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?ff(r,n):fp(r,n)}function fh(e,t){if({lo:e,hi:t}={lo:e>>>0,hi:t>>>0},t<=2097151)return String(0x100000000*t+e);let r=0xffffff&e,n=(e>>>24|t<<8)&0xffffff,i=t>>16&65535,a=r+6777216*n+6710656*i,s=n+8147497*i,o=2*i;return a>=1e7&&(s+=Math.floor(a/1e7),a%=1e7),s>=1e7&&(o+=Math.floor(s/1e7),s%=1e7),o.toString()+fg(s)+fg(a)}function fp(e,t){return{lo:0|e,hi:0|t}}function ff(e,t){return t=~t,e?e=~e+1:t+=1,fp(e,t)}let fg=e=>{let t=String(e);return"0000000".slice(t.length)+t};function fm(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let r=0;r<9;r++)t.push(127&e|128),e>>=7;t.push(1)}}function fy(){let e=this.buf[this.pos++],t=127&e;if((128&e)==0||(t|=(127&(e=this.buf[this.pos++]))<<7,(128&e)==0)||(t|=(127&(e=this.buf[this.pos++]))<<14,(128&e)==0)||(t|=(127&(e=this.buf[this.pos++]))<<21,(128&e)==0))return this.assertBounds(),t;
135t|=(15&(e=this.buf[this.pos++]))<<28;for(let t=5;(128&e)!=0&&t<10;t++)e=this.buf[this.pos++];if((128&e)!=0)throw Error("invalid varint");return this.assertBounds(),t>>>0}var fv=r(41463);let fb=function(){let e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&(globalThis.Deno||"object"!=typeof fv||"object"!=typeof fv.env||"1"!==fv.env.BUF_BIGINT_DISABLE)){let t=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),n=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){let n="bigint"==typeof e?e:BigInt(e);if(n>r||n<t)throw Error(`invalid int64: ${e}`);return n},uParse(e){let t="bigint"==typeof e?e:BigInt(e);if(t>i||t<n)throw Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,r)=>(e.setInt32(0,t,!0),e.setInt32(4,r,!0),e.getBigInt64(0,!0)),uDec:(t,r)=>(e.setInt32(0,t,!0),e.setInt32(4,r,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),fw(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),fS(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),fw(e),fd(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),fS(e),fd(e)),dec:(e,t)=>{let r,n,i;return(n=0x80000000&(r=fp(e,t)).hi)&&(r=ff(r.lo,r.hi)),i=fh(r.lo,r.hi),n?"-"+i:i},uDec:(e,t)=>fh(e,t)}}();function fw(e){if(!/^-?[0-9]+$/.test(e))throw Error("invalid int64: "+e)}function fS(e){if(!/^[0-9]+$/.test(e))throw Error("invalid uint64: "+e)}let fE=Symbol.for("@bufbuild/protobuf/text-encoding");function f_(){if(void 0==globalThis[fE]){let e,t=new globalThis.TextEncoder,r=new globalThis.TextDecoder;globalThis[fE]={encodeUtf8:e=>t.encode(e),decodeUtf8:(t,n)=>n?(void 0===e&&(e=new globalThis.TextDecoder("utf-8",{fatal:!0})),e.decode(t)):r.decode(t),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(e){return!1}}}}return globalThis[fE]}(I=Y||(Y={}))[I.Varint=0]="Varint",I[I.Bit64=1]="Bit64",I[I.LengthDelimited=2]="LengthDelimited",I[I.StartGroup=3]="StartGroup",I[I.EndGroup=4]="EndGroup",I[I.Bit32=5]="Bit32";class fC{constructor(e=f_().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;let t=new Uint8Array(e),r=0;for(let e=0;e<this.chunks.length;e++)t.set(this.chunks[e],r),r+=this.chunks[e].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(fx(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return fI(e),fm(e,this.buf),this}bool(e){return this.buf.push(+!!e),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){var t=e;if("string"==typeof t){let e=t;if(Number.isNaN(t=Number(t))&&"NaN"!==e)throw Error("invalid float32: "+e)}else if("number"!=typeof t)throw Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>34028234663852886e22||t<-34028234663852886e22))throw Error("invalid float32: "+t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,e,!0),this.raw(r)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){fx(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){fI(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return fI(e),fm(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),n=fb.enc(e);return r.setInt32(0,n.lo,!0),r.setInt32(4,n.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),n=fb.uEnc(e);return r.setInt32(0,n.lo,!0),r.setInt32(4,n.hi,!0),this.raw(t)}int64(e){let t=fb.enc(e);return fc(t.lo,t.hi,this.buf),this}sint64(e){let t=fb.enc(e),r=t.hi>>31;return fc(t.lo<<1^r,(t.hi<<1|t.lo>>>31)^r,this.buf),this}uint64(e){let t=fb.uEnc(e);return fc(t.lo,t.hi,this.buf),this}}class fk{constructor(e,t=f_().decodeUtf8){this.decodeUtf8=t,this.varint64=fu,this.uint32=fy,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),r=this.pos-e;if(r>5||5==r&&this.buf[this.pos-1]>15)throw Error("illegal tag: varint overflows uint32");let n=t>>>3,i=7&t;if(n<=0||i>5)throw Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(e,t){let r=this.pos;switch(e){case Y.Varint:for(;128&this.buf[this.pos++];);break;case Y.Bit64:this.pos+=4;case Y.Bit32:this.pos+=4;break;case Y.LengthDelimited:let n=this.uint32();this.pos+=n;break;case Y.StartGroup:for(;;){let[e,r]=this.tag();if(r===Y.EndGroup){if(void 0!==t&&e!==t)throw Error("invalid end group tag");break}this.skip(r,e)}break;default:throw Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return fb.dec(...this.varint64())}uint64(){return fb.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(1&e);return e=(e>>>1|(1&t)<<31)^r,t=t>>>1^r,fb.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return fb.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return fb.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){return this.decodeUtf8(this.bytes(),e)}}function fI(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>0x7fffffff||e<-0x80000000)throw Error("invalid int32: "+e)}function fx(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>0xffffffff||e<0)throw Error("invalid uint32: "+e)}let fA=((x={})[x.NULL_VALUE=0]="NULL_VALUE",x[x.UNRECOGNIZED=-1]="UNRECOGNIZED",x);function fT(){return{fields:{}}}let fO={encode:(e,t=new fC)=>
135(Object.entries(e.fields).forEach(([e,r])=>{void 0!==r&&fR.encode({key:e,value:r},t.uint32(10).fork()).join()}),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fT();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:{if(10!==e)break;let t=fR.decode(r,r.uint32());void 0!==t.value&&(i.fields[t.key]=t.value);continue}}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fO.fromPartial(e??{}),fromPartial(e){let t=fT();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,r])=>(void 0!==r&&(e[t]=r),e),{}),t},wrap(e){let t=fT();if(void 0!==e)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function fN(){return{key:"",value:void 0}}let fR={encode:(e,t=new fC)=>(""!==e.key&&t.uint32(10).string(e.key),void 0!==e.value&&fP.encode(fP.wrap(e.value),t.uint32(18).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fN();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.key=r.string();continue;case 2:if(18!==e)break;i.value=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fR.fromPartial(e??{}),fromPartial(e){let t=fN();return t.key=e.key??"",t.value=e.value??void 0,t}};function fD(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}let fP={encode:(e,t=new fC)=>(void 0!==e.nullValue&&t.uint32(8).int32(e.nullValue),void 0!==e.numberValue&&t.uint32(17).double(e.numberValue),void 0!==e.stringValue&&t.uint32(26).string(e.stringValue),void 0!==e.boolValue&&t.uint32(32).bool(e.boolValue),void 0!==e.structValue&&fO.encode(fO.wrap(e.structValue),t.uint32(42).fork()).join(),void 0!==e.listValue&&fj.encode(fj.wrap(e.listValue),t.uint32(50).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fD();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(8!==e)break;i.nullValue=r.int32();continue;case 2:if(17!==e)break;i.numberValue=r.double();continue;case 3:if(26!==e)break;
135i.stringValue=r.string();continue;case 4:if(32!==e)break;i.boolValue=r.bool();continue;case 5:if(42!==e)break;i.structValue=fO.unwrap(fO.decode(r,r.uint32()));continue;case 6:if(50!==e)break;i.listValue=fj.unwrap(fj.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fP.fromPartial(e??{}),fromPartial(e){let t=fD();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=fD();if(null===e)t.nullValue=fA.NULL_VALUE;else if("boolean"==typeof e)t.boolValue=e;else if("number"==typeof e)t.numberValue=e;else if("string"==typeof e)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if("object"==typeof e)t.structValue=e;else if(void 0!==e)throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(void 0!==e.stringValue)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;else if(e?.nullValue!==void 0)return null}};function fM(){return{values:[]}}let fj={encode(e,t=new fC){for(let r of e.values)fP.encode(fP.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fM();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.values.push(fP.unwrap(fP.decode(r,r.uint32())));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fj.fromPartial(e??{}),fromPartial(e){let t=fM();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=fM();return t.values=e??[],t},unwrap:e=>e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e},fF=((A={})[A.ADD=0]="ADD",A[A.REMOVE=1]="REMOVE",A[A.REPLACE=2]="REPLACE",A[A.MOVE=3]="MOVE",A[A.COPY=4]="COPY",A[A.TEST=5]="TEST",A[A.UNRECOGNIZED=-1]="UNRECOGNIZED",A);function fL(){return{op:0,path:"",from:void 0,value:void 0}}let fq={encode:(e,t=new fC)=>(0!==e.op&&t.uint32(8).int32(e.op),""!==e.path&&t.uint32(18).string(e.path),void 0!==e.from&&t.uint32(26).string(e.from),void 0!==e.value&&fP.encode(fP.wrap(e.value),t.uint32(34).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fL();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(8!==e)break;i.op=r.int32();continue;case 2:if(18!==e)break;i.path=r.string();continue;case 3:if(26!==e)break;i.from=r.string();continue;case 4:if(34!==e)break;i.value=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fq.fromPartial(e??{}),fromPartial(e){let t=fL();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function f$(){return{id:"",type:"",function:void 0}}let fU={encode:(e,t=new fC)=>(""!==e.id&&t.uint32(10).string(e.id),""!==e.type&&t.uint32(18).string(e.type),void 0!==e.function&&fz.encode(e.function,t.uint32(26).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=f$();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.id=r.string();continue;case 2:if(18!==e)break;i.type=r.string();continue;case 3:if(26!==e)break;i.function=fz.decode(r,r.uint32());continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fU.fromPartial(e??{}),fromPartial(e){let t=f$();return t.id=e.id??"",t.type=e.type??"",t.function=void 0!==e.function&&null!==e.function?fz.fromPartial(e.function):void 0,t}};function fV(){return{name:"",arguments:""}}let fz={encode:(e,t=new fC)=>(""!==e.name&&t.uint32(10).string(e.name),""!==e.arguments&&t.uint32(18).string(e.arguments),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fV();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.name=r.string();continue;case 2:if(18!==e)break;i.arguments=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fz.fromPartial(e??{}),fromPartial(e){let t=fV();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function fG(){return{value:"",mimeType:""}}let fB={encode:(e,t=new fC)=>(""!==e.value&&t.uint32(10).string(e.value),""!==e.mimeType&&t.uint32(18).string(e.mimeType),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fG();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.value=r.string();continue;case 2:if(18!==e)break;i.mimeType=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fB.fromPartial(e??{}),fromPartial(e){let t=fG();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function fQ(){return{value:"",mimeType:void 0}}let fH={encode:(e,t=new fC)=>(""!==e.value&&t.uint32(10).string(e.value),void 0!==e.mimeType&&t.uint32(18).string(e.mimeType),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fQ();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.value=r.string();continue;case 2:if(18!==e)break;i.mimeType=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fH.fromPartial(e??{}),fromPartial(e){let t=fQ();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function fZ(){return{data:void 0,url:void 0}}let fK={encode:(e,t=new fC)=>(void 0!==e.data&&fB.encode(e.data,t.uint32(10).fork()).join(),void 0!==e.url&&fH.encode(e.url,t.uint32(18).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fZ();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.data=fB.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.url=fH.decode(r,r.uint32());continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fK.fromPartial(e??{}),fromPartial(e){let t=fZ();return t.data=void 0!==e.data&&null!==e.data?fB.fromPartial(e.data):void 0,t.url=void 0!==e.url&&null!==e.url?fH.fromPartial(e.url):void 0,t}},fY={encode:(e,t=new fC)=>(""!==e.text&&t.uint32(10).string(e.text),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i={text:""};for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.text=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fY.fromPartial(e??{}),fromPartial(e){let t={text:""};return t.text=e.text??"",t}};function fW(){return{source:void 0,metadata:void 0}}let fJ={encode:(e,t=new fC)=>(void 0!==e.source&&fK.encode(e.source,t.uint32(10).fork()).join(),void 0!==e.metadata&&fP.encode(fP.wrap(e.metadata),t.uint32(18).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fW();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.source=fK.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.metadata=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>fJ.fromPartial(e??{}),fromPartial(e){let t=fW();return t.source=void 0!==e.source&&null!==e.source?fK.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function fX(){return{source:void 0,metadata:void 0}}let f0={encode:(e,t=new fC)=>(void 0!==e.source&&fK.encode(e.source,t.uint32(10).fork()).join(),void 0!==e.metadata&&fP.encode(fP.wrap(e.metadata),t.uint32(18).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=fX();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.source=fK.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.metadata=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>f0.fromPartial(e??{}),fromPartial(e){let t=fX();return t.source=void 0!==e.source&&null!==e.source?fK.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function f1(){return{source:void 0,metadata:void 0}}
135let f2={encode:(e,t=new fC)=>(void 0!==e.source&&fK.encode(e.source,t.uint32(10).fork()).join(),void 0!==e.metadata&&fP.encode(fP.wrap(e.metadata),t.uint32(18).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=f1();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.source=fK.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.metadata=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>f2.fromPartial(e??{}),fromPartial(e){let t=f1();return t.source=void 0!==e.source&&null!==e.source?fK.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function f3(){return{source:void 0,metadata:void 0}}let f5={encode:(e,t=new fC)=>(void 0!==e.source&&fK.encode(e.source,t.uint32(10).fork()).join(),void 0!==e.metadata&&fP.encode(fP.wrap(e.metadata),t.uint32(18).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=f3();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.source=fK.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.metadata=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>f5.fromPartial(e??{}),fromPartial(e){let t=f3();return t.source=void 0!==e.source&&null!==e.source?fK.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function f4(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}let f6={encode:(e,t=new fC)=>(void 0!==e.text&&fY.encode(e.text,t.uint32(10).fork()).join(),void 0!==e.image&&fJ.encode(e.image,t.uint32(18).fork()).join(),void 0!==e.audio&&f0.encode(e.audio,t.uint32(26).fork()).join(),void 0!==e.video&&f2.encode(e.video,t.uint32(34).fork()).join(),void 0!==e.document&&f5.encode(e.document,t.uint32(42).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=f4();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.text=fY.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.image=fJ.decode(r,r.uint32());continue;case 3:if(26!==e)break;i.audio=f0.decode(r,r.uint32());continue;case 4:if(34!==e)break;i.video=f2.decode(r,r.uint32());continue;case 5:if(42!==e)break;i.document=f5.decode(r,r.uint32());continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>f6.fromPartial(e??{}),fromPartial(e){let t=f4();return t.text=void 0!==e.text&&null!==e.text?fY.fromPartial(e.text):void 0,t.image=void 0!==e.image&&null!==e.image?fJ.fromPartial(e.image):void 0,t.audio=void 0!==e.audio&&null!==e.audio?f0.fromPartial(e.audio):void 0,t.video=void 0!==e.video&&null!==e.video?f2.fromPartial(e.video):void 0,t.document=void 0!==e.document&&null!==e.document?f5.fromPartial(e.document):void 0,t}};function f9(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}let f8={encode(e,t=new fC){for(let r of(""!==e.id&&t.uint32(10).string(e.id),""!==e.role&&t.uint32(18).string(e.role),void 0!==e.content&&t.uint32(26).string(e.content),void 0!==e.name&&t.uint32(34).string(e.name),e.toolCalls))fU.encode(r,t.uint32(42).fork()).join();for(let r of(void 0!==e.toolCallId&&t.uint32(50).string(e.toolCallId),void 0!==e.error&&t.uint32(58).string(e.error),e.contentParts))f6.encode(r,t.uint32(66).fork()).join();return t},decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=f9();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.id=r.string();continue;case 2:if(18!==e)break;i.role=r.string();continue;case 3:if(26!==e)break;i.content=r.string();continue;case 4:if(34!==e)break;i.name=r.string();continue;case 5:if(42!==e)break;i.toolCalls.push(fU.decode(r,r.uint32()));continue;case 6:if(50!==e)break;i.toolCallId=r.string();continue;case 7:if(58!==e)break;i.error=r.string();continue;case 8:if(66!==e)break;i.contentParts.push(f6.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>f8.fromPartial(e??{}),fromPartial(e){let t=f9();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>fU.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>f6.fromPartial(e))||[],t}},f7=((T={})[T.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",T[T.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",T[T.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",T[T.TOOL_CALL_START=3]="TOOL_CALL_START",T[T.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",T[T.TOOL_CALL_END=5]="TOOL_CALL_END",T[T.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",T[T.STATE_DELTA=7]="STATE_DELTA",T[T.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",T[T.RAW=9]="RAW",T[T.CUSTOM=10]="CUSTOM",T[T.RUN_STARTED=11]="RUN_STARTED",T[T.RUN_FINISHED=12]="RUN_FINISHED",T[T.RUN_ERROR=13]="RUN_ERROR",T[T.STEP_STARTED=14]="STEP_STARTED",T[T.STEP_FINISHED=15]="STEP_FINISHED",T[T.UNRECOGNIZED=-1]="UNRECOGNIZED",T);function ge(){return{type:0,timestamp:void 0,rawEvent:void 0}}let gt={encode:(e,t=new fC)=>(0!==e.type&&t.uint32(8).int32(e.type),void 0!==e.timestamp&&t.uint32(16).int64(e.timestamp),void 0!==e.rawEvent&&fP.encode(fP.wrap(e.rawEvent),t.uint32(26).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=ge();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(8!==e)break;i.type=r.int32();continue;case 2:if(16!==e)break;i.timestamp=function(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}(r.int64());continue;case 3:if(26!==e)break;i.rawEvent=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gt.fromPartial(e??{}),fromPartial(e){let t=ge();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function gr(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}let gn={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.messageId&&t.uint32(18).string(e.messageId),void 0!==e.role&&t.uint32(26).string(e.role),void 0!==e.name&&t.uint32(34).string(e.name),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gr();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.messageId=r.string();continue;case 3:if(26!==e)break;i.role=r.string();continue;case 4:if(34!==e)break;i.name=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gn.fromPartial(e??{}),fromPartial(e){let t=gr();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function gi(){return{baseEvent:void 0,messageId:"",delta:""}}let ga={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.messageId&&t.uint32(18).string(e.messageId),""!==e.delta&&t.uint32(26).string(e.delta),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gi();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.messageId=r.string();continue;case 3:if(26!==e)break;i.delta=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>ga.fromPartial(e??{}),fromPartial(e){let t=gi();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function gs(){return{baseEvent:void 0,messageId:""}}let go={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.messageId&&t.uint32(18).string(e.messageId),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gs();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.messageId=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>go.fromPartial(e??{}),fromPartial(e){let t=gs();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function gl(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}let gu={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.toolCallId&&t.uint32(18).string(e.toolCallId),""!==e.toolCallName&&t.uint32(26).string(e.toolCallName),void 0!==e.parentMessageId&&t.uint32(34).string(e.parentMessageId),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gl();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.toolCallId=r.string();continue;case 3:if(26!==e)break;i.toolCallName=r.string();continue;case 4:if(34!==e)break;i.parentMessageId=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gu.fromPartial(e??{}),fromPartial(e){let t=gl();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function gc(){return{baseEvent:void 0,toolCallId:"",delta:""}}let gd={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.toolCallId&&t.uint32(18).string(e.toolCallId),""!==e.delta&&t.uint32(26).string(e.delta),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gc();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.toolCallId=r.string();continue;case 3:if(26!==e)break;i.delta=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gd.fromPartial(e??{}),fromPartial(e){let t=gc();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function gh(){return{baseEvent:void 0,toolCallId:""}}let gp={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.toolCallId&&t.uint32(18).string(e.toolCallId),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gh();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.toolCallId=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gp.fromPartial(e??{}),fromPartial(e){let t=gh();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function gf(){return{baseEvent:void 0,snapshot:void 0}}let gg={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),void 0!==e.snapshot&&fP.encode(fP.wrap(e.snapshot),t.uint32(18).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gf();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.snapshot=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gg.fromPartial(e??{}),fromPartial(e){let t=gf();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function gm(){return{baseEvent:void 0,delta:[]}}let gy={encode(e,t=new fC){for(let r of(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),e.delta))fq.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gm();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.delta.push(fq.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gy.fromPartial(e??{}),fromPartial(e){let t=gm();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>fq.fromPartial(e))||[],t}};
135function gv(){return{baseEvent:void 0,messages:[]}}let gb={encode(e,t=new fC){for(let r of(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messages))f8.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gv();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.messages.push(f8.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gb.fromPartial(e??{}),fromPartial(e){let t=gv();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>f8.fromPartial(e))||[],t}};function gw(){return{baseEvent:void 0,event:void 0,source:void 0}}let gS={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),void 0!==e.event&&fP.encode(fP.wrap(e.event),t.uint32(18).fork()).join(),void 0!==e.source&&t.uint32(26).string(e.source),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gw();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.event=fP.unwrap(fP.decode(r,r.uint32()));continue;case 3:if(26!==e)break;i.source=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gS.fromPartial(e??{}),fromPartial(e){let t=gw();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function gE(){return{baseEvent:void 0,name:"",value:void 0}}let g_={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.name&&t.uint32(18).string(e.name),void 0!==e.value&&fP.encode(fP.wrap(e.value),t.uint32(26).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gE();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.name=r.string();continue;case 3:if(26!==e)break;i.value=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>g_.fromPartial(e??{}),fromPartial(e){let t=gE();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function gC(){return{baseEvent:void 0,threadId:"",runId:""}}let gk={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.threadId&&t.uint32(18).string(e.threadId),""!==e.runId&&t.uint32(26).string(e.runId),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gC();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.threadId=r.string();continue;case 3:if(26!==e)break;i.runId=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gk.fromPartial(e??{}),fromPartial(e){let t=gC();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function gI(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}let gx={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.threadId&&t.uint32(18).string(e.threadId),""!==e.runId&&t.uint32(26).string(e.runId),void 0!==e.result&&fP.encode(fP.wrap(e.result),t.uint32(34).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gI();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.threadId=r.string();continue;case 3:if(26!==e)break;i.runId=r.string();continue;case 4:if(34!==e)break;i.result=fP.unwrap(fP.decode(r,r.uint32()));continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gx.fromPartial(e??{}),fromPartial(e){let t=gI();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function gA(){return{baseEvent:void 0,code:void 0,message:""}}let gT={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),void 0!==e.code&&t.uint32(18).string(e.code),""!==e.message&&t.uint32(26).string(e.message),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gA();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.code=r.string();continue;case 3:if(26!==e)break;i.message=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gT.fromPartial(e??{}),fromPartial(e){let t=gA();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function gO(){return{baseEvent:void 0,stepName:""}}let gN={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.stepName&&t.uint32(18).string(e.stepName),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gO();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.stepName=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gN.fromPartial(e??{}),fromPartial(e){let t=gO();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function gR(){return{baseEvent:void 0,stepName:""}}let gD={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),""!==e.stepName&&t.uint32(18).string(e.stepName),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gR();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.stepName=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gD.fromPartial(e??{}),fromPartial(e){let t=gR();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function gP(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}let gM={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),void 0!==e.messageId&&t.uint32(18).string(e.messageId),void 0!==e.role&&t.uint32(26).string(e.role),void 0!==e.delta&&t.uint32(34).string(e.delta),void 0!==e.name&&t.uint32(42).string(e.name),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gP();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.messageId=r.string();continue;case 3:if(26!==e)break;i.role=r.string();continue;case 4:if(34!==e)break;i.delta=r.string();continue;case 5:if(42!==e)break;i.name=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gM.fromPartial(e??{}),fromPartial(e){let t=gP();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t}};function gj(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}let gF={encode:(e,t=new fC)=>(void 0!==e.baseEvent&>.encode(e.baseEvent,t.uint32(10).fork()).join(),void 0!==e.toolCallId&&t.uint32(18).string(e.toolCallId),void 0!==e.toolCallName&&t.uint32(26).string(e.toolCallName),void 0!==e.parentMessageId&&t.uint32(34).string(e.parentMessageId),void 0!==e.delta&&t.uint32(42).string(e.delta),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gj();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.baseEvent=gt.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.toolCallId=r.string();continue;case 3:if(26!==e)break;i.toolCallName=r.string();continue;case 4:if(34!==e)break;i.parentMessageId=r.string();continue;case 5:if(42!==e)break;i.delta=r.string();continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gF.fromPartial(e??{}),fromPartial(e){let t=gj();return t.baseEvent=void 0!==e.baseEvent&&null!==e.baseEvent?gt.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function gL(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}let gq={encode:(e,t=new fC)=>(void 0!==e.textMessageStart&&gn.encode(e.textMessageStart,t.uint32(10).fork()).join(),void 0!==e.textMessageContent&&ga.encode(e.textMessageContent,t.uint32(18).fork()).join(),void 0!==e.textMessageEnd&&go.encode(e.textMessageEnd,t.uint32(26).fork()).join(),void 0!==e.toolCallStart&&gu.encode(e.toolCallStart,t.uint32(34).fork()).join(),void 0!==e.toolCallArgs&&gd.encode(e.toolCallArgs,t.uint32(42).fork()).join(),void 0!==e.toolCallEnd&&gp.encode(e.toolCallEnd,t.uint32(50).fork()).join(),void 0!==e.stateSnapshot&&gg.encode(e.stateSnapshot,t.uint32(58).fork()).join(),void 0!==e.stateDelta&&gy.encode(e.stateDelta,t.uint32(66).fork()).join(),void 0!==e.messagesSnapshot&&gb.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),void 0!==e.raw&&gS.encode(e.raw,t.uint32(82).fork()).join(),void 0!==e.custom&&g_.encode(e.custom,t.uint32(90).fork()).join(),void 0!==e.runStarted&&gk.encode(e.runStarted,t.uint32(98).fork()).join(),void 0!==e.runFinished&&gx.encode(e.runFinished,t.uint32(106).fork()).join(),void 0!==e.runError&&gT.encode(e.runError,t.uint32(114).fork()).join(),void 0!==e.stepStarted&&gN.encode(e.stepStarted,t.uint32(122).fork()).join(),void 0!==e.stepFinished&&gD.encode(e.stepFinished,t.uint32(130).fork()).join(),void 0!==e.textMessageChunk&&gM.encode(e.textMessageChunk,t.uint32(138).fork()).join(),void 0!==e.toolCallChunk&&gF.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t),decode(e,t){let r=e instanceof fk?e:new fk(e),n=void 0===t?r.len:r.pos+t,i=gL();for(;r.pos<n;){let e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.textMessageStart=gn.decode(r,r.uint32());continue;case 2:if(18!==e)break;i.textMessageContent=ga.decode(r,r.uint32());continue;case 3:if(26!==e)break;i.textMessageEnd=go.decode(r,r.uint32());continue;case 4:if(34!==e)break;i.toolCallStart=gu.decode(r,r.uint32());continue;case 5:if(42!==e)break;i.toolCallArgs=gd.decode(r,r.uint32());continue;case 6:if(50!==e)break;i.toolCallEnd=gp.decode(r,r.uint32());continue;case 7:if(58!==e)break;i.stateSnapshot=gg.decode(r,r.uint32());continue;case 8:if(66!==e)break;i.stateDelta=gy.decode(r,r.uint32());continue;case 9:if(74!==e)break;i.messagesSnapshot=gb.decode(r,r.uint32());continue;case 10:if(82!==e)break;i.raw=gS.decode(r,r.uint32());continue;case 11:if(90!==e)break;i.custom=g_.decode(r,r.uint32());continue;case 12:if(98!==e)break;i.runStarted=gk.decode(r,r.uint32());continue;case 13:if(106!==e)break;i.runFinished=gx.decode(r,r.uint32());continue;case 14:if(114!==e)break;i.runError=gT.decode(r,r.uint32());continue;case 15:if(122!==e)break;i.stepStarted=gN.decode(r,r.uint32());continue;case 16:if(130!==e)break;i.stepFinished=gD.decode(r,r.uint32());continue;case 17:if(138!==e)break;i.textMessageChunk=gM.decode(r,r.uint32());continue;case 18:if(146!==e)break;i.toolCallChunk=gF.decode(r,r.uint32());continue}if((7&e)==4||0===e)break;r.skip(7&e)}return i},create:e=>gq.fromPartial(e??{}),fromPartial(e){let t=gL();return t.textMessageStart=void 0!==e.textMessageStart&&null!==e.textMessageStart?gn.fromPartial(e.textMessageStart):void 0,t.textMessageContent=void 0!==e.textMessageContent&&null!==e.textMessageContent?ga.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=void 0!==e.textMessageEnd&&null!==e.textMessageEnd?go.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=void 0!==e.toolCallStart&&null!==e.toolCallStart?gu.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=void 0!==e.toolCallArgs&&null!==e.toolCallArgs?gd.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=void 0!==e.toolCallEnd&&null!==e.toolCallEnd?gp.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=void 0!==e.stateSnapshot&&null!==e.stateSnapshot?gg.fromPartial(e.stateSnapshot):void 0,t.stateDelta=void 0!==e.stateDelta&&null!==e.stateDelta?gy.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=void 0!==e.messagesSnapshot&&null!==e.messagesSnapshot?gb.fromPartial(e.messagesSnapshot):void 0,t.raw=void 0!==e.raw&&null!==e.raw?gS.fromPartial(e.raw):void 0,t.custom=void 0!==e.custom&&null!==e.custom?g_.fromPartial(e.custom):void 0,t.runStarted=void 0!==e.runStarted&&null!==e.runStarted?gk.fromPartial(e.runStarted):void 0,t.runFinished=void 0!==e.runFinished&&null!==e.runFinished?gx.fromPartial(e.runFinished):void 0,t.runError=void 0!==e.runError&&null!==e.runError?gT.fromPartial(e.runError):void 0,t.stepStarted=void 0!==e.stepStarted&&null!==e.stepStarted?gN.fromPartial(e.stepStarted):void 0,t.stepFinished=void 0!==e.stepFinished&&null!==e.stepFinished?gD.fromPartial(e.stepFinished):void 0,t.textMessageChunk=void 0!==e.textMessageChunk&&null!==e.textMessageChunk?gM.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=void 0!==e.toolCallChunk&&null!==e.toolCallChunk?gF.fromPartial(e.toolCallChunk):void 0,t}},g$=e=>{if(e&&"object"==typeof e){if(e.data)return{type:"data",value:e.data.value,mimeType:e.data.mimeType};if(e.url)return{type:"url",value:e.url.value,mimeType:e.url.mimeType}}},gU=e=>{if(e&&"object"==typeof e){if(e.text)return{type:"text",text:e.text.text};
135if(e.image)return{type:"image",source:g$(e.image.source),metadata:e.image.metadata};if(e.audio)return{type:"audio",source:g$(e.audio.source),metadata:e.audio.metadata};if(e.video)return{type:"video",source:g$(e.video.source),metadata:e.video.metadata};if(e.document)return{type:"document",source:g$(e.document.source),metadata:e.document.metadata}}},gV="application/vnd.ag-ui.event+proto";(O=W||(W={})).assertEqual=e=>{},O.assertIs=function(e){},O.assertNever=function(e){throw Error()},O.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},O.getValidEnumValues=e=>{let t=O.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return O.objectValues(r)},O.objectValues=e=>O.objectKeys(e).map(function(t){return e[t]}),O.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},O.find=(e,t)=>{for(let r of e)if(t(r))return r},O.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,O.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},O.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(J||(J={})).mergeShapes=(e,t)=>({...e,...t});let gz=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gG=e=>{switch(typeof e){case"undefined":return gz.undefined;case"string":return gz.string;case"number":return Number.isNaN(e)?gz.nan:gz.number;case"boolean":return gz.boolean;case"function":return gz.function;case"bigint":return gz.bigint;case"symbol":return gz.symbol;case"object":if(Array.isArray(e))return gz.array;if(null===e)return gz.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return gz.promise;if("u">typeof Map&&e instanceof Map)return gz.map;if("u">typeof Set&&e instanceof Set)return gz.set;if("u">typeof Date&&e instanceof Date)return gz.date;return gz.object;default:return gz.unknown}}
135,gB=W.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class gQ extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof gQ))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,W.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}gQ.create=e=>new gQ(e);let gH=(e,t)=>{let r;switch(e.code){case gB.invalid_type:r=e.received===gz.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case gB.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,W.jsonStringifyReplacer)}`;break;case gB.unrecognized_keys:r=`Unrecognized key(s) in object: ${W.joinValues(e.keys,", ")}`;break;case gB.invalid_union:r="Invalid input";break;case gB.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${W.joinValues(e.options)}`;break;case gB.invalid_enum_value:r=`Invalid enum value. Expected ${W.joinValues(e.options)}, received '${e.received}'`;break;case gB.invalid_arguments:r="Invalid function arguments";break;case gB.invalid_return_type:r="Invalid function return type";break;case gB.invalid_date:r="Invalid date";break;case gB.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:W.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case gB.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case gB.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case gB.custom:r="Invalid input";break;case gB.invalid_intersection_types:r="Intersection results could not be merged";break;case gB.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case gB.not_finite:r="Number must be finite";break;default:r=t.defaultError,W.assertNever(e)}return{message:r}};(N=X||(X={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},N.toString=e=>"string"==typeof e?e:e?.message;let gZ=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};if(void 0!==i.message)return{...i,path:a,message:i.message};let o="";for(let e of n.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}};function gK(e,t){let r=gZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,gH,void 0].filter(e=>!!e)});e.common.issues.push(r)}class gY{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return gW;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return gY.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return gW;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}}let gW=Object.freeze({status:"aborted"}),gJ=e=>({status:"dirty",value:e}),gX=e=>
vendor: 32,081 bytes, line 135
135({status:"valid",value:e}),g0=e=>"u">typeof Promise&&e instanceof Promise;class g1{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let g2=(e,t)=>{if("valid"===t.status)return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new gQ(e.common.issues);return this._error=t,this._error}}};function g3(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return"invalid_enum_value"===t.code?{message:a??i.defaultError}:void 0===i.data?{message:a??n??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:a??r??i.defaultError}},description:i}}class g5{get description(){return this._def.description}_getType(e){return gG(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:gG(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gY,ctx:{common:e.parent.common,data:e.data,parsedType:gG(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(g0(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gG(e)},n=this._parseSync({data:e,path:r.path,parent:r});return g2(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gG(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return"valid"===r.status?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>"valid"===e.status?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gG(e)},n=this._parse({data:e,path:r.path,parent:r});return g2(r,await (g0(n)?n:Promise.resolve(n)))}refine(e,t){return this._refinement((r,n)=>{let i=e(r),a=()=>n.addIssue({code:gB.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new mU({schema:this,typeName:ee.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return mV.create(this,this._def)}nullable(){return mz.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mC.create(this)}promise(){return m$.create(this,this._def)}or(e){return mI.create([this,e],this._def)}and(e){return mT.create(this,e,this._def)}transform(e){return new mU({...g3(this._def),schema:this,typeName:ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new mG({...g3(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:ee.ZodDefault})}brand(){return new mH({typeName:ee.ZodBranded,type:this,...g3(this._def)})}catch(e){return new mB({...g3(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:ee.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return mZ.create(this,e)}readonly(){return mK.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let g4=/^c[^\s-]{8,}$/i,g6=/^[0-9a-z]+$/,g9=/^[0-9A-HJKMNP-TV-Z]{26}$/i,g8=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,g7=/^[a-z0-9_-]{21}$/i,me=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ma=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ms=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mo=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ml=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",mc=RegExp(`^${mu}$`);function md(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}class mh extends g5{_parse(e){var t,r,n,i;let a;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==gz.string){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.string,received:t.parsedType}),gW}let s=new gY;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(gK(a=this._getOrReturnCtx(e,a),{code:gB.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),s.dirty());else if("max"===l.kind)e.data.length>l.value&&(gK(a=this._getOrReturnCtx(e,a),{code:gB.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),s.dirty());else if("length"===l.kind){let t=e.data.length>l.value,r=e.data.length<l.value;(t||r)&&(a=this._getOrReturnCtx(e,a),t?gK(a,{code:gB.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):r&&gK(a,{code:gB.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),s.dirty())}else if("email"===l.kind)mr.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"email",code:gB.invalid_string,message:l.message}),s.dirty());else if("emoji"===l.kind)o||(o=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),o.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"emoji",code:gB.invalid_string,message:l.message}),s.dirty());else if("uuid"===l.kind)g8.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"uuid",code:gB.invalid_string,message:l.message}),s.dirty());else if("nanoid"===l.kind)g7.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"nanoid",code:gB.invalid_string,message:l.message}),s.dirty());else if("cuid"===l.kind)g4.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"cuid",code:gB.invalid_string,message:l.message}),s.dirty());else if("cuid2"===l.kind)g6.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"cuid2",code:gB.invalid_string,message:l.message}),s.dirty());else if("ulid"===l.kind)g9.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"ulid",code:gB.invalid_string,message:l.message}),s.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{gK(a=this._getOrReturnCtx(e,a),{validation:"url",code:gB.invalid_string,message:l.message}),s.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"regex",code:gB.invalid_string,message:l.message}),s.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(gK(a=this._getOrReturnCtx(e,a),{code:gB.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),s.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(gK(a=this._getOrReturnCtx(e,a),{code:gB.invalid_string,validation:{startsWith:l.value},message:l.message}),s.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(gK(a=this._getOrReturnCtx(e,a),{code:gB.invalid_string,validation:{endsWith:l.value},message:l.message}),s.dirty()):"datetime"===l.kind?(function(e){let t=`${mu}T${md(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{code:gB.invalid_string,validation:"datetime",message:l.message}),s.dirty()):"date"===l.kind?mc.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{code:gB.invalid_string,validation:"date",message:l.message}),s.dirty()):"time"===l.kind?RegExp(`^${md(l)}$`).test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{code:gB.invalid_string,validation:"time",message:l.message}),s.dirty()):"duration"===l.kind?mt.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"duration",code:gB.invalid_string,message:l.message}),s.dirty()):"ip"===l.kind?(t=e.data,!(("v4"===(r=l.version)||!r)&&mn.test(t)||("v6"===r||!r)&&ma.test(t))&&1&&(gK(a=this._getOrReturnCtx(e,a),{validation:"ip",code:gB.invalid_string,message:l.message}),s.dirty())):"jwt"===l.kind?!function(e,t){if(!me.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if("object"!=typeof i||null===i||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(gK(a=this._getOrReturnCtx(e,a),{validation:"jwt",code:gB.invalid_string,message:l.message}),s.dirty()):"cidr"===l.kind?(n=e.data,!(("v4"===(i=l.version)||!i)&&mi.test(n)||("v6"===i||!i)&&ms.test(n))&&1&&(gK(a=this._getOrReturnCtx(e,a),{validation:"cidr",code:gB.invalid_string,message:l.message}),s.dirty())):"base64"===l.kind?mo.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"base64",code:gB.invalid_string,message:l.message}),s.dirty()):"base64url"===l.kind?ml.test(e.data)||(gK(a=this._getOrReturnCtx(e,a),{validation:"base64url",code:gB.invalid_string,message:l.message}),s.dirty()):W.assertNever(l);return{status:s.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:gB.invalid_string,...X.errToObj(r)})}_addCheck(e){return new mh({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...X.errToObj(e)})}url(e){return this._addCheck({kind:"url",...X.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...X.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...X.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...X.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...X.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...X.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...X.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...X.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...X.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...X.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...X.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...X.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...X.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...X.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...X.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...X.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...X.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...X.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...X.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...X.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...X.errToObj(t)})}nonempty(e){return this.min(1,X.errToObj(e))}trim(){return new mh({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mh({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mh({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}mh.create=e=>new mh({checks:[],typeName:ee.ZodString,coerce:e?.coerce??!1,...g3(e)});class mp extends g5{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==gz.number){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.number,received:t.parsedType}),gW}let r=new gY;for(let n of this._def.checks)"int"===n.kind?W.isInteger(e.data)||(gK(t=this._getOrReturnCtx(e,t),{code:gB.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(e.data,n.value)&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(gK(t=this._getOrReturnCtx(e,t),{code:gB.not_finite,message:n.message}),r.dirty()):W.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,X.toString(t))}gt(e,t){return this.setLimit("min",e,!1,X.toString(t))}lte(e,t){return this.setLimit("max",e,!0,X.toString(t))}lt(e,t){return this.setLimit("max",e,!1,X.toString(t))}setLimit(e,t,r,n){return new mp({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:X.toString(n)}]})}_addCheck(e){return new mp({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:X.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:X.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&W.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}mp.create=e=>new mp({checks:[],typeName:ee.ZodNumber,coerce:e?.coerce||!1,...g3(e)});class mf extends g5{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==gz.bigint)return this._getInvalidInput(e);let r=new gY;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):W.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.bigint,received:t.parsedType}),gW}gte(e,t){return this.setLimit("min",e,!0,X.toString(t))}gt(e,t){return this.setLimit("min",e,!1,X.toString(t))}lte(e,t){return this.setLimit("max",e,!0,X.toString(t))}lt(e,t){return this.setLimit("max",e,!1,X.toString(t))}setLimit(e,t,r,n){return new mf({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:X.toString(n)}]})}_addCheck(e){return new mf({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}mf.create=e=>new mf({checks:[],typeName:ee.ZodBigInt,coerce:e?.coerce??!1,...g3(e)});class mg extends g5{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==gz.boolean){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.boolean,received:t.parsedType}),gW}return gX(e.data)}}mg.create=e=>new mg({typeName:ee.ZodBoolean,coerce:e?.coerce||!1,...g3(e)});class mm extends g5{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==gz.date){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.date,received:t.parsedType}),gW}if(Number.isNaN(e.data.getTime()))return gK(this._getOrReturnCtx(e),{code:gB.invalid_date}),gW;let r=new gY;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(gK(t=this._getOrReturnCtx(e,t),{code:gB.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):W.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new mm({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:X.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:X.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}mm.create=e=>new mm({checks:[],coerce:e?.coerce||!1,typeName:ee.ZodDate,...g3(e)});class my extends g5{_parse(e){if(this._getType(e)!==gz.symbol){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.symbol,received:t.parsedType}),gW}return gX(e.data)}}my.create=e=>new my({typeName:ee.ZodSymbol,...g3(e)});class mv extends g5{_parse(e){if(this._getType(e)!==gz.undefined){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.undefined,received:t.parsedType}),gW}return gX(e.data)}}mv.create=e=>new mv({typeName:ee.ZodUndefined,...g3(e)});class mb extends g5{_parse(e){if(this._getType(e)!==gz.null){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.null,received:t.parsedType}),gW}return gX(e.data)}}mb.create=e=>new mb({typeName:ee.ZodNull,...g3(e)});class mw extends g5{constructor(){super(...arguments),this._any=!0}_parse(e){return gX(e.data)}}mw.create=e=>new mw({typeName:ee.ZodAny,...g3(e)});class mS extends g5{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gX(e.data)}}mS.create=e=>new mS({typeName:ee.ZodUnknown,...g3(e)});class mE extends g5{_parse(e){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.never,received:t.parsedType}),gW}}mE.create=e=>new mE({typeName:ee.ZodNever,...g3(e)});class m_ extends g5{_parse(e){if(this._getType(e)!==gz.undefined){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.void,received:t.parsedType}),gW}return gX(e.data)}}m_.create=e=>new m_({typeName:ee.ZodVoid,...g3(e)});class mC extends g5{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==gz.array)return gK(t,{code:gB.invalid_type,expected:gz.array,received:t.parsedType}),gW;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(gK(t,{code:e?gB.too_big:gB.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(gK(t,{code:gB.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(gK(t,{code:gB.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new g1(t,e,t.path,r)))).then(e=>gY.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new g1(t,e,t.path,r)));return gY.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new mC({...this._def,minLength:{value:e,message:X.toString(t)}})}max(e,t){return new mC({...this._def,maxLength:{value:e,message:X.toString(t)}})}length(e,t){return new mC({...this._def,exactLength:{value:e,message:X.toString(t)}})}nonempty(e){return this.min(1,e)}}mC.create=(e,t)=>new mC({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ee.ZodArray,...g3(t)});class mk extends g5{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=W.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==gz.object){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.object,received:t.parsedType}),gW}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof mE&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||a.push(e);let s=[];for(let e of i){let t=n[e],i=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new g1(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof mE){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(gK(r,{code:gB.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new g1(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>gY.mergeObjectSync(t,e)):gY.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return X.errToObj,new mk({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:X.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new mk({...this._def,unknownKeys:"strip"})}passthrough(){return new mk({...this._def,unknownKeys:"passthrough"})}extend(e){return new mk({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new mk({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ee.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new mk({...this._def,catchall:e})}pick(e){let t={};for(let r of W.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new mk({...this._def,shape:()=>t})}omit(e){let t={};for(let r of W.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new mk({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof mk){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=mV.create(e(i))}return new mk({...t._def,shape:()=>r})}if(t instanceof mC)return new mC({...t._def,type:e(t.element)});if(t instanceof mV)return mV.create(e(t.unwrap()));if(t instanceof mz)return mz.create(e(t.unwrap()));if(t instanceof mO)return mO.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of W.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new mk({...this._def,shape:()=>t})}required(e){let t={};for(let r of W.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof mV;)e=e._def.innerType;t[r]=e}return new mk({...this._def,shape:()=>t})}keyof(){return mF(W.objectKeys(this.shape))}}mk.create=(e,t)=>new mk({shape:()=>e,unknownKeys:"strip",catchall:mE.create(),typeName:ee.ZodObject,...g3(t)}),mk.strictCreate=(e,t)=>new mk({shape:()=>e,unknownKeys:"strict",catchall:mE.create(),typeName:ee.ZodObject,...g3(t)}),mk.lazycreate=(e,t)=>new mk({shape:e,unknownKeys:"strip",catchall:mE.create(),typeName:ee.ZodObject,...g3(t)});class mI extends g5{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new gQ(e.ctx.common.issues));return gK(t,{code:gB.invalid_union,unionErrors:r}),gW});{let e,n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=n.map(e=>new gQ(e));return gK(t,{code:gB.invalid_union,unionErrors:i}),gW}}get options(){return this._def.options}}mI.create=(e,t)=>
135new mI({options:e,typeName:ee.ZodUnion,...g3(t)});let mx=e=>{if(e instanceof mM)return mx(e.schema);if(e instanceof mU)return mx(e.innerType());if(e instanceof mj)return[e.value];if(e instanceof mL)return e.options;if(e instanceof mq)return W.objectValues(e.enum);else if(e instanceof mG)return mx(e._def.innerType);else if(e instanceof mv)return[void 0];else if(e instanceof mb)return[null];else if(e instanceof mV)return[void 0,...mx(e.unwrap())];else if(e instanceof mz)return[null,...mx(e.unwrap())];else if(e instanceof mH)return mx(e.unwrap());else if(e instanceof mK)return mx(e.unwrap());else if(e instanceof mB)return mx(e._def.innerType);else return[]};class mA extends g5{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==gz.object)return gK(t,{code:gB.invalid_type,expected:gz.object,received:t.parsedType}),gW;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(gK(t,{code:gB.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),gW)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=mx(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new mA({typeName:ee.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...g3(r)})}}class mT extends g5{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if("aborted"===e.status||"aborted"===n.status)return gW;let i=function e(t,r){let n=gG(t),i=gG(r);if(t===r)return{valid:!0,data:t};if(n===gz.object&&i===gz.object){let n=W.objectKeys(r),i=W.objectKeys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};a[n]=i.data}return{valid:!0,data:a}}if(n===gz.array&&i===gz.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let a=e(t[i],r[i]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}if(n===gz.date&&i===gz.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,n.value);return i.valid?(("dirty"===e.status||"dirty"===n.status)&&t.dirty(),{status:t.value,value:i.data}):(gK(r,{code:gB.invalid_intersection_types}),gW)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}mT.create=(e,t,r)=>new mT({left:e,right:t,typeName:ee.ZodIntersection,...g3(r)});class mO extends g5{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==gz.array)return gK(r,{code:gB.invalid_type,expected:gz.array,received:r.parsedType}),gW;if(r.data.length<this._def.items.length)return gK(r,{code:gB.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gW;!this._def.rest&&r.data.length>this._def.items.length&&(gK(r,{code:gB.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new g1(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>gY.mergeArray(t,e)):gY.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new mO({...this._def,rest:e})}}mO.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new mO({items:e,typeName:ee.ZodTuple,rest:null,...g3(t)})};class mN extends g5{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==gz.object)return gK(r,{code:gB.invalid_type,expected:gz.object,received:r.parsedType}),gW;let n=[],i=this._def.keyType,a=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new g1(r,e,r.path,e)),value:a._parse(new g1(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?gY.mergeObjectAsync(t,n):gY.mergeObjectSync(t,n)}
135get element(){return this._def.valueType}static create(e,t,r){return new mN(t instanceof g5?{keyType:e,valueType:t,typeName:ee.ZodRecord,...g3(r)}:{keyType:mh.create(),valueType:e,typeName:ee.ZodRecord,...g3(t)})}}class mR extends g5{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==gz.map)return gK(r,{code:gB.invalid_type,expected:gz.map,received:r.parsedType}),gW;let n=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new g1(r,e,r.path,[a,"key"])),value:i._parse(new g1(r,t,r.path,[a,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of a){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return gW;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of a){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return gW;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}mR.create=(e,t,r)=>new mR({valueType:t,keyType:e,typeName:ee.ZodMap,...g3(r)});class mD extends g5{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==gz.set)return gK(r,{code:gB.invalid_type,expected:gz.set,received:r.parsedType}),gW;let n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(gK(r,{code:gB.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(gK(r,{code:gB.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let r=new Set;for(let n of e){if("aborted"===n.status)return gW;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>i._parse(new g1(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>a(e)):a(s)}min(e,t){return new mD({...this._def,minSize:{value:e,message:X.toString(t)}})}max(e,t){return new mD({...this._def,maxSize:{value:e,message:X.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}mD.create=(e,t)=>new mD({valueType:e,minSize:null,maxSize:null,typeName:ee.ZodSet,...g3(t)});class mP extends g5{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==gz.function)return gK(t,{code:gB.invalid_type,expected:gz.function,received:t.parsedType}),gW;function r(e,r){return gZ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,gH,gH].filter(e=>!!e),issueData:{code:gB.invalid_arguments,argumentsError:r}})}function n(e,r){return gZ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,gH,gH].filter(e=>!!e),issueData:{code:gB.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof m$){let e=this;return gX(async function(...t){let s=new gQ([]),o=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(r(t,e)),s}),l=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(l,i).catch(e=>{throw s.addIssue(n(l,e)),s})})}{let e=this;return gX(function(...t){let s=e._def.args.safeParse(t,i);if(!s.success)throw new gQ([r(t,s.error)]);let o=Reflect.apply(a,this,s.data),l=e._def.returns.safeParse(o,i);if(!l.success)throw new gQ([n(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mP({...this._def,args:mO.create(e).rest(mS.create())})}returns(e){return new mP({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new mP({args:e||mO.create([]).rest(mS.create()),returns:t||mS.create(),typeName:ee.ZodFunction,...g3(r)})}}class mM extends g5{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}mM.create=(e,t)=>
vendor: 4,343 bytes, line 135
135new mM({getter:e,typeName:ee.ZodLazy,...g3(t)});class mj extends g5{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return gK(t,{received:t.data,code:gB.invalid_literal,expected:this._def.value}),gW}return{status:"valid",value:e.data}}get value(){return this._def.value}}function mF(e,t){return new mL({values:e,typeName:ee.ZodEnum,...g3(t)})}mj.create=(e,t)=>new mj({value:e,typeName:ee.ZodLiteral,...g3(t)});class mL extends g5{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return gK(t,{expected:W.joinValues(r),received:t.parsedType,code:gB.invalid_type}),gW}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return gK(t,{received:t.data,code:gB.invalid_enum_value,options:r}),gW}return gX(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return mL.create(e,{...this._def,...t})}exclude(e,t=this._def){return mL.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}mL.create=mF;class mq extends g5{_parse(e){let t=W.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==gz.string&&r.parsedType!==gz.number){let e=W.objectValues(t);return gK(r,{expected:W.joinValues(e),received:r.parsedType,code:gB.invalid_type}),gW}if(this._cache||(this._cache=new Set(W.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=W.objectValues(t);return gK(r,{received:r.data,code:gB.invalid_enum_value,options:e}),gW}return gX(e.data)}get enum(){return this._def.values}}mq.create=(e,t)=>new mq({values:e,typeName:ee.ZodNativeEnum,...g3(t)});class m$ extends g5{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==gz.promise&&!1===t.common.async?(gK(t,{code:gB.invalid_type,expected:gz.promise,received:t.parsedType}),gW):gX((t.parsedType===gz.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}m$.create=(e,t)=>new m$({type:e,typeName:ee.ZodPromise,...g3(t)});class mU extends g5{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{gK(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return gW;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?gW:"dirty"===n.status||"dirty"===t.value?gJ(n.value):n});{if("aborted"===t.value)return gW;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?gW:"dirty"===n.status||"dirty"===t.value?gJ(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?gW:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?gW:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>"valid"!==e.status?gW:Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})));else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if("valid"!==e.status)return gW;let a=n.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}W.assertNever(n)}}mU.create=(e,t,r)=>
135new mU({schema:e,typeName:ee.ZodEffects,effect:t,...g3(r)}),mU.createWithPreprocess=(e,t,r)=>new mU({schema:t,effect:{type:"preprocess",transform:e},typeName:ee.ZodEffects,...g3(r)});class mV extends g5{_parse(e){return this._getType(e)===gz.undefined?gX(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mV.create=(e,t)=>new mV({innerType:e,typeName:ee.ZodOptional,...g3(t)});class mz extends g5{_parse(e){return this._getType(e)===gz.null?gX(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mz.create=(e,t)=>new mz({innerType:e,typeName:ee.ZodNullable,...g3(t)});class mG extends g5{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===gz.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}mG.create=(e,t)=>new mG({innerType:e,typeName:ee.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...g3(t)});class mB extends g5{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return g0(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new gQ(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new gQ(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}mB.create=(e,t)=>new mB({innerType:e,typeName:ee.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...g3(t)});class mQ extends g5{_parse(e){if(this._getType(e)!==gz.nan){let t=this._getOrReturnCtx(e);return gK(t,{code:gB.invalid_type,expected:gz.nan,received:t.parsedType}),gW}return{status:"valid",value:e.data}}}mQ.create=e=>new mQ({typeName:ee.ZodNaN,...g3(e)}),Symbol("zod_brand");class mH extends g5{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class mZ extends g5{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?gW:"dirty"===e.status?(t.dirty(),gJ(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?gW:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new mZ({in:e,out:t,typeName:ee.ZodPipeline})}}class mK extends g5{_parse(e){let t=this._def.innerType._parse(e),r=e=>("valid"===e.status&&(e.value=Object.freeze(e.value)),e);return g0(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}mK.create=(e,t)=>new mK({innerType:e,typeName:ee.ZodReadonly,...g3(t)}),mk.lazycreate,(R=ee||(ee={})).ZodString="ZodString",R.ZodNumber="ZodNumber",R.ZodNaN="ZodNaN",R.ZodBigInt="ZodBigInt",R.ZodBoolean="ZodBoolean",R.ZodDate="ZodDate",R.ZodSymbol="ZodSymbol",R.ZodUndefined="ZodUndefined",R.ZodNull="ZodNull",R.ZodAny="ZodAny",R.ZodUnknown="ZodUnknown",R.ZodNever="ZodNever",R.ZodVoid="ZodVoid",R.ZodArray="ZodArray",R.ZodObject="ZodObject",R.ZodUnion="ZodUnion",R.ZodDiscriminatedUnion="ZodDiscriminatedUnion",R.ZodIntersection="ZodIntersection",R.ZodTuple="ZodTuple",R.ZodRecord="ZodRecord",R.ZodMap="ZodMap",R.ZodSet="ZodSet",R.ZodFunction="ZodFunction",R.ZodLazy="ZodLazy",R.ZodLiteral="ZodLiteral",R.ZodEnum="ZodEnum",R.ZodEffects="ZodEffects",R.ZodNativeEnum="ZodNativeEnum",R.ZodOptional="ZodOptional",R.ZodNullable="ZodNullable",R.ZodDefault="ZodDefault",R.ZodCatch="ZodCatch",R.ZodPromise="ZodPromise",R.ZodBranded="ZodBranded",R.ZodPipeline="ZodPipeline",R.ZodReadonly="ZodReadonly";let mY=mh.create;mp.create,mQ.create,mf.create;let mW=mg.create;mm.create,my.create,mv.create,mb.create;let mJ=mw.create;mS.create,mE.create,m_.create,mC.create;let mX=mk.create;mk.strictCreate,mI.create;let m0=mA.create;mT.create,mO.create,mN.create,mR.create,mD.create,mP.create,mM.create;let m1=mj.create,m2=mL.create;mq.create,m$.create,mU.create,mV.create,mz.create,mU.createWithPreprocess,mZ.create;let m3=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,m5=e=>{if("string"!=typeof e)throw TypeError("Invalid argument expected string");let t=e.match(m3);
135if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},m4=e=>"*"===e||"x"===e||"X"===e,m6=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},m9=(e,t)=>{let r,n;if(m4(e)||m4(t))return 0;let[i,a]=typeof(r=m6(e))!=typeof(n=m6(t))?[String(r),String(n)]:[r,n];return i>a?1:i<a?-1:0},m8=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=m9(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},m7=(e,t)=>{let r=m5(e),n=m5(t),i=r.pop(),a=n.pop(),s=m8(r,n);return 0!==s?s:i&&a?m8(i.split("."),a.split(".")):i||a?i?-1:1:0};var ye=r(41463);let yt=e=>{if("function"==typeof structuredClone)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function yr(e){if(Object.freeze(e),"object"==typeof e&&e)for(let t of Object.values(e))"object"==typeof t&&t&&!Object.isFrozen(t)&&yr(t);return e}async function yn(e,t,r,n){let i="u">typeof ye&&void 0!==ye.env,a=i&&!!ye.env.VITEST_WORKER_ID,s=i&&!!ye.env.VITEST_WORKER_ID,o=yt(t),l=yt(r),u=o,c=l,d;for(let t of e)try{s&&(yr(u),yr(c));let e=await n(t,u,c);if(void 0===e)continue;if(void 0!==e.messages&&e.messages!==u&&(u=yt(e.messages)),void 0!==e.state&&e.state!==c&&(c=yt(e.state)),d=e.stopPropagation,!0===d)break}catch(e){if(s&&e instanceof TypeError){if(a)throw e;console.error("AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.",e)}else a||console.error("Subscriber error:",e);continue}return{...u===o?{}:{messages:s&&Object.isFrozen(u)?yt(u):u},...c===l?{}:{state:s&&Object.isFrozen(c)?yt(c):c},...void 0===d?{}:{stopPropagation:d}}}function yi(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(!0===e)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,r=e.lifecycle??!0;return{enabled:t||r,events:t,lifecycle:r,verbose:e.verbose??!1}}function ya(e){return e instanceof ys?e:!0===e?new ys(yi(!0)):void 0}var ys=class{constructor(e){this.config=e}event(e,t,r,n){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,"string"==typeof r?r:JSON.stringify(r)):console.debug(`[${e}] ${t}`,n??r))}lifecycle(e,t,r){this.config.lifecycle&&(r?console.debug(`[${e}] ${t}`,r):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function yo(e){return e.enabled?new ys(e):void 0}let yl=(e,t,r,n,i)=>{var a,s;let o=ya(i),l=yt(r.messages),u=yt(e.state),c={},d=e=>{void 0!==e.messages&&(l=e.messages,c.messages=e.messages),void 0!==e.state&&(u=e.state,c.state=e.state)},h=()=>{let e=yt(c);return c={},void 0!==e.messages||void 0!==e.state?p0(e):p1};return t.pipe(fi(async t=>{let i=await yn(n,l,u,(n,i,a)=>n.onEvent?.({event:t,agent:r,input:e,messages:i,state:a}));if(d(i),!0===i.stopPropagation?o?.event("APPLY","Event dropped:",t,{type:t.type,reason:"stopPropagation by subscriber"}):o?.event("APPLY","Event applied:",t,{type:t.type,subscribers:n.length}),!0===i.stopPropagation)return h();switch(t.type){case hi.TEXT_MESSAGE_START:{let i=await yn(n,l,u,(n,i,a)=>n.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation){let{messageId:e,role:r="assistant",name:n}=t;if(!l.find(t=>t.id===e)){let t={id:e,role:r,content:"",...void 0!==n&&{name:n}};l.push(t),d({messages:l})}}return h()}case hi.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,s=l.find(e=>e.id===i);if(!s)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),h();let o=await yn(n,l,u,(n,i,a)=>n.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:r,input:e,textMessageBuffer:"string"==typeof s.content?s.content:""}));return d(o),!0!==o.stopPropagation&&(s.content=`${"string"==typeof s.content?s.content:""}${a}`,d({messages:l})),h()}case hi.TEXT_MESSAGE_END:{let{messageId:i}=t,a=l.find(e=>e.id===i);return a?(d(await yn(n,l,u,(n,i,s)=>n.onTextMessageEndEvent?.({event:t,messages:i,state:s,agent:r,input:e,textMessageBuffer:"string"==typeof a.content?a.content:""}))),await Promise.all(n.map(t=>{t.onNewMessage?.({message:a,messages:l,state:u,agent:r,input:e})}))):console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),h()}case hi.TOOL_CALL_START:{let i=await yn(n,l,u,(n,i,a)=>n.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation){let{toolCallId:e,toolCallName:r,parentMessageId:n}=t,i=function(e,t,r){if(t){let n=e.find(e=>e.id===t);if(n?.role==="assistant")return n;n&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${n.role}' message, not assistant — falling back to toolCallId`);let i={id:n?r:t,role:"assistant",toolCalls:[]};return e.push(i),i}let n={id:r,role:"assistant",toolCalls:[]};return e.push(n),n}(l,n,e);i.toolCalls??=[],i.toolCalls.push({id:e,type:"function",function:{name:r,arguments:""}}),d({messages:l})}return h()}case hi.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}
135=t,s=l.find(e=>e.toolCalls?.some(e=>e.id===i));if(!s)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),h();let o=s.toolCalls?.find(e=>e.id===i);if(!o)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),h();let c=await yn(n,l,u,(n,i,a)=>{let s=o.function.arguments,l=o.function.name,u={};try{u=fl(s)}catch{}return n.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:r,input:e,toolCallBuffer:s,toolCallName:l,partialToolCallArgs:u})});return d(c),!0!==c.stopPropagation&&(o.function.arguments+=a,d({messages:l})),h()}case hi.TOOL_CALL_END:{let{toolCallId:i}=t,a=l.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),h();let s=a.toolCalls?.find(e=>e.id===i);return s?(d(await yn(n,l,u,(n,i,a)=>{let o=s.function.arguments,l=s.function.name,u={};try{u=JSON.parse(o)}catch{}return n.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:r,input:e,toolCallName:l,toolCallArgs:u})})),await Promise.all(n.map(t=>{t.onNewToolCall?.({toolCall:s,messages:l,state:u,agent:r,input:e})}))):console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),h()}case hi.TOOL_CALL_RESULT:{let i=await yn(n,l,u,(n,i,a)=>n.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation){let{messageId:i,toolCallId:a,content:s,role:o}=t,c={id:i,toolCallId:a,role:o||"tool",content:s};l.push(c),await Promise.all(n.map(t=>{t.onNewMessage?.({message:c,messages:l,state:u,agent:r,input:e})})),d({messages:l})}return h()}case hi.STATE_SNAPSHOT:{let i=await yn(n,l,u,(n,i,a)=>n.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation){let{snapshot:e}=t;d({state:u=e})}return h()}case hi.STATE_DELTA:{let i=await yn(n,l,u,(n,i,a)=>n.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation){let{delta:e}=t;try{u=hY(u,e,!0,!1).newDocument,d({state:u})}catch(r){let t=r instanceof Error?r.message:String(r);console.warn(`Failed to apply state patch: 136Current state: ${JSON.stringify(u,null,2)} 137Patch operations: ${JSON.stringify(e,null,2)} 138Error: ${t}`)}}return h()}case hi.MESSAGES_SNAPSHOT:{let i=await yn(n,l,u,(n,i,a)=>n.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation){let{messages:e}=t,r=new Map(e.map(e=>[e.id,e])),n=e=>"activity"===e||"reasoning"===e,i=new Set((l=l.filter(e=>n(e.role)||r.has(e.id)).map(e=>n(e.role)?e:r.get(e.id))).map(e=>e.id));for(let t of e)i.has(t.id)||l.push(t);d({messages:l})}return h()}case hi.ACTIVITY_SNAPSHOT:{let i=l.findIndex(e=>e.id===t.messageId),a=i>=0?l[i]:void 0,s=a?.role==="activity"?a:void 0,o=t.replace??!0,c=await yn(n,l,u,(n,i,o)=>n.onActivitySnapshotEvent?.({event:t,messages:i,state:o,agent:r,input:e,activityMessage:s,existingMessage:a}));if(d(c),!0!==c.stopPropagation){let a={id:t.messageId,role:"activity",activityType:t.activityType,content:yt(t.content)},c;-1===i?(l.push(a),c=a):s?o&&(l[i]={...s,activityType:t.activityType,content:yt(t.content)}):o&&(l[i]=a,c=a),d({messages:l}),c&&await Promise.all(n.map(t=>t.onNewMessage?.({message:c,messages:l,state:u,agent:r,input:e})))}return h()}case hi.ACTIVITY_DELTA:{let i=l.findIndex(e=>e.id===t.messageId);if(-1===i)return h();let a=l[i];if("activity"!==a.role)return console.warn(`ACTIVITY_DELTA: Message '${t.messageId}' is not an activity message`),h();let s=await yn(n,l,u,(n,i,s)=>n.onActivityDeltaEvent?.({event:t,messages:i,state:s,agent:r,input:e,activityMessage:a}));if(d(s),!0!==s.stopPropagation)try{let e=yt(a.content??{}),r=hY(e,t.patch??[],!0,!1).newDocument;l[i]={...a,content:yt(r),activityType:t.activityType},d({messages:l})}catch(r){let e=r instanceof Error?r.message:String(r);console.warn(`Failed to apply activity patch for '${t.messageId}': ${e}`)}return h()}case hi.RAW:return d(await yn(n,l,u,(n,i,a)=>n.onRawEvent?.({event:t,messages:i,state:a,agent:r,input:e}))),h();case hi.CUSTOM:return d(await yn(n,l,u,(n,i,a)=>n.onCustomEvent?.({event:t,messages:i,state:a,agent:r,input:e}))),h();case hi.RUN_STARTED:{let i=await yn(n,l,u,(n,i,a)=>n.onRunStartedEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation&&t.input?.messages){for(let e of t.input.messages)l.find(t=>
138t.id===e.id)||l.push(e);d({messages:l})}return h()}case hi.RUN_FINISHED:return d(await yn(n,l,u,(n,i,a)=>n.onRunFinishedEvent?.({event:t,messages:i,state:a,agent:r,input:e,result:t.result}))),h();case hi.RUN_ERROR:return d(await yn(n,l,u,(n,i,a)=>n.onRunErrorEvent?.({event:t,messages:i,state:a,agent:r,input:e}))),h();case hi.STEP_STARTED:return d(await yn(n,l,u,(n,i,a)=>n.onStepStartedEvent?.({event:t,messages:i,state:a,agent:r,input:e}))),h();case hi.STEP_FINISHED:return d(await yn(n,l,u,(n,i,a)=>n.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:r,input:e}))),h();case hi.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case hi.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case hi.THINKING_START:case hi.THINKING_END:case hi.THINKING_TEXT_MESSAGE_START:case hi.THINKING_TEXT_MESSAGE_CONTENT:case hi.THINKING_TEXT_MESSAGE_END:return h();case hi.REASONING_START:return d(await yn(n,l,u,(n,i,a)=>n.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:r,input:e}))),h();case hi.REASONING_MESSAGE_START:{let i=await yn(n,l,u,(n,i,a)=>n.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(i),!0!==i.stopPropagation){let{messageId:e}=t;l.find(t=>t.id===e)||(l.push({id:e,role:"reasoning",content:""}),d({messages:l}))}return h()}case hi.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,s=l.find(e=>e.id===i);if(!s)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),h();let o=await yn(n,l,u,(n,i,a)=>n.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:r,input:e,reasoningMessageBuffer:"string"==typeof s.content?s.content:""}));return d(o),!0!==o.stopPropagation&&(s.content=`${"string"==typeof s.content?s.content:""}${a}`,d({messages:l})),h()}case hi.REASONING_MESSAGE_END:{let{messageId:i}=t,a=l.find(e=>e.id===i);return a?(d(await yn(n,l,u,(n,i,s)=>n.onReasoningMessageEndEvent?.({event:t,messages:i,state:s,agent:r,input:e,reasoningMessageBuffer:"string"==typeof a.content?a.content:""}))),await Promise.all(n.map(t=>{t.onNewMessage?.({message:a,messages:l,state:u,agent:r,input:e})}))):console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),h()}case hi.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case hi.REASONING_END:return d(await yn(n,l,u,(n,i,a)=>n.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:r,input:e}))),h();case hi.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:s}=t,o=await yn(n,l,u,(n,i,a)=>n.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:r,input:e}));if(d(o),!0!==o.stopPropagation){let e=!1;if("tool-call"===i){for(let t of l)if("assistant"===t.role&&t.toolCalls){let r=t.toolCalls.find(e=>e.id===a);if(r){r.encryptedValue=s,e=!0;break}}}else{let t=l.find(e=>e.id===a);t?.role!=="activity"&&t&&(t.encryptedValue=s,e=!0)}e&&(c.messages=l)}return h()}}return t.type,h()}),(void 0===a&&(a=1/0),fe(pD,a)),n.length>0?(s={},pH(function(e,t){var r=!1;e.subscribe(pZ(t,function(e){r=!0,t.next(e)},function(){r||t.next(s),t.complete()}))})):e=>e)},yu=e=>t=>{let r=ya(e),n=new Map,i=new Map,a=!1,s=!1,o=!1,l=new Map,u=!1,c=!1,d=!1;return t.pipe(fe(e=>{let t=e.type;if(r?.event("VERIFY","Event:",e,{type:e.type}),s)return p2(()=>new dJ(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&t!==hi.RUN_ERROR&&t!==hi.RUN_STARTED)return p2(()=>new dJ(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(o){if(t===hi.RUN_STARTED){if(d&&!a)return p2(()=>new dJ("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));a&&(n.clear(),i.clear(),l.clear(),u=!1,c=!1,a=!1,s=!1,d=!0)}}else if(o=!0,t!==hi.RUN_STARTED&&t!==hi.RUN_ERROR)return p2(()=>new dJ("First event must be 'RUN_STARTED'"));switch(t){case hi.TEXT_MESSAGE_START:{let t=e.messageId;return n.has(t)?p2(()=>new dJ(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${t}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(n.set(t,!0),p0(e))}case hi.TEXT_MESSAGE_CONTENT:{let t=e.messageId;return n.has(t)?p0(e):p2(()=>new dJ(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${t}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case hi.TEXT_MESSAGE_END:{let t=e.messageId;return n.has(t)?(n.delete(t),p0(e)):p2(()=>new dJ(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${t}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case hi.TOOL_CALL_START:{let t=e.toolCallId;return i.has(t)?p2(()=>new dJ(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${t}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(i.set(t,!0),p0(e))}case hi.TOOL_CALL_ARGS:{let t=e.toolCallId;return i.has(t)?p0(e):p2(()=>new dJ(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${t}'. Start a tool call with 'TOOL_CALL_START' first.`))}case hi.TOOL_CALL_END:{let t=e.toolCallId;return i.has(t)?(i.delete(t),p0(e)):p2(()=>new dJ(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${t}'. A 'TOOL_CALL_START' event must be sent first.`))}case hi.STEP_STARTED:{let t=e.stepName;return l.has(t)?p2(()=>new dJ(`Step "${t}" is already active for 'STEP_STARTED'`)):(l.set(t,!0),p0(e))}case hi.STEP_FINISHED:{let t=e.stepName;return l.has(t)?(l.delete(t),p0(e)):p2(()=>new dJ(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}case hi.RUN_STARTED:return d=!0,p0(e);case hi.RUN_FINISHED:if(l.size>0){let e=Array.from(l.keys()).join(", ");return p2(()=>new dJ(`Cannot send 'RUN_FINISHED' while steps are still active: ${e}`))}if(n.size>0){let e=Array.from(n.keys()).join(", ");return p2(()=>new dJ(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(", ");return p2(()=>new dJ(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}return a=!0,p0(e);case hi.RUN_ERROR:return s=!0,p0(e);case hi.CUSTOM:return p0(e);case hi.THINKING_TEXT_MESSAGE_START:return u?c?p2(()=>new dJ("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(c=!0,p0(e)):p2(()=>new dJ("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case hi.THINKING_TEXT_MESSAGE_CONTENT:return c?p0(e):p2(()=>new dJ("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case hi.THINKING_TEXT_MESSAGE_END:return c?(c=!1,p0(e)):p2(()=>new dJ("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case hi.THINKING_START:return u?p2(()=>new dJ("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(u=!0,p0(e));case hi.THINKING_END:return u?(u=!1,p0(e)):p2(()=>new dJ("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return p0(e)}}))},yc=((D={}).HEADERS="headers",D.DATA="data",D),yd=m2(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),yh=m2(["LangGraphInterruptEvent","PredictState","Exit"]);m0("type",[mX({type:m1(yd.enum.TextMessageStart),messageId:mY(),parentMessageId:mY().optional(),role:mY().optional()}),mX({type:m1(yd.enum.TextMessageContent),messageId:mY(),content:mY()}),mX({type:m1(yd.enum.TextMessageEnd),messageId:mY()}),mX({type:m1(yd.enum.ActionExecutionStart),actionExecutionId:mY(),actionName:mY(),parentMessageId:mY().optional()}),mX({type:m1(yd.enum.ActionExecutionArgs),actionExecutionId:mY(),args:mY(
138)}),mX({type:m1(yd.enum.ActionExecutionEnd),actionExecutionId:mY()}),mX({type:m1(yd.enum.ActionExecutionResult),actionName:mY(),actionExecutionId:mY(),result:mY()}),mX({type:m1(yd.enum.AgentStateMessage),threadId:mY(),agentName:mY(),nodeName:mY(),runId:mY(),active:mW(),role:mY(),state:mY(),running:mW()}),mX({type:m1(yd.enum.MetaEvent),name:yh,value:mJ()}),mX({type:m1(yd.enum.RunError),message:mY(),code:mY().optional()})]),mX({id:mY(),role:mY(),content:mY(),parentMessageId:mY().optional()}),mX({id:mY(),name:mY(),arguments:mJ(),parentMessageId:mY().optional()}),mX({id:mY(),result:mJ(),actionExecutionId:mY(),actionName:mY()});let yp=e=>{if("string"==typeof e)return e;if(!Array.isArray(e))return;let t=e.filter(e=>"text"===e.type).map(e=>e.text).filter(e=>e.length>0);if(0!==t.length)return t.join(` 139`)},yf=e=>t=>{let r=ya(e),n,i,a,s,o=()=>"text"===s?[(()=>{if(!n||"text"!==s)throw Error("No text message to close");let e={type:hi.TEXT_MESSAGE_END,messageId:n.messageId};return s=void 0,n=void 0,r?.event("TRANSFORM","TEXT_MESSAGE_END",e,{messageId:e.messageId}),e})()]:"tool"===s?[(()=>{if(!i||"tool"!==s)throw Error("No tool call to close");let e={type:hi.TOOL_CALL_END,toolCallId:i.toolCallId};return s=void 0,i=void 0,r?.event("TRANSFORM","TOOL_CALL_END",e,{toolCallId:e.toolCallId}),e})()]:"reasoning"===s?[(()=>{if(!a||"reasoning"!==s)throw Error("No reasoning message to close");let e={type:hi.REASONING_MESSAGE_END,messageId:a.messageId};return s=void 0,a=void 0,r?.event("TRANSFORM","REASONING_MESSAGE_END",e,{messageId:e.messageId}),e})()]:[];return t.pipe(fe(e=>{switch(e.type){case hi.TEXT_MESSAGE_START:case hi.TEXT_MESSAGE_CONTENT:case hi.TEXT_MESSAGE_END:case hi.TOOL_CALL_START:case hi.TOOL_CALL_ARGS:case hi.TOOL_CALL_END:case hi.TOOL_CALL_RESULT:case hi.STATE_SNAPSHOT:case hi.STATE_DELTA:case hi.MESSAGES_SNAPSHOT:case hi.CUSTOM:case hi.RUN_STARTED:case hi.RUN_FINISHED:case hi.RUN_ERROR:case hi.STEP_STARTED:case hi.STEP_FINISHED:case hi.THINKING_START:case hi.THINKING_END:case hi.THINKING_TEXT_MESSAGE_START:case hi.THINKING_TEXT_MESSAGE_CONTENT:case hi.THINKING_TEXT_MESSAGE_END:case hi.REASONING_START:case hi.REASONING_MESSAGE_START:case hi.REASONING_MESSAGE_CONTENT:case hi.REASONING_MESSAGE_END:case hi.REASONING_END:return[...o(),e];case hi.RAW:case hi.ACTIVITY_SNAPSHOT:case hi.ACTIVITY_DELTA:case hi.REASONING_ENCRYPTED_VALUE:return[e];case hi.TEXT_MESSAGE_CHUNK:let t=[];if(("text"!==s||void 0!==e.messageId&&e.messageId!==n?.messageId)&&t.push(...o()),"text"!==s){if(void 0===e.messageId)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:e.messageId,name:e.name},s="text";let i={type:hi.TEXT_MESSAGE_START,messageId:e.messageId,role:e.role||"assistant",...void 0!==e.name&&{name:e.name}};t.push(i),r?.event("TRANSFORM","TEXT_MESSAGE_START",i,{messageId:e.messageId})}if(void 0!==e.delta){let i={type:hi.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:e.delta};t.push(i),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",i,{messageId:n.messageId})}return t;case hi.TOOL_CALL_CHUNK:let l=[];
139if(("tool"!==s||void 0!==e.toolCallId&&e.toolCallId!==i?.toolCallId)&&l.push(...o()),"tool"!==s){if(void 0===e.toolCallId)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(void 0===e.toolCallName)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");i={toolCallId:e.toolCallId,toolCallName:e.toolCallName,parentMessageId:e.parentMessageId},s="tool";let t={type:hi.TOOL_CALL_START,toolCallId:e.toolCallId,toolCallName:e.toolCallName,parentMessageId:e.parentMessageId};l.push(t),r?.event("TRANSFORM","TOOL_CALL_START",t,{toolCallId:e.toolCallId,toolCallName:e.toolCallName})}if(void 0!==e.delta){let t={type:hi.TOOL_CALL_ARGS,toolCallId:i.toolCallId,delta:e.delta};l.push(t),r?.event("TRANSFORM","TOOL_CALL_ARGS",t,{toolCallId:i.toolCallId})}return l;case hi.REASONING_MESSAGE_CHUNK:let u=[];if(("reasoning"!==s||e.messageId&&e.messageId!==a?.messageId)&&u.push(...o()),"reasoning"!==s){if(void 0===e.messageId)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");a={messageId:e.messageId},s="reasoning";let t={type:hi.REASONING_MESSAGE_START,messageId:e.messageId};u.push(t),r?.event("TRANSFORM","REASONING_MESSAGE_START",t,{messageId:e.messageId})}if(void 0!==e.delta){let t={type:hi.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:e.delta};u.push(t),r?.event("TRANSFORM","REASONING_MESSAGE_CONTENT",t,{messageId:a.messageId})}return u}return e.type,[]}),ft(()=>{o()}))};var yg=class{runNext(e,t){return t.run(e).pipe(yf(!1))}runNextWithState(e,t){let r=yt(e.messages||[]),n=yt(e.state||{}),i=new p8;return yl(e,i,t,[]).subscribe(e=>{void 0!==e.messages&&(r=e.messages),void 0!==e.state&&(n=e.state)}),this.runNext(e,t).pipe(fi(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:yt(r),state:yt(n)})))}},ym=class extends yg{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function yy(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(e=>"object"==typeof e&&!!e&&"type"in e&&"text"===e.type&&"string"==typeof e.text).map(e=>e.text).join("");return{...e,content:r}}return"string"==typeof t?e:{...e,content:""}}var yv=class extends yg{run(e,t){let{parentRunId:r,...n}=e,i={...n,messages:n.messages.map(yy)};return this.runNext(i,t)}};let yb="THINKING_START",yw="THINKING_END",yS="THINKING_TEXT_MESSAGE_START",yE="THINKING_TEXT_MESSAGE_CONTENT",y_="THINKING_TEXT_MESSAGE_END";var yC=class extends yg{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){"u">typeof ye&&void 0!==ye.env&&ye.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(p7(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case yb:{this.currentReasoningId=cf();let{title:t,...r}=e;return this.warnAboutTransformation(yb,hi.REASONING_START),{...r,type:hi.REASONING_START,messageId:this.currentReasoningId}}case yS:return this.currentMessageId=cf(),this.warnAboutTransformation(yS,hi.REASONING_MESSAGE_START),{...e,type:hi.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case yE:{let{delta:t,...r}=e;return this.warnAboutTransformation(yE,hi.REASONING_MESSAGE_CONTENT),{...r,type:hi.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??cf(),delta:t}}case y_:{let t=this.currentMessageId??cf();return this.warnAboutTransformation(y_,hi.REASONING_MESSAGE_END),{...e,type:hi.REASONING_MESSAGE_END,messageId:t}}case yw:{let t=this.currentReasoningId??cf();return this.warnAboutTransformation(yw,hi.REASONING_END),{...e,type:hi.REASONING_END,messageId:t}}default:return e}}},yk=class{get maxVersion(){return"0.0.52"}get debug(){return this._debug}set debug(e){this._debug=yi(e),this._debugLogger=yo(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){"boolean"==typeof e?this._debugLogger=e?yo(yi(!0)):void 0:this._debugLogger=e}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??cf(),this.messages=yt(n??[]),this.state=yt(i??{}),this._debug=yi(a),this._debugLogger=yo(this._debug),0>=m7(this.maxVersion,"0.0.39")&&this.middlewares.unshift(new yv),0>=m7(this.maxVersion,"0.0.45")&&this.middlewares.unshift(new yC)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>"function"==typeof e?new ym(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{let r;this.isRunning=!0,this.agentId=this.agentId??cf();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle("LIFECYCLE","Run started:",{agentId:this.agentId,threadId:this.threadId});let i,a=new Set(this.messages.map(e=>e.id)),s=[{onRunFinishedEvent:e=>{i=e.result}},...this.subscribers,t??{}];await this.onInitialize(n,s),this.activeRunDetach$=new p4,this.activeRunCompletionPromise=new Promise(e=>{r=e}),await fn(pP(()=>0===this.middlewares.length?this.run(n):this.middlewares.reduceRight((e,t)=>({run:r=>t.run(r,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),yf(this.debugLogger),yu(this.debugLogger),e=>e.pipe(fa(this.activeRunDetach$)),e=>this.apply(n,e,s),e=>this.processApplyEvents(n,e,s),fs(e=>(this.debugLogger?.lifecycle("LIFECYCLE","Run errored:",{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,s))),ft(()=>{this.debugLogger?.lifecycle("LIFECYCLE","Run finished:",{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,s),r?.(),r=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}
139))(p0(null)));let o=yt(this.messages).filter(e=>!a.has(e.id));return{result:i,newMessages:o}}finally{this.isRunning=!1}}connect(e){throw new dX}async connectAgent(e,t){try{let r;this.isRunning=!0,this.agentId=this.agentId??cf();let n=this.prepareRunAgentInput(e),i,a=new Set(this.messages.map(e=>e.id)),s=[{onRunFinishedEvent:e=>{i=e.result}},...this.subscribers,t??{}];await this.onInitialize(n,s),this.activeRunDetach$=new p4,this.activeRunCompletionPromise=new Promise(e=>{r=e}),await fn(pP(()=>p3(()=>this.connect(n)),yf(this.debugLogger),yu(this.debugLogger),e=>e.pipe(fa(this.activeRunDetach$)),e=>this.apply(n,e,s),e=>this.processApplyEvents(n,e,s),fs(e=>(this.isRunning=!1,e instanceof dX?p1:this.onError(n,e,s))),ft(()=>{this.isRunning=!1,this.onFinalize(n,s),r?.(),r=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(p0(null)),{defaultValue:void 0});let o=yt(this.messages).filter(e=>!a.has(e.id));return{result:i,newMessages:o}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,r){return yl(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){var n,i;return t.pipe((i=h7(n=t=>{t.messages&&(this.messages=t.messages,r.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,r.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))})?{next:n,error:void 0,complete:void 0}:n)?pH(function(e,t){null==(r=i.subscribe)||r.call(i);var r,n=!0;e.subscribe(pZ(t,function(e){var r;null==(r=i.next)||r.call(i,e),t.next(e)},function(){var e;n=!1,null==(e=i.complete)||e.call(i),t.complete()},function(e){var r;n=!1,null==(r=i.error)||r.call(i,e),t.error(e)},function(){var e,t;n&&(null==(e=i.unsubscribe)||e.call(i)),null==(t=i.finalize)||t.call(i)}))}):pD)}prepareRunAgentInput(e){let t=yt(this.messages).filter(e=>"activity"!==e.role);return{threadId:this.threadId,runId:e?.runId||cf(),tools:yt(e?.tools??[]),context:yt(e?.context??[]),forwardedProps:yt(e?.forwardedProps??{}),state:yt(this.state),messages:t}}async onInitialize(e,t){let r=await yn(t,this.messages,this.state,(t,r,n)=>t.onRunInitialized?.({messages:r,state:n,agent:this,input:e}));(void 0!==r.messages||void 0!==r.state)&&(r.messages&&(this.messages=r.messages,e.messages=r.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),r.state&&(this.state=r.state,e.state=r.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}onError(e,t,r){return pX(yn(r,this.messages,this.state,(r,n,i)=>r.onRunFailed?.({error:t,messages:n,state:i,agent:this,input:e}))).pipe(p7(n=>{if((void 0!==n.messages||void 0!==n.state)&&(void 0!==n.messages&&(this.messages=n.messages,r.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),void 0!==n.state&&(this.state=n.state,r.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),!0!==n.stopPropagation){let e=String(t);if("AbortError"!==t.name&&"Fetch is aborted"!==t.message&&"signal is aborted without reason"!==t.message&&"component unmounted"!==t.message&&"component unmounted"!==e)throw console.error("Agent execution failed:",t),t}return{}}))}async onFinalize(e,t){let r=await yn(t,this.messages,this.state,(t,r,n)=>t.onRunFinalized?.({messages:r,state:n,agent:this,input:e}));(void 0!==r.messages||void 0!==r.state)&&(void 0!==r.messages&&(this.messages=r.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),void 0!==r.state&&(this.state=r.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=yt(this.messages),e.state=yt(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if("assistant"===e.role&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if("assistant"===t.role&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=yt(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=yt(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){let t,r,n;this.agentId=this.agentId??cf();let i=this.prepareRunAgentInput(e);return(0===this.middlewares.length?this.run(i):this.middlewares.reduceRight((e,t)=>({run:r=>t.run(r,e),get messages(){return e.messages},get state(){return e.state}}),this).run(i)).pipe(yf(this.debugLogger),yu(this.debugLogger),(t=this.threadId,r=i.runId,n=this.agentId,e=>{let i={},a=!0,s=!0,o="",l=null,u=null,c=[],d={},h=e=>{"object"==typeof e&&e&&("messages"in e&&delete e.messages,i=e)};return e.pipe(fe(e=>{switch(e.type){case hi.TEXT_MESSAGE_START:return[{type:yd.enum.TextMessageStart,messageId:e.messageId,role:e.role}];case hi.TEXT_MESSAGE_CONTENT:return[{type:yd.enum.TextMessageContent,messageId:e.messageId,content:e.delta}];case hi.TEXT_MESSAGE_END:return[{type:yd.enum.TextMessageEnd,messageId:e.messageId}];case hi.TOOL_CALL_START:return c.push({id:e.toolCallId,type:"function",function:{name:e.toolCallName,arguments:""}}),s=!0,d[e.toolCallId]=e.toolCallName,[{type:yd.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}];case hi.TOOL_CALL_ARGS:{let l=c.find(t=>
139t.id===e.toolCallId);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${e.toolCallId}'`),[];l.function.arguments+=e.delta;let d=!1;if(u){let e=u.find(e=>e.tool==l.function.name);if(e)try{let t=JSON.parse(fl(l.function.arguments));e.tool_argument&&e.tool_argument in t?(h({...i,[e.state_key]:t[e.tool_argument]}),d=!0):e.tool_argument||(h({...i,[e.state_key]:t}),d=!0)}catch{}}return[{type:yd.enum.ActionExecutionArgs,actionExecutionId:e.toolCallId,args:e.delta},...d?[{type:yd.enum.AgentStateMessage,threadId:t,agentName:n,nodeName:o,runId:r,running:a,role:"assistant",state:JSON.stringify(i),active:s}]:[]]}case hi.TOOL_CALL_END:return[{type:yd.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}];case hi.TOOL_CALL_RESULT:return[{type:yd.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||"unknown"}];case hi.RAW:return[];case hi.CUSTOM:switch(e.name){case"Exit":a=!1;break;case"PredictState":u=e.value}return[{type:yd.enum.MetaEvent,name:e.name,value:e.value}];case hi.STATE_SNAPSHOT:return h(e.snapshot),[{type:yd.enum.AgentStateMessage,threadId:t,agentName:n,nodeName:o,runId:r,running:a,role:"assistant",state:JSON.stringify(i),active:s}];case hi.STATE_DELTA:{let l=hY(i,e.delta,!0,!1);return l?(h(l.newDocument),[{type:yd.enum.AgentStateMessage,threadId:t,agentName:n,nodeName:o,runId:r,running:a,role:"assistant",state:JSON.stringify(i),active:s}]):[]}case hi.MESSAGES_SNAPSHOT:return l=e.messages,[{type:yd.enum.AgentStateMessage,threadId:t,agentName:n,nodeName:o,runId:r,running:a,role:"assistant",state:JSON.stringify({...i,...l?{messages:l}:{}}),active:!0}];case hi.RUN_STARTED:return[];case hi.RUN_FINISHED:return l&&(i.messages=l),0===Object.keys(i).length?[]:[{type:yd.enum.AgentStateMessage,threadId:t,agentName:n,nodeName:o,runId:r,running:a,role:"assistant",state:JSON.stringify({...i,...l?{messages:function(e){let t=[];for(let r of e)if("assistant"===r.role||"user"===r.role||"system"===r.role){let e=yp(r.content);if(e){let n={id:r.id,role:r.role,content:e};t.push(n)}if("assistant"===r.role&&r.toolCalls&&r.toolCalls.length>0)for(let e of r.toolCalls){let n={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:r.id};t.push(n)}}else if("tool"===r.role){let n="unknown";for(let t of e)if("assistant"===t.role&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===r.toolCallId){n=e.function.name;break}}let i={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(i)}return t}(l)}:{}}),active:!1}];case hi.RUN_ERROR:return[{type:yd.enum.RunError,message:e.message,code:e.code}];case hi.STEP_STARTED:return o=e.stepName,c=[],u=null,[{type:yd.enum.AgentStateMessage,threadId:t,agentName:n,nodeName:o,runId:r,running:a,role:"assistant",state:JSON.stringify(i),active:!0}];case hi.STEP_FINISHED:return c=[],u=null,[{type:yd.enum.AgentStateMessage,threadId:t,agentName:n,nodeName:o,runId:r,running:a,role:"assistant",state:JSON.stringify(i),active:!1}];default:return[]}}))}),e=>e.pipe(p7(e=>(this.debugLogger?.event("LEGACY","Event:",e,{type:e.type}),e))))}},yI=class extends yk{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=yt(e.headers??{})}run(e){var t,r,n,i;let a,s,o,l;return t=this.url,r=this.requestInit(e),i=p3(()=>pX(fetch(t,r))).pipe((n=e=>{if(!e.ok){let t=e.headers.get("content-type")||"";return pX(e.text()).pipe(fe(r=>{let n=r;if(t.includes("application/json"))try{n=JSON.parse(r)}catch{}let i=Error(`HTTP ${e.status}: ${"string"==typeof n?n:JSON.stringify(n)}`);return i.status=e.status,i.payload=n,p2(()=>i)}))}let t={type:yc.HEADERS,status:e.status,headers:e.headers},r=e.body?.getReader();return r?new pj(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:n}=await r.read();if(t)break;let i={type:yc.DATA,data:n};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{r.cancel().catch(e=>{if(e?.name!=="AbortError")throw e})})):p2(()=>Error("Failed to getReader() from response"))},pH(function(e,t){var r=null,i=0,a=!1,s=function(){return a&&!r&&t.complete()};e.subscribe(pZ(t,function(e){null==r||r.unsubscribe(),pG(n(e,i++)).subscribe(r=pZ(t,function(e){return t.next(e)},function(){r=null,s()}))},function(){a=!0,s()}))}))),a=ya(this.debugLogger),s=new p4,o=new p8,l=!1,i.subscribe({next:e=>{if(o.next(e),e.type!==yc.HEADERS||l)l||s.error(Error("No headers event received before data events"));else{l=!0;let t=e.headers.get("content-type");a?.lifecycle("HTTP","Stream format detected:",{contentType:t,parser:t===gV?"protobuf":"sse"}),t===gV?(e=>{let t=new p4,r=new Uint8Array;function n(){for(;r.length>=4;){let e=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<e)break;try{let n=r.slice(4,e),i=function(e){let t=Object.values(gq.decode(e)).find(e=>void 0!==e);if(!t)throw Error("Invalid event");
139if(t.type=f7[t.baseEvent.type],t.timestamp=t.baseEvent.timestamp,t.rawEvent=t.baseEvent.rawEvent,t.type===hi.MESSAGES_SNAPSHOT)for(let e of t.messages){if("user"===e.role&&Array.isArray(e.contentParts)){let t=e.contentParts.map(e=>gU(e)).filter(e=>void 0!==e);t.length>0&&(e.content=t)}Array.isArray(e.contentParts)&&0===e.contentParts.length&&(e.contentParts=void 0),e.toolCalls?.length===0&&(e.toolCalls=void 0)}if(t.type===hi.STATE_DELTA)for(let e of t.delta)e.op=fF[e.op].toLowerCase(),Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]});return Object.keys(t).forEach(e=>{void 0===t[e]&&delete t[e]}),hD.parse(t)}(n);t.next(i),r=r.slice(e)}catch(r){let e=r instanceof Error?r.message:String(r);t.error(Error(`Failed to decode protocol buffer message: ${e}`));return}}}return e.subscribe({next:e=>{if(e.type!==yc.HEADERS&&e.type===yc.DATA&&e.data){let t=new Uint8Array(r.length+e.data.length);t.set(r,0),t.set(e.data,r.length),r=t,n()}},error:e=>t.error(e),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}}),t.asObservable()})(o).subscribe({next:e=>s.next(e),error:e=>s.error(e),complete:()=>s.complete()}):((e,t)=>{let r=ya(t),n=new p4,i=new TextDecoder("utf-8",{fatal:!1}),a="";function s(e){let t=e.split(` 140`),i=[];for(let e of t)e.startsWith("data:")&&i.push(e.slice(5).replace(/^ /,""));if(i.length>0)try{let e=i.join(` 141`),t=JSON.parse(e);r?.event("SSE","Event received:",t,{type:t.type}),n.next(t)}catch(e){n.error(e)}}return e.subscribe({next:e=>{if(e.type!==yc.HEADERS&&e.type===yc.DATA&&e.data){let t=i.decode(e.data,{stream:!0}),r=(a+=t).split(/\n\n/);for(let e of(a=r.pop()||"",r))s(e)}},error:e=>n.error(e),complete:()=>{a&&s(a+=i.decode()),n.complete()}}),n.asObservable()})(o,a).subscribe({next:e=>{try{let t=hD.parse(e);
141a?.event("HTTP","Event validated:",t,{type:t.type,valid:!0}),s.next(t)}catch(t){a?.event("HTTP","Event invalid:",{json:e,error:String(t)}),s.error(t)}},error:e=>{if(e?.name==="AbortError"){s.next({type:hi.RUN_ERROR,message:e.message||"Request aborted",code:"abort",rawEvent:e}),s.complete();return}return s.error(e)},complete:()=>s.complete()})}},error:e=>{o.error(e),s.error(e)},complete:()=>{o.complete()}}),s.asObservable()}clone(){let e=super.clone();e.url=this.url,e.headers=yt(this.headers??{});let t=new AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};class yx extends yI{requestInit(e){let{params:t,accessToken:r,recordDebugSession:n}=e.forwardedProps||{},i={...t,...n&&{recordDebugSession:!0}};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${r}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify(i),signal:this.abortController.signal}}}let yA=new ef({required:!0}),yT=new ef({required:!0,constrainTo:l_}),yO=e=>({...e,name:lC(e.name)}),yN=rS("followUpAnswers/setIsEnabled",e=>to(e,new eu({required:!0}))),yR=rS("followUpAnswers/setFollowUpAnswersConversationId",e=>to(e,e7)),yD=rS("followUpAnswers/setFollowUpAnswersConversationToken",e=>to(e,e7)),yP=rS("followUpAnswers/clearFollowUpAnswersConversationToken"),yM=rS("followUpAnswers/createFollowUpAnswer",e=>to(e,{question:e7})),yj=rS("followUpAnswers/setActiveFollowUpAnswerId",e=>to(e,e7)),yF=rS("followUpAnswers/setFollowUpAnswerContentFormat",e=>to(e,{contentFormat:lO,answerId:e7})),yL=rS("followUpAnswers/setFollowUpIsLoading",e=>to(e,{isLoading:new eu({required:!0}),answerId:e7})),yq=rS("followUpAnswers/setFollowUpIsStreaming",e=>to(e,{isStreaming:new eu({required:!0}),answerId:e7})),y$=rS("followUpAnswers/followUpMessageChunkReceived",e=>to(e,{textDelta:yA,answerId:e7})),yU=rS("followUpAnswers/followUpCitationsReceived",e=>to(e,{citations:new ev({required:!0,each:new em({values:lT})}),answerId:e7})),yV=rS("followUpAnswers/followUpCompleted",e=>to(e,{answerId:e7,cannotAnswer:new eu({required:!1})})),yz=rS("followUpAnswers/followUpFailed",e=>to(e,{message:new ef,code:new ed({min:0}),answerId:e7})),yG=rS("followUpAnswers/activeFollowUpStartFailed",e=>to(e,{message:new ef})),yB=rS("followUpAnswers/likeFollowUp",e=>to(e,{answerId:e7})),yQ=rS("followUpAnswers/dislikeFollowUp",e=>to(e,{answerId:e7})),yH=rS("followUpAnswers/submitFollowUpFeedback",e=>to(e,{answerId:e7})),yZ=rS("followUpAnswers/resetFollowUpAnswers"),yK=rS("followUpAnswers/stepStarted",e=>to(yO(e),{answerId:e7,name:yT,startedAt:new ed({min:0,required:!0})})),yY=rS("followUpAnswers/stepFinished",e=>to(yO(e),{answerId:e7,name:yT,finishedAt:new ed({min:0,required:!0})}));(P=et||(et={}))[P.SseMaxDurationExceeded=1e3]="SseMaxDurationExceeded",P[P.SseFollowUpNotSupported=1001]="SseFollowUpNotSupported",P[P.ConversationNotFound=1002]="ConversationNotFound",P[P.SseModelsNotAvailable=1003]="SseModelsNotAvailable",P[P.SseInternalError=1004]="SseInternalError",P[P.SseTurnLimitReached=1005]="SseTurnLimitReached";let yW={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":et.SseMaxDurationExceeded,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":et.SseFollowUpNotSupported,"KNOWLEDGE:NOT_FOUND":et.ConversationNotFound,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":et.SseModelsNotAvailable,"KNOWLEDGE:SSE_INTERNAL_ERROR":et.SseInternalError,"KNOWLEDGE:SSE_TURN_LIMIT_REACHED":et.SseTurnLimitReached},yJ=(e,t)=>{let{referrer:r,userAgent:n,location:i,clientId:a}=e.getMeta("");return{...t?t():{},referrer:r,userAgent:n,location:i,clientId:a}};function yX(e){var t;if(!e||!((t=e)&&/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(t)))return null;try{let t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=decodeURIComponent(r.split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(n)}catch(e){return null}}function y0(e,t){e.dispatch(ll({status:401,statusCode:401,message:t.message,type:t.name}))}let y1=Symbol.for("coveo-headless-internal-state");var y2=r(85574);let y3=(e,t,r,n,i,a)=>{let s=e[t];el(s)||el(i)||i===s||i!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${s}] matches engine configuration value [${r}]`))},y5=(e,t)=>!el(e)&&t!==e,y4=e=>{let t=yX(e);return!!t&&t},y6=(e,t)=>(y5(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),y9=(e,t,r,n)=>(y3(e,"searchHub",t.searchHub,"default",r,n),y6(e,t)),y8=(e,t)=>(y5(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),y7=(e,t,r,n)=>(y3(e,"pipeline",t.pipeline,"",r,n),y8(e,t)),ve=(e,t)=>
141(y5(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),vt=new ea({...{organizationId:e7,accessToken:e7,name:new ef({required:!1,emptyAllowed:!1}),analytics:new em({options:{required:!1},values:{enabled:new eu({required:!1}),originContext:new ef({required:!1}),originLevel2:new ef({required:!1}),originLevel3:new ef({required:!1}),analyticsMode:new ef({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new ef({required:!1,url:!0}),trackingId:new ef({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new ef({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})},search:new em({options:{required:!1},values:{pipeline:new ef({required:!1,emptyAllowed:!0}),searchHub:te,locale:te,timezone:te,authenticationProviders:new ev({required:!1,each:e7}),proxyBaseUrl:new ef({required:!1,url:!0})}})}),vr={debug:sb,pipeline:sk,searchHub:lg,search:lp};function vn(e){let t=(n=e.loggerOptions,(0,y2.pino)({name:"@coveo/headless",level:n?.level||"warn",formatters:{log:n?.logFormatter}})),{configuration:r}=e;var n,i=r,a=t;try{vt.validate(i)}catch(e){throw a.error(e,"Search engine configuration error"),e}let s=function(e,t){let{search:r}=e;return new e3({logger:t,preprocessRequest:e.preprocessRequest||eF,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||e6,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||e9,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||e8})}(r,t),o=new ej({logger:t}),l={...{analyticsClientMiddleware:function(e){let{analytics:t}=e;return t?.analyticsClientMiddleware||((e,t)=>t)}(r),validatePayload:ts,preprocessRequest:r.preprocessRequest||eF,logger:t},apiClient:s,streamingClient:o},u=function(e,t){let r={...e.reducers,configuration:cu,version:ce},n=function(e,t,r){var n,i;let a,s,{reducers:o,navigatorContextProvider:l}=e,u=(n={...o,configurationReducer:r},i=e.preloadedState??{},s={...n},{get combinedReducer(){let e;return e=rg({...function(e){let t={};for(let[r,n]of e)t[r]=n;return t}(Object.entries(i).filter(([e])=>!(e in s)).map(([e,t])=>[e,()=>t])),...s}),(t,r)=>{let n=e(t,r);return a?a(n,r):n}},containsAll:e=>Object.keys(e).every(e=>e in s),add(e){Object.keys(e).filter(e=>!(e in s)).forEach(t=>{s[t]=e[t]})},addCrossReducer(e){a=e}});e.crossReducer&&u.addCrossReducer(e.crossReducer);let c=t.logger,d=function(e,t,r){let{preloadedState:n,configuration:i}=e,a=i.name||"coveo-headless",s=function(e,t,r){var n;let i,a,s,o,l,u,c,d,h,p,{renewAccessToken:f}=e.configuration,g=(i=0,a=null,s=function(e,t={}){let r;return(...n)=>{let i=t.isImmediate&&!r;if(clearTimeout(r),r=setTimeout(()=>{r=void 0,t.isImmediate||e.apply(void 0,n)},500),i)return e.apply(void 0,n)}}(()=>{i=0}),o=async(e,t=!1)=>{let r=!a;r&&f&&(a=(async()=>{try{return await f()}catch(e){if(!t)throw e;return null}})().finally(()=>{a=null}));let n=await a;return r&&n&&e.dispatch(sa({accessToken:n})),n},l=async e=>{let r=e.getState().configuration.accessToken;if(r&&function(e,t=60){if(!e)return!1;let r=yX(e);if(!r||"number"!=typeof r.exp)return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}(r)){t.debug("Access token is expired or about to expire, attempting renewal.");try{await o(e)?t.debug("Access token was renewed."):t.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(e){t.warn(e,"Access token renewal failed. A retry will occur if necessary.")}}},u=async(e,r,n)=>{if(i>=5)return t.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),y0(e,r.error),r;a||(i++,s());try{await o(e,!0)}catch(e){t.debug(e,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}e.dispatch(n)},e=>r=>async n=>{var i;let a="function"==typeof f;if("function"!=typeof n)return r(n);a&&await l(e);let s=await r(n);return"object"==typeof(i=s)&&null!==i&&"error"in i&&i.error?.name===new eH().name?a?await u(e,s,n):(t.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),y0(e,s.error),s):s}),m=(c=((e={})=>{let t=new Map,r=new Map,{extra:n,onError:i=ng}=e;r4(i,"onError");let a=e=>{var r;return(r=nu(t,e)??nl(e)).unsubscribe=()=>t.delete(r.id),t.set(r.id,r),e=>{r.unsubscribe(),e?.cancelActive&&nc(r)}};ni(a,{withTypes:()=>a});let s=e=>{let r=nu(t,e);return r&&(r.unsubscribe(),e.cancelActive&&nc(r)),!!r};
141ni(s,{withTypes:()=>s});let o=async(e,s,o,l)=>{var u,c;let d,h=new AbortController,p=(u=h.signal,d=async(e,t)=>{r7(u);let r=()=>{},n=[new Promise((t,n)=>{let i=a({predicate:e,effect:(e,r)=>{r.unsubscribe(),t([e,r.getState(),r.getOriginalState()])}});r=()=>{i(),n()}})];null!=t&&n.push(new Promise(e=>setTimeout(e,t,null)));try{let e=await ne(u,Promise.race(n));return r7(u),e}finally{r()}},(e,t)=>r9(d(e,t))),f=[];try{let i;e.pending.add(h),i=r.get(e)??0,r.set(e,i+1),await Promise.resolve(e.effect(s,ni({},o,{getOriginalState:l,condition:(e,t)=>p(e,t).then(Boolean),take:p,delay:nn(h.signal),pause:nr(h.signal),extra:n,signal:h.signal,fork:(c=h.signal,(e,t)=>{r4(e,"taskExecutor");let r=new AbortController;r8(c,()=>r.abort(c.reason));let n=nt(async()=>{r7(c),r7(r.signal);let t=await e({pause:nr(r.signal),delay:nn(r.signal),signal:r.signal});return r7(r.signal),t},()=>r.abort(r1));return t?.autoJoin&&f.push(n.catch(r6)),{result:nr(c)(n),cancel(){r.abort(r0)}}}),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,r)=>{e!==h&&(e.abort(r2),r.delete(e))})},cancel:()=>{h.abort(r2),e.pending.delete(h)},throwIfCancelled:()=>{r7(h.signal)}})))}catch(e){e instanceof r5||nd(i,e,{raisedBy:"effect"})}finally{let t;await Promise.all(f),h.abort(r3),1===(t=r.get(e)??1)?r.delete(e):r.set(e,t-1),e.pending.delete(h)}},l=()=>{for(let e of r.keys())nc(e);t.clear()};return{middleware:e=>r=>n=>{let u;if(!ry(n))return r(n);if(nh.match(n))return a(n.payload);if(np.match(n))return void l();if(nf.match(n))return s(n.payload);let c=e.getState(),d=()=>{if(c===na)throw Error(nm(23));return c};try{if(u=r(n),t.size>0){let r=e.getState();for(let a of Array.from(t.values())){let t=!1;try{t=a.predicate(n,r,c)}catch(e){t=!1,nd(i,e,{raisedBy:"predicate"})}t&&o(a,n,e,d)}}}finally{c=na}return u},startListening:a,stopListening:s,clearListeners:l}})({extra:n={getNavigatorContext:r}}),p={run:async(e,t,r)=>{var n,i;let a,s,o,l,u,c,p,f,g,m;h();let y=a_(e),v=e.configuration.organizationId,b=e.configuration.environment,w=e.configuration.accessToken,S=e.configuration.knowledge.debugAgentSession,E=new yx({url:`${((e,t,r)=>{let n=eW(t,r),i=e?.trim();if(!n||!t||!i)throw Error("Missing required parameters for answer endpoint");let a=`/api/preview/organizations/${t}/agents`;return`${n}${a}/${i}`})(y,v,b)}/answer`});d=E;let _=(a="",s=!1,{onRunStartedEvent:({event:e})=>{a=e.runId,s=!1,t(lP(e.runId)),t(lK(!1)),t(lY(!0)),t(yR(e.threadId)),t(yP())},onStepStartedEvent:({event:e})=>{t(l5({name:e.stepName,startedAt:e.timestamp??Date.now()}))},onStepFinishedEvent:({event:e})=>{t(l4({name:e.stepName,finishedAt:e.timestamp??Date.now()}))},onTextMessageContentEvent:({event:e})=>{e.delta.length>0&&(s=!0),t(lF({textDelta:e.delta}))},onCustomEvent:({event:e})=>{let{name:r,value:n}=e;switch(r){case"header":n?.contentFormat&&t(lW(n.contentFormat)),"boolean"==typeof n?.followUpEnabled&&t(yN(n.followUpEnabled)),n?.conversationToken&&t(yD(n.conversationToken));return;case"citations":return void t(lL({citations:n.citations}))}},onRunErrorEvent:({event:e})=>{var r;let n=(r=e.code)?yW[r]??et.SseInternalError:et.SseInternalError;t(lq({message:e.message,code:n}))},onRunFinishedEvent:({event:e})=>{let r=e.result?.completionReason==="ANSWERED",n=r?!s:void 0;t(l1(r)),t(l2(!r)),t(lY(!1)),t(lm(r,a,n)),t(ly())}}),C=(n=e,i=r(),o=n.query?.q,l=lE(n),u=sz(n.configuration.analytics,i,{actionCause:lo(n)}),c=n.configuration.search.locale,p=n.searchHub,f=n.pipeline,g=n.context,m=aA(n)??[],{q:o||"",...l.length&&{facets:l},citationsFieldToInclude:m,...p?.length&&{searchHub:p},...f?.length&&{pipeline:f},...g?.contextValues&&{context:g.contextValues},...u,locale:c});try{t(lK(!0)),await E.runAgent({forwardedProps:{params:C,accessToken:w,recordDebugSession:S}},_)}catch(e){t(lK(!1)),t(lq({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",e)}},abortRun:h=()=>{d?.abortRun(),d=void 0}},c.startListening({actionCreator:o4.pending,effect:async(e,t)=>{let r=t.getState();if(!aI(r))return;
141p.abortRun(),t.dispatch(l$()),t.dispatch(yZ());let i=r.query?.q;i&&""!==i.trim()&&p.run(r,t.dispatch,n.getNavigatorContext)}}),c);return[cc,g,()=>e=>r=>{if(!r.error)return e(r);let n=r.error;if(r.payload?.ignored||t.error({error:n,action:r},`Action dispatch error ${r.type}`),"SchemaValidationError"!==r.error.name)return e(r)},ct].concat(u8.middleware,m.middleware,e.middlewares||[])}(e,t.logger,()=>t.navigatorContext);return function({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:i}){return function(e){let t,r,n,i=function(e){let{thunk:t=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:i=!0}=e??{},a=new rE;return t&&("boolean"==typeof t?a.push(rb):a.push(rv(t.extraArgument))),a},{reducer:a,middleware:s,devTools:o=!0,duplicateMiddlewareCheck:l=!0,preloadedState:u,enhancers:c}=e||{};if("function"==typeof a)t=a;else if(rf(a))t=rg(a);else throw Error(nm(1));r="function"==typeof s?s(i):i();let d=rm;o&&(d=rw({trace:!1,..."object"==typeof o&&o}));let h=(n=function(...e){return t=>(r,n)=>{let i=t(r,n),a=()=>{throw Error(rc(15))},s={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=rm(...e.map(e=>e(s)))(i.dispatch),{...i,dispatch:a}}}(...r),function(e){let{autoBatch:t=!0}=e??{},r=new rE(n);return t&&r.push(((e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,a=!1,s=!1,o=new Set,l="tick"===e.type?queueMicrotask:"raf"===e.type?"u">typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:rx(10):"callback"===e.type?e.queueNotification:rx(e.timeout),u=()=>{s=!1,a&&(a=!1,o.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){let t=n.subscribe(()=>i&&e());return o.add(e),()=>{t(),o.delete(e)}},dispatch(e){try{return(a=!(i=!e?.meta?.[rk]))&&!s&&(s=!0,l(u)),n.dispatch(e)}finally{i=!0}}})})("object"==typeof t?t:void 0)),r});return function e(t,r,n){if("function"!=typeof t)throw Error(rc(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(rc(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(rc(1));return n(e)(t,r)}let i=t,a=r,s=new Map,o=s,l=0,u=!1;
141function c(){o===s&&(o=new Map,s.forEach((e,t)=>{o.set(t,e)}))}function d(){if(u)throw Error(rc(3));return a}function h(e){if("function"!=typeof e)throw Error(rc(4));if(u)throw Error(rc(5));let t=!0;c();let r=l++;return o.set(r,e),function(){if(t){if(u)throw Error(rc(6));t=!1,c(),o.delete(r),s=null}}}function p(e){if(!rf(e))throw Error(rc(7));if(void 0===e.type)throw Error(rc(8));if("string"!=typeof e.type)throw Error(rc(17));if(u)throw Error(rc(9));try{u=!0,a=i(a,e)}finally{u=!1}return(s=o).forEach(e=>{e()}),e}return p({type:rp.INIT}),{dispatch:p,subscribe:h,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw Error(rc(10));i=e,p({type:rp.REPLACE})},[rd]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(rc(11));function t(){e.next&&e.next(d())}return t(),{unsubscribe:h(t)}},[rd](){return this}}}}}(t,u,d(..."function"==typeof c?c(h):h()))}({reducer:e,preloadedState:t,devTools:{stateSanitizer:e=>e.history?{...e,history:"<<OMIT>>"}:e,name:i,shouldHotReload:!1},middleware:e=>{let t;return e({thunk:{extraArgument:n}}).prepend(...r).concat((t=n.logger,e=>r=>n=>(t.debug({action:n,nextState:e.getState()},`Action dispatched: ${n.type}`),r(n))))}})}({preloadedState:n,reducer:r.combinedReducer,middlewares:s,thunkExtraArguments:t,name:a})}(e,{...t,get relay(){return nW(h.state,l)},get navigatorContext(){return yJ(this.relay,l)}},u),h={addReducers(e){u.containsAll(e)||(u.add(e),d.replaceReducer(u.combinedReducer))},dispatch:d.dispatch,subscribe:d.subscribe,enableAnalytics(){d.dispatch(sc())},disableAnalytics(){d.dispatch(su())},get state(){return d.getState()},get relay(){return nW(this.state,l)},get navigatorContext(){return yJ(this.relay,l)},logger:c,store:d};return h}({...e,reducers:r},t,cu),{accessToken:i,environment:a,organizationId:s}=e.configuration;n.dispatch(sa({accessToken:i,environment:a,organizationId:s}));let o=function(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...i}=r??{},a={...i,...r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl}};return"next"!==a.analyticsMode&&function(){if("u"<typeof navigator||"u"<typeof window)return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(e=>eE.has(e))}()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}(e.configuration,n.logger);return o&&n.dispatch(sl(o)),n}({...e,reducers:vr,crossReducer:rT({},e=>{e.addCase(lf,(e,r)=>{let n=y4(e.configuration.accessToken);return n?y9(n,e,r.payload,t):e}).addCase(sC,(e,r)=>{let n=y4(e.configuration.accessToken);return n?y7(n,e,r.payload,t):e}).addCase(sa,(e,t)=>{if(e.configuration.accessToken!==t.payload.accessToken)return e;let{accessToken:r}=t.payload;if(!r)return e;let n=y4(r);return n?[y8,y6,ve].reduce((e,t)=>t(n,e),e):e}).addCase(ss,(e,r)=>{let n=y4(e.configuration.accessToken);if(!n)return e;let i=y9(n,e,r.payload.searchHub,t);return y7(n,i,r.payload?.pipeline,t)}).addCase(sl,(e,r)=>{var n;let i=y4(e.configuration.accessToken);return i?(n=r.payload.userDisplayName,y3(i,"userDisplayName",e.configuration.analytics.userDisplayName,cs().analytics.userDisplayName,n,t),ve(i,e)):e})})},l),c=function(e){let{search:t}=e,{proxyBaseUrl:r,pipeline:n,searchHub:i,timezone:a,locale:s,authenticationProviders:o}=t??{};return{proxyBaseUrl:r,pipeline:n,searchHub:i,timezone:a,locale:s,authenticationProviders:o}}(r);return c&&u.dispatch(ss(c)),{...u,get state(){return u.state},executeFirstSearch(e=se()){if(ls(u.state))return;let t=o4({legacy:e,next:{actionCause:B.interfaceLoad}});u.dispatch(t)},executeFirstSearchAfterStandaloneSearchBoxRedirect(e){let{cause:t,metadata:r}=e;if(ls(u.state))return;let n=r&&"omniboxFromLink"===t,i=o4({legacy:n?sn(r):sr(),next:n?{actionCause:B.omniboxFromLink}:{actionCause:B.searchFromLink}});u.dispatch(i)}}}let vi={value:e7,numberOfResults:new ed({min:0}),state:e7},va=new ed({min:1,default:8,required:!1}),vs={desiredCount:new ed({min:1,max:20,default:5,required:!1}),numberOfValues:va},vo=rS("automaticFacet/setOptions",e=>to(e,vs)),vl=rS("automaticFacet/deselectAll",e=>to(e,e7)),vu=rS("automaticFacet/toggleSelectValue",e=>to(e,{field:e7,selection:new em({values:vi})})),vc={state:new es({required:!0}),numberOfResults:new ed({required:!0,min:0}),value:new ef({required:!0,emptyAllowed:!0}),path:new ev({required:!0,each:e7}),moreValuesAvailable:new eu({required:!1})},vd={facetId:e7,field:e7,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),activeTab:new ef({required:!1}),delimitingCharacter:new ef({required:!1,emptyAllowed:!0}),filterFacetCount:new eu({required:!1}),injectionDepth:new ed({required:!1,min:0}),numberOfValues:new ed({required:!1,min:1}),sortCriteria:new es({required:!1}),basePath:new ev({required:!1,each:e7}),filterByBasePath:new eu({required:!1})},vh=rS("categoryFacet/register",e=>to(e,vd)),vp=rS("categoryFacet/toggleSelectValue",e=>
141{try{return ts(e.facetId,e7),!function e(t){t.children.forEach(t=>{e(t)}),ts({state:t.state,numberOfResults:t.numberOfResults,value:t.value,path:t.path,moreValuesAvailable:t.moreValuesAvailable},vc)}(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:ta(t)}}}),vf=rS("categoryFacet/deselectAll",e=>to(e,vd.facetId)),vg=rS("categoryFacet/updateNumberOfValues",e=>to(e,{facetId:vd.facetId,numberOfValues:vd.numberOfValues})),vm=rS("categoryFacet/updateSortCriterion",e=>to(e,{facetId:vd.facetId,criterion:new es})),vy=rS("categoryFacet/updateBasePath",e=>to(e,{facetId:vd.facetId,basePath:new ev({each:e7})})),vv={categoryFacetId:e7,categoryFacetPath:new ev({required:!0,each:e7})},vb=e=>a4("analytics/categoryFacet/breadcrumb",(t,r)=>(to(e,vv),t.makeBreadcrumbFacet(((e,{categoryFacetId:t,categoryFacetPath:r})=>{let n=e.categoryFacetSet[t],i=n?.request.field,a=`${i}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:i,categoryFacetTitle:a}})(r,e)))),vw=rS("facetOptions/update",(e={freezeFacetOrder:!0})=>to(e,{freezeFacetOrder:new eu({required:!1})})),vS=rS("facetOptions/facet/enable",e=>to(e,e7)),vE=rS("facetOptions/facet/disable",e=>to(e,e7)),v_=(e,t)=>"object"==typeof e&&0===Object.keys({...e}).length||!t||!e||!e.excluded?.includes(t)&&(!!(e.included&&(0===e.included.length||e.included.includes(t)))||!!e.excluded&&!e.included),vC={facetId:e7,captions:new em({options:{required:!1}}),numberOfValues:new ed({required:!1,min:1}),query:new ef({required:!1,emptyAllowed:!0})},vk={path:new ev({required:!0,each:e7}),displayValue:tt,rawValue:tt,count:new ed({required:!0,min:0})},vI=rS("categoryFacet/selectSearchResult",e=>to(e,{facetId:e7,value:new em({values:vk})})),vx=rS("categoryFacetSearch/register",e=>to(e,vC));function vA(e,t){let{facetId:r,criterion:n}=t,i=e[r]?.request;i&&(i.sortCriteria=n)}function vT(e){e&&(e.currentValues=e.currentValues.map(e=>({...e,...{previousState:"idle"!==e.state?e.state:void 0},state:"idle"})),e.preventAutoSelect=!0)}function vO(e,t){e&&(e.numberOfValues=t)}function vN(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function vR(e,t,r){e.currentValues=function(e,t){if(!e.length)return[];let r=vD(e[0],t),n=r;for(let r of e.splice(1)){let e=vD(r,t);n.children.push(e),n=e}return n.state="selected",n.retrieveChildren=!0,[r]}(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function vD(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}rT({},e=>{e.addCase(vh,(e,t)=>{var r;let n=t.payload,{facetId:i,tabs:a}=n;if(i in e)return;let s=(r=n,{...vP,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...r}),o=s.numberOfValues;e[i]={request:s,initialNumberOfValues:o,tabs:a}}).addCase(s_.fulfilled,(e,t)=>t.payload?.categoryFacetSet??e).addCase(sg,(e,t)=>{let r=t.payload.cf||{},n=t.payload.tab;Object.keys(e).forEach(t=>{let i=e[t],a=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!v_(i.tabs,n)){a.currentValues.length&&vR(a,[],i.initialNumberOfValues);return}let s=r[t]||[];(s.length||a.currentValues.length)&&vR(a,s,i.initialNumberOfValues)})}).addCase(vm,(e,t)=>{let{facetId:r,criterion:n}=t.payload,i=e[r]?.request;i&&(i.sortCriteria=n)}).addCase(vy,(e,t)=>{let{facetId:r,basePath:n}=t.payload,i=e[r]?.request;i&&(i.basePath=[...n])}).addCase(vp,(e,t)=>{let{facetId:r,selection:n,retrieveCount:i}=t.payload,a=e[r]?.request;if(!a)return;let{path:s}=n,o=function(e,t,r){let n=e.currentValues;for(let e of t){let t=n[0];t&&e===t.value||(t=vM(e,r),n.length=0,n.push(t)),t.retrieveChildren=!1,t.previousState=void 0,t.state="idle",n=t.children}return n}(a,s.slice(0,s.length-1),i);if(o.length){let e=o[0];e.retrieveChildren=!0,e.state="selected",e.previousState="idle",e.children=[];return}let l=vM(n.value,i);l.state="selected",l.previousState="idle",o.push(l),a.numberOfValues=1}).addCase(vf,(e,t)=>{vN(e,t.payload)}).addCase(sI,e=>{Object.keys(e).forEach(t=>vN(e,t))}).addCase(sA,(e,t)=>Object.keys(e).forEach(r=>{e[r].request.preventAutoSelect=!t.payload.allow})).addCase(vg,(e,t)=>{let{facetId:r,numberOfValues:n}=t.payload,i=e[r]?.request;if(i){if(!i.currentValues.length)return vO(i,n);!function(e,t){let{facetId:r,numberOfValues:n}=t,i=e[r]?.request.currentValues[0];if(i){for(;i.children.length&&i?.state!=="selected";)i=i.children[0];i.retrieveCount=n}}(e,t.payload)}}).addCase(vI,(e,t)=>{let{facetId:r,value:n}=t.payload,i=e[r];if(!i)return;let a=[...n.path,n.rawValue];vR(i.request,a,i.initialNumberOfValues)}).addCase(o8.fulfilled,(e,t)=>{vj(e,t.payload.response.facets)}).addCase(o4.fulfilled,(e,t)=>{vj(e,t.payload.response.facets)}).addCase(vE,(e,t)=>{vN(e,t.payload)}).addCase(cn,(e,t)=>{let r=t.payload;Object.keys(e).forEach(t=>{let n=e[t];(n.tabs?.included?.length||n.tabs?.excluded?.length)&&!v_(n.tabs,r)&&vN(e,t)})})});let vP={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function vM(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function vj(e,t){t.forEach(t=>{var r,n,i;let a,s;if(r=e,!(t.facetId in r))return;let o=t.facetId,l=e[o]?.request;if(!l)return;
141let u=(n=l,i=t,a=aN(n.currentValues),s=aN(i.values),a.length!==s.length);l.currentValues=u?[]:l.currentValues,l.preventAutoSelect=!1})}let vF=new ef({regex:/^[a-zA-Z0-9-_]+$/}),vL=new ef({required:!0}),vq=new ev({each:new ef}),v$=new ef,vU=new eu,vV=new eu,vz=new ed({min:0}),vG=new ed({min:1}),vB=new eu({required:!0}),vQ=new em,vH=new em({values:{captions:vQ,numberOfValues:vG,query:new ef}}),vZ=new em({options:{required:!1},values:{type:new ef({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ev({required:!0,max:25,each:new ef({emptyAllowed:!1,required:!0})})}}),vK=new eu,vY=new ev({min:1,max:25,required:!1,each:new ef({emptyAllowed:!1,required:!0})}),vW={facetId:e7,field:new ef({required:!0,emptyAllowed:!0}),tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),activeTab:new ef({required:!1}),filterFacetCount:new eu({required:!1}),injectionDepth:new ed({required:!1,min:0}),numberOfValues:new ed({required:!1,min:1}),sortCriteria:new es({required:!1}),resultsMustMatch:new es({required:!1}),allowedValues:vZ,customSort:vY},vJ=rS("facet/register",e=>to(e,vW)),vX=rS("facet/toggleSelectValue",e=>to(e,{facetId:e7,selection:new em({values:vi})})),v0=rS("facet/toggleExcludeValue",e=>to(e,{facetId:e7,selection:new em({values:vi})})),v1=rS("facet/deselectAll",e=>to(e,e7)),v2=rS("facet/updateSortCriterion",e=>to(e,{facetId:e7,criterion:new es({required:!0})})),v3=rS("facet/updateNumberOfValues",e=>to(e,{facetId:e7,numberOfValues:new ed({required:!0,min:1})})),v5=rS("facet/updateIsFieldExpanded",e=>to(e,{facetId:e7,isFieldExpanded:new eu({required:!0})})),v4=rS("facet/updateFreezeCurrentValues",e=>to(e,{facetId:e7,freezeCurrentValues:new eu({required:!0})})),v6=e=>a4("analytics/facet/showMore",(t,r)=>{to(e,e7);let n=aD(e,aM(r));return t.makeFacetShowMore(n)}),v9=e=>a4("analytics/facet/showLess",(t,r)=>{to(e,e7);let n=aD(e,aM(r));return t.makeFacetShowLess(n)}),v8=e=>a4("analytics/facet/sortChange",(t,r)=>{to(e,{facetId:e7,criterion:new es({required:!0})});let{facetId:n,criterion:i}=e,a={...aD(n,aM(r)),criteria:i};return t.makeFacetUpdateSort(a)}),v7=e=>a4("analytics/facet/reset",(t,r)=>{to(e,e7);let n=aD(e,aM(r));return t.makeFacetClearAll(n)}),be=e=>a4("analytics/facet/select",(t,r)=>{to(e,{facetId:e7,facetValue:e7});let n=aP(e,aM(r));return t.makeFacetSelect(n)}),bt=e=>a4("analytics/facet/exclude",(t,r)=>{to(e,{facetId:e7,facetValue:e7});let n=aP(e,aM(r));return t.makeFacetExclude(n)}),br=e=>a4("analytics/facet/deselect",(t,r)=>{to(e,{facetId:e7,facetValue:e7});let n=aP(e,aM(r));return t.makeFacetDeselect(n)}),bn=e=>a4("analytics/facet/unexclude",(t,r)=>{to(e,{facetId:e7,facetValue:e7});let n=aP(e,aM(r));return t.makeFacetUnexclude(n)}),bi=e=>a4("analytics/facet/breadcrumb",(t,r)=>{to(e,{facetId:e7,facetValue:e7});let n=aP(e,aM(r));return t.makeBreadcrumbFacet(n)}),ba=()=>({actionCause:B.facetClearAll}),bs=()=>({actionCause:B.facetSelect}),bo=()=>({actionCause:B.facetExclude}),bl=()=>({actionCause:B.facetDeselect}),bu={facetId:e7,value:new em({values:{displayValue:tt,rawValue:tt,count:new ed({required:!0,min:0})}})},bc=rS("facetSearch/register",e=>to(e,vC)),bd=rS("facetSearch/update",e=>to(e,vC)),bh=rS("facetSearch/toggleSelectValue",e=>to(e,bu)),bp=rS("facetSearch/toggleExcludeValue",e=>to(e,bu)),bf=rT({},e=>{e.addCase(vJ,(e,t)=>{let{facetId:r,tabs:n}=t.payload;if(!(r in e)){var i;e[r]=(i=t.payload,{request:{...by,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...i},hasBreadcrumbs:!0,tabs:n})}}).addCase(s_.fulfilled,(e,t)=>{if(t.payload&&0!==Object.keys(t.payload.facetSet).length)return t.payload.facetSet}).addCase(sg,(e,t)=>{let r=t.payload.f||{},n=t.payload.fExcluded||{};Object.keys(e).forEach(t=>{let{request:i}=e[t],a=r[t]||[],s=n[t]||[],o=a.length+s.length,l=i.currentValues.filter(e=>!a.includes(e.value)&&!s.includes(e.value));i.currentValues=[...a.map(bb),...s.map(bw),...l.map(bS)],i.preventAutoSelect=o>0,i.numberOfValues=Math.max(o,i.numberOfValues)})}).addCase(vX,(e,t)=>{let{facetId:r,selection:n}=t.payload,i=e[r]?.request;if(!i)return;i.preventAutoSelect=!0;let a=i.currentValues.find(e=>e.value===n.value);if(!a)return void bg(i,n);let s="selected"===a.state;a.previousState=a.state,a.state=s?"idle":"selected",i.freezeCurrentValues=!0}).addCase(v0,(e,t)=>{let{facetId:r,selection:n}=t.payload,i=e[r]?.request;if(!i)return;i.preventAutoSelect=!0;let a=i.currentValues.find(e=>e.value===n.value);if(!a)return void bg(i,n);let s="excluded"===a.state;a.previousState=a.state,a.state=s?"idle":"excluded",i.freezeCurrentValues=!0}).addCase(v4,(e,t)=>{let{facetId:r,freezeCurrentValues:n}=t.payload,i=e[r]?.request;i&&(i.freezeCurrentValues=n)}).addCase(v1,(e,t)=>{vT(e[t.payload]?.request)}).addCase(sI,e=>{Object.values(e).filter(e=>
141e.hasBreadcrumbs).forEach(({request:e})=>vT(e))}).addCase(sx,e=>{Object.values(e).filter(e=>!e.hasBreadcrumbs).forEach(({request:e})=>vT(e))}).addCase(sA,(e,t)=>Object.values(e).forEach(e=>{e.request.preventAutoSelect=!t.payload.allow})).addCase(v2,(e,t)=>{vA(e,t.payload)}).addCase(v3,(e,t)=>{let{facetId:r,numberOfValues:n}=t.payload;vO(e[r]?.request,n)}).addCase(v5,(e,t)=>{let{facetId:r,isFieldExpanded:n}=t.payload,i=e[r]?.request;i&&(i.isFieldExpanded=n)}).addCase(o4.fulfilled,(e,t)=>{t.payload.response.facets.forEach(t=>bm(e[t.facetId]?.request,t))}).addCase(o8.fulfilled,(e,t)=>{t.payload.response.facets.forEach(t=>bm(e[t.facetId]?.request,t))}).addCase(bh,(e,t)=>{let{facetId:r,value:n}=t.payload,i=e[r]?.request;if(!i)return;let{rawValue:a}=n,{currentValues:s}=i,o=s.find(e=>e.value===a);if(o){o.state="selected";return}bg(i,bb(a)),i.freezeCurrentValues=!0,i.preventAutoSelect=!0}).addCase(bp,(e,t)=>{let{facetId:r,value:n}=t.payload,i=e[r]?.request;if(!i)return;let{rawValue:a}=n,{currentValues:s}=i,o=s.find(e=>e.value===a);if(o){o.state="excluded";return}bg(i,bw(a)),i.freezeCurrentValues=!0,i.preventAutoSelect=!0}).addCase(vE,(e,t)=>{if(!(t.payload in e))return;let{request:r}=e[t.payload];vT(r)}).addCase(cn,(e,t)=>{let r=t.payload;Object.keys(e).forEach(t=>{let n=e[t];(n.tabs?.included?.length||n.tabs?.excluded?.length)&&!v_(n.tabs,r)&&vT(n.request)})})});function bg(e,t){let{currentValues:r}=e,n=r.findIndex(e=>"idle"===e.state),i=-1===n?r.length:n;e.currentValues.splice(i,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function bm(e,t){e&&(e.currentValues=t.values.map(bv),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}let by={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function bv(e){let{value:t,state:r}=e;return{value:t,state:r}}function bb(e){return{value:e,state:"selected"}}function bw(e){return{value:e,state:"excluded"}}function bS(e){return{...e,state:"idle"}}let bE=()=>a4("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());function b_(e){let t=bC(e.start,e),r=bC(e.end,e);return{start:t,end:r,endInclusive:e.endInclusive??!1,state:e.state??"idle"}}function bC(e,t){let{dateFormat:r}=t;return e&&"object"==typeof e&&"period"in e?(s6(e),function(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}(e)):"string"==typeof e&&oe(e)?(s6(e),e):(s2(e,r),s1(s0(e,r)))}let bk=rS("rangeFacet/updateSortCriterion",e=>to(e,{facetId:e7,criterion:new es({required:!0})})),bI={state:e7,start:new ed({required:!0}),end:new ed({required:!0}),endInclusive:new eu({required:!0}),numberOfResults:new ed({required:!0,min:0})},bx={start:e7,end:e7,endInclusive:new eu({required:!0}),state:e7,numberOfResults:new ed({required:!0,min:0})},bA=e=>({facetId:e7,selection:new em("string"==typeof e.start?{values:bx}:{values:bI})}),bT={start:e7,end:e7,endInclusive:new eu({required:!0}),state:e7},bO={facetId:e7,field:e7,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),activeTab:new ef({required:!1}),currentValues:new ev({required:!1,each:new em({values:bT})}),generateAutomaticRanges:new eu({required:!0}),filterFacetCount:new eu({required:!1}),injectionDepth:new ed({required:!1,min:0}),numberOfValues:new ed({required:!1,min:1}),sortCriteria:new es({required:!1}),rangeAlgorithm:new es({required:!1})};function bN(e){e.currentValues&&e.currentValues.forEach(e=>{let{start:t,end:r}=b_(e);if(s0(oe(t)?s8(t):t).isAfter(s0(oe(r)?s8(r):r)))throw Error(`The start value is greater than the end value for the date range ${e.start} to ${e.end}`)})}let bR=rS("dateFacet/register",e=>{try{return ts(e,bO),bN(e),{payload:e,error:null}}catch(t){return{payload:e,error:ta(t)}}}),bD=rS("dateFacet/toggleSelectValue",e=>to(e,{facetId:e7,selection:new em({values:bx})})),bP=rS("dateFacet/toggleExcludeValue",e=>to(e,{facetId:e7,selection:new em({values:bx})})),bM=rS("dateFacet/updateFacetValues",e=>{try{return ts(e,{facetId:e7,values:new ev({each:new em({values:bx})})}),bN({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ta(t)}}}),bj=(e,{facetId:t,selection:r})=>{let n=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,i=`${n}_${t}`;return{facetId:t,facetField:n,facetTitle:i,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},bF=e=>a4("analytics/dateFacet/breadcrumb",(t,r)=>{to(e,bA(e.selection));let n=bj(r,e);return t.makeBreadcrumbFacet(n)}),bL={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function bq(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let i=bH(r);r.numberOfValues=i,e[n]=t}function b$(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=bH(n))}function bU(e,t,r){let n=e[t]?.request;if(!n)return;let i=bQ(n.currentValues,r);if(!i)return;let a="selected"===i.state;i.previousState=i.state,i.state=a?"idle":"selected",n.preventAutoSelect=!0}function bV(e,t,r){let n=e[t]?.request;if(!n)return;let i=bQ(n.currentValues,r);if(!i)return;let a="excluded"===i.state;i.previousState=i.state,i.state=a?"idle":"excluded",n.preventAutoSelect=!0}function bz(e,t){let r=e[t]?.request;
141r&&r.currentValues.forEach(e=>{"idle"!==e.state&&(e.previousState=e.state),e.state="idle"})}function bG(e,t){Object.entries(e).forEach(([e,{request:r}])=>{let n=t[e]||[];r.currentValues.forEach(e=>(bQ(n,e)&&(e.state="selected"),e));let i=n.filter(e=>!bQ(r.currentValues,e)),a=r.currentValues;a.push(...i),r.numberOfValues=Math.max(r.numberOfValues,a.length)})}function bB(e,t,r){t.forEach(t=>{let n=t.facetId,i=e[n]?.request;i&&(i.currentValues=r(t.values),i.preventAutoSelect=!1)})}function bQ(e,t){let{start:r,end:n}=t;return e.find(e=>e.start===r&&e.end===n)}function bH(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}let bZ=rT({},e=>{e.addCase(bR,(e,t)=>{var r;let{payload:n}=t,{tabs:i}=n;bq(e,(r=n,{request:{...bL,currentValues:[],preventAutoSelect:!1,type:"dateRange",...r},tabs:i}))}).addCase(s_.fulfilled,(e,t)=>t.payload?.dateFacetSet??e).addCase(sg,(e,t)=>{bG(e,t.payload.df||{})}).addCase(bD,(e,t)=>{let{facetId:r,selection:n}=t.payload;bU(e,r,n)}).addCase(bP,(e,t)=>{let{facetId:r,selection:n}=t.payload;bV(e,r,n)}).addCase(bM,(e,t)=>{let{facetId:r,values:n}=t.payload;b$(e,r,n)}).addCase(v1,(e,t)=>{bz(e,t.payload)}).addCase(sI,e=>{Object.keys(e).forEach(t=>{bz(e,t)})}).addCase(bk,(e,t)=>{vA(e,t.payload)}).addCase(o4.fulfilled,(e,t)=>{bB(e,t.payload.response.facets,bK)}).addCase(vE,(e,t)=>{bz(e,t.payload)}).addCase(cn,(e,t)=>{let r=t.payload;Object.keys(e).forEach(t=>{let n=e[t];(n.tabs?.included?.length||n.tabs?.excluded?.length)&&!v_(n.tabs,r)&&bz(e,t)})})});function bK(e){return e.map(e=>{let{numberOfResults:t,...r}=e;return r})}let bY={state:e7,start:new ed({required:!0}),end:new ed({required:!0}),endInclusive:new eu({required:!0})},bW={facetId:e7,field:e7,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),activeTab:new ef({required:!1}),currentValues:new ev({required:!1,each:new em({values:bY})}),generateAutomaticRanges:new eu({required:!0}),filterFacetCount:new eu({required:!1}),injectionDepth:new ed({required:!1,min:0}),numberOfValues:new ed({required:!1,min:1}),sortCriteria:new es({required:!1}),rangeAlgorithm:new es({required:!1})};function bJ(e){e.currentValues&&e.currentValues.forEach(({start:e,end:t})=>{if(e>t)throw Error(`The start value is greater than the end value for the numeric range ${e} to ${t}`)})}let bX=rS("numericFacet/register",e=>{try{return to(e,bW),bJ(e),{payload:e,error:null}}catch(t){return{payload:e,error:ta(t)}}}),b0=rS("numericFacet/toggleSelectValue",e=>to(e,{facetId:e7,selection:new em({values:bI})})),b1=rS("numericFacet/toggleExcludeValue",e=>to(e,{facetId:e7,selection:new em({values:bI})})),b2=rS("numericFacet/updateFacetValues",e=>{try{return ts(e,{facetId:e7,values:new ev({each:new em({values:bI})})}),bJ({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ta(t)}}}),b3=e=>a4("analytics/numericFacet/breadcrumb",(t,r)=>{to(e,bA(e.selection));let n=bj(r,e);return t.makeBreadcrumbFacet(n)});function b5(e){return e.map(e=>{let{numberOfResults:t,...r}=e;return r})}rT({},e=>{e.addCase(bX,(e,t)=>{var r;let{payload:n}=t,{tabs:i}=n;bq(e,(r=n,{request:{...bL,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...r},tabs:i}))}).addCase(s_.fulfilled,(e,t)=>t.payload?.numericFacetSet??e).addCase(sg,(e,t)=>{bG(e,t.payload.nf||{})}).addCase(b0,(e,t)=>{let{facetId:r,selection:n}=t.payload;bU(e,r,n)}).addCase(b1,(e,t)=>{let{facetId:r,selection:n}=t.payload;bV(e,r,n)}).addCase(b2,(e,t)=>{let{facetId:r,values:n}=t.payload;b$(e,r,n)}).addCase(v1,(e,t)=>{bz(e,t.payload)}).addCase(sI,e=>{Object.keys(e).forEach(t=>{bz(e,t)})}).addCase(bk,(e,t)=>{vA(e,t.payload)}).addCase(o4.fulfilled,(e,t)=>{bB(e,t.payload.response.facets,b5)}).addCase(vE,(e,t)=>{bz(e,t.payload)}).addCase(cn,(e,t)=>{let r=t.payload;Object.keys(e).forEach(t=>{let n=e[t];(n.tabs?.included?.length||n.tabs?.excluded?.length)&&!v_(n.tabs,r)&&bz(e,t)})})});let b4=new em({options:{required:!0},values:{caption:tt,expression:tt,state:new ef({constrainTo:["idle","selected","excluded"]})}}),b6=new ev({required:!0,each:b4}),b9=rS("staticFilter/register",e=>to(e,{id:e7,values:b6})),b8=rS("staticFilter/toggleSelect",e=>to(e,{id:e7,value:b4})),b7=rS("staticFilter/toggleExclude",e=>to(e,{id:e7,value:b4})),we=rS("staticFilter/deselectAllFilterValues",e=>to(e,e7)),wt=e=>a4("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),wr=e=>a4("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),wn=e=>a4("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e)),wi=new ev({each:e7,required:!0}),wa=(e,t)=>(to(e,e7),eg(t)?to(t,e7):to(t,wi),{payload:{contextKey:e,contextValue:t}}),ws=rS("context/set",e=>{for(let[t,r]of Object.entries(e))wa(t,r);return{payload:e}}),wo=rS("context/add",e=>wa(e.contextKey,e.contextValue)),wl=rS("context/remove",e=>to(e,e7));rT(of(),e=>{e.addCase(ws,(e,t)=>{e.contextValues=t.payload}).addCase(wo,(e,t)=>{e.contextValues[t.payload.contextKey]=t.payload.contextValue}).addCase(wl,(e,t)=>{delete e.contextValues[t.payload]}).addCase(s_.fulfilled,(e,t)=>{t.payload&&(e.contextValues=t.payload.context.contextValues)})}),new ea({values:new em({options:{required:!1}})});let wu=rT(oy(),e=>{e.addCase(vw,(e,t)=>({...e,...t.payload})).addCase(o4.fulfilled,e=>{e.freezeFacetOrder=!1}).addCase(o4.rejected,e=>{e.freezeFacetOrder=!1}).addCase(s_.fulfilled,(e,t)=>t.payload?.facetOptions??e).addCase(vh,(e,t)=>{let{facetId:r,tabs:n}=t.payload;wc(n,e,r)}
141).addCase(vJ,(e,t)=>{let{facetId:r,tabs:n}=t.payload;wc(n,e,r)}).addCase(bR,(e,t)=>{let{facetId:r,tabs:n}=t.payload;wc(n,e,r)}).addCase(bX,(e,t)=>{let{facetId:r,tabs:n}=t.payload;wc(n,e,r)}).addCase(vS,(e,t)=>{e.facets[t.payload].enabled=!0}).addCase(vE,(e,t)=>{e.facets[t.payload].enabled=!1}).addCase(sg,(e,t)=>{[...Object.keys(t.payload.f??{}),...Object.keys(t.payload.fExcluded??{}),...Object.keys(t.payload.cf??{}),...Object.keys(t.payload.nf??{}),...Object.keys(t.payload.df??{})].forEach(t=>{t in e||(e.facets[t]=om()),e.facets[t].enabled=!0})})});function wc(e,t,r){let n={...om(),tabs:e??{}};t.facets[r]=n}function wd(e,t){t in e&&Object.keys(e).forEach(r=>{e[r].isActive=r===t})}rT({},e=>{e.addCase(cr,(e,t)=>{let r=t.payload,{id:n}=r;n in e||(e[n]={...r,isActive:!1})}).addCase(cn,(e,t)=>{wd(e,t.payload)}).addCase(sm,(e,t)=>{wd(e,t.payload)}).addCase(s_.fulfilled,(e,t)=>t.payload?.tabSet??e).addCase(sg,(e,t)=>{let r=t.payload.tab;el(r)||Object.keys(e).forEach(t=>{e[t].isActive=t===r})})});let wh=rS("dictionaryFieldContext/set",e=>{let t=to(e,new em({options:{required:!0}})).error;if(t)return{payload:e,error:t};let r=to(Object.values(e),new ev({each:tt})).error;return r?{payload:e,error:r}:{payload:e}}),wp=rS("dictionaryFieldContext/add",e=>to(e,new em({options:{required:!0},values:{field:tt,key:tt}}))),wf=rS("dictionaryFieldContext/remove",e=>to(e,tt));rT(og(),e=>{e.addCase(wh,(e,t)=>{e.contextValues=t.payload}).addCase(wp,(e,t)=>{let{field:r,key:n}=t.payload;e.contextValues[r]=n}).addCase(wf,(e,t)=>{delete e.contextValues[t.payload]}).addCase(s_.fulfilled,(e,t)=>{t.payload&&(e.contextValues=t.payload.dictionaryFieldContext.contextValues)})});let wg=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""});function wm(e){return{value:e,state:"selected",numberOfResults:0}}rT({enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:wg(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"},e=>{e.addCase(os,e=>{e.enableDidYouMean=!0}).addCase(oo,e=>{e.enableDidYouMean=!1}).addCase(ou,e=>{e.automaticallyCorrectQuery=!0}).addCase(ol,e=>{e.automaticallyCorrectQuery=!1}).addCase(o4.pending,e=>{e.queryCorrection=wg(),e.wasAutomaticallyCorrected=!1,e.wasCorrectedTo=""}).addCase(o4.fulfilled,(e,t)=>{let r,{queryCorrection:n,queryCorrections:i}=t.payload.response;"legacy"===e.queryCorrectionMode&&(e.queryCorrection=i?.[0]?i[0]:wg()),"next"===e.queryCorrectionMode&&(e.queryCorrection=r={...{correctedQuery:"",corrections:[],originalQuery:""},...n,correctedQuery:n?.correctedQuery||n?.corrections[0]?.correctedQuery||""},e.wasCorrectedTo=r.correctedQuery),e.wasAutomaticallyCorrected=t.payload.automaticallyCorrected,e.originalQuery=t.payload.originalQuery}).addCase(oc,(e,t)=>{e.wasCorrectedTo=t.payload}).addCase(od,(e,t)=>{e.queryCorrectionMode=t.payload})}),rT(aO(),e=>{e.addCase(o4.fulfilled,(e,t)=>{e.set={};let r=t.payload.response.generateAutomaticFacets?.facets;r?.forEach(t=>{e.set[t.field]={response:t}})}).addCase(vo,(e,t)=>{t.payload.desiredCount&&(e.desiredCount=t.payload.desiredCount),t.payload.numberOfValues&&(e.numberOfValues=t.payload.numberOfValues)}).addCase(vu,(e,t)=>{let{field:r,selection:n}=t.payload,i=e.set[r]?.response;if(!i)return;let a=i.values.find(e=>e.value===n.value);if(!a)return;let s="selected"===a.state;a.state=s?"idle":"selected"}).addCase(vl,(e,t)=>{let r=t.payload,n=e.set[r]?.response;if(n)for(let e of n.values)e.state="idle"}).addCase(sg,(e,t)=>{let r=t.payload.af??{},n=Object.keys(e.set);for(let t in r)if(!e.set[t]){let n={field:t,values:[],moreValuesAvailable:!1,label:"",indexScore:0},i=r[t].map(e=>wm(e));n.values.push(...i),e.set[t]={response:n}}for(let t of n)if(!(t in r))for(let r of(e.set[t]?.response).values)r.state="idle";for(let t in r){let n=e.set[t]?.response;if(n){let e=n.values,i=new Set(r[t]);for(let t of e)i.has(t.value)?(t.state="selected",i.delete(t.value)):t.state="idle";for(let e of i)n.values.push(wm(e))}}}).addCase(s_.fulfilled,(e,t)=>{if(t.payload&&0!==Object.keys(t.payload.automaticFacetSet.set).length)return t.payload.automaticFacetSet}).addCase(sI,e=>{Object.values(e.set).forEach(({response:e})=>
141{e.values.forEach(e=>{e.state="idle"})})})});let wy=e=>"selected"===e.state,wv=e=>"excluded"===e.state;function wb(e,t,r){let{facetId:n}=t;if(e[n])return;let i={...wI,...t},a=r();e[n]={options:i,isLoading:!1,response:a,initialNumberOfValues:i.numberOfValues,requestId:""}}function ww(e,t){let{facetId:r,...n}=t,i=e[r];i&&(i.options={...i.options,...n})}function wS(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function wE(e,t){let r=e[t];r&&(r.isLoading=!1)}function w_(e,t,r){let{facetId:n,response:i}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=i)}function wC(e,t,r){let{facetId:n}=t,i=e[n];i&&(i.requestId="",i.isLoading=!1,i.response=r(),i.options.numberOfValues=i.initialNumberOfValues,i.options.query=wI.query)}function wk(e,t){Object.keys(e).forEach(r=>wC(e,{facetId:r},t))}let wI={captions:{},numberOfValues:10,query:""},wx=async(e,t,r,n)=>{let i=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:s,query:o,numberOfValues:l}=i,{field:u,delimitingCharacter:c,basePath:d,filterFacetCount:h}=a,p=wA(a),f=p.length?[p]:[],g=`*${o}*`;return{url:t.configuration.search.apiBaseUrl??eJ(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")},basePath:d,captions:s,numberOfValues:l,query:g,field:u,delimitingCharacter:c,ignorePaths:f,filterFacetCount:h,type:"hierarchical",...n?{}:{searchContext:(await oW(t,r)).request}}},wA=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t},wT=async(e,t,r,n)=>{let{captions:i,query:a,numberOfValues:s}=t.facetSearchSet[e].options,{field:o,currentValues:l,filterFacetCount:u}=t.facetSet[e].request,c=l.filter(e=>"idle"!==e.state).map(e=>e.value),d=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??eJ(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")},captions:i,numberOfValues:s,query:d,field:o,ignoreValues:c,filterFacetCount:u,type:"specific",...n?{}:{searchContext:(await oW(t,r)).request}}},wO=e=>async(t,{getState:r,extra:{apiClient:n,validatePayload:i,navigatorContext:a}})=>{let s,o=r();return i(t,e7),s=wP(o,t)?await wT(t,o,a,e):await wx(t,o,a,e),{facetId:t,response:await n.facetSearch(s)}},wN=rB("facetSearch/executeSearch",wO(!1)),wR=rB("facetSearch/executeSearch",wO(!0)),wD=rS("facetSearch/clearResults",e=>to(e,{facetId:e7})),wP=(e,t)=>void 0!==e.facetSearchSet&&void 0!==e.facetSet&&void 0!==e.facetSet[t];function wM(){return{moreValuesAvailable:!1,values:[]}}rT({},e=>{e.addCase(vx,(e,t)=>{wb(e,t.payload,wM)}).addCase(bd,(e,t)=>{ww(e,t.payload)}).addCase(wN.pending,(e,t)=>{wS(e,t.meta.arg,t.meta.requestId)}).addCase(wN.rejected,(e,t)=>{wE(e,t.meta.arg)}).addCase(wN.fulfilled,(e,t)=>{w_(e,t.payload,t.meta.requestId)}).addCase(wD,(e,{payload:{facetId:t}})=>{wC(e,{facetId:t},wM)}).addCase(o4.fulfilled,e=>{wk(e,wM)})}),new ea({field:vL,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),basePath:vq,delimitingCharacter:v$,facetId:vF,facetSearch:vH,filterByBasePath:vU,filterFacetCount:vV,injectionDepth:vz,numberOfValues:vG,sortCriteria:new ef({constrainTo:["alphanumeric","occurrences"]})});let wj=rT({},e=>{e.addCase(bc,(e,t)=>{wb(e,t.payload,wF)}).addCase(bd,(e,t)=>{ww(e,t.payload)}).addCase(wN.pending,(e,t)=>{wS(e,t.meta.arg,t.meta.requestId)}).addCase(wN.rejected,(e,t)=>{wE(e,t.meta.arg)}).addCase(wN.fulfilled,(e,t)=>{w_(e,t.payload,t.meta.requestId)}).addCase(wD,(e,{payload:t})=>{wC(e,t,wF)}).addCase(o4.fulfilled,e=>{wk(e,wF)})});function wF(){return{moreValuesAvailable:!1,values:[]}}let wL={facetId:e7,selection:new em({values:vi})},wq=rB("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:i}}=r;i({facetId:e,selection:t},wL),n(vX({facetId:e,selection:t})),n(vw())}),w$=rB("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:i}}=r;i({facetId:e,selection:t},wL),n(v0({facetId:e,selection:t})),n(vw())}),wU=(e,t)=>e.search?.response.facets.find(e=>e.facetId===t);function wV(e){let t,r=new Map;return{subscribe(n){let i;n();let a=Symbol();return 0===r.size&&(t=JSON.stringify(this.state),i=e.subscribe(()=>{(e=>{try{let r=JSON.stringify(e),n=t!==r;return t=r,n}catch(e){return console.warn('Could not detect if state has changed, check the controller "get state method"',e),!0}}
141)(this.state)&&r.forEach(e=>e())})),r.set(a,n),()=>{r.delete(a),0===r.size&&i?.()}},get state(){return{}}}}function wz(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:i}=e;return[t,r,n,i]}function wG(e,t){let{state:r,logger:n}=e,{field:i,facetId:a}=t;return a||function(e,t){var r,n,i,a,s;let o,{field:l,state:u}=e;if(!function(e){let{field:t,state:r}=e;return wz(r).some(e=>e&&t in e)}(e))return l;let c=`${l}_`,d=(r=c,n=wz(u).map(e=>Object.keys(e||{})).reduce((e,t)=>e.concat(t),[]),i=r,(n.map(e=>{let t=parseInt(e.split(i)[1],10);return Number.isNaN(t)?0:t}).sort().pop()??0)+1);return a=l,s=t,o=`A facet with field "${a}" already exists. 142 To avoid unexpected behaviour, configure the #id option on the facet controller.`,s.warn(o),`${c}${d}`}({field:i,state:r},n)}let wB=["allValues","atLeastOneValue"],wQ=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"],wH=new ea({facetId:vF,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),field:vL,filterFacetCount:vV,injectionDepth:vz,numberOfValues:vG,sortCriteria:new ef({constrainTo:wQ}),resultsMustMatch:new ef({constrainTo:wB}),facetSearch:vH}),wZ=new ea({facetId:vF,field:vL,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),filterFacetCount:vV,injectionDepth:vz,numberOfValues:vG,sortCriteria:new ef({constrainTo:wQ}),resultsMustMatch:new ef({constrainTo:wB}),facetSearch:vH,allowedValues:vZ,hasBreadcrumbs:vK,customSort:vY});function wK(e,t){e.addReducers({facetSet:bf,configuration:cu,facetSearchSet:wj,search:lp}),!1;let{dispatch:r}=e,n=function(e,t,r=wH){e.addReducers({facetSet:bf,facetOptions:wu,configuration:cu,facetSearchSet:wj}),!1;let{dispatch:n}=e,i=wV(e),a=wG(e,t.options),s=t.options.tabs??{},o=lb(e.state.tabSet),l={...by,...function(e,t){let{[e]:r,...n}=t;return n}("facetSearch",t.options),field:t.options.field,facetId:a,tabs:s,activeTab:o},u={facetSearch:{...wI,...t.options.facetSearch},...l};tu(e,r,u,"buildFacet");let c=()=>{let t;return t=e.state,t.facetSet[a]?.request};return n(vJ(l)),{...i,toggleSelect:e=>n(wq({facetId:u.facetId,selection:e})),toggleExclude:e=>n(w$({facetId:u.facetId,selection:e})),toggleSingleSelect:function(e){"idle"===e.state&&n(v1(a)),this.toggleSelect(e)},toggleSingleExclude:function(e){"idle"===e.state&&n(v1(a)),this.toggleExclude(e)},isValueSelected:wy,isValueExcluded:wv,deselectAll(){n(v1(a)),n(vw())},sortBy(e){n(v2({facetId:a,criterion:e})),n(vw())},isSortedBy(e){return this.state.sortCriterion===e},showMoreValues(){let e=c().numberOfValues,t=u.numberOfValues;n(v3({facetId:a,numberOfValues:e+(t-e%t)})),n(v5({facetId:a,isFieldExpanded:!0})),n(vw())},showLessValues(){n(v3({facetId:a,numberOfValues:Math.max(u.numberOfValues,(()=>{let{currentValues:e}=c();return e.filter(e=>"idle"!==e.state).length})())})),n(v5({facetId:a,isFieldExpanded:!1})),n(vw())},enable(){n(vS(a))},disable(){n(vE(a))},get state(){var d;let t,r,n=c(),i=(r=wU(d=e.state,a),r&&r.facetId in d.facetSet?r:void 0),o=e.state.search.isLoading,l=lw(e.state,a);t="object"==typeof n.sortCriteria?"descending"===n.sortCriteria.order?"alphanumericDescending":"alphanumeric":n.sortCriteria;let h=i?i.values:[],p=h.some(e=>"idle"!==e.state),f=!!i&&i.moreValuesAvailable,g=n.resultsMustMatch;return{label:i?.label,facetId:a,tabs:s,values:h,sortCriterion:t,resultsMustMatch:g,isLoading:o,hasActiveValues:p,canShowMoreValues:f,canShowLessValues:(()=>{let{currentValues:e}=c(),t=u.numberOfValues,r=!!e.find(e=>"idle"===e.state);return t<e.length&&r})(),enabled:l}}}}(e,{...t,options:{...t.options,...t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}}}},wZ),i=(()=>{let{facetSearch:i}=t.options;return function(e,t){let{dispatch:r}=e,{options:n,select:i,exclude:a,isForFieldSuggestions:s,executeFacetSearchActionCreator:o,executeFieldSuggestActionCreator:l}=t,{facetId:u}=n;r(bc(n));let c=function(e,t){let r=e.dispatch,{options:n,getFacetSearch:i,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:s}=t,{facetId:o}=n;return{updateText(e){r(bd({facetId:o,query:e,numberOfValues:i().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:e,options:n}=i();r(bd({facetId:o,numberOfValues:n.numberOfValues+e}
142)),r(t.isForFieldSuggestions?s(o):a(o))},search(){r(t.isForFieldSuggestions?s(o):a(o))},clear(){r(wD({facetId:o}))},updateCaptions(e){r(bd({facetId:o,captions:e}))},get state(){let{response:e,isLoading:t,options:r}=i(),{query:n}=r,a=e.values;return{...e,values:a,isLoading:t,query:n}}}}(e,{options:n,getFacetSearch:()=>"state"in e?e.state.facetSearchSet[u]:e[y1].facetSearchSet[u],isForFieldSuggestions:s,executeFacetSearchActionCreator:o,executeFieldSuggestActionCreator:l});return{...c,select(e){r(bh({facetId:u,value:e})),i(e)},exclude(e){r(bp({facetId:u,value:e})),a(e)},singleSelect(e){r(v1(u)),r(bh({facetId:u,value:e})),i(e)},singleExclude(e){r(v1(u)),r(bp({facetId:u,value:e})),a(e)},get state(){let{values:e}=c.state;return{...c.state,values:e.map(({count:e,displayValue:t,rawValue:r})=>({count:e,displayValue:t,rawValue:r}))}}}}(e,{options:{facetId:n.state.facetId,...i},select:e=>{r(vw()),r(o4({legacy:be({facetId:n.state.facetId,facetValue:e.rawValue}),next:bs()}))},exclude:e=>{r(vw()),r(o4({legacy:bt({facetId:n.state.facetId,facetValue:e.rawValue}),next:bo()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:wN,executeFieldSuggestActionCreator:wR})})(),{state:a,...s}=i;return{...n,facetSearch:s,toggleSelect(e){let t;n.toggleSelect(e),r(o4({legacy:(t={facetId:n.state.facetId,facetValue:e.value},wy(e)?br(t):be(t)),next:wy(e)?bl():bs()}))},toggleExclude(e){let t;n.toggleExclude(e),r(o4({legacy:(t={facetId:n.state.facetId,facetValue:e.value},wv(e)?bn(t):bt(t)),next:wv(e)?{actionCause:B.facetUnexclude}:bo()}))},deselectAll(){n.deselectAll(),r(o4({legacy:v7(n.state.facetId),next:ba()}))},sortBy(e){n.sortBy(e),r(o4({legacy:v8({facetId:n.state.facetId,criterion:e})}))},isSortedBy(e){return this.state.sortCriterion===e},showMoreValues(){n.showMoreValues(),r(o8({legacy:v6(n.state.facetId)}))},showLessValues(){n.showLessValues(),r(o8({legacy:v9(n.state.facetId)}))},get state(){return{...n.state,facetSearch:i.state}}}}let wY=e=>"selected"===e.state,wW=e=>"excluded"===e.state,wJ=rS("rangeFacet/executeToggleSelect",e=>to(e,bA(e.selection))),wX=rS("rangeFacet/executeToggleExclude",e=>to(e,bA(e.selection))),w0={facetId:e7,selection:new em({values:bx})},w1=rB("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,w0),t(bD(e)),t(wJ(e)),t(vw())}),w2=rB("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,w0),t(bP(e)),t(wX(e)),t(vw())}),w3=["idle","selected","excluded"],w5=["ascending","descending"],w4=["even","equiprobable"],w6={start:new ef,end:new ef,endInclusive:new eu,state:new ef({constrainTo:w3})},w9=new ea({facetId:vF,field:vL,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),generateAutomaticRanges:vB,filterFacetCount:vV,injectionDepth:vz,numberOfValues:vG,currentValues:new ev({each:new em({values:w6})}),sortCriteria:new ef({constrainTo:w5}),rangeAlgorithm:new ef({constrainTo:w4})});function w8(e,t){tu(e,w9,t,"buildDateFacet"),bN(t)}function w7(e,t){let r=function(e,t){e.addReducers({configuration:cu,search:lp,dateFacetSet:bZ,facetOptions:wu}),!1;var r=t.options;if(!r.generateAutomaticRanges&&void 0===r.currentValues)throw Error("currentValues should be specified for buildDateFacet when generateAutomaticRanges is false.");let n=e.dispatch,i=wG(e,t.options),a=t.options.tabs??{},s=lb(e.state.tabSet),o={currentValues:[],...t.options,facetId:i,tabs:a,activeTab:s};w8(e,o),n(bR(o));let l=function(e,t){let{facetId:r,getRequest:n}=t,i=wV(e),a=e.dispatch;return{...i,isValueSelected:wY,isValueExcluded:wW,deselectAll(){a(v1(r)),a(vw())},sortBy(e){a(bk({facetId:r,criterion:e})),a(vw())},isSortedBy(e){return this.state.sortCriterion===e},enable(){a(vS(r))},disable(){a(vE(r))},get state(){let t=n(),i=wU(e.state,r),a=t.sortCriteria,s=t.resultsMustMatch,o=i?i.values:[],l=e.state.search.isLoading,u=lw(e.state,r),c=o.some(e=>"idle"!==e.state);return{facetId:r,values:o,sortCriterion:a,resultsMustMatch:s,hasActiveValues:c,isLoading:l,enabled:u,domain:i?.domain}}}}(e,{facetId:i,getRequest:()=>e.state.dateFacetSet[i].request});return{...l,toggleSelect:e=>n(w1({facetId:i,selection:e}
142)),toggleSingleSelect:function(e){"idle"===e.state&&n(v1(i)),this.toggleSelect(e)},toggleExclude:e=>n(w2({facetId:i,selection:e})),toggleSingleExclude:function(e){"idle"===e.state&&n(v1(i)),this.toggleExclude(e)},get state(){return l.state}}}(e,t),n=e.dispatch;return{...r,deselectAll(){r.deselectAll(),n(o4({legacy:v7(r.state.facetId),next:ba()}))},sortBy(e){r.sortBy(e),n(o4({legacy:v8({facetId:r.state.facetId,criterion:e})}))},toggleSelect:e=>{var t;let i;r.toggleSelect(e),n(o4({legacy:(t=r.state.facetId,i={facetId:t,facetValue:`${e.start}..${e.end}`},wY(e)?br(i):be(i)),next:wY(e)?bl():bs()}))},toggleExclude:e=>{var t;let i;r.toggleExclude(e),n(o4({legacy:(t=r.state.facetId,i={facetId:t,facetValue:`${e.start}..${e.end}`},wW(e)?bn(i):bt(i))}))},get state(){return r.state}}}function Se(e,t){e.addReducers({dateFacetSet:bZ,configuration:cu,search:lp}),!1;let r=function(e,t){e.addReducers({dateFacetSet:bZ,facetOptions:wu,configuration:cu,search:lp}),!1;let r=wV(e),{dispatch:n}=e,i=wG(e,t.options),a=t.options.tabs??{},s=lb(e.state.tabSet),o={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:i,tabs:a,activeTab:s};return w8(e,o),n(bR(o)),{...r,clear:()=>{n(bM({facetId:i,values:[]})),n(vw())},setRange:e=>{let t=bM({facetId:i,values:[{...e,state:"selected",numberOfResults:0,endInclusive:!0}]});return!t.error&&(n(t),n(vw()),!0)},enable(){n(vS(i))},disable(){n(vE(i))},get state(){let t=e.state.search.isLoading,r=lw(e.state,i),n=(((e,t)=>{let r=wU(e,t);if(r&&r.facetId in e.dateFacetSet)return r})(e.state,i)||{values:[]}).values.filter(e=>"selected"===e.state);return{facetId:i,isLoading:t,range:n.length?n[0]:void 0,enabled:r}}}}(e,t),{dispatch:n}=e;return{...r,clear:()=>{r.clear(),n(o4({legacy:v7(r.state.facetId),next:ba()}))},setRange:e=>{let t=r.setRange(e);return t&&n(o4({legacy:be({facetId:r.state.facetId,facetValue:`${e.start}..${e.end}`}),next:bs()})),t},get state(){return{...r.state}}}}let St={facetId:e7,selection:new em({values:bI})};rB("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,St),t(b0(e)),t(wJ(e)),t(vw())}),rB("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,St),t(b1(e)),t(wX(e)),t(vw())});let Sr={start:new ed,end:new ed,endInclusive:new eu,state:new ef({constrainTo:w3})};new ea({facetId:vF,tabs:new em({options:{required:!1},values:{included:new ev({each:new ef}),excluded:new ev({each:new ef})}}),field:vL,generateAutomaticRanges:vB,filterFacetCount:vV,injectionDepth:vz,numberOfValues:vG,currentValues:new ev({each:new em({values:Sr})}),sortCriteria:new ef({constrainTo:w5}),resultsMustMatch:new ef({constrainTo:wB}),rangeAlgorithm:new ef({constrainTo:w4})});let Sn={collectionField:new ef({emptyAllowed:!1,required:!1}),parentField:new ef({emptyAllowed:!1,required:!1}),childField:new ef({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ed({min:0,required:!1})},Si=rS("folding/register",e=>to(e,Sn)),Sa=rB("folding/loadCollection",async(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:i}})=>{var a;let s=t(),o="legacy"===s.configuration.analytics.analyticsMode?await sQ(s):sG(s,i),l=await n.search({...o,q:""===(a=s).query.q?"":a.query.enableQuerySyntax?`${a.query.q} OR @uri`:`( <@- ${a.query.q} -@> ) OR @uri`,enableQuerySyntax:!0,cq:`@${s.folding.fields.collection}="${e}"`,filterField:s.folding.fields.collection,childField:s.folding.fields.parent,parentField:s.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return void 0!==l.error?r(l.error):{collectionId:e,results:l.success.results,searchUid:l.success.searchUid,rootResult:s.folding.collections[e].result}}),Ss=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function So(e,t){return e.raw[t.parent]}function Sl(e,t){let r=e.raw[t.child];return eS(r)?r[0]:r}function Su(e,t,r,n){let i={};return e.forEach(e=>{let a=e.raw[t.collection];if(a&&(Sl(e,t)||e.parentResult)){var s,o,l;let u,c,d,h,p;i[a]=(h=function e(t){return t.childResults?t.childResults.flatMap(t=>[t,...e(t)]):[]}(s=e),p=[s,...h].filter(e=>e.parentResult).map(e=>e.parentResult),o=[s,...h,...p],l=e=>e.uniqueId,u=[...o.reduce((e,t)=>
142{let r=l(t);return e.has(r)||e.set(r,t),e},new Map).values()],d=function e(t,r,n,i=[]){let a=Sl(t,n);return a&&-1===i.indexOf(a)?r.filter(e=>{let r=Sl(e,n)===Sl(t,n);return So(e,n)===a&&!r}).map(s=>{let o={...s,searchUid:t.searchUid};return{result:o,children:e(o,r,n,[...i,a])}}):[]}(c={...n??u.find(e=>{var r,n;let i=void 0===So(e,t),a=(r=So(e,t),n=Sl(e,t),(r||n)!==void 0&&r===n);return i||a})??function e(t){return t.parentResult?e(t.parentResult):t}(e),searchUid:r},u,t),{result:c,children:d,moreResultsAvailable:e.totalNumberOfChildResults>d.length+1,isLoadingMoreResults:!1})}}),i}function Sc(e,t){if(!e.collections[t])throw Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}rT(Ss(),e=>e.addCase(o4.fulfilled,(e,{payload:t})=>{e.collections=e.enabled?Su(t.response.results,e.fields,t.response.searchUid):{}}).addCase(o6.fulfilled,(e,{payload:t})=>{e.collections=e.enabled?Su(t.response.results,e.fields,t.response.searchUid):{}}).addCase(o9.fulfilled,(e,{payload:t})=>{e.collections=e.enabled?{...e.collections,...Su(t.response.results,e.fields,t.response.searchUid)}:{}}).addCase(Si,(e,{payload:t})=>e.enabled?e:{enabled:!0,collections:{},fields:{collection:t.collectionField??e.fields.collection,parent:t.parentField??e.fields.parent,child:t.childField??e.fields.child},filterFieldRange:t.numberOfFoldedResults??e.filterFieldRange}).addCase(Sa.pending,(e,{meta:t})=>{Sc(e,t.arg).isLoadingMoreResults=!0}).addCase(Sa.rejected,(e,{meta:t})=>{Sc(e,t.arg).isLoadingMoreResults=!1}).addCase(Sa.fulfilled,(e,{payload:{collectionId:t,results:r,rootResult:n,searchUid:i}})=>{let a=Su(r,e.fields,i,n);if(!a||!a[t])throw Error(`Unable to create collection ${t} from received results: ${JSON.stringify(r)}. Folding most probably in an invalid state... `);e.collections[t]=a[t],e.collections[t].moreResultsAvailable=!1}));let Sd={id:e7},Sh=rS("querySuggest/register",e=>to(e,{...Sd,count:new ed({min:0})})),Sp=rS("querySuggest/unregister",e=>to(e,Sd)),Sf=rS("querySuggest/selectSuggestion",e=>to(e,{...Sd,expression:tt})),Sg=rS("querySuggest/clear",e=>to(e,Sd)),Sm=rB("querySuggest/fetch",async(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:i,navigatorContext:a}})=>{i(e,Sd);let s=e.id,o=await Sy(s,t(),a),l=await n.querySuggest(o);return void 0!==l.error?r(l.error):{id:s,q:o.q,...l.success}}),Sy=async(e,t,r)=>({accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??eJ(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?aX.getInstance().getHistory():[],...t.context&&{context:t.context.contextValues},...t.pipeline&&{pipeline:t.pipeline},...t.searchHub&&{searchHub:t.searchHub},tab:t.configuration.analytics.originLevel2,...t.configuration.analytics.enabled&&{...t.configuration.analytics.enabled&&"legacy"===t.configuration.analytics.analyticsMode?await sB(t.configuration.analytics):sz(t.configuration.analytics,r)},...t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}}),Sv=rT(aV(),e=>e.addCase(sV,(e,t)=>({...e,...t.payload})).addCase(oc,(e,t)=>{e.q=t.payload}).addCase(Sf,(e,t)=>{e.q=t.payload.expression}).addCase(s_.fulfilled,(e,t)=>t.payload?.query??e).addCase(sg,(e,t)=>{e.q=t.payload.q??e.q,e.enableQuerySyntax=t.payload.enableQuerySyntax??e.enableQuerySyntax})),Sb=rS("fields/registerFieldsToInclude",e=>to(e,tr)),Sw=rS("fields/fetchall/enable"),SS=rS("fields/fetchall/disable"),SE=rB("fields/fetchDescription",async(e,{extra:t,getState:r,rejectWithValue:n})=>{let i=r(),{accessToken:a,environment:s,organizationId:o}=i.configuration,{apiBaseUrl:l}=i.configuration.search,u=await t.apiClient.fieldDescriptions({accessToken:a,organizationId:o,url:l??eJ(o,s)});return void 0!==u.error?n(u.error):u.success.fields}),S_=["author","language","urihash","objecttype","collection","source","permanentid"];[...S_];let SC=rT({fieldsToInclude:S_,fetchAllFields:!1,fieldsDescription:[]},e=>e.addCase(Sb,(e,t)=>{e.fieldsToInclude=[...new Set(e.fieldsToInclude.concat(t.payload))]}).addCase(Sw,e=>{e.fetchAllFields=!0}).addCase(SS,e=>{e.fetchAllFields=!1}).addCase(SE.fulfilled,(e,{payload:t})=>{e.fieldsDescription=t}).addCase(Si,(e,{payload:t})=>{let r=Ss().fields;e.fieldsToInclude.push(t.collectionField??r.collection,t.parentField??r.parent,t.childField??r.child)}));function Sk(e){e.addReducers({search:lp}),!1;return{...wV(e),get state(){let t=e.state;
142return{hasError:null!==t.search.error,isLoading:t.search.isLoading,hasResults:!!t.search.results.length,firstSearchExecuted:ls(t)}}}}let SI=new ea({fieldsToInclude:new ev({required:!1,each:new ef({required:!0,emptyAllowed:!1})})});function Sx(e){let t=new Set;return e.filter(e=>{let r=!t.has(e.uri);return r&&t.add(e.uri),r})}function SA(e){return e.followUpAnswers.find(e=>e.isActive)}function ST(e,t){return e.followUpAnswers.find(e=>e.answerId===t)}function SO(e,t){return t.payload.response.facets.map(e=>e.facetId)}new ea(Sn),rT(lk(),e=>e.addCase(lD,(e,{payload:t})=>{e.isVisible=t}).addCase(lj,(e,{payload:t})=>{e.isEnabled=t}).addCase(lQ,(e,{payload:t})=>{e.id=t.id}).addCase(lF,(e,{payload:t})=>{e.isLoading=!1,e.isStreaming=!0,delete e.error;let r=t.textDelta,n=!!e.answer?.trim(),i=r.trim().length>0;if(n){e.answer+=r;return}e.answer=i?r:void 0}).addCase(lL,(e,{payload:t})=>{e.isLoading=!1,e.isStreaming=!0,e.citations=Sx([...e.citations,...t.citations]),delete e.error}).addCase(lq,(e,{payload:t})=>{e.isLoading=!1,e.isStreaming=!1,e.error={...t,isRetryable:1===t.code},e.citations=[],delete e.answer}).addCase(lU,e=>{e.liked=!0,e.disliked=!1}).addCase(lV,e=>{e.liked=!1,e.disliked=!0}).addCase(lz,e=>{e.feedbackModalOpen=!0}).addCase(lH,e=>{e.feedbackModalOpen=!1}).addCase(lZ,e=>{e.feedbackSubmitted=!0}).addCase(l$,e=>({...lk(),...e.answerConfigurationId?{answerConfigurationId:e.answerConfigurationId}:{},responseFormat:e.responseFormat,fieldsToIncludeInCitations:e.fieldsToIncludeInCitations,isVisible:e.isVisible,id:e.id})).addCase(lK,(e,{payload:t})=>{e.isLoading=t}).addCase(lY,(e,{payload:t})=>{e.isStreaming=t}).addCase(lW,(e,{payload:t})=>{e.answerContentFormat=t}).addCase(lJ,(e,{payload:t})=>{e.responseFormat=t}).addCase(l0,(e,t)=>{e.fieldsToIncludeInCitations=[...new Set(e.fieldsToIncludeInCitations.concat(t.payload))]}).addCase(l1,(e,{payload:t})=>{e.isAnswerGenerated=t}).addCase(lG,e=>{e.expanded=!0}).addCase(lB,e=>{e.expanded=!1}).addCase(lX,(e,{payload:t})=>{e.answerConfigurationId=t}).addCase(l2,(e,{payload:t})=>{e.cannotAnswer=t}).addCase(l3,(e,{payload:t})=>{e.answerApiQueryParams=t}).addCase(lP,(e,{payload:t})=>{e.answerId=t}).addCase(lM,(e,{payload:t})=>{e.answerGenerationMode=t}).addCase(l5,(e,{payload:t})=>{e.generationSteps.push({name:t.name,status:"active",startedAt:t.startedAt})}).addCase(l4,(e,{payload:t})=>{let r=e.generationSteps.findLast(e=>e.name===t.name&&"active"===e.status);r&&(r.status="completed",r.finishedAt=t.finishedAt)})),u9.injectEndpoints({endpoints:e=>({post:e.query({query:e=>({url:"/evaluations",method:"POST",body:e})})})}),rT({conversationId:"",conversationToken:"",isEnabled:!1,followUpAnswers:[]},e=>e.addCase(yN,(e,{payload:t})=>{e.isEnabled=t}).addCase(yR,(e,{payload:t})=>{e.conversationId=t}).addCase(yD,(e,{payload:t})=>{e.conversationToken=t}).addCase(yP,e=>{e.conversationToken=""}).addCase(yM,(e,{payload:t})=>{let r=SA(e);r&&(r.isActive=!1),e.followUpAnswers.push({question:t.question,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]})}).addCase(yj,(e,{payload:t})=>{let r=SA(e);r&&!r.answerId&&(r.answerId=t)}).addCase(yF,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.answerContentFormat=t.contentFormat)}).addCase(yL,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.isLoading=t.isLoading)}).addCase(yq,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.isStreaming=t.isStreaming)}).addCase(y$,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.answer||(r.answer=""),r.answer+=t.textDelta,delete r.error)}).addCase(yU,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.citations=Sx([...r.citations,...t.citations]),delete r.error)}).addCase(yV,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.isLoading=!1,r.isStreaming=!1,r.isActive=!1,r.cannotAnswer=!!t.cannotAnswer)}).addCase(yz,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.isLoading=!1,r.isStreaming=!1,r.error={message:t.message,code:t.code},r.citations=[],delete r.answer)}).addCase(yG,(e,{payload:t})=>{let r=SA(e);r&&(r.isLoading=!1,r.isStreaming=!1,r.error={message:t.message},r.citations=[],delete r.answer)}).addCase(yB,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.liked=!0,r.disliked=!1)}).addCase(yQ,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.liked=!1,r.disliked=!0)}).addCase(yH,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.feedbackSubmitted=!0)}).addCase(yK,(e,{payload:t})=>{let r=ST(e,t.answerId);r&&(r.generationSteps=[...r.generationSteps,{name:t.name,status:"active",startedAt:t.startedAt}])}).addCase(yY,(e,{payload:t})=>{let r=ST(e,t.answerId);if(!r)return;let n=r.generationSteps.findLast(e=>
142e.name===t.name&&"active"===e.status);n&&(n.status="completed",n.finishedAt=t.finishedAt)}).addCase(yZ,e=>{e.followUpAnswers=[],e.conversationId="",e.conversationToken="",e.isEnabled=!1})),rT([],e=>{e.addCase(o4.fulfilled,SO).addCase(s_.fulfilled,(e,t)=>t.payload?.facetOrder??e)});let SN=()=>a4("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),SR=()=>a4("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),SD=()=>a4("history/analytics/noresultsback",e=>e.makeNoResultsBack()),SP=e=>({past:[],present:e,future:[]}),{getOwnPropertyNames:SM,getOwnPropertySymbols:Sj}=Object,{hasOwnProperty:SF}=Object.prototype;function SL(e,t){return function(r,n,i){return e(r,n,i)&&t(r,n,i)}}function Sq(e){return function(t,r,n){if(!t||!r||"object"!=typeof t||"object"!=typeof r)return e(t,r,n);let{cache:i}=n,a=i.get(t),s=i.get(r);if(a&&s)return a===r&&s===t;i.set(t,r),i.set(r,t);let o=e(t,r,n);return i.delete(t),i.delete(r),o}}function S$(e){return SM(e).concat(Sj(e))}let SU=Object.hasOwn||((e,t)=>SF.call(e,t)),{getOwnPropertyDescriptor:SV,keys:Sz}=Object,SG=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};function SB(e,t){return e===t}function SQ(e,t){return e.byteLength===t.byteLength&&S3(new Uint8Array(e),new Uint8Array(t))}function SH(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function SZ(e,t){return e.byteLength===t.byteLength&&S3(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function SK(e,t){return SG(e.getTime(),t.getTime())}function SY(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function SW(e,t,r){let n,i,a=e.size;if(a!==t.size)return!1;if(!a)return!0;let s=Array(a),o=e.entries(),l=0;for(;(n=o.next())&&!n.done;){let a=t.entries(),o=!1,u=0;for(;(i=a.next())&&!i.done;){if(s[u]){u++;continue}let a=n.value,c=i.value;if(r.equals(a[0],c[0],l,u,e,t,r)&&r.equals(a[1],c[1],a[0],c[0],e,t,r)){o=s[u]=!0;break}u++}if(!o)return!1;l++}return!0}function SJ(e,t,r){let n=Sz(e),i=n.length;if(Sz(t).length!==i)return!1;for(;i-- >0;)if(!S4(e,t,r,n[i]))return!1;return!0}function SX(e,t,r){let n,i,a,s=S$(e),o=s.length;if(S$(t).length!==o)return!1;for(;o-- >0;)if(!S4(e,t,r,n=s[o])||(i=SV(e,n),a=SV(t,n),(i||a)&&(!i||!a||i.configurable!==a.configurable||i.enumerable!==a.enumerable||i.writable!==a.writable)))return!1;return!0}function S0(e,t){return SG(e.valueOf(),t.valueOf())}function S1(e,t){return e.source===t.source&&e.flags===t.flags}function S2(e,t,r){let n,i,a=e.size;if(a!==t.size)return!1;if(!a)return!0;let s=Array(a),o=e.values();for(;(n=o.next())&&!n.done;){let a=t.values(),o=!1,l=0;for(;(i=a.next())&&!i.done;){if(!s[l]&&r.equals(n.value,i.value,n.value,i.value,e,t,r)){o=s[l]=!0;break}l++}if(!o)return!1}return!0}function S3(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function S5(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function S4(e,t,r,n){return("_owner"===n||"__o"===n||"__v"===n)&&(!!e.$$typeof||!!t.$$typeof)||SU(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}let S6=Object.prototype.toString,S9=S8();function S8(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=function(e){let t=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:s,areNumbersEqual:o,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p}){return{"[object Arguments]":l,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":o,"[object BigInt64Array]":h,"[object BigUint64Array]":h,"[object Boolean]":u,"[object DataView]":r,"[object Date]":n,"[object Error]":i,"[object Float16Array]":h,"[object Float32Array]":h,"[object Float64Array]":h,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":h,"[object Int16Array]":h,"[object Int32Array]":h,"[object Map]":s,"[object Number]":u,"[object Object]":(e,t,r)=>"function"!=typeof e.then&&"function"!=typeof t.then&&l(e,t,r),"[object RegExp]":c,"[object Set]":d,"[object String]":u,"[object URL]":p,"[object Uint8Array]":h,"[object Uint8ClampedArray]":h,"[object Uint16Array]":h,"[object Uint32Array]":h}}(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:i,areMapsEqual:a,areNumbersEqual:s,areObjectsEqual:o,areRegExpsEqual:l,areSetsEqual:u,getUnsupportedCustomComparator:c}=e;return function(e,d,h){if(e===d)return!0;
142if(null==e||null==d)return!1;let p=typeof e;if(p!==typeof d)return!1;if("object"!==p)return"number"===p||"bigint"===p?s(e,d,h):"function"===p&&i(e,d,h);let f=e.constructor;if(f!==d.constructor)return!1;if(f===Object)return o(e,d,h);if(f===Array)return r(e,d,h);if(f===Date)return n(e,d,h);if(f===RegExp)return l(e,d,h);if(f===Map)return a(e,d,h);if(f===Set)return u(e,d,h);if(f===Promise)return!1;if(Array.isArray(e))return r(e,d,h);let g=S6.call(e),m=t[g];if(m)return m(e,d,h);let y=c&&c(e,d,h,g);return!!y&&y(e,d,h)}}(function({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:SQ,areArraysEqual:r?SX:SH,areDataViewsEqual:SZ,areDatesEqual:SK,areErrorsEqual:SY,areFunctionsEqual:SB,areMapsEqual:r?SL(SW,SX):SW,areNumbersEqual:SG,areObjectsEqual:r?SX:SJ,arePrimitiveWrappersEqual:S0,areRegExpsEqual:S1,areSetsEqual:r?SL(S2,SX):S2,areTypedArraysEqual:r?SL(S3,SX):S3,areUrlsEqual:S5,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let e=Sq(n.areArraysEqual),t=Sq(n.areMapsEqual),r=Sq(n.areObjectsEqual),i=Sq(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:r,areSetsEqual:i})}return n}(e)),s=r?r(a):function(e,t,r,n,i,s,o){return a(e,t,o)};return function({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(a,s){let{cache:o=e?new WeakMap:void 0,meta:l}=r();return t(a,s,{cache:o,equals:n,meta:l,strict:i})};if(e)return function(e,r){return t(e,r,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};let a={cache:void 0,equals:n,meta:void 0,strict:i};return function(e,r){return t(e,r,a)}}({circular:t,comparator:a,createState:n,equals:s,strict:i})}function S7(e,t){return e.length===t.length&&e.every(e=>-1!==t.findIndex(t=>Ee(e,t)))}S8({strict:!0}),S8({circular:!0}),S8({circular:!0,strict:!0}),S8({createInternalComparator:()=>SG}),S8({strict:!0,createInternalComparator:()=>SG}),S8({circular:!0,createInternalComparator:()=>SG}),S8({circular:!0,createInternalComparator:()=>SG,strict:!0});let Ee=S8({createCustomConfig:e=>({...e,areArraysEqual:S7})}),Et=rT(ob({}),e=>{e.addCase(sE,(e,t)=>Er(e,t.payload)?void 0:t.payload)}),Er=(e,t)=>En(e.context,t.context)&&Ei(e.dictionaryFieldContext,t.dictionaryFieldContext)&&Ef(e.advancedSearchQueries,t.advancedSearchQueries)&&Ea(e.tabSet,t.tabSet)&&Eo(e.staticFilterSet,t.staticFilterSet)&&Eu(e.facetSet,t.facetSet)&&Eu(e.dateFacetSet,t.dateFacetSet)&&Eu(e.numericFacetSet,t.numericFacetSet)&&Ed(e.automaticFacetSet,t.automaticFacetSet)&&Ec(e.categoryFacetSet,t.categoryFacetSet)&&Eh(e.pagination,t.pagination)&&Ep(e.query,t.query)&&Eg(e,t)&&Em(e.pipeline,t.pipeline)&&Ey(e.searchHub,t.searchHub)&&Ev(e.facetOrder,t.facetOrder)&&Eb(e.debug,t.debug),En=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),Ei=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),Ea=(e,t)=>{let r=Es(e),n=Es(t);return r?.id===n?.id},Es=e=>Object.values(e).find(e=>e.isActive),Eo=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let t=El(e[r]),i=El(n);if(JSON.stringify(t)!==JSON.stringify(i))return!1}return!0},El=e=>e.values.filter(e=>"idle"!==e.state),Eu=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let t=e[r].request.currentValues.filter(e=>"idle"!==e.state),i=n.request.currentValues.filter(e=>"idle"!==e.state);if(JSON.stringify(t)!==JSON.stringify(i))return!1}return!0},Ec=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let t=aN(e[r]?.request.currentValues).map(({value:e})=>e),i=aN(n?.request.currentValues).map(({value:e})=>e);if(JSON.stringify(t)!==JSON.stringify(i))return!1}return!0},Ed=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let t=e.set[r].response.values.filter(e=>"idle"!==e.state),i=n.response.values.filter(e=>"idle"!==e.state);if(JSON.stringify(t)!==JSON.stringify(i))return!1}return!0},Eh=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,Ep=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ef=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Eg=(e,t)=>e.sortCriteria===t.sortCriteria,Em=(e,t)=>e===t,Ey=(e,t)=>e===t,Ev=(e,t)=>(function(e,t,r=(e,t)=>e===t){return e.length===t.length&&-1===e.findIndex((e,n)=>!r(t[n],e))})(e,t),Eb=(e,t)=>
142e===t;(e=>{let{actionTypes:t,reducer:r}=e,n=SP();return(e=n,i)=>{switch(i.type){case t.undo:return(e=>{let{past:t,present:r,future:n}=e;if(!r||0===t.length)return e;let i=t[t.length-1];return{past:t.slice(0,t.length-1),present:i,future:[r,...n]}})(e);case t.redo:return(e=>{let{past:t,present:r,future:n}=e;return r&&0!==n.length?{past:[...t,r],present:n[0],future:n.slice(1)}:e})(e);case t.snapshot:return(e=>{let{action:t,state:r,reducer:n}=e,{past:i,present:a}=r,s=n(a,t);return a?a===s?r:{past:[...i,a].slice(-10),present:s,future:[]}:SP(s)})({state:e,reducer:r,action:i});default:return e}}})({actionTypes:{redo:sS.type,undo:sw.type,snapshot:sE.type},reducer:Et});let Ew={results:new ev({required:!0,each:new em({values:a8})}),maxLength:new ed({required:!0,min:1,default:10})},ES=rS("recentResults/registerRecentResults",e=>to(e,Ew)),EE=rS("recentResults/pushRecentResult",e=>{var t,r;return t=e,new ea(a8).validate(Object.assign({},...Object.keys(a8).map(e=>({[e]:t[e]})),{raw:(r=t.raw,Object.assign({},...Object.keys(a9).map(e=>({[e]:r[e]}))))})),{payload:e}}),E_=rS("recentResults/clearRecentResults"),EC=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null};rT({},e=>{e.addCase(sR,(e,t)=>{((e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}}})(t.payload,e)}),e.addCase(sD,(e,t)=>{((e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)})(t.payload,e)}),e.addCase(sP,(e,t)=>{((e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([e,n])=>{n&&n.expiresAt&&Date.now()>=n.expiresAt&&delete t[r].cache[e]})})(t.payload,e)}),e.addCase(o7.pending,(e,t)=>{((e,t,r)=>{for(let e in t)for(let r in t[e].cache)t[e].cache[r].isActive=!1;if(!EC(e,t))return((e,t,r)=>{let{q:n,id:i}=e;t[i].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}})(e,t,r);let n=EC(e,t);n.isLoading=!0,n.isActive=!0,n.error=null})(t.meta.arg,e,{results:[]})}),e.addCase(o7.fulfilled,(e,t)=>{let r=t.payload.results.map(e=>({...e,searchUid:t.payload.searchUid}));((e,t,r)=>{let{id:n,q:i,searchUid:a,cacheTimeout:s,totalCountFiltered:o,duration:l}=e;t[n].cache[i]={...EC(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:s?s+Date.now():0,totalCountFiltered:o,duration:l}})({...t.payload,...t.meta.arg},e,{results:r})}),e.addCase(o7.rejected,(e,t)=>{((e,t)=>{let{id:r,q:n,error:i}=e;t[r].cache[n].error=i||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1})(t.meta.arg,e)})}),new ea({searchBoxId:te,maxResultsPerQuery:new ed({required:!0,min:1}),cacheTimeout:new ed});let Ek=rT(ov(),e=>{e.addCase(sj,(e,t)=>{let r=Ex(e),n=t.payload;e.defaultNumberOfResults=e.numberOfResults=n,e.firstResult=(r-1)*n}).addCase(sF,(e,t)=>{e.numberOfResults=t.payload,e.firstResult=0}).addCase(cn,e=>{e.firstResult=0}).addCase(sL,(e,t)=>{var r;r=t.payload,e.firstResult=(r-1)*e.numberOfResults}).addCase(sq,(e,t)=>{var r;r=t.payload,e.firstResult=(r-1)*e.numberOfResults}).addCase(sU,e=>{let t=Math.max(Ex(e)-1,1);e.firstResult=(t-1)*e.numberOfResults}).addCase(s$,e=>{let t=Math.min(Ex(e)+1,function(e){let{totalCountFiltered:t,numberOfResults:r}=e;return ET(t,r)}(e));e.firstResult=(t-1)*e.numberOfResults}).addCase(s_.fulfilled,(e,t)=>{t.payload&&(e.numberOfResults=t.payload.pagination.numberOfResults,e.firstResult=t.payload.pagination.firstResult)}).addCase(sg,(e,t)=>{e.firstResult=t.payload.firstResult??e.firstResult,e.numberOfResults=t.payload.numberOfResults??e.defaultNumberOfResults}).addCase(o4.fulfilled,(e,t)=>{let{response:r}=t.payload;e.totalCountFiltered=r.totalCountFiltered}).addCase(o6.fulfilled,(e,t)=>{let{response:r}=t.payload;e.totalCountFiltered=r.totalCountFiltered}).addCase(v1,e=>{EI(e)}).addCase(bP,e=>{EI(e)}).addCase(v0,e=>{EI(e)}).addCase(b1,e=>{EI(e)}).addCase(bp,e=>{EI(e)}).addCase(vX,e=>{EI(e)}).addCase(vf,e=>{EI(e)}).addCase(vp,e=>{EI(e)}).addCase(vI,e=>{EI(e)}).addCase(bD,e=>{EI(e)}).addCase(b0,e=>{EI(e)}).addCase(sI,e=>{EI(e)}).addCase(bM,e=>{EI(e)}).addCase(b2,e=>{EI(e)}).addCase(bh,e=>{EI(e)}).addCase(vu,e=>{EI(e)})});function EI(e){e.firstResult=ov().firstResult}function Ex(e){let{firstResult:t,numberOfResults:r}=e;return EA(t,r)}function EA(e,t){return Math.round(e/t)+1}function ET(e,t){return Math.ceil(Math.min(e,5e3)/t)}function EO(e){return e.pagination.numberOfResults}let EN=e=>EA(e.pagination.firstResult,EO(e)),ER=e=>ET(e.pagination.totalCountFiltered,EO(e)),ED=()=>a4("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||ov().numberOfResults})),EP=()=>a4("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:EN(t)})),EM=()=>a4("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:EN(t)})),Ej=()=>a4("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:EN(t)})),EF=()=>({actionCause:B.browseResults}),EL=new ea({numberOfPages:new ed({default:5,min:0})}),Eq=new ea({page:new ed({min:1})});function E$(e,t={}){let{dispatch:r}=e,n=function(e,t={}){e.addReducers({configuration:cu,pagination:Ek}),!1;let r=wV(e),{dispatch:n}=e,i=tu(e,EL,t.options,"buildPager"),a=tl(e,Eq,t.initialState,"buildPager").page;return a&&n(sL(a)),{...r,get state(){let t=EN(e.state),r=ER(e.state);return{currentPage:t,currentPages:(()=>{var t,r,n,a,s,o;let l,u,c,d,h,p,{numberOfPages:f}=i;return t=e.state,d=EN(t),h=ER(t),function(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}((s=(u=Math.max(1-(a={start:(r=d)-(l=Math.floor((n=f)/2)),end:r+(n%2==0?l-1:l)}).start,0),p={start:a.start+u,end:a.end+u}),o=h,c=Math.max(s.end-o,0),p={start:Math.max(s.start-c,1),end:s.end-c}))})(),maxPage:r,hasPreviousPage:t>1&&r>0,hasNextPage:t<r}},selectPage(e){n(sq(e))},nextPage(){n(s$())},previousPage(){n(sU())},isCurrentPage(e){return e===this.state.currentPage}}}(e,t);return{...n,get state(){return n.state},selectPage(e){n.selectPage(e),r(o6({legacy:EP(),next:EF()}))},nextPage(){n.nextPage(),r(o6({legacy:EM(),next:EF()}))},previousPage(){n.previousPage(),r(o6({legacy:Ej(),next:EF()}))}}}function EU(e){e.addReducers({search:lp,pagination:Ek}),!1;let t=wV(e),r=Sk(e);return{...t,get state(){return{...r.state,durationInMilliseconds:e.state.search.duration,durationInSeconds:Math.round((e.state.search.duration/1e3+Number.EPSILON)*100)/100,firstResult:e.state.pagination.firstResult+1,hasDuration:0!==e.state.search.duration,hasQuery:""!==e.state.search.queryExecuted,lastResult:e.state.pagination.firstResult+e.state.search.results.length,query:e.state.search.queryExecuted,total:e.state.pagination.totalCountFiltered}}}}async function EV(e,t){let{search:r,accessToken:n,organizationId:i}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??eJ(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:i,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")}}}let Ez=rB("resultPreview/fetchResultContent",async(e,{extra:t,getState:r,rejectWithValue:n})=>{let i=r(),a=await EV(i,e),s=await t.apiClient.html(a);return void 0!==s.error?n(s.error):{content:s.success,uniqueId:e.uniqueId}}),EG=rS("resultPreview/next"),EB=rS("resultPreview/previous"),EQ=rS("resultPreview/prepare",e=>to(e,{results:new ev({required:!0})})),EH=rB("resultPreview/updateContentURL",async(e,{getState:t,extra:r})=>{var n,i;let a,s=t(),o=(n=await e.buildResultPreviewRequest(s,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}
142),i=e.path,(a=new eR(`${n.url}${i}`)).addParam("access_token",n.accessToken),a.addParam("organizationId",n.organizationId),a.addParam("uniqueId",n.uniqueId),n.authentication&&a.addParam("authentication",n.authentication),void 0!==n.q&&a.addParam("q",n.q),void 0!==n.enableNavigation&&a.addParam("enableNavigation",`${n.enableNavigation}`),void 0!==n.requestedOutputSize&&a.addParam("requestedOutputSize",`${n.requestedOutputSize}`),a.href);return o?.length>2048&&r.logger.error("The content URL was truncated as it exceeds the maximum allowed length of 2048 characters."),{contentURL:o}});function EZ(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}let EK=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:i}=EZ();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=i},EY=e=>e.filter(e=>e.hasHtmlVersion).map(e=>e.uniqueId);rT(EZ(),e=>{e.addCase(Ez.pending,e=>{e.isLoading=!0}).addCase(Ez.fulfilled,(e,t)=>{let{content:r,uniqueId:n}=t.payload;e.position=e.resultsWithPreview.indexOf(n),e.content=r,e.uniqueId=n,e.isLoading=!1}).addCase(o4.fulfilled,(e,t)=>{EK(e),e.resultsWithPreview=EY(t.payload.response.results)}).addCase(o9.fulfilled,(e,t)=>{EK(e),e.resultsWithPreview=e.resultsWithPreview.concat(EY(t.payload.response.results))}).addCase(o6.fulfilled,EK).addCase(EQ,(e,t)=>{e.resultsWithPreview=EY(t.payload.results)}).addCase(EG,e=>{if(e.isLoading)return;let t=e.position+1;t>e.resultsWithPreview.length-1&&(t=0),e.position=t}).addCase(EB,e=>{if(e.isLoading)return;let t=e.position-1;t<0&&(t=e.resultsWithPreview.length-1),e.position=t}).addCase(EH.fulfilled,(e,t)=>{e.contentURL=t.payload.contentURL})});let EW={queries:new ev({required:!0,each:new ef({emptyAllowed:!1})}),maxLength:new ed({required:!0,min:1,default:10})},EJ=rS("recentQueries/registerRecentQueries",e=>to(e,EW)),EX=rS("recentQueries/clearRecentQueries");function E0(e,t){e.queries=Array.from(new Set(t.payload.queries.map(e=>e.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function E1(e){e.queries=[]}function E2(e,t){return function(e,t){e.addReducers({search:lp,configuration:cu,fields:SC}),!1;let r=wV(e),n=Sk(e),{dispatch:i}=e,a=tu(e,SI,t?.options,"buildCoreResultList");a.fieldsToInclude&&i(Sb(a.fieldsToInclude));let s=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,o=0,l=0,u=!1,c=async()=>{if(!e.state.search.isLoading){if(!s())return void e.logger.info("No more results are available for the result list to fetch.");if(Date.now()-o<200){if(++l>=5){o=Date.now(),u||e.logger.error('The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively 5 times, with little delay. Please verify the conditions under which the function is called.'),u=!0;return}}else l=0;u=!1,t?.fetchMoreResultsActionCreator&&(await i(t?.fetchMoreResultsActionCreator()),o=Date.now())}};return{...r,get state(){let t=e.state;return{...n.state,results:t.search.results,moreResultsAvailable:s(),searchResponseId:t.search.searchResponseId}},fetchMoreResults:c}}(e,{...t,fetchMoreResultsActionCreator:o9})}rT({queries:[],maxLength:10},e=>{e.addCase(EJ,E0).addCase(EX,E1).addCase(o4.fulfilled,(e,t)=>{let r=t.payload.queryExecuted,n=t.payload.response.results;r.length&&n.length&&function(e,t){let r=e.trim().toLowerCase();if(""===r)return;let n=Array.from(new Set(t.queries.filter(e=>e.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}(r,e)})}),new ea({queries:new ev({required:!0})}),new ea({maxLength:new ed({required:!0,min:1}),clearFilters:new eu}),rT({results:[],maxLength:10},e=>{e.addCase(ES,(e,t)=>{e.results=t.payload.results.slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}).addCase(E_,e=>{e.results=[]}).addCase(EE,(e,t)=>{let r=t.payload;e.results=e.results.filter(e=>e.uniqueId!==r.uniqueId);let n=e.results.slice(0,e.maxLength-1);e.results=[r,...n]})}),new ea({results:new ev({required:!0})}),new ea({maxLength:new ed({required:!0,min:1})}),new ea({enabled:new eu({default:!1})});let E3=new ea({numberOfResults:new ed({min:0})});function E5(e,t={}){e.addReducers({pagination:Ek,configuration:cu}),!1;let r=function(e,t={}){e.addReducers({pagination:Ek,configuration:cu}),!1;let r=wV(e),{dispatch:n}=e,i=tl(e,E3,t.initialState,"buildResultsPerPage").numberOfResults;return void 0!==i&&n(sj(i)),{...r,get state(){return{numberOfResults:e.state.pagination.numberOfResults}},set(e){n(sF(e))},isSetTo(e){return e===this.state.numberOfResults}}}(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(e){r.set(e),n(o6({legacy:ED(),next:EF()}))}}}let E4=()=>a4("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),E6=()=>({actionCause:B.searchboxSubmit}),E9={id:e7,query:tt},E8=rS("querySet/register",e=>to(e,E9)),E7=rS("querySet/update",e=>to(e,E9)),_e=rT({},e=>{e.addCase(E8,(e,t)=>_i(e,t.payload)).addCase(E7,(e,t)=>{let{id:r,query:n}=t.payload;_n(e,r,n)}).addCase(Sf,(e,t)=>{let{id:r,expression:n}=t.payload;_n(e,r,n)}).addCase(o4.fulfilled,(e,t)=>{let{queryExecuted:r}=t.payload;_r(e,r)}).addCase(sg,_t).addCase(s_.fulfilled,(e,t)=>{if(t.payload)for(let[r,n]of Object.entries(t.payload.querySet))_n(e,r,n)})});function _t(e,t){el(t.payload.q)||_r(e,t.payload.q)}function _r(e,t){Object.keys(e).forEach(r=>{e[r]=t})}let _n=(e,t,r)=>{t in e&&(e[t]=r)},_i=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)},_a=e=>a4("analytics/querySuggest",(t,r)=>{let n=function(e,t){let{id:r,suggestion:n}=t,i=e.querySuggest?.[r];if(!i)throw Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=i.completions.map(e=>e.expression),s=i.partialQueries.length-1,o=i.partialQueries[s]||"",l=i.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:o,partialQueries:i.partialQueries,suggestions:a,querySuggestResponseId:l}}(r,e);return t.makeOmniboxAnalytics(n)});function _s(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function _o(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}let _l=rT({},e=>e.addCase(Sh,(e,t)=>{var r;let n;
142(n=(r=t.payload).id)in e||(e[n]={id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...r})}).addCase(Sp,(e,t)=>{delete e[t.payload.id]}).addCase(Sm.pending,_s).addCase(Sm.fulfilled,(e,t)=>{let r=e[t.meta.arg.id];if(!r||t.meta.requestId!==r.currentRequestId)return;let{q:n}=t.payload;n&&r.partialQueries.push(n.replace(/;/,encodeURIComponent(";"))),r.responseId=t.payload.responseId,r.completions=t.payload.completions,r.isLoading=!1,r.error=null}).addCase(Sm.rejected,_o).addCase(Sg,(e,t)=>{let r;(r=e[t.payload.id])&&(r.responseId="",r.completions=[],r.partialQueries=[])}).addCase(ll,(e,t)=>{Object.keys(e).forEach(r=>{let n=e[r];n&&(n.error=t.payload,n.isLoading=!1)})})),_u={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},_c={open:new ef,close:new ef},_d={id:e7,numberOfSuggestions:new ed({min:0}),enableQuerySyntax:new eu,highlightOptions:new em({values:{notMatchDelimiters:new em({values:_c}),exactMatchDelimiters:new em({values:_c}),correctionDelimiters:new em({values:_c})}}),clearFilters:new eu},_h=new ea(_d);function _p(e,t={}){let r=function(e,t){e.addReducers({query:Sv,querySuggest:_l,configuration:cu,querySet:_e,search:lp}),!1;let r=wV(e),{dispatch:n}=e,i=t.options?.id||((e,t=5)=>e+Math.random().toString(36).substring(2,2+t))("search_box"),a={id:i,highlightOptions:{...t.options?.highlightOptions},..._u,...t.options};tu(e,_h,a,"buildSearchBox"),n(E8({id:i,query:e.state.query.q})),a.numberOfSuggestions&&n(Sh({id:i,count:a.numberOfSuggestions})),a.enableQuerySyntax&&n(sV({enableQuerySyntax:a.enableQuerySyntax}));let s=()=>e.state.querySet[a.id],o=async e=>{let{enableQuerySyntax:r,clearFilters:i}=a;n(o3({q:s(),enableQuerySyntax:r,clearFilters:i})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(e)):n(t.executeSearchActionCreator(e.legacy))};return{...r,updateText(e){n(E7({id:i,query:e})),this.showSuggestions()},clear(){n(E7({id:i,query:""})),n(Sg({id:i}))},showSuggestions(){a.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:i}))},selectSuggestion(e){n(Sf({id:i,expression:e})),o({legacy:_a({id:i,suggestion:e}),next:{actionCause:B.omniboxAnalytics}}).then(()=>{n(Sg({id:i}))})},submit(e=E4(),t){o({legacy:e,next:t}),n(Sg({id:i}))},get state(){var l,u;let t=e.state,r=t.querySuggest[a.id],n=(l=r,u=a.highlightOptions,l?l.completions.map(e=>{var t,r;let n,i,a,s;return{highlightedValue:(t=e.highlighted,(r=t,n={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},a=RegExp(i=`(?:${Object.keys(n).join("|")})`),s=RegExp(i,"g"),t=a.test(r)?r.replace(s,e=>n[e]):r).replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(e,t,r,n)=>t?eC(t,u.notMatchDelimiters):r?eC(r,u.exactMatchDelimiters):n?eC(n,u.correctionDelimiters):e)),rawValue:e.expression}}):[]),o=!!r&&r.isLoading;return{searchBoxId:i,value:s(),suggestions:n,isLoading:t.search.isLoading,isLoadingSuggestions:o}}}}(e,{...t,executeSearchActionCreator:o4,fetchQuerySuggestionsActionCreator:Sm,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(E4(),E6())},get state(){return r.state}}}let _f=()=>a4("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||aH()})),_g=()=>({actionCause:B.resultsSort});function _m(e={},t={},r=!1){let n=Object.keys(e),i=Object.keys(t),a=n.filter(e=>!i.includes(e));if(a.length){let t=a[0];switch(!0){case e[t].length>1:return v7(t);case r:return bn({facetId:t,facetValue:e[t][0]});default:return br({facetId:t,facetValue:e[t][0]})}}let s=i.filter(e=>!n.includes(e));if(s.length){let e=s[0];return r?bt({facetId:e,facetValue:t[e][0]}):be({facetId:e,facetValue:t[e][0]})}let o=i.find(r=>t[r].filter(t=>e[r].includes(t)));if(!o)return st();let l=e[o],u=t[o],c=u.filter(e=>!l.includes(e));if(c.length)return r?bt({facetId:o,facetValue:c[0]}):be({facetId:o,facetValue:c[0]});let d=l.filter(e=>!u.includes(e));return d.length?r?bn({facetId:o,facetValue:d[0]}):br({facetId:o,facetValue:d[0]}):st()}function _y(e={},t={}){return _m(_w(e),_w(t))}function _v(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function _b(e={},t={},r=!1){let n=Object.keys(e),i=Object.keys(t),a=n.filter(e=>!i.includes(e));if(a.length)return e[a[0]].length>1?ba():bl();if(i.filter(e=>!n.includes(e)).length)return r?bo():bs();let s=i.find(r=>t[r].filter(t=>e[r].includes(t)));if(!s)return si();let o=e[s],l=t[s];return l.filter(e=>!o.includes(e)).length?r?bo():bs():o.filter(e=>
142!l.includes(e)).length?bl():si()}function _w(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(e=>`${e.start}..${e.end}`)}),t}function _S(e,t,r,n){if(void 0===e)return{};let i=Object.entries(e).filter(([e])=>t(e)).map(([e,{request:t}])=>{let n=r(t);return n.length?{[e]:n}:{}}).reduce((e,t)=>({...e,...t}),{});return Object.keys(i).length?{[n]:i}:{}}let _E=new ea({parameters:new em({options:{required:!0},values:sf})});function __(e,t){var r;return{...(r=e.state,{q:aV().q,enableQuerySyntax:aV().enableQuerySyntax,aq:r.advancedSearchQueries?.defaultFilters.aq??sH().defaultFilters.aq,cq:r.advancedSearchQueries?.defaultFilters.cq??sH().defaultFilters.cq,firstResult:ov().firstResult,numberOfResults:r.pagination?.defaultNumberOfResults??ov().defaultNumberOfResults,sortCriteria:aH(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:!1,sf:{},tab:"",af:{},mnf:{}}),...t}}function _C(e,t){if(el(t.tab)||!e)return t;if(""===t.tab)return{...t,tab:_k(e)};if(!Object.values(e).some(e=>e.id===t.tab)){let r=Object.values(e).find(e=>e.isActive);return{...t,tab:r?.id??_k(e)}}return t}function _k(e){return Object.keys(e)[0]??""}function _I(e){var t,r,n;let i=e.state;return{...function(e,t,r){if(void 0===e)return{};let n=t(e);return n!==r?{q:n}:{}}(i.query,e=>e.q,aV().q),...function(e,t,r){if(void 0===e)return{};let n=t(e);return n!==r?{tab:n}:{}}(i.tabSet,e=>{let t=Object.values(e??{}).find(e=>e.isActive);return t?t.id:Object.keys(e??{})[0]},i.tabSet?Object.keys(i.tabSet)[0]:""),...function(e,t,r){if(void 0===e)return{};let n=t(e);return S9(n,r)?{}:{sortCriteria:n}}(i.sortCriteria,e=>e,aH()),...function(e){let t=e.facetSet;if(void 0===t)return{};let r=_x(e),n={},i={};for(let[e,{request:a}]of Object.entries(t)){if(!r(e))continue;let t=a.currentValues.filter(e=>"selected"===e.state).map(e=>e.value),s=a.currentValues.filter(e=>"excluded"===e.state).map(e=>e.value);t.length&&(n[e]=t),s.length&&(i[e]=s)}return{...Object.keys(n).length?{f:n}:{},...Object.keys(i).length?{fExcluded:i}:{}}}(i),..._S((t=i).categoryFacetSet,_x(t),e=>aN(e.currentValues).map(e=>e.value),"cf"),..._S((r=i).numericFacetSet,_x(r),_A,"nf"),..._S((n=i).dateFacetSet,_x(n),_A,"df"),...function(e){let t=e.automaticFacetSet?.set;if(void 0===t)return{};let r=Object.entries(t).map(([e,{response:t}])=>{let r=t.values.filter(e=>"selected"===e.state).map(e=>e.value);return r.length?{[e]:r}:{}}).reduce((e,t)=>({...e,...t}),{});return Object.keys(r).length?{af:r}:{}}(i)}}function _x(e){let t=function(e){let t=e.tabSet;if(!t)return;let r=Object.values(t).find(e=>e.isActive);return r?.id}(e);return r=>{let n=e.facetOptions?.facets[r],i=n?.enabled??!0,a=v_(n?.tabs,t);return i&&a}}function _A(e){return e.currentValues.filter(e=>"selected"===e.state)}function _T(e){let t=e.state;return{..._I(e),...function(e){if(void 0===e.query)return{};let t=e.query.enableQuerySyntax;return void 0!==t&&t!==aV().enableQuerySyntax?{enableQuerySyntax:t}:{}}(t),...function(e){if(void 0===e.advancedSearchQueries)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}(t),...function(e){if(void 0===e.advancedSearchQueries)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}(t),...function(e){if(void 0===e.pagination)return{};let t=e.pagination.firstResult;return t!==ov().firstResult?{firstResult:t}:{}}(t),...function(e){if(void 0===e.pagination)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}(t),...function(e){if(void 0===e.debug)return{};let t=e.debug;return!1!==t?{debug:t}:{}}(t),...function(e){if(void 0===e.staticFilterSet)return{};let t=Object.entries(e.staticFilterSet).map(([e,t])=>{let r=t.values.filter(e=>"selected"===e.state).map(e=>e.caption);return r.length?{[e]:r}:{}}).reduce((e,t)=>({...e,...t}),{});return Object.keys(t).length?{sf:t}:{}}(t)}}function _O(e){return Sk(e)}function _N(e){return to(e,new em({values:{questionAnswerId:e7},options:{required:!0}}))}function _R(e,t){var r,n;let i=t??e.search?.questionAnswer?.documentId;return i&&e.search&&(r=i.contentIdKey,n=i.contentIdValue,e.search.results.find(e=>la(e,r)===n))}function _D(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(e=>e.questionAnswerId===t)??-1;return -1===r?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}let _P=()=>a4({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=_R(e),r=a6(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),_M=()=>a4({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=_R(e),r=a6(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),_j=()=>a4({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=_R(e),r=a6(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),_F=()=>a4({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=_R(e),r=a6(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),_L=()=>a4("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),_q=()=>a4("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),_$={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",
142was_not_a_question:"wasNotAQuestion"},_U=e=>a4({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=_R(t),n=a6(r),i=t.search?.response.searchUid;if(i)return{responseId:i,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:_$[e]}}}),_V=e=>a4({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=_R(t),n=a6(r),i=t.search?.response.searchUid;if(i)return{responseId:i,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),_z=e=>a4({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{_N(e);let n=_D(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=_D(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let e=_R(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:e?.title,url:e?.clickUri}}}}}),_G=e=>a4({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{_N(e);let n=_D(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=_D(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let e=_R(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:e?.title,url:e?.clickUri}}}}}),_B=rS("smartSnippet/expand"),_Q=rS("smartSnippet/collapse"),_H=rS("smartSnippet/like"),_Z=rS("smartSnippet/dislike"),_K=rS("smartSnippet/feedbackModal/open"),_Y=rS("smartSnippet/feedbackModal/close"),_W=rS("smartSnippet/related/expand",e=>_N(e)),_J=rS("smartSnippet/related/collapse",e=>_N(e)),_X=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]}),_0=(e,t)=>e.findIndex(e=>e.questionAnswerId===t.questionAnswerId);function _1({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return btoa(encodeURI(JSON.stringify({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})))}rT(_X(),e=>e.addCase(_B,e=>{e.expanded=!0}).addCase(_Q,e=>{e.expanded=!1}).addCase(_H,e=>{e.liked=!0,e.disliked=!1,e.feedbackModalOpen=!1}).addCase(_Z,e=>{e.liked=!1,e.disliked=!0}).addCase(_K,e=>{e.feedbackModalOpen=!0}).addCase(_Y,e=>{e.feedbackModalOpen=!1}).addCase(o4.fulfilled,(e,t)=>{let r=t.payload.response.questionAnswer.relatedQuestions.map((t,r)=>{var n;let i;return n=e.relatedQuestions[r],i=_1(t),n&&i===n.questionAnswerId?n:{contentIdKey:t.documentId.contentIdKey,contentIdValue:t.documentId.contentIdValue,expanded:!1,questionAnswerId:i}}),n=_1(t.payload.response.questionAnswer);return e.questionAnswerId===n?{...e,relatedQuestions:r}:{..._X(),relatedQuestions:r,questionAnswerId:n}}).addCase(_W,(e,t)=>{let r=_0(e.relatedQuestions,t.payload);-1!==r&&(e.relatedQuestions[r].expanded=!0)}).addCase(_J,(e,t)=>{let r=_0(e.relatedQuestions,t.payload);-1!==r&&(e.relatedQuestions[r].expanded=!1)}));let _2={by:new ew({enum:G,required:!0})},_3=rS("sortCriteria/register",e=>_4(e)),_5=rS("sortCriteria/update",e=>_4(e)),_4=e=>eb(e)?(e.forEach(e=>to(e,_2)),{payload:e}):to(e,_2),_6=rT(aH(),e=>{e.addCase(_3,(e,t)=>
142az(t.payload)).addCase(_5,(e,t)=>az(t.payload)).addCase(s_.fulfilled,(e,t)=>t.payload?.sortCriteria??e).addCase(sg,(e,t)=>t.payload.sortCriteria??e)});function _9(e,t={}){let{dispatch:r}=e,n=function(e,t){e.addReducers({configuration:cu,sortCriteria:_6}),!1;let r=wV(e),{dispatch:n}=e;!function(e,t){var r;if(!t)return;let n=new ea({criterion:new ev({each:aQ})}),i=(r=t).criterion?eb(r.criterion)?r.criterion:[r.criterion]:[];tl(e,n,{...t,criterion:i},"buildSort")}(e,t.initialState);let i=t.initialState?.criterion;return i&&n(_3(i)),{...r,sortBy(e){n(_5(e)),n(sq(1))},isSortedBy(e){return this.state.sortCriteria===az(e)},get state(){return{sortCriteria:e.state.sortCriteria}}}}(e,t);return{...n,get state(){return n.state},sortBy(e){n.sortBy(e),r(o4({legacy:_f(),next:_g()}))}}}function _8(e){return"redirect"===e.type}class _7{constructor(e){this.response=e}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let e=this.response.preprocessingOutput.triggers.filter(_8);return e.length?e[0].content:null}}let Ce=rS("standaloneSearchBox/register",e=>to(e,{id:e7,redirectionUrl:e7,overwrite:new eu({required:!1})})),Ct=rS("standaloneSearchBox/updateRedirectionUrl",e=>to(e,{id:e7,redirectionUrl:e7})),Cr=rS("standaloneSearchBox/reset",e=>to(e,{id:e7})),Cn=rS("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>to(e,{id:e7})),Ci=rS("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),Ca=rB("standaloneSearchBox/fetchRedirect",async(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:i,validatePayload:a,navigatorContext:s}})=>{a(e,{id:new ef({emptyAllowed:!1})});let o=await Co(r(),s),l=await i.plan(o);if(void 0!==l.error)return n(l.error);let{redirectionUrl:u}=new _7(l.success);return u&&t(Cs(u)),u||""}),Cs=e=>a4("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),Co=async(e,t)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??eJ(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...e.context&&{context:e.context.contextValues},...e.pipeline&&{pipeline:e.pipeline},...e.searchHub&&{searchHub:e.searchHub},...void 0!==e.query.enableQuerySyntax&&{enableQuerySyntax:e.query.enableQuerySyntax},...e.configuration.analytics.enabled&&"legacy"===e.configuration.analytics.analyticsMode?await sB(e.configuration.analytics):sz(e.configuration.analytics,t),...e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}});function Cl(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}function Cu(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}rT({},e=>e.addCase(Ce,(e,t)=>{let{id:r,redirectionUrl:n,overwrite:i}=t.payload;!i&&r in e||(e[r]=Cl(n))}).addCase(Cr,(e,t)=>{let{id:r}=t.payload,n=e[r];if(n){e[r]=Cl(n.defaultRedirectionUrl);return}}).addCase(Ct,(e,t)=>{let{id:r,redirectionUrl:n}=t.payload;r in e&&(e[r]=Cl(n))}).addCase(Ca.pending,(e,t)=>{let r=e[t.meta.arg.id];r&&(r.isLoading=!0)}).addCase(Ca.fulfilled,(e,t)=>{let r=t.payload,n=e[t.meta.arg.id];n&&(n.redirectTo=r||n.defaultRedirectionUrl,n.isLoading=!1)}).addCase(Ca.rejected,(e,t)=>{let r=e[t.meta.arg.id];r&&(r.isLoading=!1)}).addCase(Cn,(e,t)=>{let r=e[t.payload.id];r&&(r.analytics.cause="searchFromLink")}).addCase(Ci,(e,t)=>{let r=e[t.payload.id];r&&(r.analytics.cause="omniboxFromLink",r.analytics.metadata=t.payload.metadata)})),new ea({..._d,redirectionUrl:new ef({required:!0,emptyAllowed:!1}),overwrite:new eu({required:!1})}),rT({},e=>e.addCase(b9,(e,t)=>{let r=t.payload,{id:n}=r;n in e||(e[n]=r)}).addCase(b8,(e,t)=>{let{id:r,value:n}=t.payload,i=e[r];if(!i)return;let a=i.values.find(e=>e.caption===n.caption);if(!a)return;let s="selected"===a.state;a.state=s?"idle":"selected"}).addCase(b7,(e,t)=>{let{id:r,value:n}=t.payload,i=e[r];if(!i)return;let a=i.values.find(e=>e.caption===n.caption);if(!a)return;let s="excluded"===a.state;a.state=s?"idle":"excluded"}).addCase(we,(e,t)=>{let r=e[t.payload];
142r&&r.values.forEach(e=>{e.state="idle"})}).addCase(sI,e=>{Object.values(e).forEach(e=>{e.values.forEach(e=>{e.state="idle"})})}).addCase(sg,(e,t)=>{let r=t.payload.sf||{};Object.entries(e).forEach(([e,t])=>{let n=r[e]||[];t.values.forEach(e=>{e.state=n.includes(e.caption)?"selected":"idle"})})})),new ea({id:e7,values:b6}),new ea({expression:tt,id:e7,clearFiltersOnTabChange:new eu}),new ea({isActive:new eu}),rT({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}},e=>e.addCase(o4.pending,Cu).addCase(o4.fulfilled,(e,t)=>{var r;let n,i,a,s;return r=t.payload.response.triggers,n=[],i=[],a=[],s=[],r.forEach(e=>{switch(e.type){case"redirect":n.push(e.content);break;case"query":i.push(e.content);break;case"execute":a.push({functionName:e.content.name,params:e.content.params});break;case"notify":s.push(e.content)}}),e.redirectTo=n[0]??"",e.query=e.queryModification.newQuery,e.executions=a,e.notifications=s,e}).addCase(ox,(e,t)=>(e.queryModification={...t.payload,queryToIgnore:""},e)).addCase(oI,(e,t)=>{var r;return r=t.payload,e.queryModification.queryToIgnore=r,e}));let Cc=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,Cd={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0};function Ch(){return{serialize:Cf(Cg),deserialize:Cv}}function Cp(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}||e in Cd}let Cf=e=>t=>Object.entries(t).map(e).filter(e=>e).join("&");function Cg(e){var t,r,n,i,a,s,o;let[l,u]=e;if(!Cp(l))return"";return l in Cd&&!((t=l)in Cd&&t in{nf:!0,df:!0,mnf:!0})?Cm(r=u)&&Cy(r,e=>"string"==typeof e)?(n=l,Object.entries(u).map(([e,t])=>`${n}-${e}=${t.map(e=>encodeURIComponent(e)).join(",")}`).join("&")):"":"nf"===l||"df"===l?Cm(i=u)&&Cy(i,e=>Cm(e)&&"start"in e&&"end"in e)?(a=l,Object.entries(u).map(([e,t])=>{let r=t.map(({start:e,end:t,endInclusive:r})=>`${e}${r?"...":".."}${t}`).join(",");return`${a}-${e}=${r}`}).join("&")):"":(s=l,o=u,`${s}=${encodeURIComponent(o)}`)}function Cm(e){return!!(e&&"object"==typeof e)}function Cy(e,t){return 0===Object.entries(e).filter(e=>{let r=e[1];return!Array.isArray(r)||!r.every(t)}).length}function Cv(e){return e.split("&").map(e=>(function(e){let[t,...r]=e.split("=");return[t,r.join("=")]})(e)).map(e=>(function(e,t=Cc){var r,n;let[i,a]=e,s=t.exec(i);if(!s)return e;let o=s[1],l=s[2],u=(r=o,n=a.split(","),"nf"===r||"mnf"===r?function(e,t){let r=[];for(let n of e){let{startAsString:e,endAsString:i,isEndInclusive:a}=CS(n),s=parseFloat(e),o=parseFloat(i);Number.isFinite(s)&&Number.isFinite(o)&&r.push({endInclusive:!1,state:"idle",start:s,end:o,state:t,endInclusive:a})}return r}(n,"selected"):"df"===r?function(e,t){let r=[];for(let n of e){let{isEndInclusive:e,startAsString:i,endAsString:a}=CS(n);Cb(i)&&Cb(a)&&r.push(b_({start:i,end:a,state:t,endInclusive:e}))}return r}(n,"selected"):n);return[o,JSON.stringify({[l]:u})]})(e)).filter(Cw).map(e=>(function(e,t=!0){let r,n,[i,a]=e;if("enableQuerySyntax"===i||"debug"===i)return[i,"true"===a];if("firstResult"===i||"numberOfResults"===i)return[i,parseInt(a,10)];return i in Cd?[i,(r=JSON.parse(a),n={},Object.entries(r).forEach(e=>{let[t,r]=e;n[t]=r.map(e=>eg(e)?decodeURIComponent(e):e)}),n)]:[i,t?decodeURIComponent(a):a]})(e)).reduce((e,t)=>{let[r,n]=t;if(r in Cd){let t={...e[r],...n};return{...e,[r]:t}}return{...e,[r]:n}},{})}function Cb(e){try{if(s1(s0(e))===e)return s2(e,sX),!0;if(oe(e))return s6(e),!0;return!1}catch(e){return!1}}function Cw(e){let t=Cp(e[0]),r=2===e.length;return t&&r}function CS(e){let t=-1!==e.indexOf("..."),[r,n]=e.split(t?"...":"..");return{isEndInclusive:t,startAsString:r,endAsString:n}}let CE=new ea({fragment:new ef});function C_(e,t){let r;function n(){r=e.state.search.requestId}e.addReducers({configuration:cu}),!1;tl(e,CE,t.initialState,"buildUrlManager");let i=wV(e),a=t.initialState.fragment;n();let s=function(e,t){let{dispatch:r}=e,n=function(e,t){let{dispatch:r}=e,n=wV(e);return tl(e,_E,t.initialState,"buildSearchParameterManager"),r(sg(_C(e.state.tabSet,t.initialState.parameters))),{...n,synchronize(t){r(sg(_C(e.state.tabSet,__(e,t))))},get state(){return{parameters:_I(e)}}}}(e,t);return{...n,synchronize(t){let i=_T(e),a=__(e,i),s=__(e,t);!Ee(a,s)&&(n.synchronize(t),r(o4({legacy:a.q!==s.q?E4():a.sortCriteria!==s.sortCriteria?_f():a.firstResult!==s.firstResult?EP():a.numberOfResults!==s.numberOfResults?ED():_v(a.f,s.f)?_m(a.f,s.f):_v(a.fExcluded,s.fExcluded)?_m(a.fExcluded,s.fExcluded,!0):_v(a.cf,s.cf)?_m(a.cf,s.cf):_v(a.af,s.af)?_m(a.af,s.af):_v(a.nf,s.nf)?_y(a.nf,s.nf):_v
142(a.df,s.df)?_y(a.df,s.df):st(),next:a.q!==s.q?E6():a.sortCriteria!==s.sortCriteria?_g():_v(a.f,s.f)?_b(a.f,s.f):_v(a.fExcluded,s.fExcluded)?_b(a.fExcluded,s.fExcluded,!0):_v(a.cf,s.cf)?_b(a.cf,s.cf):_v(a.af,s.af)?_b(a.af,s.af):_v(a.nf,s.nf)?_b(_w(a.nf),_w(s.nf)):_v(a.df,s.df)?_b(_w(a.df),_w(s.df)):si()})))},get state(){return{parameters:_T(e)}}}}(e,{initialState:{parameters:CC(a)}});return{...i,subscribe(t){let i=()=>{var i,s;let o=this.state.fragment;(i=a)===(s=o)||Ee(CC(i),CC(s))||r===e.state.search.requestId||(a=o,t()),n()};return i(),e.subscribe(i)},get state(){return{fragment:Ch().serialize(s.state.parameters)}},synchronize(e){a=e;let t=CC(e);s.synchronize(t)}}}function CC(e){return Ch().deserialize(e)}rB("analytics/addPageViewEntry",async(e,{getState:t})=>{t().configuration.analytics.enabled&&aX.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});let Ck=()=>new ef({required:!1,emptyAllowed:!0}),CI=rS("advancedSearchQueries/update",e=>to(e,{aq:Ck(),cq:Ck(),lq:Ck(),dq:Ck()})),Cx=rS("advancedSearchQueries/register",e=>to(e,{aq:Ck(),cq:Ck(),lq:Ck(),dq:Ck()})),CA=rT(sH(),e=>{e.addCase(CI,(e,t)=>{let{aq:r,cq:n,lq:i,dq:a}=t.payload;eo(r)||(e.aq=r,e.aqWasSet=!0),eo(n)||(e.cq=n,e.cqWasSet=!0),eo(i)||(e.lq=i,e.lqWasSet=!0),eo(a)||(e.dq=a,e.dqWasSet=!0)}).addCase(Cx,(e,t)=>{let{aq:r,cq:n,lq:i,dq:a}=t.payload;!eo(r)&&(e.defaultFilters.aq=r,e.aqWasSet||(e.aq=r)),!eo(n)&&(e.defaultFilters.cq=n,e.cqWasSet||(e.cq=n)),!eo(i)&&(e.defaultFilters.lq=i,e.lqWasSet||(e.lq=i)),!eo(a)&&(e.defaultFilters.dq=a,e.dqWasSet||(e.dq=a))}).addCase(s_.fulfilled,(e,t)=>t.payload?.advancedSearchQueries??e).addCase(sg,(e,t)=>{let{aq:r,cq:n}=t.payload;eo(r)||(e.aq=r,e.aqWasSet=!0),eo(n)||(e.cq=n,e.cqWasSet=!0)})});function CT(e){return e.addReducers({advancedSearchQueries:CA}),{updateAdvancedSearchQueries:CI,registerAdvancedSearchQueries:Cx}}function CO(e){return e.addReducers({}),{logClearBreadcrumbs:bE,logInterfaceLoad:se,logSearchFromLink:sr,logOmniboxFromLink:sn,logInterfaceChange:st,logDidYouMeanClick:oh,logCategoryFacetBreadcrumb:vb,logFacetBreadcrumb:bi,logFacetClearAll:v7,logFacetUnexclude:bn,logFacetExclude:bt,logFacetDeselect:br,logFacetSelect:be,logFacetShowLess:v9,logFacetShowMore:v6,logFacetUpdateSort:v8,logDateFacetBreadcrumb:bF,logNumericFacetBreadcrumb:b3,logNavigateBackward:SR,logNavigateForward:SN,logPageNext:EM,logPageNumber:EP,logPagePrevious:Ej,logPagerResize:ED,logSearchboxSubmit:E4,logQuerySuggestionClick:_a,logResultsSort:_f,logDislikeSmartSnippet:_F,logLikeSmartSnippet:_j,logOpenSmartSnippetFeedbackModal:_L,logCloseSmartSnippetFeedbackModal:_q,logSmartSnippetFeedback:_U,logSmartSnippetDetailedFeedback:_V,logExpandSmartSnippet:_P,logCollapseSmartSnippet:_M,logExpandSmartSnippetSuggestion:_z,logCollapseSmartSnippetSuggestion:_G,logNoResultsBack:SD,logStaticFilterSelect:wt,logStaticFilterDeselect:wr,logStaticFilterClearAll:wn,logTriggerQuery:oS,logUndoTriggerQuery:oE,logNotifyTrigger:o_,logTriggerRedirect:oC,logTriggerExecute:ok}}let CN=rS("excerptLength/set",e=>to(e,new ed({min:0,required:!0})));function CR(e){return e.addReducers({facetSet:bf}),{deselectAllFacetValues:v1,registerFacet:vJ,toggleSelectFacetValue:vX,toggleExcludeFacetValue:v0,updateFacetIsFieldExpanded:v5,updateFacetNumberOfValues:v3,updateFacetSortCriterion:v2,updateFreezeCurrentValues:v4,updateFacetAutoSelection:sA}}function CD(e){return e.addReducers({dateFacetSet:bZ}),{deselectAllDateFacetValues:v1,registerDateFacet:bR,toggleSelectDateFacetValue:bD,toggleExcludeDateFacetValue:bP,updateDateFacetSortCriterion:bk,updateDateFacetValues:bM}}function CP(e){return e.addReducers({search:lp}),{executeSearch:oj,fetchMoreResults:oL,fetchFacetValues:oq,fetchPage:oF,fetchInstantResults:o$}}rT({length:void 0},e=>{e.addCase(CN,(e,t)=>{e.length=t.payload})}),new ea({content:new es({required:!0}),conditions:new es({required:!0}),priority:new ed({required:!1,default:0,min:0}),fields:new ev({required:!1,each:e7})})},94774:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(30772).A)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},96897:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){var l=[a,o];if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,n=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){s.label=l[1];break}if(6===l[0]&&s.label<i[1]){s.label=i[1],i=l;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(l);break}i[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}};
142Object.defineProperty(t,"__esModule",{value:!0});var a=r(78067),s=r(37310);t.backOff=function(e,t){return void 0===t&&(t={}),n(this,void 0,void 0,function(){return i(this,function(r){switch(r.label){case 0:return[4,new o(e,a.getSanitizedOptions(t)).execute()];case 1:return[2,r.sent()]}})})};var o=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return n(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw 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 n(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,s.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}})})},e}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.