@geins/core 0.10.4 → 0.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- import e from"crypto";import t from"cookie-universal";import{BroadcastChannel as n}from"broadcast-channel";import{NodeCache as r}from"@cacheable/node-cache";var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function h(e){return this instanceof h?(this.v=e,this):new h(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof h?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function c(e){s("next",e)}function u(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function p(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=l(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var v="Invariant Violation",y=Object.setPrototypeOf,m=void 0===y?function(e,t){return e.__proto__=t,e}:y,g=function(e){function t(n){void 0===n&&(n=v);var r=e.call(this,"number"==typeof n?v+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=v,m(r,t.prototype),r}return o(t,e),t}(Error);function b(e,t){if(!e)throw new g(t)}var E=["debug","log","warn","error","silent"],_=E.indexOf("log");function T(e){return function(){if(E.indexOf(e)>=_)return(console[e]||console.log).apply(console,arguments)}}!function(e){e.debug=T("debug"),e.log=T("log"),e.warn=T("warn"),e.error=T("error")}(b);var S="3.11.8";function O(e){try{return e()}catch(e){}}var w=O((function(){return globalThis}))||O((function(){return window}))||O((function(){return self}))||O((function(){return global}))||O((function(){return O.constructor("return this")()})),k=new Map;function I(e){var t=k.get(e)||1;return k.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function N(e,t){void 0===t&&(t=0);var n=I("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?n:t}),t).split(JSON.stringify(n)).join("<undefined>")}function A(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if("number"==typeof t){var i=t;(t=F(i))||(t=L(i,n),n=[])}e.apply(void 0,[t].concat(n))}}var D=Object.assign((function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e||b(e,F(t,n)||L(t,n))}),{debug:A(b.debug),log:A(b.log),warn:A(b.warn),error:A(b.error)});function R(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new g(F(e,t)||L(e,t))}var x=Symbol.for("ApolloErrorMessageHandler_"+S);function C(e){if("string"==typeof e)return e;try{return N(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function F(e,t){if(void 0===t&&(t=[]),e)return w[x]&&w[x](e,t.map(C))}function L(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:S,message:e,args:t.map(C)})))}function P(e,t){if(!Boolean(e))throw new Error(t)}function M(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const q=/\r\n|[\n\r]/g;function j(e,t){let n=0,r=1;for(const i of e.body.matchAll(q)){if("number"==typeof i.index||M(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function V(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,c=t.column+s,u=`${e.name}:${a}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<f.length;e+=80)n.push(f.slice(e,e+80));return u+U([[`${a} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+U([[a-1+" |",l[i-1]],[`${a} |`,f],["|","^".padStart(c)],[`${a+1} |`,l[i+1]]])}function U(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class Q extends Error{constructor(e,...t){var n,r,i;const{nodes:o,source:a,positions:s,path:c,originalError:u,extensions:l}=function(e){const 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!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=B(Array.isArray(o)?o:o?[o]:void 0);const f=B(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=a?a:null==f||null===(r=f[0])||void 0===r?void 0:r.source,this.positions=null!=s?s:null==f?void 0:f.map((e=>e.start)),this.locations=s&&a?s.map((e=>j(a,e))):null==f?void 0:f.map((e=>j(e.source,e.start)));const h="object"==typeof(d=null==u?void 0:u.extensions)&&null!==d?null==u?void 0:u.extensions:void 0;var d;this.extensions=null!==(i=null!=l?l:h)&&void 0!==i?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!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Q):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(const n of this.nodes)n.loc&&(e+="\n\n"+V((t=n.loc).source,j(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+V(this.source,t);var t;return e}toJSON(){const 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 B(e){return void 0===e||0===e.length?void 0:e}function z(e,t,n){return new Q(`Syntax Error: ${n}`,{source:e,positions:[t]})}class K{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class G{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,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}}}const W={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]},H=new Set(Object.keys(W));function Y(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&H.has(t)}var J,$,X,Z;function ee(e){return 9===e||32===e}function te(e){return e>=48&&e<=57}function ne(e){return e>=97&&e<=122||e>=65&&e<=90}function re(e){return ne(e)||95===e}function ie(e){return ne(e)||te(e)||95===e}function oe(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],s=ae(a);s!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,i=t,0!==t&&s<n&&(n=s))}return e.map(((e,t)=>0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function ae(e){let t=0;for(;t<e.length&&ee(e.charCodeAt(t));)++t;return t}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(J||(J={})),function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}($||($={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(X||(X={})),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(Z||(Z={}));class se{constructor(e){const t=new G(Z.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(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Z.EOF)do{if(e.next)e=e.next;else{const t=pe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Z.COMMENT);return e}}function ce(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ue(e,t){return le(e.charCodeAt(t))&&fe(e.charCodeAt(t+1))}function le(e){return e>=55296&&e<=56319}function fe(e){return e>=56320&&e<=57343}function he(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Z.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function de(e,t,n,r,i){const o=e.line,a=1+n-e.lineStart;return new G(t,n,r,o,a,i)}function pe(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.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===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return ve(e,i);case 33:return de(e,Z.BANG,i,i+1);case 36:return de(e,Z.DOLLAR,i,i+1);case 38:return de(e,Z.AMP,i,i+1);case 40:return de(e,Z.PAREN_L,i,i+1);case 41:return de(e,Z.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return de(e,Z.SPREAD,i,i+3);break;case 58:return de(e,Z.COLON,i,i+1);case 61:return de(e,Z.EQUALS,i,i+1);case 64:return de(e,Z.AT,i,i+1);case 91:return de(e,Z.BRACKET_L,i,i+1);case 93:return de(e,Z.BRACKET_R,i,i+1);case 123:return de(e,Z.BRACE_L,i,i+1);case 124:return de(e,Z.PIPE,i,i+1);case 125:return de(e,Z.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?Oe(e,i):ge(e,i)}if(te(t)||45===t)return ye(e,i,t);if(re(t))return we(e,i);throw z(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":ce(t)||ue(n,i)?`Unexpected character: ${he(e,i)}.`:`Invalid character: ${he(e,i)}.`)}return de(e,Z.EOF,r,r)}function ve(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(ce(e))++i;else{if(!ue(n,i))break;i+=2}}return de(e,Z.COMMENT,t,i,n.slice(t+1,i))}function ye(e,t,n){const r=e.source.body;let i=t,o=n,a=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),te(o))throw z(e.source,i,`Invalid number, unexpected digit after 0: ${he(e,i)}.`)}else i=me(e,i,o),o=r.charCodeAt(i);if(46===o&&(a=!0,o=r.charCodeAt(++i),i=me(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=me(e,i,o),o=r.charCodeAt(i)),46===o||re(o))throw z(e.source,i,`Invalid number, expected digit but got: ${he(e,i)}.`);return de(e,a?Z.FLOAT:Z.INT,t,i,r.slice(t,i))}function me(e,t,n){if(!te(n))throw z(e.source,t,`Invalid number, expected digit but got: ${he(e,t)}.`);const r=e.source.body;let i=t+1;for(;te(r.charCodeAt(i));)++i;return i}function ge(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,a="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return a+=n.slice(o,i),de(e,Z.STRING,t,i+1,a);if(92!==r){if(10===r||13===r)break;if(ce(r))++i;else{if(!ue(n,i))throw z(e.source,i,`Invalid character within String: ${he(e,i)}.`);i+=2}}else{a+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?be(e,i):Ee(e,i):Se(e,i);a+=t.value,i+=t.size,o=i}}throw z(e.source,i,"Unterminated string.")}function be(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!ce(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Te(e),r<0)break}throw z(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Ee(e,t){const n=e.source.body,r=_e(n,t+2);if(ce(r))return{value:String.fromCodePoint(r),size:6};if(le(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=_e(n,t+8);if(fe(e))return{value:String.fromCodePoint(r,e),size:12}}throw z(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function _e(e,t){return Te(e.charCodeAt(t))<<12|Te(e.charCodeAt(t+1))<<8|Te(e.charCodeAt(t+2))<<4|Te(e.charCodeAt(t+3))}function Te(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Se(e,t){const n=e.source.body;switch(n.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:"\t",size:2}}throw z(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Oe(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,a=o,s="";const c=[];for(;o<r;){const r=n.charCodeAt(o);if(34===r&&34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)){s+=n.slice(a,o),c.push(s);const r=de(e,Z.BLOCK_STRING,t,o+3,oe(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(o+1)||34!==n.charCodeAt(o+2)||34!==n.charCodeAt(o+3))if(10!==r&&13!==r)if(ce(r))++o;else{if(!ue(n,o))throw z(e.source,o,`Invalid character within String: ${he(e,o)}.`);o+=2}else s+=n.slice(a,o),c.push(s),13===r&&10===n.charCodeAt(o+1)?o+=2:++o,s="",a=o,i=o;else s+=n.slice(a,o),a=o+1,o+=4}throw z(e.source,o,"Unterminated string.")}function we(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!ie(n.charCodeAt(i)))break;++i}return de(e,Z.NAME,t,i,n.slice(t,i))}function ke(e){return Ie(e,[])}function Ie(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){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:Ie(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(Ie(e[r],t));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Ie(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ne=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=ke(e);throw new Error(`Cannot use ${r} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Ae{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||P(!1,`Body must be a string. Received: ${ke(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class De{constructor(e,t={}){const n=function(e){return Ne(e,Ae)}(e)?e:new Ae(e);this._lexer=new se(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Z.NAME);return this.node(e,{kind:X.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:X.DOCUMENT,definitions:this.many(Z.SOF,this.parseDefinition,Z.EOF)})}parseDefinition(){if(this.peek(Z.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Z.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()}if(e)throw z(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Z.BRACE_L))return this.node(e,{kind:X.OPERATION_DEFINITION,operation:J.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(Z.NAME)&&(n=this.parseName()),this.node(e,{kind:X.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Z.NAME);switch(e.value){case"query":return J.QUERY;case"mutation":return J.MUTATION;case"subscription":return J.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Z.PAREN_L,this.parseVariableDefinition,Z.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:X.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Z.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Z.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Z.DOLLAR),this.node(e,{kind:X.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:X.SELECTION_SET,selections:this.many(Z.BRACE_L,this.parseSelection,Z.BRACE_R)})}parseSelection(){return this.peek(Z.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Z.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:X.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Z.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Z.PAREN_L,t,Z.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Z.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Z.NAME)?this.node(e,{kind:X.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:X.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:X.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:X.FRAGMENT_DEFINITION,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){const t=this._lexer.token;switch(t.kind){case Z.BRACKET_L:return this.parseList(e);case Z.BRACE_L:return this.parseObject(e);case Z.INT:return this.advanceLexer(),this.node(t,{kind:X.INT,value:t.value});case Z.FLOAT:return this.advanceLexer(),this.node(t,{kind:X.FLOAT,value:t.value});case Z.STRING:case Z.BLOCK_STRING:return this.parseStringLiteral();case Z.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:X.BOOLEAN,value:!0});case"false":return this.node(t,{kind:X.BOOLEAN,value:!1});case"null":return this.node(t,{kind:X.NULL});default:return this.node(t,{kind:X.ENUM,value:t.value})}case Z.DOLLAR:if(e){if(this.expectToken(Z.DOLLAR),this._lexer.token.kind===Z.NAME){const e=this._lexer.token.value;throw z(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(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:X.STRING,value:e.value,block:e.kind===Z.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:X.LIST,values:this.any(Z.BRACKET_L,(()=>this.parseValueLiteral(e)),Z.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:X.OBJECT,fields:this.any(Z.BRACE_L,(()=>this.parseObjectField(e)),Z.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Z.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Z.AT),this.node(t,{kind:X.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Z.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Z.BRACKET_R),t=this.node(e,{kind:X.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(Z.BANG)?this.node(e,{kind:X.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:X.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Z.STRING)||this.peek(Z.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);return this.node(e,{kind:X.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Z.COLON);const n=this.parseNamedType();return this.node(e,{kind:X.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:X.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:X.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Z.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseFieldDefinition,Z.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Z.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:X.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Z.PAREN_L,this.parseInputValueDef,Z.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Z.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(Z.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:X.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:X.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:X.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Z.EQUALS)?this.delimitedMany(Z.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:X.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Z.BRACE_L,this.parseEnumValueDefinition,Z.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:X.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw z(this._lexer.source,this._lexer.token.start,`${Re(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:X.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseInputValueDef,Z.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Z.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(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:X.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:X.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:X.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:X.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:X.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:X.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:X.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Z.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:X.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Z.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call($,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new K(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw z(this._lexer.source,t.start,`Expected ${xe(e)}, found ${Re(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Z.NAME||t.value!==e)throw z(this._lexer.source,t.start,`Expected "${e}", found ${Re(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Z.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return z(this._lexer.source,t.start,`Unexpected ${Re(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==Z.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw z(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Re(e){const t=e.value;return xe(e.kind)+(null!=t?` "${t}"`:"")}function xe(e){return function(e){return e===Z.BANG||e===Z.DOLLAR||e===Z.AMP||e===Z.PAREN_L||e===Z.PAREN_R||e===Z.SPREAD||e===Z.COLON||e===Z.EQUALS||e===Z.AT||e===Z.BRACKET_L||e===Z.BRACKET_R||e===Z.BRACE_L||e===Z.PIPE||e===Z.BRACE_R}(e)?`"${e}"`:e}const Ce=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Fe(e){return Le[e.charCodeAt(0)]}const Le=["\\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"],Pe=Object.freeze({});function Me(e,t,n=W){const r=new Map;for(const e of Object.values(X))r.set(e,qe(t,e));let i,o,a,s=Array.isArray(e),c=[e],u=-1,l=[],f=e;const h=[],d=[];do{u++;const e=u===c.length,m=e&&0!==l.length;if(e){if(o=0===d.length?void 0:h[h.length-1],f=a,a=d.pop(),m)if(s){f=f.slice();let e=0;for(const[t,n]of l){const r=t-e;null===n?(f.splice(r,1),e++):f[r]=n}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}u=i.index,c=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?u:c[u],f=a[o],null==f)continue;h.push(o)}let g;if(!Array.isArray(f)){var p,v;Y(f)||P(!1,`Invalid AST Node: ${ke(f)}.`);const n=e?null===(p=r.get(f.kind))||void 0===p?void 0:p.leave:null===(v=r.get(f.kind))||void 0===v?void 0:v.enter;if(g=null==n?void 0:n.call(t,f,o,a,h,d),g===Pe)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!Y(g)){h.pop();continue}f=g}}var y;if(void 0===g&&m&&l.push([o,f]),e)h.pop();else i={inArray:s,index:u,keys:c,edits:l,prev:i},s=Array.isArray(f),c=s?f:null!==(y=n[f.kind])&&void 0!==y?y:[],u=-1,l=[],a&&d.push(a),a=f}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function qe(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}const je={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ve(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Qe("(",Ve(e.variableDefinitions,", "),")"),n=Ve([e.operation,Ve([e.name,t]),Ve(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Qe(" = ",n)+Qe(" ",Ve(r," "))},SelectionSet:{leave:({selections:e})=>Ue(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Qe("",e,": ")+t;let a=o+Qe("(",Ve(n,", "),")");return a.length>80&&(a=o+Qe("(\n",Be(Ve(n,"\n")),"\n)")),Ve([a,Ve(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Qe(" ",Ve(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ve(["...",Qe("on ",e),Ve(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Qe("(",Ve(n,", "),")")} on ${t} ${Qe("",Ve(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e){const t=e.replace(/"""/g,'\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||ee(e.charCodeAt(0)))),o=t.endsWith('\\"""'),a=e.endsWith('"')&&!o,s=e.endsWith("\\"),c=a||s,u=!r||e.length>70||c||i||o;let l="";const f=r&&ee(e.charCodeAt(0));return(u&&!f||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(Ce,Fe)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Ve(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Ve(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Qe("(",Ve(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Qe("",e,"\n")+Ve(["schema",Ve(t," "),Ue(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ve(["scalar",t,Ve(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ve(["type",t,Qe("implements ",Ve(n," & ")),Ve(r," "),Ue(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Qe("",e,"\n")+t+(ze(n)?Qe("(\n",Be(Ve(n,"\n")),"\n)"):Qe("(",Ve(n,", "),")"))+": "+r+Qe(" ",Ve(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Qe("",e,"\n")+Ve([t+": "+n,Qe("= ",r),Ve(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ve(["interface",t,Qe("implements ",Ve(n," & ")),Ve(r," "),Ue(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Qe("",e,"\n")+Ve(["union",t,Ve(n," "),Qe("= ",Ve(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Qe("",e,"\n")+Ve(["enum",t,Ve(n," "),Ue(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ve([t,Ve(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Qe("",e,"\n")+Ve(["input",t,Ve(n," "),Ue(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Qe("",e,"\n")+"directive @"+t+(ze(n)?Qe("(\n",Be(Ve(n,"\n")),"\n)"):Qe("(",Ve(n,", "),")"))+(r?" repeatable":"")+" on "+Ve(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ve(["extend schema",Ve(e," "),Ue(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ve(["extend scalar",e,Ve(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ve(["extend type",e,Qe("implements ",Ve(t," & ")),Ve(n," "),Ue(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ve(["extend interface",e,Qe("implements ",Ve(t," & ")),Ve(n," "),Ue(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ve(["extend union",e,Ve(t," "),Qe("= ",Ve(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ve(["extend enum",e,Ve(t," "),Ue(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ve(["extend input",e,Ve(t," "),Ue(n)]," ")}};function Ve(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Ue(e){return Qe("{\n",Be(Ve(e,"\n")),"\n}")}function Qe(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Be(e){return Qe(" ",e.replace(/\n/g,"\n "))}function ze(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function Ke(e){return e.kind===X.FIELD||e.kind===X.FRAGMENT_SPREAD||e.kind===X.INLINE_FRAGMENT}function Ge(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;D(n&&1===n.length,71,r);var i=n[0];D(i.name&&"if"===i.name.value,72,r);var o=i.value;D(o&&("Variable"===o.kind||"BooleanValue"===o.kind),73,r),t.push({directive:e,ifArgument:i})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=t&&t[r.value.name.value],D(void 0!==i,70,n.name.value)):i=r.value.value,"skip"===n.name.value?!i:i}))}function We(e,t,n){var r=new Set(e),i=r.size;return Me(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return Pe}}),n?!r.size:r.size<i}function He(e){return e&&We(["client","export"],e,!0)}const Ye=()=>Object.create(null),{forEach:Je,slice:$e}=Array.prototype,{hasOwnProperty:Xe}=Object.prototype;let Ze=class e{constructor(e=!0,t=Ye){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Je.call(e,(e=>t=t.getChildTrie(e))),Xe.call(t,"data")?t.data:t.data=this.makeData($e.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray($e.call(e,1)),i.data||i.weak||i.strong&&i.strong.size||r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}};var et="ReactNative"==O((function(){return navigator.product})),tt="function"==typeof WeakMap&&!(et&&!global.HermesInternal),nt="function"==typeof WeakSet,rt="function"==typeof Symbol&&"function"==typeof Symbol.for,it=rt&&Symbol.asyncIterator;function ot(e){return null!==e&&"object"==typeof e}function at(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw R(74,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(D(1===r.length,75,r.length),n=r[0].name.value),a(a({},e),{definitions:f([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function st(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function ct(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=e.name.value;if("function"==typeof t)return t(n);var r=t&&t[n];return D(r,76,n),r||null;default:return null}}function ut(){}O((function(){return window.document.createElement})),O((function(){return navigator.userAgent.indexOf("jsdom")>=0}));class lt{constructor(e=1/0,t=ut){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}function ft(){}const ht=ft,dt="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},pt="undefined"!=typeof WeakMap?WeakMap:Map,vt="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:ft,unregister:ft}};class yt{constructor(e=1/0,t=ht){this.max=e,this.dispose=t,this.map=new pt,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new dt(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new vt(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var mt=new WeakSet;function gt(e){e.size<=(e.max||-1)||mt.has(e)||(mt.add(e),setTimeout((function(){e.clean(),mt.delete(e)}),100))}var bt=function(e,t){var n=new yt(e,t);return n.set=function(e,t){var n=yt.prototype.set.call(this,e,t);return gt(this),n},n},Et=function(e,t){var n=new lt(e,t);return n.set=function(e,t){var n=lt.prototype.set.call(this,e,t);return gt(this),n},n},_t=Symbol.for("apollo.cacheSize"),Tt=a({},w[_t]),St={};function Ot(e,t){St[e]=t}var wt=!1!==globalThis.__DEV__?function(){var e,t,n,r,i;if(!1===globalThis.__DEV__)throw new Error("only supported in development mode");return{limits:Object.fromEntries(Object.entries({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4}).map((function(e){var t=e[0],n=e[1];return[t,Tt[t]||n]}))),sizes:a({print:null===(e=St.print)||void 0===e?void 0:e.call(St),parser:null===(t=St.parser)||void 0===t?void 0:t.call(St),canonicalStringify:null===(n=St.canonicalStringify)||void 0===n?void 0:n.call(St),links:Ct(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Rt(this.queryManager.documentTransform)}},null===(i=(r=this.cache).getMemoryInternals)||void 0===i?void 0:i.call(r))}}:void 0,kt=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return a(a({},Nt.apply(this)),{addTypenameDocumentTransform:Rt(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:At(this.storeReader.executeSelectionSet),executeSubSelectedArray:At(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:At(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:At(null==e?void 0:e.findFragmentSpreads),lookup:At(null==e?void 0:e.lookup),transform:At(null==e?void 0:e.transform)}})}:void 0,It=!1!==globalThis.__DEV__?Nt:void 0;function Nt(){return{cache:{fragmentQueryDocuments:At(this.getFragmentDoc)}}}function At(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function Dt(e){return null!=e}function Rt(e){return xt(e).map((function(e){return{cache:e}}))}function xt(e){return e?f(f([At(null==e?void 0:e.performWork)],xt(null==e?void 0:e.left),!0),xt(null==e?void 0:e.right),!0).filter(Dt):[]}function Ct(e){var t;return e?f(f([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],Ct(null==e?void 0:e.left),!0),Ct(null==e?void 0:e.right),!0).filter(Dt):[]}var Ft,Lt=Object.assign((function(e){return JSON.stringify(e,Pt)}),{reset:function(){Ft=new Et(Tt.canonicalStringify||1e3)}});function Pt(e,t){if(t&&"object"==typeof t){var n=Object.getPrototypeOf(t);if(n===Object.prototype||null===n){var r=Object.keys(t);if(r.every(Mt))return t;var i=JSON.stringify(r),o=Ft.get(i);if(!o){r.sort();var a=JSON.stringify(r);o=Ft.get(a)||r,Ft.set(i,o),Ft.set(a,o)}var s=Object.create(n);return o.forEach((function(e){s[e]=t[e]})),s}}return t}function Mt(e,t,n){return 0===t||n[t-1]<=e}function qt(e){return{__ref:String(e)}}function jt(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function Vt(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var i={};n.fields.map((function(e){return Vt(i,e.name,e.value,r)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(n)){var o=(r||{})[n.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return Vt(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw R(85,t.value,n.kind);e[t.value]=null}}!1!==globalThis.__DEV__&&Ot("canonicalStringify",(function(){return Ft.size})),Lt.reset();var Ut=["connection","include","skip","client","rest","export","nonreactive"],Qt=Lt,Bt=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),"".concat(n.connection.key,"(").concat(Qt(i),")")}return n.connection.key}var o=e;if(t){var a=Qt(t);o+="(".concat(a,")")}return n&&Object.keys(n).forEach((function(e){-1===Ut.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(Qt(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=Qt;return Qt=e,t}});function zt(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return Vt(n,r,i,t)})),n}return null}function Kt(e){return e.alias?e.alias.value:e.name.value}function Gt(e,t,n){for(var r,i=0,o=t.selections;i<o.length;i++){if(Wt(c=o[i])){if("__typename"===c.name.value)return e[Kt(c)]}else r?r.push(c):r=[c]}if("string"==typeof e.__typename)return e.__typename;if(r)for(var a=0,s=r;a<s.length;a++){var c,u=Gt(e,ct(c=s[a],n).selectionSet,n);if("string"==typeof u)return u}}function Wt(e){return"Field"===e.kind}function Ht(e){D(e&&"Document"===e.kind,77);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw R(78,e.kind);return e}));return D(t.length<=1,79,t.length),e}function Yt(e){return Ht(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Jt(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function $t(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Xt(e){var t=Yt(e);return D(t&&"query"===t.operation,80),t}function Zt(e){var t;Ht(e);for(var n=0,r=e.definitions;n<r.length;n++){var i=r[n];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw R(84)}function en(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&Vt(t,e.variable.name,e.defaultValue)})),t}const tn=()=>Object.create(null),{forEach:nn,slice:rn}=Array.prototype,{hasOwnProperty:on}=Object.prototype;class an{constructor(e=!0,t=tn){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nn.call(e,(e=>t=t.getChildTrie(e))),on.call(t,"data")?t.data:t.data=this.makeData(rn.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=this.weakness&&sn(e[n])?t.weak:t.strong;t=r&&r.get(e[n])}return t&&t.data}getChildTrie(e){const t=this.weakness&&sn(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=t.get(e);return n||t.set(e,n=new an(this.weakness,this.makeData)),n}}function sn(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}let cn=null;const un={};let ln=1;function fn(e){try{return e()}catch(e){}}const hn="@wry/context:Slot",dn=fn((()=>globalThis))||fn((()=>global))||Object.create(null),pn=dn[hn]||Array[hn]||function(e){try{Object.defineProperty(dn,hn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ln++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=cn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===un)break;return e!==cn&&(cn.slots[this.id]=t),!0}return cn&&(cn.slots[this.id]=un),!1}getValue(){if(this.hasValue())return cn.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},o=cn;cn={parent:o,slots:i};try{return t.apply(r,n)}finally{cn=o}}static bind(e){const t=cn;return function(){const n=cn;try{return cn=t,e.apply(this,arguments)}finally{cn=n}}}static noContext(e,t,n){if(!cn)return e.apply(n,t);{const r=cn;try{return cn=null,e.apply(n,t)}finally{cn=r}}}}),vn=new pn,{hasOwnProperty:yn}=Object.prototype,mn=Array.from||function(e){const t=[];return e.forEach((e=>t.push(e))),t};function gn(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const bn=[];function En(e,t){if(!e)throw new Error(t||"assertion failure")}function _n(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function Tn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Sn(e){return e.slice(0)}class On{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++On.count}peek(){if(1===this.value.length&&!In(this))return wn(this),this.value[0]}recompute(e){return En(!this.recomputing,"already recomputing"),wn(this),In(this)?function(e,t){Fn(e),vn.withValue(e,kn,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{gn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,In(e))return;An(e)}(e);return Tn(e.value)}(this,e):Tn(this.value)}setDirty(){this.dirty||(this.dirty=!0,Nn(this),gn(this))}dispose(){this.setDirty(),Fn(this),Dn(this,((e,t)=>{e.setDirty(),Ln(e,this)}))}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=bn.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(mn(this.deps).forEach((e=>e.delete(this))),this.deps.clear(),bn.push(this.deps),this.deps=null)}}function wn(e){const t=vn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),In(e)?Rn(t,e):xn(t,e),t}function kn(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=Sn(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!_n(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(e){}}catch(t){e.value[1]=t}e.recomputing=!1}function In(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Nn(e){Dn(e,Rn)}function An(e){Dn(e,xn)}function Dn(e,t){const n=e.parents.size;if(n){const r=mn(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function Rn(e,t){En(e.childValues.has(t)),En(In(t));const n=!In(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=bn.pop()||new Set;e.dirtyChildren.add(t),n&&Nn(e)}function xn(e,t){En(e.childValues.has(t)),En(!In(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,Sn(t.value)):_n(n,t.value)||e.setDirty(),Cn(e,t),In(e)||An(e)}function Cn(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(bn.length<100&&bn.push(n),e.dirtyChildren=null))}function Fn(e){e.childValues.size>0&&e.childValues.forEach(((t,n)=>{Ln(e,n)})),e.forgetDeps(),En(null===e.dirtyChildren)}function Ln(e,t){t.parents.delete(e),e.childValues.delete(t),Cn(e,t)}On.count=0;const Pn={setDirty:!0,dispose:!0,forget:!0};function Mn(e){const t=new Map;function n(e){const n=vn.getValue();if(n){let r=t.get(e);r||t.set(e,r=new Set),n.dependOn(r)}}return n.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&yn.call(Pn,n)?n:"setDirty";mn(r).forEach((e=>e[i]())),t.delete(e),gn(r)}},n}let qn;function jn(...e){return(qn||(qn=new an("function"==typeof WeakMap))).lookupArray(e)}const Vn=new Set;function Un(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=jn,normalizeResult:i,subscribe:o,cache:a=lt}=Object.create(null)){const s="function"==typeof a?new a(t,(e=>e.dispose())):a,c=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let a=s.get(t);a||(s.set(t,a=new On(e)),a.normalizeResult=i,a.subscribe=o,a.forget=()=>s.delete(t));const c=a.recompute(Array.prototype.slice.call(arguments));return s.set(t,a),Vn.add(s),vn.hasValue()||(Vn.forEach((e=>e.clean())),Vn.clear()),c};function u(e){const t=e&&s.get(e);t&&t.setDirty()}function l(e){const t=e&&s.get(e);if(t)return t.peek()}function f(e){return!!e&&s.delete(e)}return Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:o,cache:s}),c.dirtyKey=u,c.dirty=function(){u(r.apply(null,arguments))},c.peekKey=l,c.peek=function(){return l(r.apply(null,arguments))},c.forgetKey=f,c.forget=function(){return f(r.apply(null,arguments))},c.makeCacheKey=r,c.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(c)}function Qn(e){return e}var Bn,zn=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=nt?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(Qn,{cache:!1})},e.split=function(t,n,r){return void 0===r&&(r=e.identity()),Object.assign(new e((function(e){return(t(e)?n:r).transformDocument(e)}),{cache:!1}),{left:n,right:r})},e.prototype.resetCache=function(){var t=this;if(this.cached){var n=new Ze(tt);this.performWork=Un(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return D(Array.isArray(r),69),n.lookupArray(r)},max:Tt["documentTransform.cache"],cache:yt})}},e.prototype.performWork=function(e){return Ht(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var n=this;return Object.assign(new e((function(e){return t.transformDocument(n.transformDocument(e))}),{cache:!1}),{left:this,right:t})},e}(),Kn=Object.assign((function(e){var t=Bn.get(e);return t||(t=function(e){return Me(e,je)}(e),Bn.set(e,t)),t}),{reset:function(){Bn=new bt(Tt.print||2e3)}});Kn.reset(),!1!==globalThis.__DEV__&&Ot("print",(function(){return Bn?Bn.size:0}));var Gn=Array.isArray;function Wn(e){return Array.isArray(e)&&e.length>0}var Hn={kind:X.FIELD,name:{kind:X.NAME,value:"__typename"}};function Yn(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===X.FRAGMENT_SPREAD&&Yn(t[e.name.value],t)}))}function Jn(e){return Yn(Yt(e)||function(e){D("Document"===e.kind,81),D(e.definitions.length<=1,82);var t=e.definitions[0];return D("FragmentDefinition"===t.kind,83),t}(e),st($t(e)))?null:e}function $n(e){var t=new Map;return function(n){void 0===n&&(n=e);var r=t.get(n);return r||t.set(n,r={variables:new Set,fragmentSpreads:new Set}),r}}function Xn(e,t){Ht(t);for(var n=$n(""),r=$n(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!Gn(i)){if(i.kind===X.OPERATION_DEFINITION)return n(i.name&&i.name.value);if(i.kind===X.FRAGMENT_DEFINITION)return r(i.name.value)}return!1!==globalThis.__DEV__&&D.error(86),null},o=0,s=t.definitions.length-1;s>=0;--s)t.definitions[s].kind===X.OPERATION_DEFINITION&&++o;var c=function(e){var t=new Map,n=new Map;return e.forEach((function(e){e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))})),function(e){var r=t.get(e.name.value);return!r&&n.size&&n.forEach((function(t,n){n(e)&&(r=t)})),r}}(e),u=function(e){return Wn(e)&&e.map(c).some((function(e){return e&&e.remove}))},l=new Map,f=!1,h={enter:function(e){if(u(e.directives))return f=!0,null}},d=Me(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,o){var a=i(o);a&&a.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,o){if(u(e.directives))return f=!0,null;var a=i(o);a&&a.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:o>0&&e.selectionSet.selections.every((function(e){return e.kind===X.FIELD&&"__typename"===e.name.value}))?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(c(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){p(r(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},v=new Set;d.definitions.forEach((function(e){e.kind===X.OPERATION_DEFINITION?p(n(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){v.add(e)})):e.kind!==X.FRAGMENT_DEFINITION||0!==o||r(e.name.value).removed||v.add(e.name.value)})),v.forEach((function(e){p(r(e)).fragmentSpreads.forEach((function(e){v.add(e)}))}));var y={enter:function(e){if(t=e.name.value,!v.has(t)||r(t).removed)return null;var t}};return Jn(Me(d,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return a(a({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var Zn=Object.assign((function(e){return Me(e,{SelectionSet:{enter:function(e,t,n){if(!n||n.kind!==X.OPERATION_DEFINITION){var r=e.selections;if(r)if(!r.some((function(e){return Wt(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Wt(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return a(a({},e),{selections:f(f([],r,!0),[Hn],!1)})}}}}})}),{added:function(e){return e===Hn}});function er(e){return"query"===Zt(e).operation?e:Me(e,{OperationDefinition:{enter:function(e){return a(a({},e),{operation:"query"})}}})}function tr(e){return Ht(e),Xn([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var nr=Object.prototype.hasOwnProperty;function rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ir(e)}function ir(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new ar,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var or=function(e,t,n){return this.merge(e[n],t[n])},ar=function(){function e(e){void 0===e&&(e=or),this.reconciler=e,this.isObject=ot,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return ot(t)&&ot(e)?(Object.keys(t).forEach((function(i){if(nr.call(e,i)){var o=e[i];if(t[i]!==o){var a=n.reconciler.apply(n,f([e,t,i],r,!1));a!==o&&((e=n.shallowCopyForMerge(e))[i]=a)}}else(e=n.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return ot(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):a({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function sr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cr(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ur(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lr(e,t,n){return t&&ur(e.prototype,t),n&&ur(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var fr=function(){return"function"==typeof Symbol},hr=function(e){return fr()&&Boolean(Symbol[e])},dr=function(e){return hr(e)?Symbol[e]:"@@"+e};fr()&&!hr("observable")&&(Symbol.observable=Symbol("observable"));var pr=dr("iterator"),vr=dr("observable"),yr=dr("species");function mr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function gr(e){var t=e.constructor;return void 0!==t&&null===(t=t[yr])&&(t=void 0),void 0!==t?t:Nr}function br(e){return e instanceof Nr}function Er(e){Er.log?Er.log(e):setTimeout((function(){throw e}))}function _r(e){Promise.resolve().then((function(){try{e()}catch(e){Er(e)}}))}function Tr(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=mr(t,"unsubscribe");n&&n.call(t)}}catch(e){Er(e)}}function Sr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Or(e,t,n){e._state="running";var r=e._observer;try{var i=mr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(Sr(e),!i)throw n;i.call(r,n);break;case"complete":Sr(e),i&&i.call(r)}}catch(e){Er(e)}"closed"===e._state?Tr(e):"running"===e._state&&(e._state="ready")}function wr(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void _r((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Or(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Or(e,t,n);e._queue.push({type:t,value:n})}}var kr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new Ir(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(Sr(this),Tr(this))},lr(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),Ir=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){wr(this._subscription,"next",e)},t.error=function(e){wr(this._subscription,"error",e)},t.complete=function(){wr(this._subscription,"complete")},lr(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Nr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new kr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(gr(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(gr(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=gr(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=gr(this);return new i((function(t){var r,o=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=gr(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[vr]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=mr(t,vr);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return br(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(hr("iterator")&&(r=mr(t,pr)))return new n((function(e){_r((function(){if(!e.closed){for(var n,i=sr(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){_r((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){_r((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},lr(e,null,[{key:yr,get:function(){return this}}]),e}();fr()&&Object.defineProperty(Nr,Symbol("extensions"),{value:{symbol:vr,hostReportError:Er},configurable:!0}),function(e){var t,n=e.Symbol;if("function"==typeof n)if(n.observable)t=n.observable;else{t="function"==typeof n.for?n.for("https://github.com/benlesh/symbol-observable"):n("https://github.com/benlesh/symbol-observable");try{n.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());var Ar=Nr.prototype,Dr="@@observable";Ar[Dr]||(Ar[Dr]=function(){return this});var Rr=Object.prototype.toString;function xr(e){return Cr(e)}function Cr(e,t){switch(Rr.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=Cr(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=Cr(e[n],t)})),r;default:return e}}function Fr(e){var t=new Set([e]);return t.forEach((function(e){ot(e)&&function(e){if(!1!==globalThis.__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(n){ot(e[n])&&t.add(e[n])}))})),e}function Lr(e){return!1!==globalThis.__DEV__&&Fr(e),e}function Pr(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Mr(e,t,n){return new Nr((function(r){var i={then:function(e){return new Promise((function(t){return t(e())}))}};function o(e,t){return function(n){if(e){var o=function(){return r.closed?0:e(n)};i=i.then(o,o).then((function(e){return r.next(e)}),(function(e){return r.error(e)}))}else r[t](n)}}var a={next:o(t,"next"),error:o(n,"error"),complete:function(){i.then((function(){return r.complete()}))}},s=e.subscribe(a);return function(){return s.unsubscribe()}}))}function qr(e){function t(t){Object.defineProperty(e,t,{value:Nr})}return rt&&Symbol.species&&t(Symbol.species),t("@@species"),e}function jr(e){return e&&"function"==typeof e.then}var Vr=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],n.notify("next",e),Pr(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),n.notify("error",e),Pr(n.observers,"error",e))},complete:function(){var e=n,t=e.sub,r=e.sources;if(null!==t){var i=(void 0===r?[]:r).shift();i?jr(i)?i.then((function(e){return n.sub=e.subscribe(n.handlers)}),n.handlers.error):n.sub=i.subscribe(n.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Pr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.error(e)},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new Nr(t)]),jr(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return o(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach((function(n){return n(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(n,r){t||(t=!0,e(n,r))}))},t}(Nr);function Ur(e){return"incremental"in e}function Qr(e){return ot(e)&&"payload"in e}function Br(e,t){var n=e,r=new ar;return Ur(t)&&Wn(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var a=i[o],s=!isNaN(+a)?[]:{};s[a]=t,t=s}n=r.merge(n,t)})),n}function zr(e){return Wn(Kr(e))}function Kr(e){var t=Wn(e.errors)?e.errors.slice(0):[];return Ur(e)&&Wn(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function Gr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}function Wr(e,t){return Gr(e,t,t.variables&&{variables:Gr(a(a({},e&&e.variables),t.variables))})}function Hr(e){return new Nr((function(t){t.error(e)}))}qr(Vr);var Yr=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r};function Jr(e,t){return t?t(e):Nr.of()}function $r(e){return"function"==typeof e?new Zr(e):e}function Xr(e){return e.request.length<=1}var Zr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Nr.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map($r).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i,o=$r(n),a=$r(r||new e(Jr));return i=Xr(o)&&Xr(a)?new e((function(e){return t(e)?o.request(e)||Nr.of():a.request(e)||Nr.of()})):new e((function(e,n){return t(e)?o.request(e,n)||Nr.of():a.request(e,n)||Nr.of()})),Object.assign(i,{left:o,right:a})},e.execute=function(e,t){return e.request(function(e,t){var n=a({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=a(a({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return a({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Jt(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw R(44,i)}return e}(t))))||Nr.of()},e.concat=function(t,n){var r=$r(t);if(Xr(r))return!1!==globalThis.__DEV__&&D.warn(36,r),r;var i,o=$r(n);return i=Xr(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||Nr.of()}))||Nr.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||Nr.of()}))||Nr.of()})),Object.assign(i,{left:r,right:o})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(Jr)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw R(37)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),ei=Zr.execute;function ti(e){var t=null,n=null,r=!1,i=[],o=[];function a(e){if(!n){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function s(e){n=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function c(){r=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",s),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",a),e.on("error",s),e.on("end",c),e.on("finish",c),e.on("close",c);var u={next:function(){return new Promise((function(e,t){return n?t(n):i.length?e({value:i.shift(),done:!1}):r?e({value:void 0,done:!0}):void o.push([e,t])}))}};return it&&(u[Symbol.asyncIterator]=function(){return this}),u}function ni(e){var t={next:function(){return e.read()}};return it&&(t[Symbol.asyncIterator]=function(){return this}),t}function ri(e){var t,n,r,i=e;if(e.body&&(i=e.body),function(e){return!(!it||!e[Symbol.asyncIterator])}(i))return function(e){var t,n=e[Symbol.asyncIterator]();return(t={next:function(){return n.next()}})[Symbol.asyncIterator]=function(){return this},t}(i);if(function(e){return!!e.getReader}(i))return ni(i.getReader());if(function(e){return!!e.stream}(i))return ni(i.stream().getReader());if(function(e){return!!e.arrayBuffer}(i))return t=i.arrayBuffer(),n=!1,r={next:function(){return n?Promise.resolve({value:void 0,done:!0}):(n=!0,new Promise((function(e,n){t.then((function(t){e({value:t,done:!1})})).catch(n)})))}},it&&(r[Symbol.asyncIterator]=function(){return this}),r;if(function(e){return!!e.pipe}(i))return ti(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ii=Symbol();function oi(e){return e.hasOwnProperty("graphQLErrors")}var ai=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.protocolErrors,s=n.clientErrors,c=n.networkError,u=n.errorMessage,l=n.extraInfo,h=e.call(this,u)||this;return h.name="ApolloError",h.graphQLErrors=o||[],h.protocolErrors=a||[],h.clientErrors=s||[],h.networkError=c||null,h.message=u||(i=f(f(f([],(r=h).graphQLErrors,!0),r.clientErrors,!0),r.protocolErrors,!0),r.networkError&&i.push(r.networkError),i.map((function(e){return ot(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=l,h.cause=f(f(f([c],o||[],!0),a||[],!0),s||[],!0).find((function(e){return!!e}))||null,h.__proto__=t.prototype,h}return o(t,e),t}(Error),si=Object.prototype.hasOwnProperty;function ci(e){var t={};return e.split("\n").forEach((function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}})),t}function ui(e,t){if(e.status>=300){Yr(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(r){var n=r;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}var li=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=R(40,t,e.message);throw r.parseError=e,r}return n},fi={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},hi=function(e,t){return t(e)};function di(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},o={};n.forEach((function(e){i=a(a(a({},i),e.options),{headers:a(a({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),o=a(a({},o),e.http)})),i.headers&&(i.headers=function(e,t){if(!t){var n={};return Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]=e[t]})),n}var r={};Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]={originalName:t,value:e[t]}}));var i={};return Object.keys(r).forEach((function(e){i[r[e].originalName]=r[e].value})),i}(i.headers,o.preserveHeaderCase));var s=e.operationName,c=e.extensions,u=e.variables,l=e.query,f={operationName:s,variables:u};return o.includeExtensions&&(f.extensions=c),o.includeQuery&&(f.query=t(l,Kn)),{options:i,body:f}}var pi=O((function(){return fetch})),vi=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.print,o=void 0===i?hi:i,l=e.includeExtensions,f=e.preserveHeaderCase,h=e.useGETForQueries,d=e.includeUnusedVariables,p=void 0!==d&&d,v=s(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw R(38)}(r||pi);var y={http:{includeExtensions:l,preserveHeaderCase:f},options:v.fetchOptions,credentials:v.credentials,headers:v.headers};return new Zr((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),i=e.getContext(),s={};if(i.clientAwareness){var l=i.clientAwareness,f=l.name,d=l.version;f&&(s["apollographql-client-name"]=f),d&&(s["apollographql-client-version"]=d)}var v=a(a({},s),i.headers),m={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:v};if(We(["client"],e.query)){var g=tr(e.query);if(!g)return Hr(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=g}var b,E,_,T,S,w=di(e,o,fi,y,m),k=w.options,I=w.body;I.variables&&!p&&(I.variables=(b=I.variables,E=e.query,_=a({},b),T=new Set(Object.keys(b)),Me(E,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&T.delete(e.name.value)}}),T.forEach((function(e){delete _[e]})),_)),k.signal||"undefined"==typeof AbortController||(S=new AbortController,k.signal=S.signal);var N,A="OperationDefinition"===(N=Zt(e.query)).kind&&"subscription"===N.operation,R=We(["defer"],e.query);if(h&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(k.method="GET"),R||A){k.headers=k.headers||{};var x="multipart/mixed;";A&&R&&!1!==globalThis.__DEV__&&D.warn(39),A?x+="boundary=graphql;subscriptionSpec=1.0,application/json":R&&(x+="deferSpec=20220824,application/json"),k.headers.accept=x}if("GET"===k.method){var C=function(e,t){var n=[],r=function(e,t){n.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var i=void 0;try{i=li(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=li(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var a="",s=e,c=e.indexOf("#");-1!==c&&(a=e.substr(c),s=e.substr(0,c));var u=-1===s.indexOf("?")?"?":"&";return{newURI:s+u+n.join("&")+a}}(t,I),F=C.newURI,L=C.parseError;if(L)return Hr(L);t=F}else try{k.body=li(I,"Payload")}catch(L){return Hr(L)}return new Nr((function(n){var i=r||O((function(){return fetch}))||pi,o=n.next.bind(n);return i(t,k).then((function(t){var n;e.setContext({response:t});var r,i=null===(n=t.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o,s,c,l,f,h,d,p,v,y,m,g,b,E,_,T,S,O,w,k,I;return u(this,(function(u){switch(u.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=null===(I=e.headers)||void 0===I?void 0:I.get("content-type"),i="boundary=",o=(null==r?void 0:r.includes(i))?null==r?void 0:r.substring((null==r?void 0:r.indexOf(i))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",s="\r\n--".concat(o),c="",l=ri(e),f=!0,u.label=1;case 1:return f?[4,l.next()]:[3,3];case 2:for(h=u.sent(),d=h.value,p=h.done,v="string"==typeof d?d:n.decode(d),y=c.length-s.length+1,f=!p,m=(c+=v).indexOf(s,y);m>-1;){if(g=void 0,w=[c.slice(0,m),c.slice(m+s.length)],c=w[1],b=(g=w[0]).indexOf("\r\n\r\n"),E=ci(g.slice(0,b)),(_=E["content-type"])&&-1===_.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(T=g.slice(b))if(S=ui(e,T),Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S||"payload"in S)if(Qr(S)){if(O={},"payload"in S){if(1===Object.keys(S).length&&null===S.payload)return[2];O=a({},S.payload)}"errors"in S&&(O=a(a({},O),{extensions:a(a({},"extensions"in O?O.extensions:null),(k={},k[ii]=S.errors,k))})),t(O)}else t(S);else if(1===Object.keys(S).length&&"hasNext"in S&&!S.hasNext)return[2];m=c.indexOf(s)}return[3,1];case 3:return[2]}}))}))}(t,o):(r=e,function(e){return e.text().then((function(t){return ui(e,t)})).then((function(t){return Array.isArray(t)||si.call(t,"data")||si.call(t,"errors")||Yr(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map((function(e){return e.operationName})):r.operationName,"'.")),t}))})(t).then(o)})).then((function(){S=void 0,n.complete()})).catch((function(e){S=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){S&&S.abort()}}))}))},yi=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,vi(t).request)||this;return n.options=t,n}return o(t,e),t}(Zr);const{toString:mi,hasOwnProperty:gi}=Object.prototype,bi=Function.prototype.toString,Ei=new Map;function _i(e,t){try{return Ti(e,t)}finally{Ei.clear()}}function Ti(e,t){if(e===t)return!0;const n=mi.call(e);if(n!==mi.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(ki(e,t))return!0;const n=Si(e),r=Si(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!gi.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!Ti(e[i],t[i]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(ki(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,o]=e.value;if(!t.has(n))return!1;if(i&&!Ti(o,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=bi.call(e);return n===bi.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,wi)}}return!1}function Si(e){return Object.keys(e).filter(Oi,e)}function Oi(e){return void 0!==this[e]}const wi="{ [native code] }";function ki(e,t){let n=Ei.get(e);if(n){if(n.has(t))return!0}else Ei.set(e,n=new Set);return n.add(t),!1}function Ii(e,t,n,r){var i=t.data,o=s(t,["data"]),a=n.data;return _i(o,s(n,["data"]))&&Ni(Zt(e).selectionSet,i,a,{fragmentMap:st($t(e)),variables:r})}function Ni(e,t,n,r){if(t===n)return!0;var i=new Set;return e.selections.every((function(e){if(i.has(e))return!0;if(i.add(e),!Ge(e,r.variables))return!0;if(Ai(e))return!0;if(Wt(e)){var o=Kt(e),a=t&&t[o],s=n&&n[o],c=e.selectionSet;if(!c)return _i(a,s);var u=Array.isArray(a),l=Array.isArray(s);if(u!==l)return!1;if(u&&l){var f=a.length;if(s.length!==f)return!1;for(var h=0;h<f;++h)if(!Ni(c,a[h],s[h],r))return!1;return!0}return Ni(c,a,s,r)}var d=ct(e,r.fragmentMap);return d?!!Ai(d)||Ni(d.selectionSet,t,n,r):void 0}))}function Ai(e){return!!e.directives&&e.directives.some(Di)}function Di(e){return"nonreactive"===e.name.value}var Ri=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Un(at,{max:Tt["cache.fragmentQueryDocuments"]||1e3,cache:yt})}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(a(a({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.watchFragment=function(e){var t,n=this,r=e.fragment,i=e.fragmentName,o=e.from,c=e.optimistic,u=void 0===c||c,l=s(e,["fragment","fragmentName","from","optimistic"]),f=this.getFragmentDoc(r,i),h=a(a({},l),{returnPartialData:!0,id:void 0===o||"string"==typeof o?o:this.identify(o),query:f,optimistic:u});return new Nr((function(e){return n.watch(a(a({},h),{immediate:!0,callback:function(n){if(!t||!Ii(f,{data:null==t?void 0:t.result},{data:n.result})){var r={data:n.result,complete:!!n.complete};n.missing&&(r.missing=ir(n.missing.map((function(e){return e.missing})))),t=n,e.next(r)}}}))}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(a(a({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=s(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=s(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery(a(a({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment(a(a({},e),{data:i})),i)}})},e}();!1!==globalThis.__DEV__&&(Ri.prototype.getMemoryInternals=It);var xi=function(e){function t(n,r,i,o){var a,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=o,Array.isArray(s.path)){s.missing=s.message;for(var c=s.path.length-1;c>=0;--c)s.missing=((a={})[s.path[c]]=s.missing,a)}else s.missing=s.path;return s.__proto__=t.prototype,s}return o(t,e),t}(Error),Ci=Object.prototype.hasOwnProperty;function Fi(e){return null==e}function Li(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=Fi(r)?Fi(i)?void 0:{_id:i}:{id:r}),Fi(r)&&!Fi(i)&&(r=i),!Fi(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var Pi={dataIdFromObject:Li,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Mi(e){var t=e.canonizeResults;return void 0===t?Pi.canonizeResults:t}var qi=/^[_a-z][_0-9a-z]*/i;function ji(e){var t=e.match(qi);return t?t[0]:e}function Vi(e,t,n){return!!ot(t)&&(Gn(t)?t.every((function(t){return Vi(e,t,n)})):e.selections.every((function(e){if(Wt(e)&&Ge(e,n)){var r=Kt(e);return Ci.call(t,r)&&(!e.selectionSet||Vi(e.selectionSet,t[r],n))}return!0})))}function Ui(e){return ot(e)&&!jt(e)&&!Gn(e)}function Qi(e,t){var n=st($t(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var Bi=Object.create(null),zi=function(){return Bi},Ki=Object.create(null),Gi=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Lr(jt(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return jt(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return qt(e);if(jt(e))return e;var r=n.policies.identify(e)[0];if(r){var i=qt(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return a({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Ci.call(this.data,e)){var n=this.data[e];if(n&&Ci.call(n,t))return n[t]}return"__typename"===t&&Ci.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Ji?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Ci.call(this.data,e)?this.data[e]:this instanceof Ji?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;jt(e)&&(e=e.__ref),jt(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){D("string"==typeof n,1);var a=new ar(Xi).merge(i,o);if(this.data[n]=a,a!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=ji(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof Ji||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,s=!0,c={DELETE:Bi,INVALIDATE:Ki,isReference:jt,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||qt(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var l=ji(u),f=r[u];if(void 0!==f){var h="function"==typeof t?t:t[u]||t[l];if(h){var d=h===zi?Bi:h(Lr(f),a(a({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));if(d===Ki)n.group.dirty(e,u);else if(d===Bi&&(d=void 0),d!==f&&(i[u]=d,o=!0,f=d,!1!==globalThis.__DEV__)){var p=function(e){if(void 0===n.lookup(e.__ref))return!1!==globalThis.__DEV__&&D.warn(2,e),!0};if(jt(d))p(d);else if(Array.isArray(d))for(var v=!1,y=void 0,m=0,g=d;m<g.length;m++){var b=g[m];if(jt(b)){if(v=!0,p(b))break}else if("object"==typeof b&&b)n.policies.identify(b)[0]&&(y=b);if(v&&void 0!==y){!1!==globalThis.__DEV__&&D.warn(3,y);break}}}}void 0!==f&&(s=!1)}})),o)return this.merge(e,i),s&&(this instanceof Ji?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=zi,r):zi)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Ci.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ji&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){Ci.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&Ci.call(e,n)||t.delete(n)})),e){var n=e.__META,r=s(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Ji?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){Ci.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof Ji;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Ci.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){jt(e)&&(t[e.__ref]=!0),ot(e)&&Object.keys(e).forEach((function(t){var n=e[t];ot(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Wi=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Mn():null,this.keyMaker=new Ze(tt)},e.prototype.depend=function(e,t){if(this.d){this.d(Hi(e,t));var n=ji(t);n!==t&&this.d(Hi(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Hi(e,t),"__exists"===t?"forget":"setDirty")},e}();function Hi(e,t){return t+"#"+e}function Yi(e,t){Zi(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,a=e.call(this,n,new Wi(i))||this;return a.stump=new $i(a),a.storageTrie=new Ze(tt),o&&a.replace(o),a}return o(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Gi);var Ji=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return o(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){_i(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return a(a({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Ci.call(this.data,t)?a(a({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Gi),$i=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Wi(t.group.caching,t.group))||this}return o(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(Ji);function Xi(e,t,n){var r=e[n],i=t[n];return _i(r,i)?r:i}function Zi(e){return!!(e instanceof Gi&&e.group.caching)}function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var to=function(){function e(){this.known=new(nt?WeakSet:Set),this.pool=new Ze(tt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return ot(e)&&this.known.has(e)},e.prototype.pass=function(e){if(ot(e)){var t=function(e){return ot(e)?Gn(e)?e.slice(0):a({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(ot(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),!1!==globalThis.__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],a=this.sortedKeys(e);o.push(a.json);var s,c=o.length;if(a.sorted.forEach((function(n){o.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(o)).object){var u=s.object=Object.create(i);this.known.add(u),a.sorted.forEach((function(e,t){u[e]=o[c+t]})),!1!==globalThis.__DEV__&&Object.freeze(u)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}();function no(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ro=function(){function e(e){var t=this;this.knownResults=new(tt?WeakMap:Map),this.config=Gr(e,{addTypename:!1!==e.addTypename,canonizeResults:Mi(e)}),this.canon=e.canon||new to,this.executeSelectionSet=Un((function(e){var n,r=e.context.canonizeResults,i=no(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?a(a({},o),{result:t.canon.admit(o.result)}):o:(Yi(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize||Tt["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:no,makeCacheKey:function(e,t,n,r){if(Zi(n.store))return n.store.makeCacheKey(e,jt(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Un((function(e){return Yi(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize||Tt["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Zi(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new to},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,s=e.returnPartialData,c=void 0===s||s,u=e.canonizeResults,l=void 0===u?this.config.canonizeResults:u,f=this.config.cache.policies;o=a(a({},en(Xt(n))),o);var h,d=qt(i),p=this.executeSelectionSet({selectionSet:Zt(n).selectionSet,objectOrReference:d,enclosingRef:d,context:a({store:t,query:n,policies:f,variables:o,varString:Lt(o),canonizeResults:l},Qi(n,this.config.fragments))});if(p.missing&&(h=[new xi(io(p.missing),p.missing,n,o)],!c))throw h[0];return{result:p.result,complete:!h,missing:h}},e.prototype.isFresh=function(e,t,n,r){if(Zi(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(jt(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var a,s=o.variables,c=o.policies,u=o.store.getFieldValue(r,"__typename"),l=[],f=new ar;function h(e,t){var n;return e.missing&&(a=f.merge(a,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof u&&!c.rootIdsByTypename[u]&&l.push({__typename:u});var d=new Set(n.selections);d.forEach((function(e){var n,p;if(Ge(e,s))if(Wt(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),y=Kt(e);void 0===v?Zn.added(e)||(a=f.merge(a,((n={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(jt(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Gn(v)?v.length>0&&(v=h(t.executeSubSelectedArray({field:e,array:v,enclosingRef:i,context:o}),y)):e.selectionSet?null!=v&&(v=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:v,enclosingRef:jt(v)?v:i,context:o}),y)):o.canonizeResults&&(v=t.canon.pass(v)),void 0!==v&&l.push(((p={})[y]=v,p))}else{var m=ct(e,o.lookupFragment);if(!m&&e.kind===X.FRAGMENT_SPREAD)throw R(9,e.name.value);m&&c.fragmentMatches(m,u)&&m.selectionSet.selections.forEach(d.add,d)}}));var p={result:ir(l),missing:a},v=o.canonizeResults?this.canon.admit(p):Lr(p);return v.result&&this.knownResults.set(v.result,n),v},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new ar;function c(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Gn(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:a}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:jt(e)?e:o,context:a}),t):(!1!==globalThis.__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){ot(n)&&(D(!jt(n),10,function(e,t){return jt(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n),t.name.value),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function io(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var oo=new pn,ao=new WeakMap;function so(e){var t=ao.get(e);return t||ao.set(e,t={vars:new Set,dep:Mn()}),t}function co(e){so(e).vars.forEach((function(t){return t.forgetCache(e)}))}function uo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){so(e).dep.dirty(r),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=oo.getValue();s&&(i(s),so(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),so(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}var lo=Object.create(null);function fo(e){var t=JSON.stringify(e);return lo[t]||(lo[t]=Object.create(null))}function ho(e){var t=fo(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=vo(e,(function(e){var i=go(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Ci.call(t,e[0])&&(i=go(t,e,mo)),D(void 0!==i,4,e.join("."),t),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function po(e){var t=fo(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,a=vo(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return go(t,e)}else{var a=n.slice(1);if(i&&Ci.call(i,a)){var s=e.slice(0);return s[0]=a,go(i,s)}}else if(r&&Wn(r.directives)){var c=n.slice(1),u=r.directives.find((function(e){return e.name.value===c})),l=u&&zt(u,i);return l&&go(l,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function vo(e,t){var n=new ar;return yo(e).reduce((function(e,r){var i,o=t(r);if(void 0!==o){for(var a=r.length-1;a>=0;--a)(i={})[r[a]]=o,o=i;e=n.merge(e,o)}return e}),Object.create(null))}function yo(e){var t=fo(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Gn(t)?(yo(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Gn(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function mo(e,t){return e[t]}function go(e,t,n){return n=n||mo,bo(t.reduce((function e(t,r){return Gn(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function bo(e){return ot(e)?Gn(e)?e.map(bo):vo(Object.keys(e).sort(),(function(t){return go(e,t)})):e}function Eo(e){return void 0!==e.args?e.args:e.field?zt(e.field,e.variables):null}var _o=function(){},To=function(e,t){return t.fieldName},So=function(e,t,n){return(0,n.mergeObjects)(e,t)},Oo=function(e,t){return t},wo=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=a({dataIdFromObject:Li},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,i=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,s=t&&t.storeObject||e,c=a(a({},t),{typename:i,storeObject:s,readField:t&&t.readField||function(){var e=Io(arguments,s);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),u=i&&this.getTypePolicy(i),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var f=l(a(a({},e),s),c);if(!Gn(f)){o=f;break}l=ho(f)}return o=o?String(o):void 0,c.keyObject?[o,c.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,a=r.subscriptionType,c=s(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),Ci.call(t.toBeAdded,n)?t.toBeAdded[n].push(c):t.toBeAdded[n]=[c]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?So:!1===t?Oo:e.merge}a(r,t.merge),r.keyFn=!1===i?_o:Gn(i)?ho(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,c=i.read,u=i.merge;r.keyFn=!1===s?To:Gn(s)?po(s):"function"==typeof s?s:r.keyFn,"function"==typeof c&&(r.read=c),a(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||To)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(D(!r||r===e,5,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(qi);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Ci.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((function(n,i){if(n.test(e)){var o=t.supertypeMap.get(i);o&&o.forEach((function(e){return r.add(e)}))}}))),r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=s(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},u=!(!n||!this.fuzzySubtypes.size),l=!1,f=0;f<s.length;++f){var h=s[f];if(h.has(o))return a.has(o)||(l&&!1!==globalThis.__DEV__&&D.warn(6,t,o),a.add(o)),!0;h.forEach(c),u&&f===s.length-1&&Vi(e.selectionSet,n,r)&&(u=!1,l=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&c(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},s=Eo(e);o;){var c=o(s,a);if(!Gn(c)){t=c||r;break}o=po(c)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return Vt(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return Vt(r,n,i,t)}))),Bt(e.name.value,r,n)}(e.field,e.variables):Bt(r,Eo(e))),!1===t?r:r===ji(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var i=this.getStoreFieldName(e),o=ji(i),a=t.store.getFieldValue(n,i),s=this.getFieldPolicy(e.typename,o,!1),c=s&&s.read;if(c){var u=ko(this,n,e,t,t.store.getStorage(jt(n)?n.__ref:n,i));return oo.withValue(this.cache,c,[a,u])}return a}},e.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),i=r&&r.merge;return!i&&n&&(i=(r=this.getTypePolicy(n))&&r.merge),i},e.prototype.runMergeFunction=function(e,t,n,r,i){var o=n.field,a=n.typename,s=n.merge;return s===So?No(r.store)(e,t):s===Oo?t:(r.overwrite&&(e=void 0),s(e,t,ko(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function ko(e,t,n,r,i){var o=e.getStoreFieldName(n),a=ji(o),s=n.variables||r.variables,c=r.store,u=c.toReference,l=c.canRead;return{args:Eo(n),field:n.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:jt,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Io(arguments,t,s),r)},mergeObjects:No(r.store)}}function Io(e,t,n){var r,i=e[0],o=e[1],s=e.length;return"string"==typeof i?r={fieldName:i,from:s>1?o:t}:(r=a({},i),Ci.call(r,"from")||(r.from=t)),!1!==globalThis.__DEV__&&void 0===r.from&&!1!==globalThis.__DEV__&&D.warn(7,N(Array.from(e))),void 0===r.variables&&(r.variables=n),r}function No(e){return function(t,n){if(Gn(t)||Gn(n))throw R(8);if(ot(t)&&ot(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(jt(t)&&Ui(n))return e.merge(t.__ref,n),t;if(Ui(t)&&jt(n))return e.merge(t,n.__ref),n;if(Ui(t)&&Ui(n))return a(a({},t),n)}return n}}function Ao(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:a(a({},e),{clientOnly:t,deferred:n})),i}var Do=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,s=t.variables,c=t.overwrite,u=Yt(r),l=new ar;s=a(a({},en(u)),s);var f=a(a({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:s,varString:Lt(s)},Qi(r,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:f});if(!jt(h))throw R(11,i);return f.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,s=t.fieldNodeSet,c=qt(r);if(o&&o.map.size){var u=n.applyMerges(o,c,i,f);if(jt(u))return;i=u}if(!1!==globalThis.__DEV__&&!f.overwrite){var l=Object.create(null);s.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===l[ji(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(!o)return;var s=i(t);if(!s)return;if(jt(o))return;if(_i(o,s))return;if(Object.keys(o).every((function(e){return void 0!==r.getFieldValue(s,e)})))return;var c=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=ji(n),l="".concat(c,".").concat(u);if(Po.has(l))return;Po.add(l);var f=[];Gn(o)||Gn(s)||[o,s].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)}));!1!==globalThis.__DEV__&&D.warn(14,u,c,f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"",l,a({},o),a({},s))}(c,i,e,f.store)}))}e.merge(r,i)})),e.retain(h.__ref),h},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,s=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||Gt(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(u.__typename=l);var f=function(){var e=Io(arguments,u,o.variables);if(jt(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var n=c.readField(a(a({},e),{from:t.storeObject}),o);if(void 0!==n)return n}}return c.readField(e,o)},h=new Set;this.flattenFields(i,r,o,l).forEach((function(e,n){var i,o=Kt(n),a=r[o];if(h.add(n),void 0!==a){var d=c.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),p=xo(s,d),v=t.processFieldValue(a,n,n.selectionSet?Ao(e,!1,!1):e,p),y=void 0;n.selectionSet&&(jt(v)||Ui(v))&&(y=f("__typename",v));var m=c.getMergeFunction(l,n.name.value,y);m?p.info={field:n,typename:l,merge:m}:Lo(s,d),u=e.merge(u,((i={})[d]=v,i))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||Zn.added(n)||c.getReadFunction(l,n.name.value)||!1!==globalThis.__DEV__&&D.error(12,Kt(n),r)}));try{var d=c.identify(r,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:u,readField:f}),p=d[0],v=d[1];n=n||p,v&&(u=o.merge(u,v))}catch(e){if(!n)throw e}if("string"==typeof n){var y=qt(n),m=o.written[n]||(o.written[n]=[]);if(m.indexOf(i)>=0)return y;if(m.push(i),this.reader&&this.reader.isFresh(r,y,i,o))return y;var g=o.incomingById.get(n);return g?(g.storeObject=o.merge(g.storeObject,u),g.mergeTree=Co(g.mergeTree,s),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:u,mergeTree:Fo(s)?void 0:s,fieldNodeSet:h}),y}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Gn(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,xo(r,o));return Lo(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):!1!==globalThis.__DEV__?xr(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=Gt(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,a=new Ze(!1);return function e(s,c){var u=a.lookup(s,c.clientOnly,c.deferred);u.visited||(u.visited=!0,s.selections.forEach((function(a){if(Ge(a,n.variables)){var s=c.clientOnly,u=c.deferred;if(s&&u||!Wn(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=zt(e,n.variables);r&&!1===r.if||(u=!0)}})),Wt(a)){var l=i.get(a);l&&(s=s&&l.clientOnly,u=u&&l.deferred),i.set(a,Ao(n,s,u))}else{var f=ct(a,n.lookupFragment);if(!f&&a.kind===X.FRAGMENT_SPREAD)throw R(13,a.name.value);f&&o.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,Ao(n,s,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,s=this;if(e.map.size&&!jt(n)){var c,u=Gn(n)||!jt(t)&&!Ui(t)?void 0:t,l=n;u&&!i&&(i=[jt(u)?u.__ref:u]);var f=function(e,t){return Gn(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=f(u,t),o=f(l,t);if(void 0!==o){i&&i.push(t);var a=s.applyMerges(e,n,o,r,i);a!==o&&(c=c||new Map).set(t,a),i&&D(i.pop()===t)}})),c&&(n=Gn(l)?l.slice(0):a({},l),c.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),Ro=[];function xo(e,t){var n=e.map;return n.has(t)||n.set(t,Ro.pop()||{map:new Map}),n.get(t)}function Co(e,t){if(e===t||!t||Fo(t))return e;if(!e||Fo(e))return t;var n=e.info&&t.info?a(a({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,Co(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Co(t.map.get(n),e.map.get(n)))}))}return i}function Fo(e){return!e||!(e.info||e.map.size)}function Lo(e,t){var n=e.map,r=n.get(t);r&&Fo(r)&&(Ro.push(r),n.delete(t))}var Po=new Set;var Mo,qo=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new zn(Zn),n.assumeImmutableResults=!0,n.makeVar=uo,n.txCount=0,n.config=function(e){return Gr(Pi,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new wo({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return o(t,e),t.prototype.init=function(){var e=this.data=new Gi.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new Do(this,this.storeReader=new ro({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Mi(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=Un((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize||Tt["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Zi(n)){var r=e.optimistic,i=e.id,o=e.variables;return n.makeCacheKey(e.query,e.callback,Lt({optimistic:r,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(a(a({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof xi)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Ci.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(a(a({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||so(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&co(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;Lt.reset(),Kn.reset(),this.addTypenameTransform.resetCache(),null===(t=this.config.fragments)||void 0===t||t.resetCaches();var n=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),n},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(jt(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&D.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Ci.call(e,"id"))return!1;e=a(a({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Lt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),co(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,o=void 0===i||i,s=e.removeOptimistic,c=e.onWatchUpdated,u=function(e){var i=n,o=i.data,a=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=o,n.optimisticData=a}},l=new Set;return c&&!this.txCount&&this.broadcastWatches(a(a({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,u):!1===o?u(this.data):u(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&l.size?(this.broadcastWatches(a(a({},e),{onWatchUpdated:function(e,t){var n=c.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&_i(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(Ri);function jo(e){return!!e&&e<7}!1!==globalThis.__DEV__&&(qo.prototype.getMemoryInternals=kt),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Mo||(Mo={}));var Vo=Object.assign,Uo=Object.hasOwnProperty,Qo=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=zo)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=r,o.queryManager=n,o.waitForOwnResult=Go(i.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var s=n.defaultOptions.watchQuery,c=(void 0===s?{}:s).fetchPolicy,u=void 0===c?"cache-first":c,l=i.fetchPolicy,f=void 0===l?u:l,h=i.initialFetchPolicy,d=void 0===h?"standby"===f?u:f:h;o.options=a(a({},i),{initialFetchPolicy:d,fetchPolicy:f}),o.queryId=r.queryId||n.generateQueryId();var p=Yt(o.query);return o.queryName=p&&p.name&&p.name.value,o}return o(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||Mo.ready,r=a(a({},t),{loading:jo(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if(Go(o)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(r.data=s.result),_i(r.data,{})&&(r.data=void 0),s.complete?(delete r.partial,!s.complete||r.networkStatus!==Mo.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Mo.ready,r.loading=!1)):r.partial=!0,!1===globalThis.__DEV__||s.complete||this.options.partialRefetch||r.loading||r.data||r.error||Ko(s.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Ii(this.query,this.last.result,e,this.variables):!_i(this.last.result,e))||t&&!_i(this.last.variables,t))},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||_i(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&Uo.call(e,"variables")){var i=Xt(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||!1!==globalThis.__DEV__&&D.warn(20,e,(null===(t=i.name)||void 0===t?void 0:t.value)||i)}return e&&!_i(this.options.variables,e)&&(n.variables=this.options.variables=a(a({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Mo.refetch)},t.prototype.fetchMore=function(e){var t=this,n=a(a({},e.query?e:a(a(a(a({},this.options),{query:this.options.query}),e),{variables:a(a({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});n.query=this.transformDocument(n.query);var r=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):n.query;var i=this.queryInfo,o=i.networkStatus;i.networkStatus=Mo.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var s=new Set,c=null==e?void 0:e.updateQuery,u="no-cache"!==this.options.fetchPolicy;return u||D(c,21),this.queryManager.fetchQuery(r,n,Mo.fetchMore).then((function(l){if(t.queryManager.removeQuery(r),i.networkStatus===Mo.fetchMore&&(i.networkStatus=o),u)t.queryManager.cache.batch({update:function(r){var i=e.updateQuery;i?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:l.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:l.data})},onWatchUpdated:function(e){s.add(e.query)}});else{var f=t.getLast("result"),h=c(f.data,{fetchMoreResult:l.data,variables:n.variables});t.reportResult(a(a({},f),{data:h}),t.variables)}return l})).finally((function(){u&&!s.has(t.query)&&Bo(t)}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&D.error(22,t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=Gr(this.options,e||{});Vo(this.options,t)},t.prototype.setVariables=function(e){return _i(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Mo.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=void 0===n?"cache-first":n,i=t.initialFetchPolicy,o=void 0===i?r:i;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,n)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n&&this.hasObservers()){if(!t||t.interval!==n){D(n,23),(t||(this.pollingInfo={})).interval=n;var r=function(){var t,n;e.pollingInfo&&(jo(e.queryInfo.networkStatus)||(null===(n=(t=e.options).skipPollAttempt)||void 0===n?void 0:n.call(t))?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Mo.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){void 0===t&&(t=this.variables);var n=this.getLastError();return n&&this.last&&!_i(t,this.last.variables)&&(n=void 0),this.last=a({result:this.queryManager.assumeImmutableResults?e:xr(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var r=t===Mo.refetch||t===Mo.fetchMore||t===Mo.poll,i=this.options.variables,o=this.options.fetchPolicy,s=Gr(this.options,e||{}),c=r?s:Vo(this.options,s),u=this.transformDocument(c.query);this.lastQuery=u,r||(this.updatePolling(),!e||!e.variables||_i(e.variables,i)||"standby"===c.fetchPolicy||c.fetchPolicy!==o&&"function"!=typeof c.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",c),void 0===t&&(t=Mo.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Go(c.fetchPolicy));var l=function(){n.concast===d&&(n.waitForOwnResult=!1)},f=c.variables&&a({},c.variables),h=this.fetch(c,t,u),d=h.concast,p=h.fromLink,v={next:function(e){_i(n.variables,f)&&(l(),n.reportResult(e,f))},error:function(e){_i(n.variables,f)&&(oi(e)||(e=new ai({networkError:e})),l(),n.reportError(e,f))}};return r||!p&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=v),d.addObserver(v),d},t.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},t.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.last;this.resetLastResults();var r=this.subscribe.apply(this,e);return this.last=n,r},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError(),r=this.isDifferentFromLastResult(e,t);(n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(n||r)&&Pr(this.observers,"next",e)},t.prototype.reportError=function(e,t){var n=a(a({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Mo.error,loading:!1});this.updateLastResult(n,t),Pr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t}(Nr);function Bo(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,t){return this.nextFetchPolicy=r,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,t):n}}):e.reobserve()}function zo(e){!1!==globalThis.__DEV__&&D.error(24,e.message,e.stack)}function Ko(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&D.debug(25,e)}function Go(e){return"network-only"===e||"no-cache"===e||"standby"===e}qr(Qo);var Wo=new(tt?WeakMap:Map);function Ho(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Wo.set(e,(Wo.get(e)+1)%1e15),n.apply(this,arguments)})}function Yo(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Jo=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Wo.has(n)||(Wo.set(n,0),Ho(n,"evict"),Ho(n,"modify"),Ho(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Mo.loading;return this.variables&&this.networkStatus!==Mo.loading&&!_i(this.variables,e.variables)&&(t=Mo.setVariables),_i(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){Yo(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&_i(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,n=this,r=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(null===(t=this.observableQuery)||void 0===t?void 0:t.getLastError())||(this.updateLastDiff(e),this.dirty||_i(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return n.notify()}),0))))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Bo(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Yo(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(jo(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=a(a({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&_i(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Wo.get(this.cache)&&_i(t,n.variables)&&_i(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,o=new ar,a=Wn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Wn(e.incremental)){var s=Br(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=a,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&($o(e,n.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,n.variables))o.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:Wo.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var a=i.getDiffOptions(n.variables),s=o.diff(a);!i.stopped&&_i(i.variables,n.variables)&&i.updateWatch(n.variables),i.updateLastDiff(s,a),s.complete&&(e.data=s.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Mo.ready},e.prototype.markError=function(e){return this.networkStatus=Mo.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function $o(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!zr(e);return!r&&n&&e.data&&(r=!0),r}var Xo=Object.prototype.hasOwnProperty,Zo=Object.create(null),ea=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new bt(Tt["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Ze(!1);var n=new zn((function(e){return t.cache.transformDocument(e)}),{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var r=e.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(R(26))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return c(this,arguments,void 0,(function(e){var t,n,r,i,o,s,c,l=e.mutation,f=e.variables,h=e.optimisticResponse,d=e.updateQueries,p=e.refetchQueries,v=void 0===p?[]:p,y=e.awaitRefetchQueries,m=void 0!==y&&y,g=e.update,b=e.onQueryUpdated,E=e.fetchPolicy,_=void 0===E?(null===(s=this.defaultOptions.mutate)||void 0===s?void 0:s.fetchPolicy)||"network-only":E,T=e.errorPolicy,S=void 0===T?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":T,O=e.keepRootFields,w=e.context;return u(this,(function(e){switch(e.label){case 0:return D(l,27),D("network-only"===_||"no-cache"===_,28),t=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),n=this.getDocumentInfo(l).hasClientExports,f=this.getVariables(l,f),n?[4,this.localState.addExportedVariables(l,f,w)]:[3,2];case 1:f=e.sent(),e.label=2;case 2:return r=this.mutationStore&&(this.mutationStore[t]={mutation:l,variables:f,loading:!0,error:null}),i=h&&this.markMutationOptimistic(h,{mutationId:t,document:l,variables:f,fetchPolicy:_,errorPolicy:S,context:w,updateQueries:d,update:g,keepRootFields:O}),this.broadcastQueries(),o=this,[2,new Promise((function(e,n){return Mr(o.getObservableFromLink(l,a(a({},w),{optimisticResponse:i?h:void 0}),f,{},!1),(function(e){if(zr(e)&&"none"===S)throw new ai({graphQLErrors:Kr(e)});r&&(r.loading=!1,r.error=null);var n=a({},e);return"function"==typeof v&&(v=v(n)),"ignore"===S&&zr(n)&&delete n.errors,o.markMutationResult({mutationId:t,result:n,document:l,variables:f,fetchPolicy:_,errorPolicy:S,context:w,update:g,updateQueries:d,awaitRefetchQueries:m,refetchQueries:v,removeOptimistic:i?t:void 0,onQueryUpdated:b,keepRootFields:O})})).subscribe({next:function(t){o.broadcastQueries(),"hasNext"in t&&!1!==t.hasNext||e(t)},error:function(e){r&&(r.loading=!1,r.error=e),i&&o.cache.removeOptimistic(t),o.broadcastQueries(),n(e instanceof ai?e:new ai({networkError:e}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&$o(r,e.errorPolicy)){if(Ur(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ur(r)&&Wn(r.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=Br(s.result,r)),void 0!==c&&(r.data=c,i.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach((function(e,o){var a=e.observableQuery,s=a&&a.queryName;if(s&&Xo.call(u,s)){var c=u[s],l=n.queries.get(o),f=l.document,h=l.variables,d=t.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),p=d.result;if(d.complete&&p){var v=c(p,{mutationResult:r,queryName:f&&Jt(f)||void 0,queryVariables:h});v&&i.push({result:v,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(i.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var s,c=e.update,u=!(Ur(s=r)||function(e){return"hasNext"in e&&"data"in e}(s))||Ur(r)&&!r.hasNext;if(c){if(!o){var l=t.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(r=a(a({},r),{data:l.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}u&&c(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||!u||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables,{IGNORE:Zo}):e;return r!==Zo&&(this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(a(a({},t),{result:{data:r}}),e)}catch(e){!1!==globalThis.__DEV__&&D.error(e)}}),t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:He(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:We(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:Xn([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:en(Yt(e)),asQuery:a(a({},e),{definitions:e.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?a(a({},e),{operation:"query"}):e}))})};t.set(e,n)}return t.get(e)},e.prototype.getVariables=function(e,t){return a(a({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=a(a({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=new Jo(this),r=new Qo({queryManager:this,queryInfo:n,options:e});return r.lastQuery=t,this.queries.set(r.queryId,n),n.init({document:t,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),D(e.query,29),D("Document"===e.query.kind,30),D(!e.returnPartialData,31),D(!e.pollInterval,32),this.fetchQuery(t,a(a({},e),{query:this.transform(e.query)})).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(R(33)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Mo.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):ot(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e),!1):ot(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void n.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(i,o),s&&r.set(s,!0),a&&r.set(a,!0))}})),i.size&&i.forEach((function(e){var r=I("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new Qo({queryManager:t,queryInfo:i,options:a(a({},e),{fetchPolicy:"network-only"})});D(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),!1!==globalThis.__DEV__&&r.size&&r.forEach((function(e,t){e||!1!==globalThis.__DEV__&&D.warn("string"==typeof t?34:35,t)})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=void 0===i?"none":i,a=e.variables,s=e.context,c=void 0===s?{}:s,u=e.extensions,l=void 0===u?{}:u;n=this.transform(n),a=this.getVariables(n,a);var f=function(e){return t.getObservableFromLink(n,c,e,l).map((function(i){"no-cache"!==r&&($o(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var a=zr(i),s=function(e){return!!e.extensions&&Array.isArray(e.extensions[ii])}(i);if(a||s){var c={};if(a&&(c.graphQLErrors=i.errors),s&&(c.protocolErrors=i.extensions[ii]),"none"===o||s)throw new ai(c)}return"ignore"===o&&delete i.errors,i}))};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,a,c).then(f);return new Nr((function(e){var t=null;return h.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return f(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r,i){var o,s,c=this;void 0===i&&(i=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var u=this.getDocumentInfo(e),l=u.serverQuery,f=u.clientQuery;if(l){var h=this.inFlightLinkObservables,d=this.link,p={query:l,variables:n,operationName:Jt(l)||void 0,context:this.prepareContext(a(a({},t),{forceFetch:!i})),extensions:r};if(t=p.context,i){var v=Kn(l),y=Lt(n),m=h.lookup(v,y);if(!(s=m.observable)){var g=new Vr([ei(d,p)]);s=m.observable=g,g.beforeNext((function(){h.remove(v,y)}))}}else s=new Vr([ei(d,p)])}else s=new Vr([Nr.of({data:{}})]),t=this.prepareContext(t);return f&&(s=Mr(s,(function(e){return c.localState.runResolvers({document:f,remoteResult:e,context:t,variables:n})}))),s},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(n.query);return Mr(this.getObservableFromLink(i,n.context,n.variables),(function(o){var a=Kr(o),s=a.length>0,c=n.errorPolicy;if(r>=e.lastRequestId){if(s&&"none"===c)throw e.markError(new ai({graphQLErrors:a}));e.markResult(o,i,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Mo.ready};return s&&"none"===c&&(u.data=void 0),s&&"ignore"!==c&&(u.errors=a,u.networkStatus=Mo.error),u}),(function(t){var n=oi(t)?t:new ai({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchConcastWithInfo=function(e,t,n,r){var i=this;void 0===n&&(n=Mo.loading),void 0===r&&(r=t.query);var o,a,s=this.getVariables(r,t.variables),c=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?u&&u.fetchPolicy||"cache-first":l,h=t.errorPolicy,d=void 0===h?u&&u.errorPolicy||"none":h,p=t.returnPartialData,v=void 0!==p&&p,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,g=t.context,b=void 0===g?{}:g,E=Object.assign({},t,{query:r,variables:s,fetchPolicy:f,errorPolicy:d,returnPartialData:v,notifyOnNetworkStatusChange:m,context:b}),_=function(e){E.variables=e;var r=i.fetchQueryByPolicy(c,E,n);return"standby"!==E.fetchPolicy&&r.sources.length>0&&c.observableQuery&&c.observableQuery.applyNextFetchPolicy("after-fetch",t),r},T=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){T(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(E.query).hasClientExports)o=new Vr(this.localState.addExportedVariables(E.query,E.variables,E.context).then(_).then((function(e){return e.sources}))),a=!0;else{var S=_(E.variables);a=S.fromLink,o=new Vr(S.sources)}return o.promise.then(T,T),{concast:o,fromLink:a}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?I("refetchQueries"):void 0:a,c=e.onQueryUpdated,u=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){u.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var l=new Map;return n&&this.cache.batch({update:n,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof Jo&&e.watcher.observableQuery;if(r){if(c){u.delete(r.queryId);var i=c(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==c&&u.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),u.size&&u.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,a=e.diff;if(c){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}r=c(i,a,o)}c&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,s=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,f=t.context,h=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:i,variables:o,networkStatus:n});var p=function(){return e.getDiff()},v=function(t,n){void 0===n&&(n=e.networkStatus||Mo.loading);var s=t.result;!1===globalThis.__DEV__||l||_i(s,{})||Ko(t.missing);var c=function(e){return Nr.of(a({data:e,loading:jo(n),networkStatus:n},t.complete?null:{partial:!0}))};return s&&r.getDocumentInfo(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:s},context:f,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data||void 0)})):"none"===u&&n===Mo.refetch&&Array.isArray(t.missing)?c(void 0):c(s)},y="no-cache"===s?0:n===Mo.refetch&&"merge"!==c?1:2,m=function(){return r.getResultsFromLink(e,y,{query:i,variables:o,context:f,fetchPolicy:s,errorPolicy:u})},g=h&&"number"==typeof d&&d!==n&&jo(n);switch(s){default:case"cache-first":return(b=p()).complete?{fromLink:!1,sources:[v(b,e.markReady())]}:l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-and-network":var b;return(b=p()).complete||l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[v(p(),e.markReady())]};case"network-only":return g?{fromLink:!0,sources:[v(p()),m()]}:{fromLink:!0,sources:[m()]};case"no-cache":return g?{fromLink:!0,sources:[v(e.getDiff()),m()]}:{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Jo(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return a(a(a({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),ta=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=rr(t.resolvers,e)})):this.resolvers=rr(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return c(this,arguments,void 0,(function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return u(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,s).then((function(e){return a(a({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return We(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return tr(e)},e.prototype.prepareContext=function(e){var t=this.cache;return a(a({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return c(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),u(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return a(a({},t),e.exportedVariables)}))]:[2,a({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Me(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Pe}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:er(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return c(this,arguments,void 0,(function(e,t,n,r,i,o){var s,c,l,f,h,d,p,v,y,m;return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),u(this,(function(u){return s=Zt(e),c=$t(e),l=st(c),f=this.collectSelectionsToResolve(s,l),h=s.operation,d=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",v=(p=this).cache,y=p.client,m={fragmentMap:l,context:a(a({},n),{cache:v,client:y}),variables:r,fragmentMatcher:i,defaultOperationType:d,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(s.selectionSet,false,t,m).then((function(e){return{result:e,exportedVariables:m.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,a,s,l,f=this;return u(this,(function(h){return i=r.fragmentMap,o=r.context,a=r.variables,s=[n],l=function(e){return c(f,void 0,void 0,(function(){var c,l;return u(this,(function(u){return(t||r.selectionsToResolve.has(e))&&Ge(e,a)?Wt(e)?[2,this.resolveField(e,t,n,r).then((function(t){var n;void 0!==t&&s.push(((n={})[Kt(e)]=t,n))}))]:(!function(e){return"InlineFragment"===e.kind}(e)?(c=i[e.name.value],D(c,18,e.name.value)):c=e,c&&c.typeCondition&&(l=c.typeCondition.name.value,r.fragmentMatcher(n,l,o))?[2,this.resolveSelectionSet(c.selectionSet,t,n,r).then((function(e){s.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return ir(s)}))]}))}))},e.prototype.resolveField=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,a,s,c,l,f,h,d,p=this;return u(this,(function(u){return n?(i=r.variables,o=e.name.value,a=Kt(e),s=o!==a,c=n[a]||n[o],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=n.__typename||r.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(d=h[s?o:a])&&(l=Promise.resolve(oo.withValue(this.cache,d,[n,zt(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,l.then((function(n){var i,o;if(void 0===n&&(n=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)}))})),!e.selectionSet)return n;if(null==n)return n;var a=null!==(o=null===(i=e.directives)||void 0===i?void 0:i.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(n)?p.resolveSubSelectedArray(e,t||a,n,r):e.selectionSet?p.resolveSelectionSet(e.selectionSet,t||a,n,r):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map((function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;return function e(i){if(!r.has(i)){var o=new Set;r.set(i,o),Me(i,{Directive:function(e,t,r,i,a){"client"===e.name.value&&a.forEach((function(e){n(e)&&Ke(e)&&o.add(e)}))},FragmentSpread:function(r,i,a,s,c){var u=t[r.name.value];D(u,19,r.name.value);var l=e(u);l.size>0&&(c.forEach((function(e){n(e)&&Ke(e)&&o.add(e)})),o.add(r),l.forEach((function(e){o.add(e)})))}})}return r.get(i)}(e)},e}(),na=!1,ra=function(){function e(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw R(15);var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,s=e.documentTransform,c=e.ssrMode,u=void 0!==c&&c,l=e.ssrForceFetchDelay,f=void 0===l?0:l,h=e.connectToDevTools,d=e.queryDeduplication,p=void 0===d||d,v=e.defaultOptions,y=e.defaultContext,m=e.assumeImmutableResults,g=void 0===m?o.assumeImmutableResults:m,b=e.resolvers,E=e.typeDefs,_=e.fragmentMatcher,T=e.name,O=e.version,w=e.devtools,k=e.link;k||(k=n?new yi({uri:n,credentials:r,headers:i}):Zr.empty()),this.link=k,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=p,this.defaultOptions=v||Object.create(null),this.typeDefs=E,this.devtoolsConfig=a(a({},w),{enabled:(null==w?void 0:w.enabled)||h}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=S,this.localState=new ta({cache:o,client:this,resolvers:b,fragmentMatcher:_}),this.queryManager=new ea({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:y,documentTransform:s,queryDeduplication:p,ssrMode:u,clientAwareness:{name:T,version:O},localState:this.localState,assumeImmutableResults:g,onBroadcast:this.devtoolsConfig.enabled?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if("undefined"!=typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,na||!1===globalThis.__DEV__||(na=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout((function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,n=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?n="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(n="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),n&&!1!==globalThis.__DEV__&&D.log("Download the Apollo DevTools for a better development experience: %s",n)}}),1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Wr(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=a(a({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Wr(this.defaultOptions.query,e)),D("cache-and-network"!==e.fetchPolicy,16),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=a(a({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Wr(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return ei(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){!1!==globalThis.__DEV__&&D.debug(17,e)})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(ra.prototype.getMemoryInternals=wt);var ia=new Map,oa=new Map,aa=!0,sa=!1;function ca(e){return e.replace(/[\s,]+/g," ").trim()}function ua(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=ca((a=e.loc).source.body.substring(a.start,a.end)),o=oa.get(r);o&&!o.has(i)?aa&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||oa.set(r,o=new Set),o.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e);var a})),a(a({},e),{definitions:n})}function la(e){var t=ca(e);if(!ia.has(t)){var n=function(e,t){return new De(e,t).parseDocument()}(e,{experimentalFragmentVariables:sa,allowLegacyFragmentVariables:sa});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");ia.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(ua(n)))}return ia.get(t)}function fa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),la(r)}var ha,da,pa,va,ya,ma,ga,ba,Ea,_a,Ta,Sa,Oa,wa,ka,Ia,Na,Aa,Da,Ra,xa,Ca,Fa,La,Pa,Ma,qa=fa,ja=function(){ia.clear(),oa.clear()},Va=function(){aa=!1},Ua=function(){sa=!0},Qa=function(){sa=!1};(ha=fa).gql=qa,ha.resetCaches=ja,ha.disableFragmentWarnings=Va,ha.enableExperimentalFragmentVariables=Ua,ha.disableExperimentalFragmentVariables=Qa,fa.default=fa,function(e){e.PRODUCT="PRODUCT",e.PACKAGE="PACKAGE"}(da||(da={})),function(e){e.OK="OK",e.CUSTOMER_BLACKLISTED="CUSTOMER_BLACKLISTED"}(pa||(pa={})),function(e){e.USER="USER",e.USER_LOGIN="USER_LOGIN",e.USER_LOGOUT="USER_LOGOUT",e.USER_UPDATE="USER_UPDATE",e.USER_DELETE="USER_DELETE",e.CART="CART",e.CART_ADD="CART_ADD",e.CART_REMOVE="CART_REMOVE",e.CART_UPDATE="CART_UPDATE",e.CART_CLEAR="CART_CLEAR",e.SESSION="SESSION",e.SESSION_REFRESH="SESSION_REFRESH",e.SESSION_EXPIRED="SESSION_EXPIRED",e.LIST="LIST",e.LIST_CREATE="LIST_CREATE",e.LIST_DELETE="LIST_DELETE",e.LIST_UPDATE="LIST_UPDATE",e.LIST_ADD_ITEM="LIST_ADD_ITEM",e.LIST_REMOVE_ITEM="LIST_REMOVE_ITEM",e.LIST_CLEAR="LIST_CLEAR"}(va||(va={})),function(e){e.PERSON="PERSON",e.ORGANIZATION="ORGANIZATION"}(ya||(ya={})),function(e){e.NONE="NONE",e.DEBUG="DEBUG",e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(ma||(ma={})),function(e){e.SERVER="server",e.CLIENT="client",e.HYBRID="hybrid"}(ga||(ga={})),function(e){e.follow="follow",e.noopener="noopener",e.noreferrer="noreferrer",e.alternate="alternate",e.author="author",e.bookmark="bookmark",e.external="external",e.help="help",e.license="license",e.next="next",e.nofollow="nofollow",e.prev="prev",e.search="search",e.tag="tag"}(ba||(ba={})),function(e){e.Proxy="Proxy",e.Direct="Direct"}(Ea||(Ea={})),function(e){e.NONE="NONE",e.PRICE="PRICE",e.PRICE_DESC="PRICE_DESC",e.MOST_SOLD="MOST_SOLD",e.VOTES="VOTES",e.BRAND="BRAND",e.LATEST="LATEST",e.RELEVANCE="RELEVANCE",e.FACET_ORDER="FACET_ORDER",e.ALPHABETICAL="ALPHABETICAL",e.ALPHABETICAL_DESC="ALPHABETICAL_DESC",e.AVAILABLE_STOCK="AVAILABLE_STOCK",e.AVAILABLE_STOCK_DESC="AVAILABLE_STOCK_DESC",e.TOTAL_STOCK="TOTAL_STOCK",e.TOTAL_STOCK_DESC="TOTAL_STOCK_DESC"}(_a||(_a={})),function(e){e.BY_GROUP="BY_GROUP",e.CURRENT="CURRENT"}(Ta||(Ta={})),function(e){e.Brand="Brand",e.Category="Category",e.Price="Price",e.Sku="Sku",e.StockStatus="StockStatus",e.DiscountCampaign="DiscountCampaign",e.DiscountCampaignNumber="DiscountCampaignNumber",e.Discount="Discount",e.ReducedPrice="ReducedPrice"}(Sa||(Sa={})),function(e){e.CustomerBlacklistedType="CUSTOMER_BLACKLISTED",e.OkType="OK"}(Oa||(Oa={})),function(e){e.OrganizationType="ORGANIZATION",e.PersonType="PERSON"}(wa||(wa={})),function(e){e.ExternalType="EXTERNAL",e.NoneType="NONE",e.PriceCampaignType="PRICE_CAMPAIGN",e.SalePriceType="SALE_PRICE"}(ka||(ka={})),function(e){e.ByGroupType="BY_GROUP",e.CurrentType="CURRENT"}(Ia||(Ia={})),function(e){e.ManType="MAN",e.UnsetType="UNSET",e.UnspecifiedType="UNSPECIFIED",e.WomanType="WOMAN"}(Na||(Na={})),function(e){e.FemaleType="FEMALE",e.MaleType="MALE",e.UnknownType="UNKNOWN"}(Aa||(Aa={})),function(e){e.IntersectType="INTERSECT",e.UnionType="UNION"}(Da||(Da={})),function(e){e.ExternalType="EXTERNAL",e.GeinsPayType="GEINS_PAY",e.StandardType="STANDARD"}(Ra||(Ra={})),function(e){e.AvardaType="AVARDA",e.GeinsPayType="GEINS_PAY",e.KlarnaType="KLARNA",e.StandardType="STANDARD",e.SveaType="SVEA",e.WalleyType="WALLEY"}(xa||(xa={})),function(e){e.AccessoriesType="ACCESSORIES",e.RelatedType="RELATED",e.SimilarType="SIMILAR"}(Ca||(Ca={})),function(e){e.AlphabeticalType="ALPHABETICAL",e.AlphabeticalDescType="ALPHABETICAL_DESC",e.AvailableStockType="AVAILABLE_STOCK",e.AvailableStockDescType="AVAILABLE_STOCK_DESC",e.BrandType="BRAND",e.Custom_1Type="CUSTOM_1",e.Custom_2Type="CUSTOM_2",e.Custom_3Type="CUSTOM_3",e.Custom_4Type="CUSTOM_4",e.Custom_5Type="CUSTOM_5",e.FacetOrderType="FACET_ORDER",e.LatestType="LATEST",e.MostSoldType="MOST_SOLD",e.NoneType="NONE",e.PriceType="PRICE",e.PriceDescType="PRICE_DESC",e.RelevanceType="RELEVANCE",e.TotalStockType="TOTAL_STOCK",e.TotalStockDescType="TOTAL_STOCK_DESC",e.VotesType="VOTES"}(Fa||(Fa={})),function(e){e[e.PERCENTAGE=0]="PERCENTAGE",e[e.FIXED_AMOUNT=1]="FIXED_AMOUNT"}(La||(La={})),function(e){e.UNSET="unset",e.UNSPECIFIED="unspecified",e.WOMAN="woman",e.MAN="man"}(Pa||(Pa={})),function(e){e.STANDARD="STANDARD",e.EXTERNAL="EXTERNAL",e.GEINS_PAY="GEINS_PAY"}(Ma||(Ma={}));var Ba,za=function(){function e(e,t,n,r,i){var o=this;this.observer=e,this.operation=t,this.forward=n,this.delayFor=r,this.retryIf=i,this.retryCount=0,this.currentSubscription=null,this.onError=function(e){return c(o,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this.retryCount+=1,[4,this.retryIf(this.retryCount,this.operation,e)];case 1:return t.sent()?(this.scheduleRetry(this.delayFor(this.retryCount,this.operation,e)),[2]):(this.observer.error(e),[2])}}))}))},this.try()}return e.prototype.cancel=function(){this.currentSubscription&&this.currentSubscription.unsubscribe(),clearTimeout(this.timerId),this.timerId=void 0,this.currentSubscription=null},e.prototype.try=function(){this.currentSubscription=this.forward(this.operation).subscribe({next:this.observer.next.bind(this.observer),error:this.onError,complete:this.observer.complete.bind(this.observer)})},e.prototype.scheduleRetry=function(e){var t=this;if(this.timerId)throw new Error("RetryLink BUG! Encountered overlapping retries");this.timerId=setTimeout((function(){t.timerId=void 0,t.try()}),e)},e}(),Ka=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.attempts,o=r.delay;return n.delayFor="function"==typeof o?o:function(e){var t=e||{},n=t.initial,r=void 0===n?300:n,i=t.jitter,o=void 0===i||i,a=t.max,s=void 0===a?1/0:a,c=o?r:r/2;return function(e){var t=Math.min(s,c*Math.pow(2,e));return o&&(t=Math.random()*t),t}}(o),n.retryIf="function"==typeof i?i:function(e){var t=e||{},n=t.retryIf,r=t.max,i=void 0===r?5:r;return function(e,t,r){return!(e>=i)&&(n?n(r,t):!!r)}}(i),n}return o(t,e),t.prototype.request=function(e,t){var n=this;return new Nr((function(r){var i=new za(r,e,t,n.delayFor,n.retryIf);return function(){i.cancel()}}))},t}(Zr),Ga={USER:"geins-user",USER_AUTH:"geins-auth",USER_TYPE:"geins-user-type",USER_MAX_AGE:"geins-user-maxage",REFRESH_TOKEN:"geins-auth-refresh-token"},Wa={CART_ID:"geins-cart-id"},Ha={DEFAULT:1800,REMEMBER_USER:604800},Ya={DEFAULT:604800},Ja={ITEMS:"geins-lists"},$a={DEFAULT:2592e3},Xa={main:"https://merchantapi.geins.io/graphql",auth:"https://auth-service.geins.io/api/{ACCOUNT}_{ENV}",auth_sign:"https://merchantapi.geins.io/auth/sign/{API-KEY}?identity=",image:"https://{ACCOUNT}.commerce.services"},Za={REFRESH_TOKEN:"x-auth-refresh-token"},es="x-request-id",ts="x-sdk-version",ns="x-idempotency-key",rs=new Map([["geins-cart","{geins.cartid}"],["geins-pm","{geins.paymentMethodId}"],["geins-pt","{geins.paymentType}"],["geins-uid","{payment.uid}"]]),is={RAW:"raw",THUMB_SM:"40x40",THUMB:"100x100"};function os(){return"object"==typeof globalThis&&!("window"in globalThis)}function as(e,t,n){return void 0===n&&(n="prod"),{main:Xa.main,auth:Xa.auth.replace("{ACCOUNT}",t).replace("{ENV}",n),authSign:Xa.auth_sign.replace("{API-KEY}",e),image:Xa.image.replace("{ACCOUNT}",t)}}function ss(e,t,n){if(e&&"object"==typeof e){var r=e;if(t in r){if(void 0===n)return r;if(r[t]===n)return r}for(var i=0,o=Object.keys(r);i<o.length;i++){var a=ss(r[o[i]],t,n);if(a)return a}}}function cs(e){if(!e)return{url:e,params:new Map};if(!e.includes("?"))return{url:e,params:new Map};var t=e.split("?"),n=t[0],r=t[1];return{url:n,params:new Map(r?r.split("&").map((function(e){return e.split("=")})):[])}}function us(e){return e&&e.message?e.message:""}!function(e){e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TOKEN_EXPIRED="AUTH_TOKEN_EXPIRED",e.AUTH_TOKEN_REFRESH_FAILED="AUTH_TOKEN_REFRESH_FAILED",e.AUTH_NOT_AUTHENTICATED="AUTH_NOT_AUTHENTICATED",e.CART_NOT_FOUND="CART_NOT_FOUND",e.CART_ITEM_NOT_FOUND="CART_ITEM_NOT_FOUND",e.CART_OPERATION_FAILED="CART_OPERATION_FAILED",e.CHECKOUT_FAILED="CHECKOUT_FAILED",e.ORDER_FAILED="ORDER_FAILED",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.NOT_INITIALIZED="NOT_INITIALIZED",e.PARSE_ERROR="PARSE_ERROR",e.GRAPHQL_ERROR="GRAPHQL_ERROR",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.REQUEST_TIMEOUT="REQUEST_TIMEOUT",e.RATE_LIMITED="RATE_LIMITED",e.RETRY_EXHAUSTED="RETRY_EXHAUSTED",e.NETWORK_ERROR="NETWORK_ERROR"}(Ba||(Ba={}));var ls,fs=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.cause=r,i.name="GeinsError",i}return o(t,e),t}(Error);function hs(t,n){if(!t)throw new fs("Token is required.",Ba.INVALID_ARGUMENT);var r=t.split(".");if(3!==r.length&&n||2!==r.length&&!n)throw new fs("Invalid JWT token format.",Ba.PARSE_ERROR);var i=r[0],o=r[1],a=r[2],s=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t);return decodeURIComponent(n.split("").map((function(e){return"%".concat(e.charCodeAt(0).toString(16).padStart(2,"0"))})).join(""))},c=JSON.parse(s(i)),u=JSON.parse(s(o));if(n&&e.createHmac("sha256",n).update("".concat(i,".").concat(o)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")!==a)throw new fs("Invalid token signature.",Ba.AUTH_FAILED);return{header:c,payload:u}}function ds(t,n){if(!t||"object"!=typeof t)throw new fs("Payload must be a valid object.",Ba.INVALID_ARGUMENT);var r=function(e){return btoa(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},i={alg:n?"HS256":"none",typ:"JWT"},o=r(JSON.stringify(i)),a=r(JSON.stringify(t));if(!n)return"".concat(o,".").concat(a);var s=e.createHmac("sha256",n).update("".concat(o,".").concat(a)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return"".concat(o,".").concat(a,".").concat(s)}var ps=function(){function e(e){this.currentLogLevel=e}return e.prototype.shouldLog=function(e){if(this.currentLogLevel===ma.NONE)return!1;var t=[ma.DEBUG,ma.INFO,ma.WARN,ma.ERROR];return t.indexOf(e)>=t.indexOf(this.currentLogLevel)},e.prototype.none=function(e){this.shouldLog(ma.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.debug=function(e){this.shouldLog(ma.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.info=function(e){this.shouldLog(ma.INFO)&&console.info("[INFO]: ".concat(e))},e.prototype.warn=function(e){this.shouldLog(ma.WARN)&&console.warn("[WARN]: ".concat(e))},e.prototype.error=function(e){this.shouldLog(ma.ERROR)&&console.error("[ERROR]: ".concat(e))},e}(),vs="undefined"!=typeof process&&"test"===(null===(ls=process.env)||void 0===ls?void 0:ls.NODE_ENV)?ma.NONE:ma.WARN,ys=new ps(vs),ms=function(){function e(e){void 0===e&&(e=3e5),this.defaultTTL=e,this.cache=new Map}return e.prototype.set=function(e,t,n){void 0===n&&(n=this.defaultTTL);var r=Date.now()+n;this.cache.set(e,{value:t,expiry:r})},e.prototype.get=function(e){var t=this.cache.get(e);if(t&&t.expiry>Date.now())return t.value;this.cache.delete(e)},e.prototype.delete=function(e){this.cache.delete(e)},e.prototype.clear=function(){this.cache.clear()},e}();function gs(e){return d(this,arguments,(function(e,t){var n,r,i,o,a,s,c,l;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=null!==(c=t.take)&&void 0!==c?c:20,r=null!==(l=t.startSkip)&&void 0!==l?l:0,u.label=1;case 1:return[4,h(e(r,n))];case 2:return i=u.sent(),o=i.items,a=i.count,s=r+o.length<a,[4,h({items:o,count:a,hasMore:s,skip:r,take:n})];case 3:return[4,u.sent()];case 4:return u.sent(),s&&0!==o.length?(r+=o.length,[3,1]):[3,5];case 5:return[2]}}))}))}function bs(e){return c(this,arguments,void 0,(function(e,t){var n,r,i,o,a,s,c,l,f,h;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=[],u.label=1;case 1:u.trys.push([1,6,7,12]),r=!0,i=p(gs(e,t)),u.label=2;case 2:return[4,i.next()];case 3:if(o=u.sent(),c=o.done)return[3,5];h=o.value,r=!1,a=h,n.push.apply(n,a.items),u.label=4;case 4:return r=!0,[3,2];case 5:return[3,12];case 6:return s=u.sent(),l={error:s},[3,12];case 7:return u.trys.push([7,,10,11]),r||c||!(f=i.return)?[3,9]:[4,f.call(i)];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:if(l)throw l.error;return[7];case 11:return[7];case 12:return[2,n]}}))}))}function Es(){return new Zr((function(e,t){var n="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),r=Date.now();return e.setContext((function(e){var t,i=e.headers;return{headers:a(a({},void 0===i?{}:i),(t={},t[es]=n,t[ts]="0.5.0",t)),requestId:n,requestStartTime:r}})),t(e)}))}var _s=function(e){function t(t,n,r,i){var o=e.call(this,t,n,i)||this;return o.requestId=r,o.name="NetworkRequestError",o}return o(t,e),t}(fs),Ts=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," timed out after ").concat(n,"ms"),Ba.REQUEST_TIMEOUT,t,r)||this;return i.timeoutMs=n,i.name="TimeoutError",i}return o(t,e),t}(_s),Ss=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," rate limited").concat(n?" (retry after ".concat(n,"ms)"):""),Ba.RATE_LIMITED,t,r)||this;return i.retryAfterMs=n,i.name="RateLimitError",i}return o(t,e),t}(_s),Os=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," failed after ").concat(n," attempts"),Ba.RETRY_EXHAUSTED,t,r)||this;return i.attempts=n,i.name="RetryExhaustedError",i}return o(t,e),t}(_s);var ws,ks,Is=function(){function e(e){var t,n=this;this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[],this._timer=null,this._onMetrics=e.onMetrics;var r=null!==(t=e.flushIntervalMs)&&void 0!==t?t:6e4;this._onMetrics&&r>0&&(this._timer=setInterval((function(){return n.flush()}),r),"object"==typeof this._timer&&"unref"in this._timer&&this._timer.unref())}return e.prototype.recordSuccess=function(e){this._totalRequests++,this._successCount++,this._durations.push(e)},e.prototype.recordError=function(e,t){this._totalRequests++,this._errorCount++,t&&this._timeoutCount++,this._durations.push(e)},e.prototype.recordRetry=function(){this._retryCount++},e.prototype.snapshot=function(){var e=f([],this._durations,!0).sort((function(e,t){return e-t})),t=e.length>0?e.reduce((function(e,t){return e+t}),0)/e.length:0,n=Math.max(0,Math.ceil(.95*e.length)-1),r=e.length>0?e[n]:0;return{totalRequests:this._totalRequests,successCount:this._successCount,errorCount:this._errorCount,timeoutCount:this._timeoutCount,retryCount:this._retryCount,avgDurationMs:Math.round(t),p95DurationMs:r}},e.prototype.flush=function(){this._onMetrics&&this._onMetrics(this.snapshot())},e.prototype.reset=function(){this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[]},e.prototype.destroy=function(){this._timer&&(clearInterval(this._timer),this._timer=null)},e}();!function(e){e.CACHE_FIRST="cache-first",e.NETWORK_ONLY="network-only",e.CACHE_ONLY="cache-only",e.NO_CACHE="no-cache",e.STANDBY="standby"}(ws||(ws={})),function(e){e.QUERY="query",e.MUTATION="mutation"}(ks||(ks={}));var Ns=function(){function e(e){this._telemetry=null,this.fetchPolicy=os()?ws.NO_CACHE:ws.CACHE_FIRST,this.pollInterval=0;var t=e.apiUrl,n=e.apiKey,r=e.fetchPolicy,i=e.settings;this._apolloClient=this.createClient(t,n,i),r&&(this.fetchPolicy=r)}return e.prototype.createClient=function(e,t,n){var r=new qo({typePolicies:{CartType:{fields:{items:{merge:function(e,t){return t}},appliedCampaigns:{merge:function(e,t){return t}}}}}}),i=this.createLinkChain(e,t,n);return new ra({link:i,cache:r})},e.prototype.createLinkChain=function(e,t,n){var r,i,o=null==n?void 0:n.requestConfig,s=[];s.push(Es()),s.push(new Zr((function(e,t){var n=Zt(e.query);return"OperationDefinition"===n.kind&&"mutation"===n.operation&&e.setContext((function(e){var t,n=e.headers;return{headers:a(a({},void 0===n?{}:n),(t={},t[ns]="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),t))}})),t(e)})));var c,u=new ps(null!==(r=null==n?void 0:n.logLevel)&&void 0!==r?r:ma.NONE);s.push(function(e){return new Zr((function(t,n){var r=t.getContext(),i=r.requestId,o=r.requestStartTime,a=t.operationName||"unknown";return e.debug("[".concat(i,"] Starting ").concat(a)),new Nr((function(r){var s=n(t).subscribe({next:function(t){var n=Date.now()-(o||Date.now());e.debug("[".concat(i,"] ").concat(a," completed in ").concat(n,"ms")),r.next(t)},error:function(t){var n=Date.now()-(o||Date.now());e.error("[".concat(i,"] ").concat(a," failed after ").concat(n,"ms: ").concat(t.message)),r.error(t)},complete:function(){r.complete()}});return function(){return s.unsubscribe()}}))}))}(u)),(null==o?void 0:o.interceptors)&&s.push((c=o.interceptors,new Zr((function(e,t){return new Nr((function(n){var r=e.getContext(),i=r.requestId||"unknown",o=r.requestStartTime||Date.now(),s=e.operationName||"unknown",u=function(){var a=t(e).subscribe({next:function(e){if(c.onResponse){var t={requestId:i,operationName:s,durationMs:Date.now()-o,data:e.data};try{c.onResponse(t)}catch(e){}}n.next(e)},error:function(e){if(c.onError){var t={requestId:i,operationName:s,durationMs:Date.now()-o,error:e,retryCount:r.retryCount||0};try{c.onError(t)}catch(e){}}n.error(e)},complete:function(){n.complete()}});return a};if(c.onRequest){var l,f=a({},r.headers||{}),h={requestId:i,operationName:s,headers:f,timestamp:o};try{var d=c.onRequest(h);d&&"function"==typeof d.then?d.then((function(){e.setContext((function(){return a(a({},r),{headers:h.headers})})),l=u()})).catch((function(e){n.error(e)})):(e.setContext((function(){return a(a({},r),{headers:h.headers})})),l=u())}catch(e){return void n.error(e)}return function(){null==l||l.unsubscribe()}}var p=u();return function(){return p.unsubscribe()}}))}))));var l,f=null!==(i=null==o?void 0:o.timeoutMs)&&void 0!==i?i:0;f>0&&s.push(function(e){return new Zr((function(t,n){return e<=0?n(t):new Nr((function(r){var i=!1,o=setTimeout((function(){if(!i){i=!0;var n=t.getContext().requestId;r.error(new Ts(n||"unknown",e))}}),e),a=n(t).subscribe({next:function(e){i||r.next(e)},error:function(e){i||(i=!0,clearTimeout(o),r.error(e))},complete:function(){i||(i=!0,clearTimeout(o),r.complete())}});return function(){i=!0,clearTimeout(o),a.unsubscribe()}}))}))}(f)),(null==o?void 0:o.telemetry)&&(this._telemetry=new Is(o.telemetry),s.push((l=this._telemetry,new Zr((function(e,t){return new Nr((function(n){var r=e.getContext().requestStartTime||Date.now(),i=t(e).subscribe({next:function(e){l.recordSuccess(Date.now()-r),n.next(e)},error:function(e){var t="TimeoutError"===(null==e?void 0:e.name);l.recordError(Date.now()-r,t),n.error(e)},complete:function(){n.complete()}});return function(){return i.unsubscribe()}}))}))))),(null==o?void 0:o.retry)&&s.push(this.createRetryLink(o.retry));var h=vi({uri:e,headers:{Accept:"application/json","x-apikey":t}});return s.push(h),Zr.from(s)},e.prototype.createRetryLink=function(e){var t=e.maxRetries,n=void 0===t?3:t,r=e.initialDelayMs,i=void 0===r?300:r,o=e.maxDelayMs,a=void 0===o?1e4:o,s=e.jitter;return new Ka({delay:{initial:i,max:a,jitter:void 0===s||s},attempts:{max:n+1,retryIf:function(e){var t;if(!e)return!1;var n=e,r=n.response,i=null!==(t=n.statusCode)&&void 0!==t?t:null==r?void 0:r.status;return 429===i||(!i||i>=500)}}})},e.prototype.getClient=function(){return this._apolloClient},Object.defineProperty(e.prototype,"telemetry",{get:function(){return this._telemetry},enumerable:!1,configurable:!0}),e.prototype.clearCacheAndRefetchQueries=function(){this._apolloClient.resetStore()},e.prototype.getFetchPolicy=function(e,t){return e===ks.QUERY?t||this.fetchPolicy:e===ks.MUTATION?ws.NETWORK_ONLY:t===ws.NO_CACHE||t===ws.NETWORK_ONLY?t:ws.NETWORK_ONLY},e.prototype.buildContext=function(e){if(e)return{headers:{Authorization:"Bearer ".concat(e)}}},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,a=t||fa(n||""),s=i||{},[2,this._apolloClient.query({query:a,variables:r,fetchPolicy:this.getFetchPolicy(ks.QUERY,s.fetchPolicy),pollInterval:s.pollInterval||this.pollInterval,context:this.buildContext(o)})]}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,a=t||fa(n||""),s=i||{},[2,this._apolloClient.mutate({mutation:a,variables:r,fetchPolicy:this.getFetchPolicy(ks.MUTATION,s.fetchPolicy),context:this.buildContext(o)})]}))}))},e}(),As=function(){function e(e){this.baseUrl="https://mgmtapi.geins.io",this.apiKey=e.apiKey,this.authToken=this.createAuthToken(e)}return e.prototype.createAuthToken=function(e){return btoa("".concat(e.username,":").concat(e.password))},e.prototype.getEndpointUrl=function(e){return"".concat(this.baseUrl,"/").concat(e)},e.prototype.request=function(t,n){return c(this,arguments,void 0,(function(t,n,r){var i,o;return void 0===r&&(r={}),u(this,(function(s){switch(s.label){case 0:return i=this.getEndpointUrl(n),o={method:t,headers:{Accept:"application/json","Content-Type":"application/json","x-apikey":this.apiKey,Authorization:"Bearer ".concat(this.authToken)},body:JSON.stringify(r)},[4,fetch(i,a(a({},o),{signal:AbortSignal.timeout(e.FETCH_TIMEOUT_MS)})).then((function(e){return e.json()}))];case 1:return[2,s.sent()]}}))}))},e.FETCH_TIMEOUT_MS=1e4,e}(),Ds=function(){function e(e,t){if(this._apiClient=e,!t.channel)throw new fs("Channel is required",Ba.INVALID_ARGUMENT);this._geinsSettings=t,this._channelId="".concat(t.channel,"|").concat(t.tld)}return e.prototype.destroy=function(){this._apiClient=void 0},e.prototype.createVariables=function(e){var t=a({},e);if(delete t.userToken,!t.languageId){if(!this._geinsSettings.locale)throw new fs("Language is required",Ba.INVALID_ARGUMENT);t.languageId=this._geinsSettings.locale}if(!t.marketId){if(!this._geinsSettings.market)throw new fs("Market is required",Ba.INVALID_ARGUMENT);t.marketId=this._geinsSettings.market}return t.channelId||(t.channelId=this._channelId),t},e.prototype.createQueryOptions=function(e,t,n){var r=null!=n?n:{},i=r.userToken,o=s(r,["userToken"]),c=this.createVariables(a(a({},t),o));return a({query:e,variables:c},i?{userToken:i}:{})},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new fs("Merchant API Client is not set",Ba.NOT_INITIALIZED);return[2,this._apiClient().runQuery(e)]}))}))},e.prototype.runQueryParsed=function(e){return c(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return[4,this.runQuery(e)];case 1:return t=r.sent(),n=this.cleanObject(t),[2,this.parseResult(n)]}}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new fs("Merchant API Client is not set",Ba.NOT_INITIALIZED);return[2,this._apiClient().runMutation(e)]}))}))},e.prototype.parseResult=function(e){return e},e.prototype.cleanObject=function(e){var t=this,n=Object.entries(e).reduce((function(e,n){var r=n[0],i=n[1];return r.startsWith("__typename")||(Array.isArray(i)?e[r]=i.map((function(e){return e&&"object"==typeof e?t.cleanObject(e):e})):e[r]=i&&"object"==typeof i?t.cleanObject(i):i),e}),{});return n},e}(),Rs=function(){function e(e){if(this.core=e,!e)throw new fs("Core is required",Ba.NOT_INITIALIZED);if(!e.client)throw new fs("Merchant API Client is not set",Ba.NOT_INITIALIZED);if(!e.geinsSettings)throw new fs("Settings are required",Ba.NOT_INITIALIZED);var t=e.geinsSettings;this._geinsSettings=t,this._apiClient=function(){return e.client}}return e.prototype.pushEvent=function(e,t){var n=t?va[t]:void 0;if(n&&n.includes("_")){var r=n.split("_")[0];this.core.events.push(e,r)}this.core.events.push(e,n)},e.prototype.getCore=function(){return this.core},e}(),xs=function(e){function t(t,n,r){void 0===n&&(n=Ba.AUTH_FAILED);var i=e.call(this,t,n,r)||this;return i.name="AuthError",i}return o(t,e),t}(fs),Cs=function(e){function t(t,n){void 0===t&&(t="Token has expired");var r=e.call(this,t,Ba.AUTH_TOKEN_EXPIRED,n)||this;return r.name="TokenExpiredError",r}return o(t,e),t}(xs),Fs=function(e){function t(t,n){void 0===t&&(t="Token refresh failed");var r=e.call(this,t,Ba.AUTH_TOKEN_REFRESH_FAILED,n)||this;return r.name="TokenRefreshError",r}return o(t,e),t}(xs),Ls=function(e){function t(t,n,r){void 0===n&&(n=Ba.CART_OPERATION_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CartError",i}return o(t,e),t}(fs),Ps=function(e){function t(t,n,r){void 0===n&&(n=Ba.CHECKOUT_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CheckoutError",i}return o(t,e),t}(fs),Ms=function(e){function t(t,n,r){void 0===n&&(n=Ba.ORDER_FAILED);var i=e.call(this,t,n,r)||this;return i.name="OrderError",i}return o(t,e),t}(fs),qs={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ChannelFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChannelType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultLanguageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultMarketId"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};function js(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){js(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){js(e,t)})),e.definitions&&e.definitions.forEach((function(e){js(e,t)}))}qs.loc.source={body:"fragment ChannelFields on ChannelType {\n id\n name\n type\n url\n defaultLanguageId\n defaultMarketId\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Vs={};function Us(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}qs.definitions.forEach((function(e){if(e.name){var t=new Set;js(e,t),Vs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Us(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Vs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(Vs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Us(e,t);r&&n.definitions.push(r)}))}(qs,"ChannelFields");var Qs={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"LanguageFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"LanguageType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:63}};function Bs(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){Bs(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Bs(e,t)})),e.definitions&&e.definitions.forEach((function(e){Bs(e,t)}))}Qs.loc.source={body:"fragment LanguageFields on LanguageType {\n id\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var zs={};function Ks(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Qs.definitions.forEach((function(e){if(e.name){var t=new Set;Bs(e,t),zs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Ks(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=zs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(zs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ks(e,t);r&&n.definitions.push(r)}))}(Qs,"LanguageFields");var Gs={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CurrencyFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CurrencyType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"symbol"},arguments:[],directives:[]}]}}],loc:{start:0,end:60}};function Ws(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){Ws(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Ws(e,t)})),e.definitions&&e.definitions.forEach((function(e){Ws(e,t)}))}Gs.loc.source={body:"fragment CurrencyFields on CurrencyType {\n code\n symbol\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Hs={};function Ys(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Gs.definitions.forEach((function(e){if(e.name){var t=new Set;Ws(e,t),Hs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Ys(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Hs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(Hs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ys(e,t);r&&n.definitions.push(r)}))}(Gs,"CurrencyFields");var Js={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CountryFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CountryType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:56}};function $s(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){$s(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){$s(e,t)})),e.definitions&&e.definitions.forEach((function(e){$s(e,t)}))}Js.loc.source={body:"fragment CountryFields on CountryType {\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Xs={};function Zs(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Js.definitions.forEach((function(e){if(e.name){var t=new Set;$s(e,t),Xs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Zs(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Xs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(Xs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Zs(e,t);r&&n.definitions.push(r)}))}(Js,"CountryFields");var ec={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"MarketFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MarketType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"alias"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"allowedLanguages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CountryFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CurrencyFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"onlyDisplayInCheckout"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtual"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"groupKey"},arguments:[],directives:[]}]}}],loc:{start:0,end:313}};ec.loc.source={body:"#import './currencyFields.gql'\n#import './countryFields.gql'\n#import './languageFields.gql'\nfragment MarketFields on MarketType {\n id\n alias\n allowedLanguages {\n ...LanguageFields\n }\n country {\n ...CountryFields\n }\n currency {\n ...CurrencyFields\n }\n onlyDisplayInCheckout\n virtual\n groupKey\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var tc={};function nc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!tc[t]&&(tc[t]=!0,!0)}))}function rc(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){rc(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){rc(e,t)})),e.definitions&&e.definitions.forEach((function(e){rc(e,t)}))}ec.definitions=ec.definitions.concat(nc(Gs.definitions)),ec.definitions=ec.definitions.concat(nc(Js.definitions)),ec.definitions=ec.definitions.concat(nc(Qs.definitions));var ic={};function oc(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ec.definitions.forEach((function(e){if(e.name){var t=new Set;rc(e,t),ic[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[oc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=ic[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(ic[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=oc(e,t);r&&n.definitions.push(r)}))}(ec,"MarketFields");var ac={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannel"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"channelId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"NullValue"},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channel"},arguments:[{kind:"Argument",name:{kind:"Name",value:"channelId"},value:{kind:"Variable",name:{kind:"Name",value:"channelId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:358}};ac.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannel($channelId: String = null) {\n channel(channelId: $channelId) {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var sc={};function cc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!sc[t]&&(sc[t]=!0,!0)}))}function uc(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){uc(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){uc(e,t)})),e.definitions&&e.definitions.forEach((function(e){uc(e,t)}))}ac.definitions=ac.definitions.concat(cc(qs.definitions)),ac.definitions=ac.definitions.concat(cc(Qs.definitions)),ac.definitions=ac.definitions.concat(cc(ec.definitions)),ac.definitions=ac.definitions.concat(cc(Gs.definitions));var lc={};function fc(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ac.definitions.forEach((function(e){if(e.name){var t=new Set;uc(e,t),lc[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[fc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=lc[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(lc[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=fc(e,t);r&&n.definitions.push(r)}))}(ac,"getChannel");var hc={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannels"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channels"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:310}};hc.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannels {\n channels {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var dc={};function pc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!dc[t]&&(dc[t]=!0,!0)}))}function vc(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){vc(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){vc(e,t)})),e.definitions&&e.definitions.forEach((function(e){vc(e,t)}))}hc.definitions=hc.definitions.concat(pc(qs.definitions)),hc.definitions=hc.definitions.concat(pc(Qs.definitions)),hc.definitions=hc.definitions.concat(pc(ec.definitions)),hc.definitions=hc.definitions.concat(pc(Gs.definitions));var yc={};function mc(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}hc.definitions.forEach((function(e){if(e.name){var t=new Set;vc(e,t),yc[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[mc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=yc[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(yc[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=mc(e,t);r&&n.definitions.push(r)}))}(hc,"getChannels");var gc={channels:hc,channel:ac};function bc(e){if(!e||!e.id)throw new fs("Invalid result structure for channel",Ba.PARSE_ERROR);return{id:e.id,name:e.name,type:e.type,url:e.url,defaultMarketId:e.defaultMarketId,defaultLanguageId:e.defaultLanguageId,markets:e.markets?e.markets.filter((function(e){return null!=e})).map((function(e){return{id:(t=e).id,alias:t.alias,allowedLanguages:t.allowedLanguages?t.allowedLanguages.filter((function(e){return null!=e})).map((function(e){return _c(e)})):[],country:t.country?Ec(t.country):{name:"",code:""},currency:t.currency?Tc(t.currency):{code:"",symbol:"",name:"",rate:0},onlyDisplayInCheckout:t.onlyDisplayInCheckout,virtual:t.virtual,groupKey:t.groupKey,defaultLanguageId:t.defaultLanguageId};var t})):[],languages:e.languages?e.languages.filter((function(e){return null!=e})).map((function(e){return _c(e)})):[]}}function Ec(e){return{name:e.name,code:e.code}}function _c(e){return{id:e.id,name:e.name,code:e.code}}function Tc(e){return{code:e.code,symbol:e.symbol,name:e.name,rate:e.rate}}var Sc,Oc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new ms(9e5),r}return o(t,e),t.prototype.get=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return t="channel_".concat(e),(n=this.cache.get(t))?[2,n]:(r={query:gc.channel,variables:{channelId:e}},[4,this.runQueryParsed(r)]);case 1:return(i=o.sent())&&this.cache.set(t,i),[2,i]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new fs("Invalid result structure for channel",Ba.PARSE_ERROR);var t=e.data.channel;if(t)return bc(t);ys.warn("No channel found")}(e)},t}(Ds),wc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new ms(18e5),r}return o(t,e),t.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(i){switch(i.label){case 0:return e="all_channels",(t=this.cache.get(e))?[2,t]:(n={query:gc.channels,variables:{}},[4,this.runQueryParsed(n)]);case 1:return(r=i.sent())&&this.cache.set(e,r),[2,r]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new fs("Invalid result structure for channels",Ba.PARSE_ERROR);var t=e.data.channels;if(t&&0!==t.length)return t.map((function(e){return bc(e)})).filter((function(e){return void 0!==e}));ys.warn("No channel found")}(e)},t}(Ds),kc=function(){function e(e){this.path="/",this.domain="",this.secure=!0,this.httpOnly=!0,this.sameSite="lax",this.cookie=t(),this.maxAge=0,e&&(e.path&&(this.path=e.path),e.domain&&(this.domain=e.domain),void 0!==e.secure&&(this.secure=e.secure),void 0!==e.httpOnly&&(this.httpOnly=e.httpOnly),void 0!==e.sameSite&&(this.sameSite=e.sameSite),void 0!==e.maxAge&&(this.maxAge=this.parseMaxAge(e.maxAge)))}return e.prototype.getConfig=function(){return{path:this.path,domain:this.domain,secure:this.secure,httpOnly:this.httpOnly,sameSite:this.sameSite,maxAge:this.maxAge}},e.prototype.parseMaxAge=function(e){if("string"==typeof e){var t=parseInt(e,10);return isNaN(t)?0:t}return e},e.prototype.configToCookieOptions=function(e){return{path:e.path,domain:e.domain,secure:e.secure,httpOnly:e.httpOnly,sameSite:e.sameSite,maxAge:void 0!==e.maxAge?this.parseMaxAge(e.maxAge):void 0}},e.prototype.getAll=function(){return this.cookie.getAll()},e.prototype.get=function(e){return this.cookie.get(e)||""},e.prototype.remove=function(e){this.cookie.remove(e)},e.prototype.set=function(e,t){var n=this.getConfig(),r=a(a(a({},n),t),e),i=this.configToCookieOptions(r);this.cookie.set(e.name,e.payload,i)},e}(),Ic=function(){function e(e){this._cookieService=null!=e?e:new kc}return e.prototype.get=function(e){return this._cookieService.get(e)||void 0},e.prototype.set=function(e,t,n){this._cookieService.set({name:e,payload:t,maxAge:null==n?void 0:n.maxAge})},e.prototype.remove=function(e){this._cookieService.remove(e)},e}(),Nc={exports:{}};var Ac,Dc=(Sc||(Sc=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||i&&!s[c].once||r&&s[c].context!==r)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(Nc)),Nc.exports),Rc=eo(Dc),xc=function(){function e(){this.eventName="geins-event",this.emitter=new Rc,this.broadcastChannelId="geins-channel",os()||(this.broadcast=new n(this.broadcastChannelId),this.addBroadcastListener())}return e.prototype.addBroadcastListener=function(){var e=this;this.broadcast&&(this.broadcast.onmessage=function(t){var n=t;e.emitter.emit(n.eventName,n.eventMessage)})},e.prototype.listenerAdd=function(e,t){void 0===t&&(t=this.eventName),this.emitter.on(t,e)},e.prototype.listenerOnce=function(e,t){void 0===t&&(t=this.eventName),this.emitter.once(t,e)},e.prototype.listenerRemove=function(e){void 0===e&&(e=this.eventName),this.emitter.removeAllListeners(e)},e.prototype.listenerCount=function(e){return void 0===e&&(e=this.eventName),this.emitter.listenerCount(e)},e.prototype.listenersGet=function(e){return void 0===e&&(e=this.eventName),this.emitter.listeners(e)},e.prototype.push=function(e,t){var n;void 0===t&&(t=this.eventName),this.emitter.emit(t,e),(null===(n=e.broadcast)||void 0===n||n)&&this.broadcast&&this.broadcast.postMessage({eventMessage:e,eventName:t})},e}(),Cc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.log_to_console=!1,r}return o(t,e),t.prototype.verifyQueryOptions=function(e){var t,n,r,i,o=a({},e);if(!e.query&&!e.queryAsString)throw new fs("Query or queryAsString is required",Ba.INVALID_ARGUMENT);try{e.queryAsString&&!e.query&&(o.query=fa(e.queryAsString))}catch(e){throw new fs("Error parsing string to query",Ba.PARSE_ERROR,e)}var s=o.query,c=s.definitions[0];if(!(c&&"OperationDefinition"===c.kind&&(null!==(n=null===(t=c.variableDefinitions)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0))return o;o.variables=this.createVariables(null!==(r=o.variables)&&void 0!==r?r:{});var u=(null===(i=s.definitions[0].variableDefinitions)||void 0===i?void 0:i.map((function(e){return e.variable.name.value})))||[];return Object.keys(o.variables).forEach((function(e){u.includes(e)||delete o.variables[e]})),o},t.prototype.query=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,this.verifyQueryOptions(e)];case 1:return t=i.sent(),(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&ys.debug("[Geins] queryOptions: ".concat(JSON.stringify(t))),[4,this.runQuery(t)];case 2:return n=i.sent(),r=this.cleanObject(n),[2,this.parseResult(r)]}}))}))},t.prototype.mutation=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&ys.debug("[Geins] mutation options: ".concat(JSON.stringify(e))),[4,this.runMutation(e)];case 1:return t=n.sent(),[2,this.parseResult(t)]}}))}))},t.prototype.parseResult=function(e){var t=e;if(null==t?void 0:t.data)return t.data;if(null==t?void 0:t.errors)throw new fs("GraphQL errors",Ba.GRAPHQL_ERROR,t.errors);return null},t}(Ds),Fc=function(){function e(){this._store=new Map}return e.prototype.get=function(e){return this._store.get(e)},e.prototype.set=function(e,t,n){this._store.set(e,t)},e.prototype.remove=function(e){this._store.delete(e)},e.prototype.clear=function(){this._store.clear()},e}();!function(e){e[e.INIT=0]="INIT",e[e.FETCHING=1]="FETCHING",e[e.READY=2]="READY",e[e.ERROR=3]="ERROR"}(Ac||(Ac={}));var Lc=function(){function e(){this.initStore()}return e.prototype.initStore=function(){this.store=new r({stdTTL:86400,checkperiod:17280,useClones:!1})},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){return void 0!==this.store&&this.store.set(e,t),[2]}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0!==this.store?[2,this.store.get(e)]:[2,null]}))}))},e.prototype.getKeys=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0===this.store?[2,[]]:[2,this.store.keys()]}))}))},e.prototype.deleteKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return void 0===this.store?[3,2]:[4,this.store.del(e)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.hasKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0===this.store?[2,!1]:[2,this.store.has(e)]}))}))},e.prototype.clearStore=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0!==this.store&&(this.store.flushAll(),this.store.close()),[2]}))}))},e.prototype.destroy=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.clearStore()];case 1:return e.sent(),this.store=void 0,[2]}}))}))},e}(),Pc=function(){function e(e){if(this.geinsSettings=e,!e.channel)throw new fs("Channel is required",Ba.INVALID_ARGUMENT);if(!e.apiKey)throw new fs("API Key is required",Ba.INVALID_ARGUMENT);this.store=new Lc,this.channelId="".concat(e.channel,"|").concat(e.tld),this.cache=new ms(36e5),this.initApiClient()}return e.prototype.initApiClient=function(){if(!this.geinsSettings.apiKey||!this.geinsSettings.accountName)throw new fs("API Key and Account Name are required",Ba.INVALID_ARGUMENT);var e={apiUrl:as(this.geinsSettings.apiKey,this.geinsSettings.accountName,this.geinsSettings.environment).main,apiKey:this.geinsSettings.apiKey,requestOptions:{fetchPolicy:ws.CACHE_FIRST}};this._apiClient=function(){return new Ns(e)}},e.prototype.initChannelService=function(){var e=this;this.channelService=new Oc((function(){return e._apiClient()}),this.geinsSettings)},e.prototype.setKey=function(e,t){if(!this.store)throw new fs("Store is not initialized",Ba.NOT_INITIALIZED);this.store.setKey(e,t)},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this.store)throw new fs("Store is not initialized",Ba.NOT_INITIALIZED);return[2,this.store.getKey(e)]}))}))},e.prototype.setChannel=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return this.channelService||(this._apiClient||this.initApiClient(),this.initChannelService()),[4,null===(t=this.channelService)||void 0===t?void 0:t.get(this.channelId)];case 1:return(e=n.sent())&&this.cache.set(this.channelId,e),[2,e]}}))}))},e.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return(e=this.cache.get(this.channelId))?[2,e]:[4,this.setChannel()];case 1:return[2,null!=(t=n.sent())?t:void 0]}}))}))},e}(),Mc=function(){function e(e){if(!e.channel)throw new fs("Channel is required",Ba.INVALID_ARGUMENT);if(!e.apiKey)throw new fs("API Key is required",Ba.INVALID_ARGUMENT);if(!e.accountName)throw new fs("Account name is required",Ba.INVALID_ARGUMENT);this._geinsSettings=a(a({},{environment:"prod"}),e),this._geinsSettings.apiKey&&this._geinsSettings.accountName&&(this._endpointsUrls=as(this._geinsSettings.apiKey,this._geinsSettings.accountName,this._geinsSettings.environment)),os()||(this._cookieService=new kc),this._currentChannel=new Pc(this._geinsSettings),this._eventService=new xc}return e.prototype.initApiClient=function(){if(!this._geinsSettings.apiKey||!this._geinsSettings.accountName)throw new fs("Failed to initialize API Client",Ba.NOT_INITIALIZED);var e={apiUrl:this._endpointsUrls.main,apiKey:this._geinsSettings.apiKey,settings:this._geinsSettings};this._apiClient=new Ns(e)},e.prototype.initGraphQLService=function(){var e=this;this._graphQLService=new Cc((function(){return e.client}),this._geinsSettings)},Object.defineProperty(e.prototype,"channel",{get:function(){return{current:this.channelGet.bind(this),all:this.channelsGet.bind(this)}},enumerable:!1,configurable:!0}),e.prototype.channelGet=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){if(this._currentChannel||(this._currentChannel=new Pc(this._geinsSettings)),!this._currentChannel)throw new fs("Failed to initialize channel",Ba.NOT_INITIALIZED);return[2,null!==(t=null===(e=this._currentChannel)||void 0===e?void 0:e.get())&&void 0!==t?t:void 0]}))}))},e.prototype.channelsGet=function(){return c(this,void 0,void 0,(function(){var e,t=this;return u(this,(function(n){return this._accountChannels||(this._accountChannels=new wc((function(){return t.client}),this._geinsSettings)),[2,null!==(e=this._accountChannels.get())&&void 0!==e?e:void 0]}))}))},Object.defineProperty(e.prototype,"endpoints",{get:function(){if(!this._endpointsUrls)throw new fs("Endpoints are not set",Ba.NOT_INITIALIZED);return this._endpointsUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"client",{get:function(){if(!this._endpointsUrls)throw new fs("Endpoints are not set",Ba.NOT_INITIALIZED);return this._apiClient||this.initApiClient(),this._apiClient},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"graphql",{get:function(){return this._graphQLService||this.initGraphQLService(),this._graphQLService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geinsSettings",{get:function(){return this._geinsSettings},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this._eventService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cookies",{get:function(){return this._cookieService||(this._cookieService=new kc),this._cookieService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"telemetry",{get:function(){var e,t;return null!==(t=null===(e=this._apiClient)||void 0===e?void 0:e.telemetry)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),e.encodeJWT=function(e,t){return ds(e,t)},e.decodeJWT=function(e,t){return hs(e,t).payload},e}();function qc(e,t,n,r){return e&&r?"".concat(e,"/").concat(t,"/").concat(n,"/").concat(encodeURIComponent(r)):""}function jc(e,t,n){return qc(e,t,is.RAW,n)}function Vc(e,t,n){return qc(e,t,is.THUMB,n)}export{Za as AUTH_HEADERS,Ga as AUTH_STORAGE_KEYS,Ha as AUTH_STORAGE_MAX_AGE,Ea as AuthClientConnectionModes,xs as AuthError,Ds as BaseApiService,Rs as BasePackage,Wa as CART_STORAGE_KEYS,Ya as CART_STORAGE_MAX_AGE,rs as CHECKOUT_PARAMETERS,Ls as CartError,Pc as Channel,Ps as CheckoutError,kc as CookieService,Ic as CookieStorageAdapter,ya as CustomerType,La as DiscountType,xc as EventService,ws as FetchPolicyOptions,Sa as FilterSystemEntityTypes,is as GEINS_IMAGE_FOLDER,Oa as GeinsCheckoutStatus,Mc as GeinsCore,wa as GeinsCustomerType,ka as GeinsDiscountType,fs as GeinsError,Ba as GeinsErrorCode,va as GeinsEventType,Ia as GeinsFilterMode,Na as GeinsGender,Aa as GeinsGenderType,Da as GeinsIncludeMode,ma as GeinsLogLevel,Ra as GeinsPaymentCheckout,xa as GeinsPaymentType,Ca as GeinsProductRelation,Fa as GeinsSortType,Pa as Gender,Cc as GraphQLService,da as ItemType,Ja as LISTS_STORAGE_KEYS,$a as LISTS_STORAGE_MAX_AGE,ba as LinkAttributeRelEnum,ps as Logger,As as ManagementApiClient,Fc as MemoryStorage,Ns as MerchantApiClient,_s as NetworkRequestError,ks as OperationType,Ms as OrderError,Ma as PaymentOptionCheckoutType,Ta as ProductFilterModeType,_a as ProductListSortType,Ss as RateLimitError,Os as RetryExhaustedError,ga as RuntimeContext,Is as TelemetryCollector,Ts as TimeoutError,Cs as TokenExpiredError,Fs as TokenRefreshError,as as buildEndpoints,qc as buildGeinsImageUrl,jc as buildGeinsRawUrl,Vc as buildGeinsThumbnailUrl,hs as decodeJWT,ds as encodeJWT,cs as extractParametersFromUrl,ss as findObjectWithProperty,fa as gql,os as isServerContext,gs as paginate,bs as paginateAll,us as parseErrorMessage,ys as sdkLogger};
1
+ import e from"crypto";import t from"cookie-universal";import{BroadcastChannel as n}from"broadcast-channel";import{NodeCache as r}from"@cacheable/node-cache";var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function h(e){return this instanceof h?(this.v=e,this):new h(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof h?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function c(e){s("next",e)}function u(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function p(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=l(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var v="Invariant Violation",y=Object.setPrototypeOf,m=void 0===y?function(e,t){return e.__proto__=t,e}:y,g=function(e){function t(n){void 0===n&&(n=v);var r=e.call(this,"number"==typeof n?v+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=v,m(r,t.prototype),r}return o(t,e),t}(Error);function b(e,t){if(!e)throw new g(t)}var E=["debug","log","warn","error","silent"],_=E.indexOf("log");function T(e){return function(){if(E.indexOf(e)>=_)return(console[e]||console.log).apply(console,arguments)}}!function(e){e.debug=T("debug"),e.log=T("log"),e.warn=T("warn"),e.error=T("error")}(b);var S="3.11.8";function O(e){try{return e()}catch(e){}}var w=O((function(){return globalThis}))||O((function(){return window}))||O((function(){return self}))||O((function(){return global}))||O((function(){return O.constructor("return this")()})),k=new Map;function I(e){var t=k.get(e)||1;return k.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function N(e,t){void 0===t&&(t=0);var n=I("stringifyForDisplay");return JSON.stringify(e,(function(e,t){return void 0===t?n:t}),t).split(JSON.stringify(n)).join("<undefined>")}function A(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if("number"==typeof t){var i=t;(t=F(i))||(t=L(i,n),n=[])}e.apply(void 0,[t].concat(n))}}var D=Object.assign((function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];e||b(e,F(t,n)||L(t,n))}),{debug:A(b.debug),log:A(b.log),warn:A(b.warn),error:A(b.error)});function R(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new g(F(e,t)||L(e,t))}var x=Symbol.for("ApolloErrorMessageHandler_"+S);function C(e){if("string"==typeof e)return e;try{return N(e,2).slice(0,1e3)}catch(e){return"<non-serializable>"}}function F(e,t){if(void 0===t&&(t=[]),e)return w[x]&&w[x](e,t.map(C))}function L(e,t){if(void 0===t&&(t=[]),e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:S,message:e,args:t.map(C)})))}function P(e,t){if(!Boolean(e))throw new Error(t)}function M(e,t){if(!Boolean(e))throw new Error("Unexpected invariant triggered.")}const q=/\r\n|[\n\r]/g;function j(e,t){let n=0,r=1;for(const i of e.body.matchAll(q)){if("number"==typeof i.index||M(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function V(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,c=t.column+s,u=`${e.name}:${a}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<f.length;e+=80)n.push(f.slice(e,e+80));return u+U([[`${a} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+U([[a-1+" |",l[i-1]],[`${a} |`,f],["|","^".padStart(c)],[`${a+1} |`,l[i+1]]])}function U(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class Q extends Error{constructor(e,...t){var n,r,i;const{nodes:o,source:a,positions:s,path:c,originalError:u,extensions:l}=function(e){const 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!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=B(Array.isArray(o)?o:o?[o]:void 0);const f=B(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=a?a:null==f||null===(r=f[0])||void 0===r?void 0:r.source,this.positions=null!=s?s:null==f?void 0:f.map((e=>e.start)),this.locations=s&&a?s.map((e=>j(a,e))):null==f?void 0:f.map((e=>j(e.source,e.start)));const h="object"==typeof(d=null==u?void 0:u.extensions)&&null!==d?null==u?void 0:u.extensions:void 0;var d;this.extensions=null!==(i=null!=l?l:h)&&void 0!==i?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!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Q):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(const n of this.nodes)n.loc&&(e+="\n\n"+V((t=n.loc).source,j(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+V(this.source,t);var t;return e}toJSON(){const 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 B(e){return void 0===e||0===e.length?void 0:e}function z(e,t,n){return new Q(`Syntax Error: ${n}`,{source:e,positions:[t]})}class K{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class G{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,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}}}const W={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]},H=new Set(Object.keys(W));function Y(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&H.has(t)}var J,$,X,Z;function ee(e){return 9===e||32===e}function te(e){return e>=48&&e<=57}function ne(e){return e>=97&&e<=122||e>=65&&e<=90}function re(e){return ne(e)||95===e}function ie(e){return ne(e)||te(e)||95===e}function oe(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],s=ae(a);s!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,i=t,0!==t&&s<n&&(n=s))}return e.map(((e,t)=>0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function ae(e){let t=0;for(;t<e.length&&ee(e.charCodeAt(t));)++t;return t}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(J||(J={})),function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}($||($={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(X||(X={})),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(Z||(Z={}));class se{constructor(e){const t=new G(Z.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(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Z.EOF)do{if(e.next)e=e.next;else{const t=pe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Z.COMMENT);return e}}function ce(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ue(e,t){return le(e.charCodeAt(t))&&fe(e.charCodeAt(t+1))}function le(e){return e>=55296&&e<=56319}function fe(e){return e>=56320&&e<=57343}function he(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Z.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function de(e,t,n,r,i){const o=e.line,a=1+n-e.lineStart;return new G(t,n,r,o,a,i)}function pe(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.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===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return ve(e,i);case 33:return de(e,Z.BANG,i,i+1);case 36:return de(e,Z.DOLLAR,i,i+1);case 38:return de(e,Z.AMP,i,i+1);case 40:return de(e,Z.PAREN_L,i,i+1);case 41:return de(e,Z.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return de(e,Z.SPREAD,i,i+3);break;case 58:return de(e,Z.COLON,i,i+1);case 61:return de(e,Z.EQUALS,i,i+1);case 64:return de(e,Z.AT,i,i+1);case 91:return de(e,Z.BRACKET_L,i,i+1);case 93:return de(e,Z.BRACKET_R,i,i+1);case 123:return de(e,Z.BRACE_L,i,i+1);case 124:return de(e,Z.PIPE,i,i+1);case 125:return de(e,Z.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?Oe(e,i):ge(e,i)}if(te(t)||45===t)return ye(e,i,t);if(re(t))return we(e,i);throw z(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":ce(t)||ue(n,i)?`Unexpected character: ${he(e,i)}.`:`Invalid character: ${he(e,i)}.`)}return de(e,Z.EOF,r,r)}function ve(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(ce(e))++i;else{if(!ue(n,i))break;i+=2}}return de(e,Z.COMMENT,t,i,n.slice(t+1,i))}function ye(e,t,n){const r=e.source.body;let i=t,o=n,a=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),te(o))throw z(e.source,i,`Invalid number, unexpected digit after 0: ${he(e,i)}.`)}else i=me(e,i,o),o=r.charCodeAt(i);if(46===o&&(a=!0,o=r.charCodeAt(++i),i=me(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=me(e,i,o),o=r.charCodeAt(i)),46===o||re(o))throw z(e.source,i,`Invalid number, expected digit but got: ${he(e,i)}.`);return de(e,a?Z.FLOAT:Z.INT,t,i,r.slice(t,i))}function me(e,t,n){if(!te(n))throw z(e.source,t,`Invalid number, expected digit but got: ${he(e,t)}.`);const r=e.source.body;let i=t+1;for(;te(r.charCodeAt(i));)++i;return i}function ge(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,a="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return a+=n.slice(o,i),de(e,Z.STRING,t,i+1,a);if(92!==r){if(10===r||13===r)break;if(ce(r))++i;else{if(!ue(n,i))throw z(e.source,i,`Invalid character within String: ${he(e,i)}.`);i+=2}}else{a+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?be(e,i):Ee(e,i):Se(e,i);a+=t.value,i+=t.size,o=i}}throw z(e.source,i,"Unterminated string.")}function be(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!ce(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Te(e),r<0)break}throw z(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Ee(e,t){const n=e.source.body,r=_e(n,t+2);if(ce(r))return{value:String.fromCodePoint(r),size:6};if(le(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=_e(n,t+8);if(fe(e))return{value:String.fromCodePoint(r,e),size:12}}throw z(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function _e(e,t){return Te(e.charCodeAt(t))<<12|Te(e.charCodeAt(t+1))<<8|Te(e.charCodeAt(t+2))<<4|Te(e.charCodeAt(t+3))}function Te(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Se(e,t){const n=e.source.body;switch(n.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:"\t",size:2}}throw z(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Oe(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,a=o,s="";const c=[];for(;o<r;){const r=n.charCodeAt(o);if(34===r&&34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)){s+=n.slice(a,o),c.push(s);const r=de(e,Z.BLOCK_STRING,t,o+3,oe(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(o+1)||34!==n.charCodeAt(o+2)||34!==n.charCodeAt(o+3))if(10!==r&&13!==r)if(ce(r))++o;else{if(!ue(n,o))throw z(e.source,o,`Invalid character within String: ${he(e,o)}.`);o+=2}else s+=n.slice(a,o),c.push(s),13===r&&10===n.charCodeAt(o+1)?o+=2:++o,s="",a=o,i=o;else s+=n.slice(a,o),a=o+1,o+=4}throw z(e.source,o,"Unterminated string.")}function we(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!ie(n.charCodeAt(i)))break;++i}return de(e,Z.NAME,t,i,n.slice(t,i))}function ke(e){return Ie(e,[])}function Ie(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){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:Ie(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(Ie(e[r],t));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Ie(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ne=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=ke(e);throw new Error(`Cannot use ${r} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Ae{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||P(!1,`Body must be a string. Received: ${ke(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class De{constructor(e,t={}){const n=function(e){return Ne(e,Ae)}(e)?e:new Ae(e);this._lexer=new se(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Z.NAME);return this.node(e,{kind:X.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:X.DOCUMENT,definitions:this.many(Z.SOF,this.parseDefinition,Z.EOF)})}parseDefinition(){if(this.peek(Z.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Z.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()}if(e)throw z(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Z.BRACE_L))return this.node(e,{kind:X.OPERATION_DEFINITION,operation:J.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(Z.NAME)&&(n=this.parseName()),this.node(e,{kind:X.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Z.NAME);switch(e.value){case"query":return J.QUERY;case"mutation":return J.MUTATION;case"subscription":return J.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Z.PAREN_L,this.parseVariableDefinition,Z.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:X.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Z.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Z.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Z.DOLLAR),this.node(e,{kind:X.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:X.SELECTION_SET,selections:this.many(Z.BRACE_L,this.parseSelection,Z.BRACE_R)})}parseSelection(){return this.peek(Z.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Z.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:X.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Z.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Z.PAREN_L,t,Z.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Z.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Z.NAME)?this.node(e,{kind:X.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:X.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:X.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:X.FRAGMENT_DEFINITION,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){const t=this._lexer.token;switch(t.kind){case Z.BRACKET_L:return this.parseList(e);case Z.BRACE_L:return this.parseObject(e);case Z.INT:return this.advanceLexer(),this.node(t,{kind:X.INT,value:t.value});case Z.FLOAT:return this.advanceLexer(),this.node(t,{kind:X.FLOAT,value:t.value});case Z.STRING:case Z.BLOCK_STRING:return this.parseStringLiteral();case Z.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:X.BOOLEAN,value:!0});case"false":return this.node(t,{kind:X.BOOLEAN,value:!1});case"null":return this.node(t,{kind:X.NULL});default:return this.node(t,{kind:X.ENUM,value:t.value})}case Z.DOLLAR:if(e){if(this.expectToken(Z.DOLLAR),this._lexer.token.kind===Z.NAME){const e=this._lexer.token.value;throw z(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(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:X.STRING,value:e.value,block:e.kind===Z.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:X.LIST,values:this.any(Z.BRACKET_L,(()=>this.parseValueLiteral(e)),Z.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:X.OBJECT,fields:this.any(Z.BRACE_L,(()=>this.parseObjectField(e)),Z.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Z.COLON),this.node(t,{kind:X.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Z.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Z.AT),this.node(t,{kind:X.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Z.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Z.BRACKET_R),t=this.node(e,{kind:X.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(Z.BANG)?this.node(e,{kind:X.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:X.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Z.STRING)||this.peek(Z.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);return this.node(e,{kind:X.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Z.COLON);const n=this.parseNamedType();return this.node(e,{kind:X.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:X.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:X.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Z.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseFieldDefinition,Z.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Z.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:X.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Z.PAREN_L,this.parseInputValueDef,Z.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Z.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(Z.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:X.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:X.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:X.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Z.EQUALS)?this.delimitedMany(Z.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:X.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Z.BRACE_L,this.parseEnumValueDefinition,Z.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:X.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw z(this._lexer.source,this._lexer.token.start,`${Re(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:X.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Z.BRACE_L,this.parseInputValueDef,Z.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Z.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(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(Z.BRACE_L,this.parseOperationTypeDefinition,Z.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:X.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:X.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:X.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:X.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:X.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:X.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:X.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Z.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:X.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Z.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call($,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new K(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw z(this._lexer.source,t.start,`Expected ${xe(e)}, found ${Re(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Z.NAME||t.value!==e)throw z(this._lexer.source,t.start,`Expected "${e}", found ${Re(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Z.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return z(this._lexer.source,t.start,`Unexpected ${Re(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==Z.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw z(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Re(e){const t=e.value;return xe(e.kind)+(null!=t?` "${t}"`:"")}function xe(e){return function(e){return e===Z.BANG||e===Z.DOLLAR||e===Z.AMP||e===Z.PAREN_L||e===Z.PAREN_R||e===Z.SPREAD||e===Z.COLON||e===Z.EQUALS||e===Z.AT||e===Z.BRACKET_L||e===Z.BRACKET_R||e===Z.BRACE_L||e===Z.PIPE||e===Z.BRACE_R}(e)?`"${e}"`:e}const Ce=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Fe(e){return Le[e.charCodeAt(0)]}const Le=["\\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"],Pe=Object.freeze({});function Me(e,t,n=W){const r=new Map;for(const e of Object.values(X))r.set(e,qe(t,e));let i,o,a,s=Array.isArray(e),c=[e],u=-1,l=[],f=e;const h=[],d=[];do{u++;const e=u===c.length,m=e&&0!==l.length;if(e){if(o=0===d.length?void 0:h[h.length-1],f=a,a=d.pop(),m)if(s){f=f.slice();let e=0;for(const[t,n]of l){const r=t-e;null===n?(f.splice(r,1),e++):f[r]=n}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}u=i.index,c=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?u:c[u],f=a[o],null==f)continue;h.push(o)}let g;if(!Array.isArray(f)){var p,v;Y(f)||P(!1,`Invalid AST Node: ${ke(f)}.`);const n=e?null===(p=r.get(f.kind))||void 0===p?void 0:p.leave:null===(v=r.get(f.kind))||void 0===v?void 0:v.enter;if(g=null==n?void 0:n.call(t,f,o,a,h,d),g===Pe)break;if(!1===g){if(!e){h.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!Y(g)){h.pop();continue}f=g}}var y;if(void 0===g&&m&&l.push([o,f]),e)h.pop();else i={inArray:s,index:u,keys:c,edits:l,prev:i},s=Array.isArray(f),c=s?f:null!==(y=n[f.kind])&&void 0!==y?y:[],u=-1,l=[],a&&d.push(a),a=f}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function qe(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}const je={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ve(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Qe("(",Ve(e.variableDefinitions,", "),")"),n=Ve([e.operation,Ve([e.name,t]),Ve(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Qe(" = ",n)+Qe(" ",Ve(r," "))},SelectionSet:{leave:({selections:e})=>Ue(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Qe("",e,": ")+t;let a=o+Qe("(",Ve(n,", "),")");return a.length>80&&(a=o+Qe("(\n",Be(Ve(n,"\n")),"\n)")),Ve([a,Ve(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Qe(" ",Ve(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ve(["...",Qe("on ",e),Ve(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Qe("(",Ve(n,", "),")")} on ${t} ${Qe("",Ve(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e){const t=e.replace(/"""/g,'\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||ee(e.charCodeAt(0)))),o=t.endsWith('\\"""'),a=e.endsWith('"')&&!o,s=e.endsWith("\\"),c=a||s,u=!r||e.length>70||c||i||o;let l="";const f=r&&ee(e.charCodeAt(0));return(u&&!f||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(Ce,Fe)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Ve(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Ve(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Qe("(",Ve(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Qe("",e,"\n")+Ve(["schema",Ve(t," "),Ue(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ve(["scalar",t,Ve(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ve(["type",t,Qe("implements ",Ve(n," & ")),Ve(r," "),Ue(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Qe("",e,"\n")+t+(ze(n)?Qe("(\n",Be(Ve(n,"\n")),"\n)"):Qe("(",Ve(n,", "),")"))+": "+r+Qe(" ",Ve(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Qe("",e,"\n")+Ve([t+": "+n,Qe("= ",r),Ve(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qe("",e,"\n")+Ve(["interface",t,Qe("implements ",Ve(n," & ")),Ve(r," "),Ue(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Qe("",e,"\n")+Ve(["union",t,Ve(n," "),Qe("= ",Ve(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Qe("",e,"\n")+Ve(["enum",t,Ve(n," "),Ue(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Qe("",e,"\n")+Ve([t,Ve(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Qe("",e,"\n")+Ve(["input",t,Ve(n," "),Ue(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Qe("",e,"\n")+"directive @"+t+(ze(n)?Qe("(\n",Be(Ve(n,"\n")),"\n)"):Qe("(",Ve(n,", "),")"))+(r?" repeatable":"")+" on "+Ve(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ve(["extend schema",Ve(e," "),Ue(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ve(["extend scalar",e,Ve(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ve(["extend type",e,Qe("implements ",Ve(t," & ")),Ve(n," "),Ue(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Ve(["extend interface",e,Qe("implements ",Ve(t," & ")),Ve(n," "),Ue(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ve(["extend union",e,Ve(t," "),Qe("= ",Ve(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ve(["extend enum",e,Ve(t," "),Ue(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ve(["extend input",e,Ve(t," "),Ue(n)]," ")}};function Ve(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function Ue(e){return Qe("{\n",Be(Ve(e,"\n")),"\n}")}function Qe(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Be(e){return Qe(" ",e.replace(/\n/g,"\n "))}function ze(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function Ke(e){return e.kind===X.FIELD||e.kind===X.FRAGMENT_SPREAD||e.kind===X.INLINE_FRAGMENT}function Ge(e,t){var n=e.directives;return!n||!n.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var n=e.arguments,r=e.name.value;D(n&&1===n.length,71,r);var i=n[0];D(i.name&&"if"===i.name.value,72,r);var o=i.value;D(o&&("Variable"===o.kind||"BooleanValue"===o.kind),73,r),t.push({directive:e,ifArgument:i})}}));return t}(n).every((function(e){var n=e.directive,r=e.ifArgument,i=!1;return"Variable"===r.value.kind?(i=t&&t[r.value.name.value],D(void 0!==i,70,n.name.value)):i=r.value.value,"skip"===n.name.value?!i:i}))}function We(e,t,n){var r=new Set(e),i=r.size;return Me(t,{Directive:function(e){if(r.delete(e.name.value)&&(!n||!r.size))return Pe}}),n?!r.size:r.size<i}function He(e){return e&&We(["client","export"],e,!0)}const Ye=()=>Object.create(null),{forEach:Je,slice:$e}=Array.prototype,{hasOwnProperty:Xe}=Object.prototype;let Ze=class e{constructor(e=!0,t=Ye){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Je.call(e,(e=>t=t.getChildTrie(e))),Xe.call(t,"data")?t.data:t.data=this.makeData($e.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray($e.call(e,1)),i.data||i.weak||i.strong&&i.strong.size||r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}};var et="ReactNative"==O((function(){return navigator.product})),tt="function"==typeof WeakMap&&!(et&&!global.HermesInternal),nt="function"==typeof WeakSet,rt="function"==typeof Symbol&&"function"==typeof Symbol.for,it=rt&&Symbol.asyncIterator;function ot(e){return null!==e&&"object"==typeof e}function at(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw R(74,e.operation,e.name?" named '".concat(e.name.value,"'"):"");"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(D(1===r.length,75,r.length),n=r[0].name.value),a(a({},e),{definitions:f([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions,!0)})}function st(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function ct(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var n=e.name.value;if("function"==typeof t)return t(n);var r=t&&t[n];return D(r,76,n),r||null;default:return null}}function ut(){}O((function(){return window.document.createElement})),O((function(){return navigator.userAgent.indexOf("jsdom")>=0}));class lt{constructor(e=1/0,t=ut){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}function ft(){}const ht=ft,dt="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},pt="undefined"!=typeof WeakMap?WeakMap:Map,vt="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:ft,unregister:ft}};class yt{constructor(e=1/0,t=ht){this.max=e,this.dispose=t,this.map=new pt,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new dt(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new vt(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var mt=new WeakSet;function gt(e){e.size<=(e.max||-1)||mt.has(e)||(mt.add(e),setTimeout((function(){e.clean(),mt.delete(e)}),100))}var bt=function(e,t){var n=new yt(e,t);return n.set=function(e,t){var n=yt.prototype.set.call(this,e,t);return gt(this),n},n},Et=function(e,t){var n=new lt(e,t);return n.set=function(e,t){var n=lt.prototype.set.call(this,e,t);return gt(this),n},n},_t=Symbol.for("apollo.cacheSize"),Tt=a({},w[_t]),St={};function Ot(e,t){St[e]=t}var wt=!1!==globalThis.__DEV__?function(){var e,t,n,r,i;if(!1===globalThis.__DEV__)throw new Error("only supported in development mode");return{limits:Object.fromEntries(Object.entries({parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4}).map((function(e){var t=e[0],n=e[1];return[t,Tt[t]||n]}))),sizes:a({print:null===(e=St.print)||void 0===e?void 0:e.call(St),parser:null===(t=St.parser)||void 0===t?void 0:t.call(St),canonicalStringify:null===(n=St.canonicalStringify)||void 0===n?void 0:n.call(St),links:Ct(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Rt(this.queryManager.documentTransform)}},null===(i=(r=this.cache).getMemoryInternals)||void 0===i?void 0:i.call(r))}}:void 0,kt=!1!==globalThis.__DEV__?function(){var e=this.config.fragments;return a(a({},Nt.apply(this)),{addTypenameDocumentTransform:Rt(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:At(this.storeReader.executeSelectionSet),executeSubSelectedArray:At(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:At(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:At(null==e?void 0:e.findFragmentSpreads),lookup:At(null==e?void 0:e.lookup),transform:At(null==e?void 0:e.transform)}})}:void 0,It=!1!==globalThis.__DEV__?Nt:void 0;function Nt(){return{cache:{fragmentQueryDocuments:At(this.getFragmentDoc)}}}function At(e){return function(e){return!!e&&"dirtyKey"in e}(e)?e.size:void 0}function Dt(e){return null!=e}function Rt(e){return xt(e).map((function(e){return{cache:e}}))}function xt(e){return e?f(f([At(null==e?void 0:e.performWork)],xt(null==e?void 0:e.left),!0),xt(null==e?void 0:e.right),!0).filter(Dt):[]}function Ct(e){var t;return e?f(f([null===(t=null==e?void 0:e.getMemoryInternals)||void 0===t?void 0:t.call(e)],Ct(null==e?void 0:e.left),!0),Ct(null==e?void 0:e.right),!0).filter(Dt):[]}var Ft,Lt=Object.assign((function(e){return JSON.stringify(e,Pt)}),{reset:function(){Ft=new Et(Tt.canonicalStringify||1e3)}});function Pt(e,t){if(t&&"object"==typeof t){var n=Object.getPrototypeOf(t);if(n===Object.prototype||null===n){var r=Object.keys(t);if(r.every(Mt))return t;var i=JSON.stringify(r),o=Ft.get(i);if(!o){r.sort();var a=JSON.stringify(r);o=Ft.get(a)||r,Ft.set(i,o),Ft.set(a,o)}var s=Object.create(n);return o.forEach((function(e){s[e]=t[e]})),s}}return t}function Mt(e,t,n){return 0===t||n[t-1]<=e}function qt(e){return{__ref:String(e)}}function jt(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function Vt(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var i={};n.fields.map((function(e){return Vt(i,e.name,e.value,r)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(n)){var o=(r||{})[n.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map((function(e){var n={};return Vt(n,t,e,r),n[t.value]}));else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw R(85,t.value,n.kind);e[t.value]=null}}!1!==globalThis.__DEV__&&Ot("canonicalStringify",(function(){return Ft.size})),Lt.reset();var Ut=["connection","include","skip","client","rest","export","nonreactive"],Qt=Lt,Bt=Object.assign((function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),"".concat(n.connection.key,"(").concat(Qt(i),")")}return n.connection.key}var o=e;if(t){var a=Qt(t);o+="(".concat(a,")")}return n&&Object.keys(n).forEach((function(e){-1===Ut.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(Qt(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=Qt;return Qt=e,t}});function zt(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return Vt(n,r,i,t)})),n}return null}function Kt(e){return e.alias?e.alias.value:e.name.value}function Gt(e,t,n){for(var r,i=0,o=t.selections;i<o.length;i++){if(Wt(c=o[i])){if("__typename"===c.name.value)return e[Kt(c)]}else r?r.push(c):r=[c]}if("string"==typeof e.__typename)return e.__typename;if(r)for(var a=0,s=r;a<s.length;a++){var c,u=Gt(e,ct(c=s[a],n).selectionSet,n);if("string"==typeof u)return u}}function Wt(e){return"Field"===e.kind}function Ht(e){D(e&&"Document"===e.kind,77);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw R(78,e.kind);return e}));return D(t.length<=1,79,t.length),e}function Yt(e){return Ht(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function Jt(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&!!e.name})).map((function(e){return e.name.value}))[0]||null}function $t(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function Xt(e){var t=Yt(e);return D(t&&"query"===t.operation,80),t}function Zt(e){var t;Ht(e);for(var n=0,r=e.definitions;n<r.length;n++){var i=r[n];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw R(84)}function en(e){var t=Object.create(null),n=e&&e.variableDefinitions;return n&&n.length&&n.forEach((function(e){e.defaultValue&&Vt(t,e.variable.name,e.defaultValue)})),t}const tn=()=>Object.create(null),{forEach:nn,slice:rn}=Array.prototype,{hasOwnProperty:on}=Object.prototype;class an{constructor(e=!0,t=tn){this.weakness=e,this.makeData=t}lookup(...e){return this.lookupArray(e)}lookupArray(e){let t=this;return nn.call(e,(e=>t=t.getChildTrie(e))),on.call(t,"data")?t.data:t.data=this.makeData(rn.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=this.weakness&&sn(e[n])?t.weak:t.strong;t=r&&r.get(e[n])}return t&&t.data}getChildTrie(e){const t=this.weakness&&sn(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=t.get(e);return n||t.set(e,n=new an(this.weakness,this.makeData)),n}}function sn(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}let cn=null;const un={};let ln=1;function fn(e){try{return e()}catch(e){}}const hn="@wry/context:Slot",dn=fn((()=>globalThis))||fn((()=>global))||Object.create(null),pn=dn[hn]||Array[hn]||function(e){try{Object.defineProperty(dn,hn,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ln++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=cn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===un)break;return e!==cn&&(cn.slots[this.id]=t),!0}return cn&&(cn.slots[this.id]=un),!1}getValue(){if(this.hasValue())return cn.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},o=cn;cn={parent:o,slots:i};try{return t.apply(r,n)}finally{cn=o}}static bind(e){const t=cn;return function(){const n=cn;try{return cn=t,e.apply(this,arguments)}finally{cn=n}}}static noContext(e,t,n){if(!cn)return e.apply(n,t);{const r=cn;try{return cn=null,e.apply(n,t)}finally{cn=r}}}}),vn=new pn,{hasOwnProperty:yn}=Object.prototype,mn=Array.from||function(e){const t=[];return e.forEach((e=>t.push(e))),t};function gn(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const bn=[];function En(e,t){if(!e)throw new Error(t||"assertion failure")}function _n(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function Tn(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Sn(e){return e.slice(0)}class On{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++On.count}peek(){if(1===this.value.length&&!In(this))return wn(this),this.value[0]}recompute(e){return En(!this.recomputing,"already recomputing"),wn(this),In(this)?function(e,t){Fn(e),vn.withValue(e,kn,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{gn(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,In(e))return;An(e)}(e);return Tn(e.value)}(this,e):Tn(this.value)}setDirty(){this.dirty||(this.dirty=!0,Nn(this),gn(this))}dispose(){this.setDirty(),Fn(this),Dn(this,((e,t)=>{e.setDirty(),Ln(e,this)}))}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=bn.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(mn(this.deps).forEach((e=>e.delete(this))),this.deps.clear(),bn.push(this.deps),this.deps=null)}}function wn(e){const t=vn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),In(e)?Rn(t,e):xn(t,e),t}function kn(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=Sn(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!_n(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(e){}}catch(t){e.value[1]=t}e.recomputing=!1}function In(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Nn(e){Dn(e,Rn)}function An(e){Dn(e,xn)}function Dn(e,t){const n=e.parents.size;if(n){const r=mn(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function Rn(e,t){En(e.childValues.has(t)),En(In(t));const n=!In(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=bn.pop()||new Set;e.dirtyChildren.add(t),n&&Nn(e)}function xn(e,t){En(e.childValues.has(t)),En(!In(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,Sn(t.value)):_n(n,t.value)||e.setDirty(),Cn(e,t),In(e)||An(e)}function Cn(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(bn.length<100&&bn.push(n),e.dirtyChildren=null))}function Fn(e){e.childValues.size>0&&e.childValues.forEach(((t,n)=>{Ln(e,n)})),e.forgetDeps(),En(null===e.dirtyChildren)}function Ln(e,t){t.parents.delete(e),e.childValues.delete(t),Cn(e,t)}On.count=0;const Pn={setDirty:!0,dispose:!0,forget:!0};function Mn(e){const t=new Map;function n(e){const n=vn.getValue();if(n){let r=t.get(e);r||t.set(e,r=new Set),n.dependOn(r)}}return n.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&yn.call(Pn,n)?n:"setDirty";mn(r).forEach((e=>e[i]())),t.delete(e),gn(r)}},n}let qn;function jn(...e){return(qn||(qn=new an("function"==typeof WeakMap))).lookupArray(e)}const Vn=new Set;function Un(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=jn,normalizeResult:i,subscribe:o,cache:a=lt}=Object.create(null)){const s="function"==typeof a?new a(t,(e=>e.dispose())):a,c=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let a=s.get(t);a||(s.set(t,a=new On(e)),a.normalizeResult=i,a.subscribe=o,a.forget=()=>s.delete(t));const c=a.recompute(Array.prototype.slice.call(arguments));return s.set(t,a),Vn.add(s),vn.hasValue()||(Vn.forEach((e=>e.clean())),Vn.clear()),c};function u(e){const t=e&&s.get(e);t&&t.setDirty()}function l(e){const t=e&&s.get(e);if(t)return t.peek()}function f(e){return!!e&&s.delete(e)}return Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:o,cache:s}),c.dirtyKey=u,c.dirty=function(){u(r.apply(null,arguments))},c.peekKey=l,c.peek=function(){return l(r.apply(null,arguments))},c.forgetKey=f,c.forget=function(){return f(r.apply(null,arguments))},c.makeCacheKey=r,c.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(c)}function Qn(e){return e}var Bn,zn=function(){function e(e,t){void 0===t&&(t=Object.create(null)),this.resultCache=nt?new WeakSet:new Set,this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}return e.prototype.getCacheKey=function(e){return[e]},e.identity=function(){return new e(Qn,{cache:!1})},e.split=function(t,n,r){return void 0===r&&(r=e.identity()),Object.assign(new e((function(e){return(t(e)?n:r).transformDocument(e)}),{cache:!1}),{left:n,right:r})},e.prototype.resetCache=function(){var t=this;if(this.cached){var n=new Ze(tt);this.performWork=Un(e.prototype.performWork.bind(this),{makeCacheKey:function(e){var r=t.getCacheKey(e);if(r)return D(Array.isArray(r),69),n.lookupArray(r)},max:Tt["documentTransform.cache"],cache:yt})}},e.prototype.performWork=function(e){return Ht(e),this.transform(e)},e.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var t=this.performWork(e);return this.resultCache.add(t),t},e.prototype.concat=function(t){var n=this;return Object.assign(new e((function(e){return t.transformDocument(n.transformDocument(e))}),{cache:!1}),{left:this,right:t})},e}(),Kn=Object.assign((function(e){var t=Bn.get(e);return t||(t=function(e){return Me(e,je)}(e),Bn.set(e,t)),t}),{reset:function(){Bn=new bt(Tt.print||2e3)}});Kn.reset(),!1!==globalThis.__DEV__&&Ot("print",(function(){return Bn?Bn.size:0}));var Gn=Array.isArray;function Wn(e){return Array.isArray(e)&&e.length>0}var Hn={kind:X.FIELD,name:{kind:X.NAME,value:"__typename"}};function Yn(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===X.FRAGMENT_SPREAD&&Yn(t[e.name.value],t)}))}function Jn(e){return Yn(Yt(e)||function(e){D("Document"===e.kind,81),D(e.definitions.length<=1,82);var t=e.definitions[0];return D("FragmentDefinition"===t.kind,83),t}(e),st($t(e)))?null:e}function $n(e){var t=new Map;return function(n){void 0===n&&(n=e);var r=t.get(n);return r||t.set(n,r={variables:new Set,fragmentSpreads:new Set}),r}}function Xn(e,t){Ht(t);for(var n=$n(""),r=$n(""),i=function(e){for(var t=0,i=void 0;t<e.length&&(i=e[t]);++t)if(!Gn(i)){if(i.kind===X.OPERATION_DEFINITION)return n(i.name&&i.name.value);if(i.kind===X.FRAGMENT_DEFINITION)return r(i.name.value)}return!1!==globalThis.__DEV__&&D.error(86),null},o=0,s=t.definitions.length-1;s>=0;--s)t.definitions[s].kind===X.OPERATION_DEFINITION&&++o;var c=function(e){var t=new Map,n=new Map;return e.forEach((function(e){e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))})),function(e){var r=t.get(e.name.value);return!r&&n.size&&n.forEach((function(t,n){n(e)&&(r=t)})),r}}(e),u=function(e){return Wn(e)&&e.map(c).some((function(e){return e&&e.remove}))},l=new Map,f=!1,h={enter:function(e){if(u(e.directives))return f=!0,null}},d=Me(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,n,r,o){var a=i(o);a&&a.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,n,r,o){if(u(e.directives))return f=!0,null;var a=i(o);a&&a.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,n,r){l.set(JSON.stringify(r),e)},leave:function(e,t,n,i){return e===l.get(JSON.stringify(i))?e:o>0&&e.selectionSet.selections.every((function(e){return e.kind===X.FIELD&&"__typename"===e.name.value}))?(r(e.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(e){if(c(e))return f=!0,null}}});if(!f)return t;var p=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){p(r(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},v=new Set;d.definitions.forEach((function(e){e.kind===X.OPERATION_DEFINITION?p(n(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){v.add(e)})):e.kind!==X.FRAGMENT_DEFINITION||0!==o||r(e.name.value).removed||v.add(e.name.value)})),v.forEach((function(e){p(r(e)).fragmentSpreads.forEach((function(e){v.add(e)}))}));var y={enter:function(e){if(t=e.name.value,!v.has(t)||r(t).removed)return null;var t}};return Jn(Me(d,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return a(a({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var Zn=Object.assign((function(e){return Me(e,{SelectionSet:{enter:function(e,t,n){if(!n||n.kind!==X.OPERATION_DEFINITION){var r=e.selections;if(r)if(!r.some((function(e){return Wt(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Wt(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return a(a({},e),{selections:f(f([],r,!0),[Hn],!1)})}}}}})}),{added:function(e){return e===Hn}});function er(e){return"query"===Zt(e).operation?e:Me(e,{OperationDefinition:{enter:function(e){return a(a({},e),{operation:"query"})}}})}function tr(e){return Ht(e),Xn([{test:function(e){return"client"===e.name.value},remove:!0}],e)}var nr=Object.prototype.hasOwnProperty;function rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ir(e)}function ir(e){var t=e[0]||{},n=e.length;if(n>1)for(var r=new ar,i=1;i<n;++i)t=r.merge(t,e[i]);return t}var or=function(e,t,n){return this.merge(e[n],t[n])},ar=function(){function e(e){void 0===e&&(e=or),this.reconciler=e,this.isObject=ot,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var n=this,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return ot(t)&&ot(e)?(Object.keys(t).forEach((function(i){if(nr.call(e,i)){var o=e[i];if(t[i]!==o){var a=n.reconciler.apply(n,f([e,t,i],r,!1));a!==o&&((e=n.shallowCopyForMerge(e))[i]=a)}}else(e=n.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return ot(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):a({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function sr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cr(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ur(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lr(e,t,n){return t&&ur(e.prototype,t),n&&ur(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var fr=function(){return"function"==typeof Symbol},hr=function(e){return fr()&&Boolean(Symbol[e])},dr=function(e){return hr(e)?Symbol[e]:"@@"+e};fr()&&!hr("observable")&&(Symbol.observable=Symbol("observable"));var pr=dr("iterator"),vr=dr("observable"),yr=dr("species");function mr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function gr(e){var t=e.constructor;return void 0!==t&&null===(t=t[yr])&&(t=void 0),void 0!==t?t:Nr}function br(e){return e instanceof Nr}function Er(e){Er.log?Er.log(e):setTimeout((function(){throw e}))}function _r(e){Promise.resolve().then((function(){try{e()}catch(e){Er(e)}}))}function Tr(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=mr(t,"unsubscribe");n&&n.call(t)}}catch(e){Er(e)}}function Sr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Or(e,t,n){e._state="running";var r=e._observer;try{var i=mr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(Sr(e),!i)throw n;i.call(r,n);break;case"complete":Sr(e),i&&i.call(r)}}catch(e){Er(e)}"closed"===e._state?Tr(e):"running"===e._state&&(e._state="ready")}function wr(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void _r((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Or(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Or(e,t,n);e._queue.push({type:t,value:n})}}var kr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new Ir(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(Sr(this),Tr(this))},lr(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),Ir=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){wr(this._subscription,"next",e)},t.error=function(e){wr(this._subscription,"error",e)},t.complete=function(){wr(this._subscription,"complete")},lr(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Nr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new kr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(gr(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(gr(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=gr(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=gr(this);return new i((function(t){var r,o=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=gr(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[vr]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=mr(t,vr);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return br(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(hr("iterator")&&(r=mr(t,pr)))return new n((function(e){_r((function(){if(!e.closed){for(var n,i=sr(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){_r((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){_r((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},lr(e,null,[{key:yr,get:function(){return this}}]),e}();fr()&&Object.defineProperty(Nr,Symbol("extensions"),{value:{symbol:vr,hostReportError:Er},configurable:!0}),function(e){var t,n=e.Symbol;if("function"==typeof n)if(n.observable)t=n.observable;else{t="function"==typeof n.for?n.for("https://github.com/benlesh/symbol-observable"):n("https://github.com/benlesh/symbol-observable");try{n.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")());var Ar=Nr.prototype,Dr="@@observable";Ar[Dr]||(Ar[Dr]=function(){return this});var Rr=Object.prototype.toString;function xr(e){return Cr(e)}function Cr(e,t){switch(Rr.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=Cr(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=Cr(e[n],t)})),r;default:return e}}function Fr(e){var t=new Set([e]);return t.forEach((function(e){ot(e)&&function(e){if(!1!==globalThis.__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(n){ot(e[n])&&t.add(e[n])}))})),e}function Lr(e){return!1!==globalThis.__DEV__&&Fr(e),e}function Pr(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Mr(e,t,n){return new Nr((function(r){var i={then:function(e){return new Promise((function(t){return t(e())}))}};function o(e,t){return function(n){if(e){var o=function(){return r.closed?0:e(n)};i=i.then(o,o).then((function(e){return r.next(e)}),(function(e){return r.error(e)}))}else r[t](n)}}var a={next:o(t,"next"),error:o(n,"error"),complete:function(){i.then((function(){return r.complete()}))}},s=e.subscribe(a);return function(){return s.unsubscribe()}}))}function qr(e){function t(t){Object.defineProperty(e,t,{value:Nr})}return rt&&Symbol.species&&t(Symbol.species),t("@@species"),e}function jr(e){return e&&"function"==typeof e.then}var Vr=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],n.notify("next",e),Pr(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),n.notify("error",e),Pr(n.observers,"error",e))},complete:function(){var e=n,t=e.sub,r=e.sources;if(null!==t){var i=(void 0===r?[]:r).shift();i?jr(i)?i.then((function(e){return n.sub=e.subscribe(n.handlers)}),n.handlers.error):n.sub=i.subscribe(n.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),Pr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.error(e)},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new Nr(t)]),jr(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return o(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var n=this.nextResultListeners;n.size&&(this.nextResultListeners=new Set,n.forEach((function(n){return n(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(n,r){t||(t=!0,e(n,r))}))},t}(Nr);function Ur(e){return"incremental"in e}function Qr(e){return ot(e)&&"payload"in e}function Br(e,t){var n=e,r=new ar;return Ur(t)&&Wn(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var a=i[o],s=!isNaN(+a)?[]:{};s[a]=t,t=s}n=r.merge(n,t)})),n}function zr(e){return Wn(Kr(e))}function Kr(e){var t=Wn(e.errors)?e.errors.slice(0):[];return Ur(e)&&Wn(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}function Gr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)}))})),n}function Wr(e,t){return Gr(e,t,t.variables&&{variables:Gr(a(a({},e&&e.variables),t.variables))})}function Hr(e){return new Nr((function(t){t.error(e)}))}qr(Vr);var Yr=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r};function Jr(e,t){return t?t(e):Nr.of()}function $r(e){return"function"==typeof e?new Zr(e):e}function Xr(e){return e.request.length<=1}var Zr=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Nr.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map($r).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var i,o=$r(n),a=$r(r||new e(Jr));return i=Xr(o)&&Xr(a)?new e((function(e){return t(e)?o.request(e)||Nr.of():a.request(e)||Nr.of()})):new e((function(e,n){return t(e)?o.request(e,n)||Nr.of():a.request(e,n)||Nr.of()})),Object.assign(i,{left:o,right:a})},e.execute=function(e,t){return e.request(function(e,t){var n=a({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=a(a({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return a({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Jt(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(t.indexOf(i)<0)throw R(44,i)}return e}(t))))||Nr.of()},e.concat=function(t,n){var r=$r(t);if(Xr(r))return!1!==globalThis.__DEV__&&D.warn(36,r),r;var i,o=$r(n);return i=Xr(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||Nr.of()}))||Nr.of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||Nr.of()}))||Nr.of()})),Object.assign(i,{left:r,right:o})},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(Jr)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw R(37)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),ei=Zr.execute;function ti(e){var t=null,n=null,r=!1,i=[],o=[];function a(e){if(!n){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function s(e){n=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function c(){r=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",s),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",a),e.on("error",s),e.on("end",c),e.on("finish",c),e.on("close",c);var u={next:function(){return new Promise((function(e,t){return n?t(n):i.length?e({value:i.shift(),done:!1}):r?e({value:void 0,done:!0}):void o.push([e,t])}))}};return it&&(u[Symbol.asyncIterator]=function(){return this}),u}function ni(e){var t={next:function(){return e.read()}};return it&&(t[Symbol.asyncIterator]=function(){return this}),t}function ri(e){var t,n,r,i=e;if(e.body&&(i=e.body),function(e){return!(!it||!e[Symbol.asyncIterator])}(i))return function(e){var t,n=e[Symbol.asyncIterator]();return(t={next:function(){return n.next()}})[Symbol.asyncIterator]=function(){return this},t}(i);if(function(e){return!!e.getReader}(i))return ni(i.getReader());if(function(e){return!!e.stream}(i))return ni(i.stream().getReader());if(function(e){return!!e.arrayBuffer}(i))return t=i.arrayBuffer(),n=!1,r={next:function(){return n?Promise.resolve({value:void 0,done:!0}):(n=!0,new Promise((function(e,n){t.then((function(t){e({value:t,done:!1})})).catch(n)})))}},it&&(r[Symbol.asyncIterator]=function(){return this}),r;if(function(e){return!!e.pipe}(i))return ti(i);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ii=Symbol();function oi(e){return e.hasOwnProperty("graphQLErrors")}var ai=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.protocolErrors,s=n.clientErrors,c=n.networkError,u=n.errorMessage,l=n.extraInfo,h=e.call(this,u)||this;return h.name="ApolloError",h.graphQLErrors=o||[],h.protocolErrors=a||[],h.clientErrors=s||[],h.networkError=c||null,h.message=u||(i=f(f(f([],(r=h).graphQLErrors,!0),r.clientErrors,!0),r.protocolErrors,!0),r.networkError&&i.push(r.networkError),i.map((function(e){return ot(e)&&e.message||"Error message not found."})).join("\n")),h.extraInfo=l,h.cause=f(f(f([c],o||[],!0),a||[],!0),s||[],!0).find((function(e){return!!e}))||null,h.__proto__=t.prototype,h}return o(t,e),t}(Error),si=Object.prototype.hasOwnProperty;function ci(e){var t={};return e.split("\n").forEach((function(e){var n=e.indexOf(":");if(n>-1){var r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}})),t}function ui(e,t){if(e.status>=300){Yr(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(r){var n=r;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}var li=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=R(40,t,e.message);throw r.parseError=e,r}return n},fi={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},hi=function(e,t){return t(e)};function di(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},o={};n.forEach((function(e){i=a(a(a({},i),e.options),{headers:a(a({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),o=a(a({},o),e.http)})),i.headers&&(i.headers=function(e,t){if(!t){var n={};return Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]=e[t]})),n}var r={};Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]={originalName:t,value:e[t]}}));var i={};return Object.keys(r).forEach((function(e){i[r[e].originalName]=r[e].value})),i}(i.headers,o.preserveHeaderCase));var s=e.operationName,c=e.extensions,u=e.variables,l=e.query,f={operationName:s,variables:u};return o.includeExtensions&&(f.extensions=c),o.includeQuery&&(f.query=t(l,Kn)),{options:i,body:f}}var pi=O((function(){return fetch})),vi=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.print,o=void 0===i?hi:i,l=e.includeExtensions,f=e.preserveHeaderCase,h=e.useGETForQueries,d=e.includeUnusedVariables,p=void 0!==d&&d,v=s(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);!1!==globalThis.__DEV__&&function(e){if(!e&&"undefined"==typeof fetch)throw R(38)}(r||pi);var y={http:{includeExtensions:l,preserveHeaderCase:f},options:v.fetchOptions,credentials:v.credentials,headers:v.headers};return new Zr((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),i=e.getContext(),s={};if(i.clientAwareness){var l=i.clientAwareness,f=l.name,d=l.version;f&&(s["apollographql-client-name"]=f),d&&(s["apollographql-client-version"]=d)}var v=a(a({},s),i.headers),m={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:v};if(We(["client"],e.query)){var g=tr(e.query);if(!g)return Hr(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));e.query=g}var b,E,_,T,S,w=di(e,o,fi,y,m),k=w.options,I=w.body;I.variables&&!p&&(I.variables=(b=I.variables,E=e.query,_=a({},b),T=new Set(Object.keys(b)),Me(E,{Variable:function(e,t,n){n&&"VariableDefinition"!==n.kind&&T.delete(e.name.value)}}),T.forEach((function(e){delete _[e]})),_)),k.signal||"undefined"==typeof AbortController||(S=new AbortController,k.signal=S.signal);var N,A="OperationDefinition"===(N=Zt(e.query)).kind&&"subscription"===N.operation,R=We(["defer"],e.query);if(h&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(k.method="GET"),R||A){k.headers=k.headers||{};var x="multipart/mixed;";A&&R&&!1!==globalThis.__DEV__&&D.warn(39),A?x+="boundary=graphql;subscriptionSpec=1.0,application/json":R&&(x+="deferSpec=20220824,application/json"),k.headers.accept=x}if("GET"===k.method){var C=function(e,t){var n=[],r=function(e,t){n.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&r("query",t.query),t.operationName&&r("operationName",t.operationName),t.variables){var i=void 0;try{i=li(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",i)}if(t.extensions){var o=void 0;try{o=li(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",o)}var a="",s=e,c=e.indexOf("#");-1!==c&&(a=e.substr(c),s=e.substr(0,c));var u=-1===s.indexOf("?")?"?":"&";return{newURI:s+u+n.join("&")+a}}(t,I),F=C.newURI,L=C.parseError;if(L)return Hr(L);t=F}else try{k.body=li(I,"Payload")}catch(L){return Hr(L)}return new Nr((function(n){var i=r||O((function(){return fetch}))||pi,o=n.next.bind(n);return i(t,k).then((function(t){var n;e.setContext({response:t});var r,i=null===(n=t.headers)||void 0===n?void 0:n.get("content-type");return null!==i&&/^multipart\/mixed/i.test(i)?function(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o,s,c,l,f,h,d,p,v,y,m,g,b,E,_,T,S,O,w,k,I;return u(this,(function(u){switch(u.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=null===(I=e.headers)||void 0===I?void 0:I.get("content-type"),i="boundary=",o=(null==r?void 0:r.includes(i))?null==r?void 0:r.substring((null==r?void 0:r.indexOf(i))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",s="\r\n--".concat(o),c="",l=ri(e),f=!0,u.label=1;case 1:return f?[4,l.next()]:[3,3];case 2:for(h=u.sent(),d=h.value,p=h.done,v="string"==typeof d?d:n.decode(d),y=c.length-s.length+1,f=!p,m=(c+=v).indexOf(s,y);m>-1;){if(g=void 0,w=[c.slice(0,m),c.slice(m+s.length)],c=w[1],b=(g=w[0]).indexOf("\r\n\r\n"),E=ci(g.slice(0,b)),(_=E["content-type"])&&-1===_.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(T=g.slice(b))if(S=ui(e,T),Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S||"payload"in S)if(Qr(S)){if(O={},"payload"in S){if(1===Object.keys(S).length&&null===S.payload)return[2];O=a({},S.payload)}"errors"in S&&(O=a(a({},O),{extensions:a(a({},"extensions"in O?O.extensions:null),(k={},k[ii]=S.errors,k))})),t(O)}else t(S);else if(1===Object.keys(S).length&&"hasNext"in S&&!S.hasNext)return[2];m=c.indexOf(s)}return[3,1];case 3:return[2]}}))}))}(t,o):(r=e,function(e){return e.text().then((function(t){return ui(e,t)})).then((function(t){return Array.isArray(t)||si.call(t,"data")||si.call(t,"errors")||Yr(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map((function(e){return e.operationName})):r.operationName,"'.")),t}))})(t).then(o)})).then((function(){S=void 0,n.complete()})).catch((function(e){S=void 0,function(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}(e,n)})),function(){S&&S.abort()}}))}))},yi=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,vi(t).request)||this;return n.options=t,n}return o(t,e),t}(Zr);const{toString:mi,hasOwnProperty:gi}=Object.prototype,bi=Function.prototype.toString,Ei=new Map;function _i(e,t){try{return Ti(e,t)}finally{Ei.clear()}}function Ti(e,t){if(e===t)return!0;const n=mi.call(e);if(n!==mi.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(ki(e,t))return!0;const n=Si(e),r=Si(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!gi.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!Ti(e[i],t[i]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(ki(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,o]=e.value;if(!t.has(n))return!1;if(i&&!Ti(o,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=bi.call(e);return n===bi.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,wi)}}return!1}function Si(e){return Object.keys(e).filter(Oi,e)}function Oi(e){return void 0!==this[e]}const wi="{ [native code] }";function ki(e,t){let n=Ei.get(e);if(n){if(n.has(t))return!0}else Ei.set(e,n=new Set);return n.add(t),!1}function Ii(e,t,n,r){var i=t.data,o=s(t,["data"]),a=n.data;return _i(o,s(n,["data"]))&&Ni(Zt(e).selectionSet,i,a,{fragmentMap:st($t(e)),variables:r})}function Ni(e,t,n,r){if(t===n)return!0;var i=new Set;return e.selections.every((function(e){if(i.has(e))return!0;if(i.add(e),!Ge(e,r.variables))return!0;if(Ai(e))return!0;if(Wt(e)){var o=Kt(e),a=t&&t[o],s=n&&n[o],c=e.selectionSet;if(!c)return _i(a,s);var u=Array.isArray(a),l=Array.isArray(s);if(u!==l)return!1;if(u&&l){var f=a.length;if(s.length!==f)return!1;for(var h=0;h<f;++h)if(!Ni(c,a[h],s[h],r))return!1;return!0}return Ni(c,a,s,r)}var d=ct(e,r.fragmentMap);return d?!!Ai(d)||Ni(d.selectionSet,t,n,r):void 0}))}function Ai(e){return!!e.directives&&e.directives.some(Di)}function Di(e){return"nonreactive"===e.name.value}var Ri=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=Un(at,{max:Tt["cache.fragmentQueryDocuments"]||1e3,cache:yt})}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(a(a({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.watchFragment=function(e){var t,n=this,r=e.fragment,i=e.fragmentName,o=e.from,c=e.optimistic,u=void 0===c||c,l=s(e,["fragment","fragmentName","from","optimistic"]),f=this.getFragmentDoc(r,i),h=a(a({},l),{returnPartialData:!0,id:void 0===o||"string"==typeof o?o:this.identify(o),query:f,optimistic:u});return new Nr((function(e){return n.watch(a(a({},h),{immediate:!0,callback:function(n){if(!t||!Ii(f,{data:null==t?void 0:t.result},{data:n.result})){var r={data:n.result,complete:!!n.complete};n.missing&&(r.missing=ir(n.missing.map((function(e){return e.missing})))),t=n,e.next(r)}}}))}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(a(a({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=s(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=s(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery(a(a({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment(a(a({},e),{data:i})),i)}})},e}();!1!==globalThis.__DEV__&&(Ri.prototype.getMemoryInternals=It);var xi=function(e){function t(n,r,i,o){var a,s=e.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=o,Array.isArray(s.path)){s.missing=s.message;for(var c=s.path.length-1;c>=0;--c)s.missing=((a={})[s.path[c]]=s.missing,a)}else s.missing=s.path;return s.__proto__=t.prototype,s}return o(t,e),t}(Error),Ci=Object.prototype.hasOwnProperty;function Fi(e){return null==e}function Li(e,t){var n=e.__typename,r=e.id,i=e._id;if("string"==typeof n&&(t&&(t.keyObject=Fi(r)?Fi(i)?void 0:{_id:i}:{id:r}),Fi(r)&&!Fi(i)&&(r=i),!Fi(r)))return"".concat(n,":").concat("number"==typeof r||"string"==typeof r?r:JSON.stringify(r))}var Pi={dataIdFromObject:Li,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Mi(e){var t=e.canonizeResults;return void 0===t?Pi.canonizeResults:t}var qi=/^[_a-z][_0-9a-z]*/i;function ji(e){var t=e.match(qi);return t?t[0]:e}function Vi(e,t,n){return!!ot(t)&&(Gn(t)?t.every((function(t){return Vi(e,t,n)})):e.selections.every((function(e){if(Wt(e)&&Ge(e,n)){var r=Kt(e);return Ci.call(t,r)&&(!e.selectionSet||Vi(e.selectionSet,t[r],n))}return!0})))}function Ui(e){return ot(e)&&!jt(e)&&!Gn(e)}function Qi(e,t){var n=st($t(e));return{fragmentMap:n,lookupFragment:function(e){var r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var Bi=Object.create(null),zi=function(){return Bi},Ki=Object.create(null),Gi=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Lr(jt(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return jt(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return qt(e);if(jt(e))return e;var r=n.policies.identify(e)[0];if(r){var i=qt(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return a({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Ci.call(this.data,e)){var n=this.data[e];if(n&&Ci.call(n,t))return n[t]}return"__typename"===t&&Ci.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Ji?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Ci.call(this.data,e)?this.data[e]:this instanceof Ji?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;jt(e)&&(e=e.__ref),jt(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){D("string"==typeof n,1);var a=new ar(Xi).merge(i,o);if(this.data[n]=a,a!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=ji(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof Ji||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,s=!0,c={DELETE:Bi,INVALIDATE:Ki,isReference:jt,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||qt(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(u){var l=ji(u),f=r[u];if(void 0!==f){var h="function"==typeof t?t:t[u]||t[l];if(h){var d=h===zi?Bi:h(Lr(f),a(a({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));if(d===Ki)n.group.dirty(e,u);else if(d===Bi&&(d=void 0),d!==f&&(i[u]=d,o=!0,f=d,!1!==globalThis.__DEV__)){var p=function(e){if(void 0===n.lookup(e.__ref))return!1!==globalThis.__DEV__&&D.warn(2,e),!0};if(jt(d))p(d);else if(Array.isArray(d))for(var v=!1,y=void 0,m=0,g=d;m<g.length;m++){var b=g[m];if(jt(b)){if(v=!0,p(b))break}else if("object"==typeof b&&b)n.policies.identify(b)[0]&&(y=b);if(v&&void 0!==y){!1!==globalThis.__DEV__&&D.warn(3,y);break}}}}void 0!==f&&(s=!1)}})),o)return this.merge(e,i),s&&(this instanceof Ji?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=zi,r):zi)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(Ci.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ji&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){Ci.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&Ci.call(e,n)||t.delete(n)})),e){var n=e.__META,r=s(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Ji?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){Ci.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof Ji;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!Ci.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){jt(e)&&(t[e.__ref]=!0),ot(e)&&Object.keys(e).forEach((function(t){var n=e[t];ot(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Wi=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Mn():null,this.keyMaker=new Ze(tt)},e.prototype.depend=function(e,t){if(this.d){this.d(Hi(e,t));var n=ji(t);n!==t&&this.d(Hi(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Hi(e,t),"__exists"===t?"forget":"setDirty")},e}();function Hi(e,t){return t+"#"+e}function Yi(e,t){Zi(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,a=e.call(this,n,new Wi(i))||this;return a.stump=new $i(a),a.storageTrie=new Ze(tt),o&&a.replace(o),a}return o(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Gi);var Ji=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return o(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){_i(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return a(a({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return Ci.call(this.data,t)?a(a({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Gi),$i=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Wi(t.group.caching,t.group))||this}return o(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(e,t){return this.parent.merge(e,t)},t}(Ji);function Xi(e,t,n){var r=e[n],i=t[n];return _i(r,i)?r:i}function Zi(e){return!!(e instanceof Gi&&e.group.caching)}function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var to=function(){function e(){this.known=new(nt?WeakSet:Set),this.pool=new Ze(tt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return ot(e)&&this.known.has(e)},e.prototype.pass=function(e){if(ot(e)){var t=function(e){return ot(e)?Gn(e)?e.slice(0):a({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(ot(e)){var n=this.passes.get(e);if(n)return n;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var r=e.map(this.admit,this);return(s=this.pool.lookupArray(r)).array||(this.known.add(s.array=r),!1!==globalThis.__DEV__&&Object.freeze(r)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],a=this.sortedKeys(e);o.push(a.json);var s,c=o.length;if(a.sorted.forEach((function(n){o.push(t.admit(e[n]))})),!(s=this.pool.lookupArray(o)).object){var u=s.object=Object.create(i);this.known.add(u),a.sorted.forEach((function(e,t){u[e]=o[c+t]})),!1!==globalThis.__DEV__&&Object.freeze(u)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var r=JSON.stringify(t);(n.keys=this.keysByJSON.get(r))||this.keysByJSON.set(r,n.keys={sorted:t,json:r})}return n.keys},e}();function no(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ro=function(){function e(e){var t=this;this.knownResults=new(tt?WeakMap:Map),this.config=Gr(e,{addTypename:!1!==e.addTypename,canonizeResults:Mi(e)}),this.canon=e.canon||new to,this.executeSelectionSet=Un((function(e){var n,r=e.context.canonizeResults,i=no(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?a(a({},o),{result:t.canon.admit(o.result)}):o:(Yi(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize||Tt["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:no,makeCacheKey:function(e,t,n,r){if(Zi(n.store))return n.store.makeCacheKey(e,jt(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Un((function(e){return Yi(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize||Tt["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(Zi(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new to},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,s=e.returnPartialData,c=void 0===s||s,u=e.canonizeResults,l=void 0===u?this.config.canonizeResults:u,f=this.config.cache.policies;o=a(a({},en(Xt(n))),o);var h,d=qt(i),p=this.executeSelectionSet({selectionSet:Zt(n).selectionSet,objectOrReference:d,enclosingRef:d,context:a({store:t,query:n,policies:f,variables:o,varString:Lt(o),canonizeResults:l},Qi(n,this.config.fragments))});if(p.missing&&(h=[new xi(io(p.missing),p.missing,n,o)],!c))throw h[0];return{result:p.result,complete:!h,missing:h}},e.prototype.isFresh=function(e,t,n,r){if(Zi(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(jt(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var a,s=o.variables,c=o.policies,u=o.store.getFieldValue(r,"__typename"),l=[],f=new ar;function h(e,t){var n;return e.missing&&(a=f.merge(a,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof u&&!c.rootIdsByTypename[u]&&l.push({__typename:u});var d=new Set(n.selections);d.forEach((function(e){var n,p;if(Ge(e,s))if(Wt(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),y=Kt(e);void 0===v?Zn.added(e)||(a=f.merge(a,((n={})[y]="Can't find field '".concat(e.name.value,"' on ").concat(jt(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Gn(v)?v.length>0&&(v=h(t.executeSubSelectedArray({field:e,array:v,enclosingRef:i,context:o}),y)):e.selectionSet?null!=v&&(v=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:v,enclosingRef:jt(v)?v:i,context:o}),y)):o.canonizeResults&&(v=t.canon.pass(v)),void 0!==v&&l.push(((p={})[y]=v,p))}else{var m=ct(e,o.lookupFragment);if(!m&&e.kind===X.FRAGMENT_SPREAD)throw R(9,e.name.value);m&&c.fragmentMatches(m,u)&&m.selectionSet.selections.forEach(d.add,d)}}));var p={result:ir(l),missing:a},v=o.canonizeResults?this.canon.admit(p):Lr(p);return v.result&&this.knownResults.set(v.result,n),v},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new ar;function c(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Gn(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:a}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:jt(e)?e:o,context:a}),t):(!1!==globalThis.__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){ot(n)&&(D(!jt(n),10,function(e,t){return jt(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n),t.name.value),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function io(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var oo=new pn,ao=new WeakMap;function so(e){var t=ao.get(e);return t||ao.set(e,t={vars:new Set,dep:Mn()}),t}function co(e){so(e).vars.forEach((function(t){return t.forgetCache(e)}))}function uo(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){so(e).dep.dirty(r),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=oo.getValue();s&&(i(s),so(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),so(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}var lo=Object.create(null);function fo(e){var t=JSON.stringify(e);return lo[t]||(lo[t]=Object.create(null))}function ho(e){var t=fo(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=vo(e,(function(e){var i=go(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Ci.call(t,e[0])&&(i=go(t,e,mo)),D(void 0!==i,4,e.join("."),t),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function po(e){var t=fo(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,a=vo(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return go(t,e)}else{var a=n.slice(1);if(i&&Ci.call(i,a)){var s=e.slice(0);return s[0]=a,go(i,s)}}else if(r&&Wn(r.directives)){var c=n.slice(1),u=r.directives.find((function(e){return e.name.value===c})),l=u&&zt(u,i);return l&&go(l,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function vo(e,t){var n=new ar;return yo(e).reduce((function(e,r){var i,o=t(r);if(void 0!==o){for(var a=r.length-1;a>=0;--a)(i={})[r[a]]=o,o=i;e=n.merge(e,o)}return e}),Object.create(null))}function yo(e){var t=fo(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Gn(t)?(yo(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Gn(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function mo(e,t){return e[t]}function go(e,t,n){return n=n||mo,bo(t.reduce((function e(t,r){return Gn(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function bo(e){return ot(e)?Gn(e)?e.map(bo):vo(Object.keys(e).sort(),(function(t){return go(e,t)})):e}function Eo(e){return void 0!==e.args?e.args:e.field?zt(e.field,e.variables):null}var _o=function(){},To=function(e,t){return t.fieldName},So=function(e,t,n){return(0,n.mergeObjects)(e,t)},Oo=function(e,t){return t},wo=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=a({dataIdFromObject:Li},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,i=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,s=t&&t.storeObject||e,c=a(a({},t),{typename:i,storeObject:s,readField:t&&t.readField||function(){var e=Io(arguments,s);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),u=i&&this.getTypePolicy(i),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var f=l(a(a({},e),s),c);if(!Gn(f)){o=f;break}l=ho(f)}return o=o?String(o):void 0,c.keyObject?[o,c.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,a=r.subscriptionType,c=s(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),Ci.call(t.toBeAdded,n)?t.toBeAdded[n].push(c):t.toBeAdded[n]=[c]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?So:!1===t?Oo:e.merge}a(r,t.merge),r.keyFn=!1===i?_o:Gn(i)?ho(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,c=i.read,u=i.merge;r.keyFn=!1===s?To:Gn(s)?po(s):"function"==typeof s?s:r.keyFn,"function"==typeof c&&(r.read=c),a(r,u)}r.read&&r.merge&&(r.keyFn=r.keyFn||To)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(D(!r||r===e,5,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(qi);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Ci.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((function(n,i){if(n.test(e)){var o=t.supertypeMap.get(i);o&&o.forEach((function(e){return r.add(e)}))}}))),r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=s(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},u=!(!n||!this.fuzzySubtypes.size),l=!1,f=0;f<s.length;++f){var h=s[f];if(h.has(o))return a.has(o)||(l&&!1!==globalThis.__DEV__&&D.warn(6,t,o),a.add(o)),!0;h.forEach(c),u&&f===s.length-1&&Vi(e.selectionSet,n,r)&&(u=!1,l=!0,this.fuzzySubtypes.forEach((function(e,n){var r=t.match(e);r&&r[0]===t&&c(n)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!(!n||!n.keyFn)},e.prototype.getStoreFieldName=function(e){var t,n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},s=Eo(e);o;){var c=o(s,a);if(!Gn(c)){t=c||r;break}o=po(c)}return void 0===t&&(t=e.field?function(e,t){var n=null;e.directives&&(n={},e.directives.forEach((function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach((function(r){var i=r.name,o=r.value;return Vt(n[e.name.value],i,o,t)}))})));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach((function(e){var n=e.name,i=e.value;return Vt(r,n,i,t)}))),Bt(e.name.value,r,n)}(e.field,e.variables):Bt(r,Eo(e))),!1===t?r:r===ji(t)?t:r+":"+t},e.prototype.readField=function(e,t){var n=e.from;if(n&&(e.field||e.fieldName)){if(void 0===e.typename){var r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}var i=this.getStoreFieldName(e),o=ji(i),a=t.store.getFieldValue(n,i),s=this.getFieldPolicy(e.typename,o,!1),c=s&&s.read;if(c){var u=ko(this,n,e,t,t.store.getStorage(jt(n)?n.__ref:n,i));return oo.withValue(this.cache,c,[a,u])}return a}},e.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t,!1);return n&&n.read},e.prototype.getMergeFunction=function(e,t,n){var r=this.getFieldPolicy(e,t,!1),i=r&&r.merge;return!i&&n&&(i=(r=this.getTypePolicy(n))&&r.merge),i},e.prototype.runMergeFunction=function(e,t,n,r,i){var o=n.field,a=n.typename,s=n.merge;return s===So?No(r.store)(e,t):s===Oo?t:(r.overwrite&&(e=void 0),s(e,t,ko(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:r.variables},r,i||Object.create(null))))},e}();function ko(e,t,n,r,i){var o=e.getStoreFieldName(n),a=ji(o),s=n.variables||r.variables,c=r.store,u=c.toReference,l=c.canRead;return{args:Eo(n),field:n.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:jt,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Io(arguments,t,s),r)},mergeObjects:No(r.store)}}function Io(e,t,n){var r,i=e[0],o=e[1],s=e.length;return"string"==typeof i?r={fieldName:i,from:s>1?o:t}:(r=a({},i),Ci.call(r,"from")||(r.from=t)),!1!==globalThis.__DEV__&&void 0===r.from&&!1!==globalThis.__DEV__&&D.warn(7,N(Array.from(e))),void 0===r.variables&&(r.variables=n),r}function No(e){return function(t,n){if(Gn(t)||Gn(n))throw R(8);if(ot(t)&&ot(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(jt(t)&&Ui(n))return e.merge(t.__ref,n),t;if(Ui(t)&&jt(n))return e.merge(t,n.__ref),n;if(Ui(t)&&Ui(n))return a(a({},t),n)}return n}}function Ao(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:a(a({},e),{clientOnly:t,deferred:n})),i}var Do=function(){function e(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,s=t.variables,c=t.overwrite,u=Yt(r),l=new ar;s=a(a({},en(u)),s);var f=a(a({store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:s,varString:Lt(s)},Qi(r,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:f});if(!jt(h))throw R(11,i);return f.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,s=t.fieldNodeSet,c=qt(r);if(o&&o.map.size){var u=n.applyMerges(o,c,i,f);if(jt(u))return;i=u}if(!1!==globalThis.__DEV__&&!f.overwrite){var l=Object.create(null);s.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)}));Object.keys(i).forEach((function(e){(function(e){return!0===l[ji(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(!o)return;var s=i(t);if(!s)return;if(jt(o))return;if(_i(o,s))return;if(Object.keys(o).every((function(e){return void 0!==r.getFieldValue(s,e)})))return;var c=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),u=ji(n),l="".concat(c,".").concat(u);if(Po.has(l))return;Po.add(l);var f=[];Gn(o)||Gn(s)||[o,s].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)}));!1!==globalThis.__DEV__&&D.warn(14,u,c,f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"",l,a({},o),a({},s))}(c,i,e,f.store)}))}e.merge(r,i)})),e.retain(h.__ref),h},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,s=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||Gt(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(u.__typename=l);var f=function(){var e=Io(arguments,u,o.variables);if(jt(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var n=c.readField(a(a({},e),{from:t.storeObject}),o);if(void 0!==n)return n}}return c.readField(e,o)},h=new Set;this.flattenFields(i,r,o,l).forEach((function(e,n){var i,o=Kt(n),a=r[o];if(h.add(n),void 0!==a){var d=c.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),p=xo(s,d),v=t.processFieldValue(a,n,n.selectionSet?Ao(e,!1,!1):e,p),y=void 0;n.selectionSet&&(jt(v)||Ui(v))&&(y=f("__typename",v));var m=c.getMergeFunction(l,n.name.value,y);m?p.info={field:n,typename:l,merge:m}:Lo(s,d),u=e.merge(u,((i={})[d]=v,i))}else!1===globalThis.__DEV__||e.clientOnly||e.deferred||Zn.added(n)||c.getReadFunction(l,n.name.value)||!1!==globalThis.__DEV__&&D.error(12,Kt(n),r)}));try{var d=c.identify(r,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:u,readField:f}),p=d[0],v=d[1];n=n||p,v&&(u=o.merge(u,v))}catch(e){if(!n)throw e}if("string"==typeof n){var y=qt(n),m=o.written[n]||(o.written[n]=[]);if(m.indexOf(i)>=0)return y;if(m.push(i),this.reader&&this.reader.isFresh(r,y,i,o))return y;var g=o.incomingById.get(n);return g?(g.storeObject=o.merge(g.storeObject,u),g.mergeTree=Co(g.mergeTree,s),h.forEach((function(e){return g.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:u,mergeTree:Fo(s)?void 0:s,fieldNodeSet:h}),y}return u},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Gn(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,xo(r,o));return Lo(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):!1!==globalThis.__DEV__?xr(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=Gt(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,a=new Ze(!1);return function e(s,c){var u=a.lookup(s,c.clientOnly,c.deferred);u.visited||(u.visited=!0,s.selections.forEach((function(a){if(Ge(a,n.variables)){var s=c.clientOnly,u=c.deferred;if(s&&u||!Wn(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=zt(e,n.variables);r&&!1===r.if||(u=!0)}})),Wt(a)){var l=i.get(a);l&&(s=s&&l.clientOnly,u=u&&l.deferred),i.set(a,Ao(n,s,u))}else{var f=ct(a,n.lookupFragment);if(!f&&a.kind===X.FRAGMENT_SPREAD)throw R(13,a.name.value);f&&o.fragmentMatches(f,r,t,n.variables)&&e(f.selectionSet,Ao(n,s,u))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,s=this;if(e.map.size&&!jt(n)){var c,u=Gn(n)||!jt(t)&&!Ui(t)?void 0:t,l=n;u&&!i&&(i=[jt(u)?u.__ref:u]);var f=function(e,t){return Gn(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=f(u,t),o=f(l,t);if(void 0!==o){i&&i.push(t);var a=s.applyMerges(e,n,o,r,i);a!==o&&(c=c||new Map).set(t,a),i&&D(i.pop()===t)}})),c&&(n=Gn(l)?l.slice(0):a({},l),c.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),Ro=[];function xo(e,t){var n=e.map;return n.has(t)||n.set(t,Ro.pop()||{map:new Map}),n.get(t)}function Co(e,t){if(e===t||!t||Fo(t))return e;if(!e||Fo(e))return t;var n=e.info&&t.info?a(a({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,Co(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,Co(t.map.get(n),e.map.get(n)))}))}return i}function Fo(e){return!e||!(e.info||e.map.size)}function Lo(e,t){var n=e.map,r=n.get(t);r&&Fo(r)&&(Ro.push(r),n.delete(t))}var Po=new Set;var Mo,qo=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new zn(Zn),n.assumeImmutableResults=!0,n.makeVar=uo,n.txCount=0,n.config=function(e){return Gr(Pi,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new wo({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return o(t,e),t.prototype.init=function(){var e=this.data=new Gi.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader,r=this.config.fragments;this.storeWriter=new Do(this,this.storeReader=new ro({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Mi(this.config),canon:e?void 0:n&&n.canon,fragments:r}),r),this.maybeBroadcastWatch=Un((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize||Tt["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(Zi(n)){var r=e.optimistic,i=e.id,o=e.variables;return n.makeCacheKey(e.query,e.callback,Lt({optimistic:r,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(a(a({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof xi)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Ci.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(a(a({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||so(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&co(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){var t;Lt.reset(),Kn.reset(),this.addTypenameTransform.resetCache(),null===(t=this.config.fragments)||void 0===t||t.resetCaches();var n=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),n},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(jt(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){!1!==globalThis.__DEV__&&D.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Ci.call(e,"id"))return!1;e=a(a({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Lt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),co(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,o=void 0===i||i,s=e.removeOptimistic,c=e.onWatchUpdated,u=function(e){var i=n,o=i.data,a=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=o,n.optimisticData=a}},l=new Set;return c&&!this.txCount&&this.broadcastWatches(a(a({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,u):!1===o?u(this.data):u(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&l.size?(this.broadcastWatches(a(a({},e),{onWatchUpdated:function(e,t){var n=c.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){return this.addTypenameToDocument(this.addFragmentsToDocument(e))},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.addFragmentsToDocument=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.addTypenameToDocument=function(e){return this.addTypename?this.addTypenameTransform.transformDocument(e):e},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&_i(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(Ri);function jo(e){return!!e&&e<7}!1!==globalThis.__DEV__&&(qo.prototype.getMemoryInternals=kt),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Mo||(Mo={}));var Vo=Object.assign,Uo=Object.hasOwnProperty,Qo=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=zo)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=r,o.queryManager=n,o.waitForOwnResult=Go(i.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var s=n.defaultOptions.watchQuery,c=(void 0===s?{}:s).fetchPolicy,u=void 0===c?"cache-first":c,l=i.fetchPolicy,f=void 0===l?u:l,h=i.initialFetchPolicy,d=void 0===h?"standby"===f?u:f:h;o.options=a(a({},i),{initialFetchPolicy:d,fetchPolicy:f}),o.queryId=r.queryId||n.generateQueryId();var p=Yt(o.query);return o.queryName=p&&p.name&&p.name.value,o}return o(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||Mo.ready,r=a(a({},t),{loading:jo(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if(Go(o)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers);else if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(r.data=s.result),_i(r.data,{})&&(r.data=void 0),s.complete?(delete r.partial,!s.complete||r.networkStatus!==Mo.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=Mo.ready,r.loading=!1)):r.partial=!0,!1===globalThis.__DEV__||s.complete||this.options.partialRefetch||r.loading||r.data||r.error||Ko(s.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||((this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Ii(this.query,this.last.result,e,this.variables):!_i(this.last.result,e))||t&&!_i(this.last.variables,t))},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||_i(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",!1!==globalThis.__DEV__&&e&&Uo.call(e,"variables")){var i=Xt(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||!1!==globalThis.__DEV__&&D.warn(20,e,(null===(t=i.name)||void 0===t?void 0:t.value)||i)}return e&&!_i(this.options.variables,e)&&(n.variables=this.options.variables=a(a({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,Mo.refetch)},t.prototype.fetchMore=function(e){var t=this,n=a(a({},e.query?e:a(a(a(a({},this.options),{query:this.options.query}),e),{variables:a(a({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"});n.query=this.transformDocument(n.query);var r=this.queryManager.generateQueryId();this.lastQuery=e.query?this.transformDocument(this.options.query):n.query;var i=this.queryInfo,o=i.networkStatus;i.networkStatus=Mo.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var s=new Set,c=null==e?void 0:e.updateQuery,u="no-cache"!==this.options.fetchPolicy;return u||D(c,21),this.queryManager.fetchQuery(r,n,Mo.fetchMore).then((function(l){if(t.queryManager.removeQuery(r),i.networkStatus===Mo.fetchMore&&(i.networkStatus=o),u)t.queryManager.cache.batch({update:function(r){var i=e.updateQuery;i?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:l.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:l.data})},onWatchUpdated:function(e){s.add(e.query)}});else{var f=t.getLast("result"),h=c(f.data,{fetchMoreResult:l.data,variables:n.variables});t.reportResult(a(a({},f),{data:h}),t.variables)}return l})).finally((function(){u&&!s.has(t.query)&&Bo(t)}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):!1!==globalThis.__DEV__&&D.error(22,t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.silentSetOptions=function(e){var t=Gr(this.options,e||{});Vo(this.options,t)},t.prototype.setVariables=function(e){return _i(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},Mo.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=void 0===n?"cache-first":n,i=t.initialFetchPolicy,o=void 0===i?r:i;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,e,t,n)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n&&this.hasObservers()){if(!t||t.interval!==n){D(n,23),(t||(this.pollingInfo={})).interval=n;var r=function(){var t,n;e.pollingInfo&&(jo(e.queryInfo.networkStatus)||(null===(n=(t=e.options).skipPollAttempt)||void 0===n?void 0:n.call(t))?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},Mo.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){void 0===t&&(t=this.variables);var n=this.getLastError();return n&&this.last&&!_i(t,this.last.variables)&&(n=void 0),this.last=a({result:this.queryManager.assumeImmutableResults?e:xr(e),variables:t},n?{error:n}:null)},t.prototype.reobserveAsConcast=function(e,t){var n=this;this.isTornDown=!1;var r=t===Mo.refetch||t===Mo.fetchMore||t===Mo.poll,i=this.options.variables,o=this.options.fetchPolicy,s=Gr(this.options,e||{}),c=r?s:Vo(this.options,s),u=this.transformDocument(c.query);this.lastQuery=u,r||(this.updatePolling(),!e||!e.variables||_i(e.variables,i)||"standby"===c.fetchPolicy||c.fetchPolicy!==o&&"function"!=typeof c.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",c),void 0===t&&(t=Mo.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Go(c.fetchPolicy));var l=function(){n.concast===d&&(n.waitForOwnResult=!1)},f=c.variables&&a({},c.variables),h=this.fetch(c,t,u),d=h.concast,p=h.fromLink,v={next:function(e){_i(n.variables,f)&&(l(),n.reportResult(e,f))},error:function(e){_i(n.variables,f)&&(oi(e)||(e=new ai({networkError:e})),l(),n.reportError(e,f))}};return r||!p&&this.concast||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=v),d.addObserver(v),d},t.prototype.reobserve=function(e,t){return this.reobserveAsConcast(e,t).promise},t.prototype.resubscribeAfterError=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.last;this.resetLastResults();var r=this.subscribe.apply(this,e);return this.last=n,r},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError(),r=this.isDifferentFromLastResult(e,t);(n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),(n||r)&&Pr(this.observers,"next",e)},t.prototype.reportError=function(e,t){var n=a(a({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:Mo.error,loading:!1});this.updateLastResult(n,t),Pr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(e){return this.queryManager.transform(e)},t}(Nr);function Bo(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(e,t){return this.nextFetchPolicy=r,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(e,t):n}}):e.reobserve()}function zo(e){!1!==globalThis.__DEV__&&D.error(24,e.message,e.stack)}function Ko(e){!1!==globalThis.__DEV__&&e&&!1!==globalThis.__DEV__&&D.debug(25,e)}function Go(e){return"network-only"===e||"no-cache"===e||"standby"===e}qr(Qo);var Wo=new(tt?WeakMap:Map);function Ho(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Wo.set(e,(Wo.get(e)+1)%1e15),n.apply(this,arguments)})}function Yo(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Jo=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Wo.has(n)||(Wo.set(n,0),Ho(n,"evict"),Ho(n,"modify"),Ho(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||Mo.loading;return this.variables&&this.networkStatus!==Mo.loading&&!_i(this.variables,e.variables)&&(t=Mo.setVariables),_i(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){Yo(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&_i(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var t=this.observableQuery;if(t&&"no-cache"===t.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t,n=this,r=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(null===(t=this.observableQuery)||void 0===t?void 0:t.getLastError())||(this.updateLastDiff(e),this.dirty||_i(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return n.notify()}),0))))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Bo(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;Yo(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(jo(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=a(a({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&_i(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Wo.get(this.cache)&&_i(t,n.variables)&&_i(e.data,n.result.data))},e.prototype.markResult=function(e,t,n,r){var i=this,o=new ar,a=Wn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Wn(e.incremental)){var s=Br(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=a,"no-cache"===n.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):0!==r&&($o(e,n.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,n.variables))o.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:1===r}),i.lastWrite={result:e,variables:n.variables,dmCount:Wo.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var a=i.getDiffOptions(n.variables),s=o.diff(a);!i.stopped&&_i(i.variables,n.variables)&&i.updateWatch(n.variables),i.updateLastDiff(s,a),s.complete&&(e.data=s.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Mo.ready},e.prototype.markError=function(e){return this.networkStatus=Mo.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function $o(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!zr(e);return!r&&n&&e.data&&(r=!0),r}var Xo=Object.prototype.hasOwnProperty,Zo=Object.create(null),ea=function(){function e(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new bt(Tt["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Ze(!1);var n=new zn((function(e){return t.cache.transformDocument(e)}),{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var r=e.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(R(26))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){return c(this,arguments,void 0,(function(e){var t,n,r,i,o,s,c,l=e.mutation,f=e.variables,h=e.optimisticResponse,d=e.updateQueries,p=e.refetchQueries,v=void 0===p?[]:p,y=e.awaitRefetchQueries,m=void 0!==y&&y,g=e.update,b=e.onQueryUpdated,E=e.fetchPolicy,_=void 0===E?(null===(s=this.defaultOptions.mutate)||void 0===s?void 0:s.fetchPolicy)||"network-only":E,T=e.errorPolicy,S=void 0===T?(null===(c=this.defaultOptions.mutate)||void 0===c?void 0:c.errorPolicy)||"none":T,O=e.keepRootFields,w=e.context;return u(this,(function(e){switch(e.label){case 0:return D(l,27),D("network-only"===_||"no-cache"===_,28),t=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),n=this.getDocumentInfo(l).hasClientExports,f=this.getVariables(l,f),n?[4,this.localState.addExportedVariables(l,f,w)]:[3,2];case 1:f=e.sent(),e.label=2;case 2:return r=this.mutationStore&&(this.mutationStore[t]={mutation:l,variables:f,loading:!0,error:null}),i=h&&this.markMutationOptimistic(h,{mutationId:t,document:l,variables:f,fetchPolicy:_,errorPolicy:S,context:w,updateQueries:d,update:g,keepRootFields:O}),this.broadcastQueries(),o=this,[2,new Promise((function(e,n){return Mr(o.getObservableFromLink(l,a(a({},w),{optimisticResponse:i?h:void 0}),f,{},!1),(function(e){if(zr(e)&&"none"===S)throw new ai({graphQLErrors:Kr(e)});r&&(r.loading=!1,r.error=null);var n=a({},e);return"function"==typeof v&&(v=v(n)),"ignore"===S&&zr(n)&&delete n.errors,o.markMutationResult({mutationId:t,result:n,document:l,variables:f,fetchPolicy:_,errorPolicy:S,context:w,update:g,updateQueries:d,awaitRefetchQueries:m,refetchQueries:v,removeOptimistic:i?t:void 0,onQueryUpdated:b,keepRootFields:O})})).subscribe({next:function(t){o.broadcastQueries(),"hasNext"in t&&!1!==t.hasNext||e(t)},error:function(e){r&&(r.loading=!1,r.error=e),i&&o.cache.removeOptimistic(t),o.broadcastQueries(),n(e instanceof ai?e:new ai({networkError:e}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&$o(r,e.errorPolicy)){if(Ur(r)||i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Ur(r)&&Wn(r.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=Br(s.result,r)),void 0!==c&&(r.data=c,i.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach((function(e,o){var a=e.observableQuery,s=a&&a.queryName;if(s&&Xo.call(u,s)){var c=u[s],l=n.queries.get(o),f=l.document,h=l.variables,d=t.diff({query:f,variables:h,returnPartialData:!0,optimistic:!1}),p=d.result;if(d.complete&&p){var v=c(p,{mutationResult:r,queryName:f&&Jt(f)||void 0,queryVariables:h});v&&i.push({result:v,dataId:"ROOT_QUERY",query:f,variables:h})}}}))}if(i.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var s,c=e.update,u=!(Ur(s=r)||function(e){return"hasNext"in e&&"data"in e}(s))||Ur(r)&&!r.hasNext;if(c){if(!o){var l=t.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(r=a(a({},r),{data:l.result}))&&delete r.incremental,"hasNext"in r&&delete r.hasNext)}u&&c(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||!u||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables,{IGNORE:Zo}):e;return r!==Zo&&(this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(a(a({},t),{result:{data:r}}),e)}catch(e){!1!==globalThis.__DEV__&&D.error(e)}}),t.mutationId),!0)},e.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(e,t,n).concast.promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},e.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:He(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:We(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:Xn([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:en(Yt(e)),asQuery:a(a({},e),{definitions:e.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?a(a({},e),{operation:"query"}):e}))})};t.set(e,n)}return t.get(e)},e.prototype.getVariables=function(e,t){return a(a({},this.getDocumentInfo(e).defaultVars),t)},e.prototype.watchQuery=function(e){var t=this.transform(e.query);void 0===(e=a(a({},e),{variables:this.getVariables(t,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=new Jo(this),r=new Qo({queryManager:this,queryInfo:n,options:e});return r.lastQuery=t,this.queries.set(r.queryId,n),n.init({document:t,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),D(e.query,29),D("Document"===e.query.kind,30),D(!e.returnPartialData,31),D(!e.pollInterval,32),this.fetchQuery(t,a(a({},e),{query:this.transform(e.query)})).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(R(33)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=Mo.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):ot(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e),!1):ot(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void n.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(i,o),s&&r.set(s,!0),a&&r.set(a,!0))}})),i.size&&i.forEach((function(e){var r=I("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new Qo({queryManager:t,queryInfo:i,options:a(a({},e),{fetchPolicy:"network-only"})});D(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),!1!==globalThis.__DEV__&&r.size&&r.forEach((function(e,t){e||!1!==globalThis.__DEV__&&D.warn("string"==typeof t?34:35,t)})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=void 0===i?"none":i,a=e.variables,s=e.context,c=void 0===s?{}:s,u=e.extensions,l=void 0===u?{}:u;n=this.transform(n),a=this.getVariables(n,a);var f=function(e){return t.getObservableFromLink(n,c,e,l).map((function(i){"no-cache"!==r&&($o(i,o)&&t.cache.write({query:n,result:i.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries());var a=zr(i),s=function(e){return!!e.extensions&&Array.isArray(e.extensions[ii])}(i);if(a||s){var c={};if(a&&(c.graphQLErrors=i.errors),s&&(c.protocolErrors=i.extensions[ii]),"none"===o||s)throw new ai(c)}return"ignore"===o&&delete i.errors,i}))};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,a,c).then(f);return new Nr((function(e){var t=null;return h.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return f(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r,i){var o,s,c=this;void 0===i&&(i=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var u=this.getDocumentInfo(e),l=u.serverQuery,f=u.clientQuery;if(l){var h=this.inFlightLinkObservables,d=this.link,p={query:l,variables:n,operationName:Jt(l)||void 0,context:this.prepareContext(a(a({},t),{forceFetch:!i})),extensions:r};if(t=p.context,i){var v=Kn(l),y=Lt(n),m=h.lookup(v,y);if(!(s=m.observable)){var g=new Vr([ei(d,p)]);s=m.observable=g,g.beforeNext((function(){h.remove(v,y)}))}}else s=new Vr([ei(d,p)])}else s=new Vr([Nr.of({data:{}})]),t=this.prepareContext(t);return f&&(s=Mr(s,(function(e){return c.localState.runResolvers({document:f,remoteResult:e,context:t,variables:n})}))),s},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(n.query);return Mr(this.getObservableFromLink(i,n.context,n.variables),(function(o){var a=Kr(o),s=a.length>0,c=n.errorPolicy;if(r>=e.lastRequestId){if(s&&"none"===c)throw e.markError(new ai({graphQLErrors:a}));e.markResult(o,i,n,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Mo.ready};return s&&"none"===c&&(u.data=void 0),s&&"ignore"!==c&&(u.errors=a,u.networkStatus=Mo.error),u}),(function(t){var n=oi(t)?t:new ai({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchConcastWithInfo=function(e,t,n,r){var i=this;void 0===n&&(n=Mo.loading),void 0===r&&(r=t.query);var o,a,s=this.getVariables(r,t.variables),c=this.getQuery(e),u=this.defaultOptions.watchQuery,l=t.fetchPolicy,f=void 0===l?u&&u.fetchPolicy||"cache-first":l,h=t.errorPolicy,d=void 0===h?u&&u.errorPolicy||"none":h,p=t.returnPartialData,v=void 0!==p&&p,y=t.notifyOnNetworkStatusChange,m=void 0!==y&&y,g=t.context,b=void 0===g?{}:g,E=Object.assign({},t,{query:r,variables:s,fetchPolicy:f,errorPolicy:d,returnPartialData:v,notifyOnNetworkStatusChange:m,context:b}),_=function(e){E.variables=e;var r=i.fetchQueryByPolicy(c,E,n);return"standby"!==E.fetchPolicy&&r.sources.length>0&&c.observableQuery&&c.observableQuery.applyNextFetchPolicy("after-fetch",t),r},T=function(){return i.fetchCancelFns.delete(e)};if(this.fetchCancelFns.set(e,(function(e){T(),setTimeout((function(){return o.cancel(e)}))})),this.getDocumentInfo(E.query).hasClientExports)o=new Vr(this.localState.addExportedVariables(E.query,E.variables,E.context).then(_).then((function(e){return e.sources}))),a=!0;else{var S=_(E.variables);a=S.fromLink,o=new Vr(S.sources)}return o.promise.then(T,T),{concast:o,fromLink:a}},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?I("refetchQueries"):void 0:a,c=e.onQueryUpdated,u=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){u.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var l=new Map;return n&&this.cache.batch({update:n,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof Jo&&e.watcher.observableQuery;if(r){if(c){u.delete(r.queryId);var i=c(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&l.set(r,i),i}null!==c&&u.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),u.size&&u.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,a=e.diff;if(c){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}r=c(i,a,o)}c&&!0!==r||(r=i.refetch()),!1!==r&&l.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,s=t.fetchPolicy,c=t.refetchWritePolicy,u=t.errorPolicy,l=t.returnPartialData,f=t.context,h=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:i,variables:o,networkStatus:n});var p=function(){return e.getDiff()},v=function(t,n){void 0===n&&(n=e.networkStatus||Mo.loading);var s=t.result;!1===globalThis.__DEV__||l||_i(s,{})||Ko(t.missing);var c=function(e){return Nr.of(a({data:e,loading:jo(n),networkStatus:n},t.complete?null:{partial:!0}))};return s&&r.getDocumentInfo(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:s},context:f,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data||void 0)})):"none"===u&&n===Mo.refetch&&Array.isArray(t.missing)?c(void 0):c(s)},y="no-cache"===s?0:n===Mo.refetch&&"merge"!==c?1:2,m=function(){return r.getResultsFromLink(e,y,{query:i,variables:o,context:f,fetchPolicy:s,errorPolicy:u})},g=h&&"number"==typeof d&&d!==n&&jo(n);switch(s){default:case"cache-first":return(b=p()).complete?{fromLink:!1,sources:[v(b,e.markReady())]}:l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-and-network":var b;return(b=p()).complete||l||g?{fromLink:!0,sources:[v(b),m()]}:{fromLink:!0,sources:[m()]};case"cache-only":return{fromLink:!1,sources:[v(p(),e.markReady())]};case"network-only":return g?{fromLink:!0,sources:[v(p()),m()]}:{fromLink:!0,sources:[m()]};case"no-cache":return g?{fromLink:!0,sources:[v(e.getDiff()),m()]}:{fromLink:!0,sources:[m()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Jo(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return a(a(a({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},e}(),ta=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=rr(t.resolvers,e)})):this.resolvers=rr(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){return c(this,arguments,void 0,(function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return u(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,s).then((function(e){return a(a({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return We(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return tr(e)},e.prototype.prepareContext=function(e){var t=this.cache;return a(a({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e){return c(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),u(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return a(a({},t),e.exportedVariables)}))]:[2,a({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Me(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Pe}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:er(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t){return c(this,arguments,void 0,(function(e,t,n,r,i,o){var s,c,l,f,h,d,p,v,y,m;return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),u(this,(function(u){return s=Zt(e),c=$t(e),l=st(c),f=this.collectSelectionsToResolve(s,l),h=s.operation,d=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",v=(p=this).cache,y=p.client,m={fragmentMap:l,context:a(a({},n),{cache:v,client:y}),variables:r,fragmentMatcher:i,defaultOperationType:d,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(s.selectionSet,false,t,m).then((function(e){return{result:e,exportedVariables:m.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,a,s,l,f=this;return u(this,(function(h){return i=r.fragmentMap,o=r.context,a=r.variables,s=[n],l=function(e){return c(f,void 0,void 0,(function(){var c,l;return u(this,(function(u){return(t||r.selectionsToResolve.has(e))&&Ge(e,a)?Wt(e)?[2,this.resolveField(e,t,n,r).then((function(t){var n;void 0!==t&&s.push(((n={})[Kt(e)]=t,n))}))]:(!function(e){return"InlineFragment"===e.kind}(e)?(c=i[e.name.value],D(c,18,e.name.value)):c=e,c&&c.typeCondition&&(l=c.typeCondition.name.value,r.fragmentMatcher(n,l,o))?[2,this.resolveSelectionSet(c.selectionSet,t,n,r).then((function(e){s.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return ir(s)}))]}))}))},e.prototype.resolveField=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,a,s,c,l,f,h,d,p=this;return u(this,(function(u){return n?(i=r.variables,o=e.name.value,a=Kt(e),s=o!==a,c=n[a]||n[o],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=n.__typename||r.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(d=h[s?o:a])&&(l=Promise.resolve(oo.withValue(this.cache,d,[n,zt(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,l.then((function(n){var i,o;if(void 0===n&&(n=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=n)}))})),!e.selectionSet)return n;if(null==n)return n;var a=null!==(o=null===(i=e.directives)||void 0===i?void 0:i.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(n)?p.resolveSubSelectedArray(e,t||a,n,r):e.selectionSet?p.resolveSelectionSet(e.selectionSet,t||a,n,r):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n,r){var i=this;return Promise.all(n.map((function(n){return null===n?null:Array.isArray(n)?i.resolveSubSelectedArray(e,t,n,r):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,n,r):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var n=function(e){return!Array.isArray(e)},r=this.selectionsToResolveCache;return function e(i){if(!r.has(i)){var o=new Set;r.set(i,o),Me(i,{Directive:function(e,t,r,i,a){"client"===e.name.value&&a.forEach((function(e){n(e)&&Ke(e)&&o.add(e)}))},FragmentSpread:function(r,i,a,s,c){var u=t[r.name.value];D(u,19,r.name.value);var l=e(u);l.size>0&&(c.forEach((function(e){n(e)&&Ke(e)&&o.add(e)})),o.add(r),l.forEach((function(e){o.add(e)})))}})}return r.get(i)}(e)},e}(),na=!1,ra=function(){function e(e){var t=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw R(15);var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,s=e.documentTransform,c=e.ssrMode,u=void 0!==c&&c,l=e.ssrForceFetchDelay,f=void 0===l?0:l,h=e.connectToDevTools,d=e.queryDeduplication,p=void 0===d||d,v=e.defaultOptions,y=e.defaultContext,m=e.assumeImmutableResults,g=void 0===m?o.assumeImmutableResults:m,b=e.resolvers,E=e.typeDefs,_=e.fragmentMatcher,T=e.name,O=e.version,w=e.devtools,k=e.link;k||(k=n?new yi({uri:n,credentials:r,headers:i}):Zr.empty()),this.link=k,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=p,this.defaultOptions=v||Object.create(null),this.typeDefs=E,this.devtoolsConfig=a(a({},w),{enabled:(null==w?void 0:w.enabled)||h}),void 0===this.devtoolsConfig.enabled&&(this.devtoolsConfig.enabled=!1!==globalThis.__DEV__),f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=S,this.localState=new ta({cache:o,client:this,resolvers:b,fragmentMatcher:_}),this.queryManager=new ea({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:y,documentTransform:s,queryDeduplication:p,ssrMode:u,clientAwareness:{name:T,version:O},localState:this.localState,assumeImmutableResults:g,onBroadcast:this.devtoolsConfig.enabled?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if("undefined"!=typeof window){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,na||!1===globalThis.__DEV__||(na=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout((function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var e=window.navigator,t=e&&e.userAgent,n=void 0;"string"==typeof t&&(t.indexOf("Chrome/")>-1?n="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":t.indexOf("Firefox/")>-1&&(n="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),n&&!1!==globalThis.__DEV__&&D.log("Download the Apollo DevTools for a better development experience: %s",n)}}),1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Wr(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=a(a({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Wr(this.defaultOptions.query,e)),D("cache-and-network"!==e.fetchPolicy,16),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=a(a({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Wr(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return ei(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){!1!==globalThis.__DEV__&&D.debug(17,e)})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();!1!==globalThis.__DEV__&&(ra.prototype.getMemoryInternals=wt);var ia=new Map,oa=new Map,aa=!0,sa=!1;function ca(e){return e.replace(/[\s,]+/g," ").trim()}function ua(e){var t=new Set,n=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var r=e.name.value,i=ca((a=e.loc).source.body.substring(a.start,a.end)),o=oa.get(r);o&&!o.has(i)?aa&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||oa.set(r,o=new Set),o.add(i),t.has(i)||(t.add(i),n.push(e))}else n.push(e);var a})),a(a({},e),{definitions:n})}function la(e){var t=ca(e);if(!ia.has(t)){var n=function(e,t){return new De(e,t).parseDocument()}(e,{experimentalFragmentVariables:sa,allowLegacyFragmentVariables:sa});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");ia.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(ua(n)))}return ia.get(t)}function fa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach((function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]})),la(r)}var ha,da,pa,va,ya,ma,ga,ba,Ea,_a,Ta,Sa,Oa,wa,ka,Ia,Na,Aa,Da,Ra,xa,Ca,Fa,La,Pa,Ma,qa=fa,ja=function(){ia.clear(),oa.clear()},Va=function(){aa=!1},Ua=function(){sa=!0},Qa=function(){sa=!1};(ha=fa).gql=qa,ha.resetCaches=ja,ha.disableFragmentWarnings=Va,ha.enableExperimentalFragmentVariables=Ua,ha.disableExperimentalFragmentVariables=Qa,fa.default=fa,function(e){e.PRODUCT="PRODUCT",e.PACKAGE="PACKAGE"}(da||(da={})),function(e){e.OK="OK",e.CUSTOMER_BLACKLISTED="CUSTOMER_BLACKLISTED"}(pa||(pa={})),function(e){e.USER="USER",e.USER_LOGIN="USER_LOGIN",e.USER_LOGOUT="USER_LOGOUT",e.USER_UPDATE="USER_UPDATE",e.USER_DELETE="USER_DELETE",e.CART="CART",e.CART_ADD="CART_ADD",e.CART_REMOVE="CART_REMOVE",e.CART_UPDATE="CART_UPDATE",e.CART_CLEAR="CART_CLEAR",e.SESSION="SESSION",e.SESSION_REFRESH="SESSION_REFRESH",e.SESSION_EXPIRED="SESSION_EXPIRED",e.LIST="LIST",e.LIST_CREATE="LIST_CREATE",e.LIST_DELETE="LIST_DELETE",e.LIST_UPDATE="LIST_UPDATE",e.LIST_ADD_ITEM="LIST_ADD_ITEM",e.LIST_REMOVE_ITEM="LIST_REMOVE_ITEM",e.LIST_CLEAR="LIST_CLEAR"}(va||(va={})),function(e){e.PERSON="PERSON",e.ORGANIZATION="ORGANIZATION"}(ya||(ya={})),function(e){e.NONE="NONE",e.DEBUG="DEBUG",e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(ma||(ma={})),function(e){e.SERVER="server",e.CLIENT="client",e.HYBRID="hybrid"}(ga||(ga={})),function(e){e.follow="follow",e.noopener="noopener",e.noreferrer="noreferrer",e.alternate="alternate",e.author="author",e.bookmark="bookmark",e.external="external",e.help="help",e.license="license",e.next="next",e.nofollow="nofollow",e.prev="prev",e.search="search",e.tag="tag"}(ba||(ba={})),function(e){e.Proxy="Proxy",e.Direct="Direct"}(Ea||(Ea={})),function(e){e.NONE="NONE",e.PRICE="PRICE",e.PRICE_DESC="PRICE_DESC",e.MOST_SOLD="MOST_SOLD",e.VOTES="VOTES",e.BRAND="BRAND",e.LATEST="LATEST",e.RELEVANCE="RELEVANCE",e.FACET_ORDER="FACET_ORDER",e.ALPHABETICAL="ALPHABETICAL",e.ALPHABETICAL_DESC="ALPHABETICAL_DESC",e.AVAILABLE_STOCK="AVAILABLE_STOCK",e.AVAILABLE_STOCK_DESC="AVAILABLE_STOCK_DESC",e.TOTAL_STOCK="TOTAL_STOCK",e.TOTAL_STOCK_DESC="TOTAL_STOCK_DESC"}(_a||(_a={})),function(e){e.BY_GROUP="BY_GROUP",e.CURRENT="CURRENT"}(Ta||(Ta={})),function(e){e.Brand="Brand",e.Category="Category",e.Price="Price",e.Sku="Sku",e.StockStatus="StockStatus",e.DiscountCampaign="DiscountCampaign",e.DiscountCampaignNumber="DiscountCampaignNumber",e.Discount="Discount",e.ReducedPrice="ReducedPrice"}(Sa||(Sa={})),function(e){e.CustomerBlacklistedType="CUSTOMER_BLACKLISTED",e.OkType="OK"}(Oa||(Oa={})),function(e){e.OrganizationType="ORGANIZATION",e.PersonType="PERSON"}(wa||(wa={})),function(e){e.ExternalType="EXTERNAL",e.NoneType="NONE",e.PriceCampaignType="PRICE_CAMPAIGN",e.SalePriceType="SALE_PRICE"}(ka||(ka={})),function(e){e.ByGroupType="BY_GROUP",e.CurrentType="CURRENT"}(Ia||(Ia={})),function(e){e.ManType="MAN",e.UnsetType="UNSET",e.UnspecifiedType="UNSPECIFIED",e.WomanType="WOMAN"}(Na||(Na={})),function(e){e.FemaleType="FEMALE",e.MaleType="MALE",e.UnknownType="UNKNOWN"}(Aa||(Aa={})),function(e){e.IntersectType="INTERSECT",e.UnionType="UNION"}(Da||(Da={})),function(e){e.ExternalType="EXTERNAL",e.GeinsPayType="GEINS_PAY",e.StandardType="STANDARD"}(Ra||(Ra={})),function(e){e.AvardaType="AVARDA",e.GeinsPayType="GEINS_PAY",e.KlarnaType="KLARNA",e.StandardType="STANDARD",e.SveaType="SVEA",e.WalleyType="WALLEY"}(xa||(xa={})),function(e){e.AccessoriesType="ACCESSORIES",e.RelatedType="RELATED",e.SimilarType="SIMILAR"}(Ca||(Ca={})),function(e){e.AlphabeticalType="ALPHABETICAL",e.AlphabeticalDescType="ALPHABETICAL_DESC",e.AvailableStockType="AVAILABLE_STOCK",e.AvailableStockDescType="AVAILABLE_STOCK_DESC",e.BrandType="BRAND",e.Custom_1Type="CUSTOM_1",e.Custom_2Type="CUSTOM_2",e.Custom_3Type="CUSTOM_3",e.Custom_4Type="CUSTOM_4",e.Custom_5Type="CUSTOM_5",e.FacetOrderType="FACET_ORDER",e.LatestType="LATEST",e.MostSoldType="MOST_SOLD",e.NoneType="NONE",e.PriceType="PRICE",e.PriceDescType="PRICE_DESC",e.RelevanceType="RELEVANCE",e.TotalStockType="TOTAL_STOCK",e.TotalStockDescType="TOTAL_STOCK_DESC",e.VotesType="VOTES"}(Fa||(Fa={})),function(e){e[e.PERCENTAGE=0]="PERCENTAGE",e[e.FIXED_AMOUNT=1]="FIXED_AMOUNT"}(La||(La={})),function(e){e.UNSET="unset",e.UNSPECIFIED="unspecified",e.WOMAN="woman",e.MAN="man"}(Pa||(Pa={})),function(e){e.STANDARD="STANDARD",e.EXTERNAL="EXTERNAL",e.GEINS_PAY="GEINS_PAY"}(Ma||(Ma={}));var Ba,za=function(){function e(e,t,n,r,i){var o=this;this.observer=e,this.operation=t,this.forward=n,this.delayFor=r,this.retryIf=i,this.retryCount=0,this.currentSubscription=null,this.onError=function(e){return c(o,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this.retryCount+=1,[4,this.retryIf(this.retryCount,this.operation,e)];case 1:return t.sent()?(this.scheduleRetry(this.delayFor(this.retryCount,this.operation,e)),[2]):(this.observer.error(e),[2])}}))}))},this.try()}return e.prototype.cancel=function(){this.currentSubscription&&this.currentSubscription.unsubscribe(),clearTimeout(this.timerId),this.timerId=void 0,this.currentSubscription=null},e.prototype.try=function(){this.currentSubscription=this.forward(this.operation).subscribe({next:this.observer.next.bind(this.observer),error:this.onError,complete:this.observer.complete.bind(this.observer)})},e.prototype.scheduleRetry=function(e){var t=this;if(this.timerId)throw new Error("RetryLink BUG! Encountered overlapping retries");this.timerId=setTimeout((function(){t.timerId=void 0,t.try()}),e)},e}(),Ka=function(e){function t(t){var n=e.call(this)||this,r=t||{},i=r.attempts,o=r.delay;return n.delayFor="function"==typeof o?o:function(e){var t=e||{},n=t.initial,r=void 0===n?300:n,i=t.jitter,o=void 0===i||i,a=t.max,s=void 0===a?1/0:a,c=o?r:r/2;return function(e){var t=Math.min(s,c*Math.pow(2,e));return o&&(t=Math.random()*t),t}}(o),n.retryIf="function"==typeof i?i:function(e){var t=e||{},n=t.retryIf,r=t.max,i=void 0===r?5:r;return function(e,t,r){return!(e>=i)&&(n?n(r,t):!!r)}}(i),n}return o(t,e),t.prototype.request=function(e,t){var n=this;return new Nr((function(r){var i=new za(r,e,t,n.delayFor,n.retryIf);return function(){i.cancel()}}))},t}(Zr),Ga={USER:"geins-user",USER_AUTH:"geins-auth",USER_TYPE:"geins-user-type",USER_MAX_AGE:"geins-user-maxage",REFRESH_TOKEN:"geins-auth-refresh-token"},Wa={CART_ID:"geins-cart-id"},Ha={DEFAULT:1800,REMEMBER_USER:604800},Ya={DEFAULT:604800},Ja={ITEMS:"geins-lists"},$a={DEFAULT:2592e3},Xa={main:"https://merchantapi.geins.io/graphql",auth:"https://auth-service.geins.io/api/{ACCOUNT}_{ENV}",auth_sign:"https://merchantapi.geins.io/auth/sign/{API-KEY}?identity=",image:"https://{ACCOUNT}.commerce.services"},Za={REFRESH_TOKEN:"x-auth-refresh-token"},es="x-request-id",ts="x-sdk-version",ns="x-idempotency-key",rs=new Map([["geins-cart","{geins.cartid}"],["geins-pm","{geins.paymentMethodId}"],["geins-pt","{geins.paymentType}"],["geins-uid","{payment.uid}"]]),is={RAW:"raw",THUMB_SM:"40x40",THUMB:"100x100"};function os(){return"object"==typeof globalThis&&!("window"in globalThis)}function as(e,t,n,r){return void 0===n&&(n="prod"),{main:r||Xa.main,auth:Xa.auth.replace("{ACCOUNT}",t).replace("{ENV}",n),authSign:Xa.auth_sign.replace("{API-KEY}",e),image:Xa.image.replace("{ACCOUNT}",t)}}function ss(e,t,n){if(e&&"object"==typeof e){var r=e;if(t in r){if(void 0===n)return r;if(r[t]===n)return r}for(var i=0,o=Object.keys(r);i<o.length;i++){var a=ss(r[o[i]],t,n);if(a)return a}}}function cs(e){if(!e)return{url:e,params:new Map};if(!e.includes("?"))return{url:e,params:new Map};var t=e.split("?"),n=t[0],r=t[1];return{url:n,params:new Map(r?r.split("&").map((function(e){return e.split("=")})):[])}}function us(e){return e&&e.message?e.message:""}!function(e){e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TOKEN_EXPIRED="AUTH_TOKEN_EXPIRED",e.AUTH_TOKEN_REFRESH_FAILED="AUTH_TOKEN_REFRESH_FAILED",e.AUTH_NOT_AUTHENTICATED="AUTH_NOT_AUTHENTICATED",e.CART_NOT_FOUND="CART_NOT_FOUND",e.CART_ITEM_NOT_FOUND="CART_ITEM_NOT_FOUND",e.CART_OPERATION_FAILED="CART_OPERATION_FAILED",e.CHECKOUT_FAILED="CHECKOUT_FAILED",e.ORDER_FAILED="ORDER_FAILED",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.NOT_INITIALIZED="NOT_INITIALIZED",e.PARSE_ERROR="PARSE_ERROR",e.GRAPHQL_ERROR="GRAPHQL_ERROR",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.REQUEST_TIMEOUT="REQUEST_TIMEOUT",e.RATE_LIMITED="RATE_LIMITED",e.RETRY_EXHAUSTED="RETRY_EXHAUSTED",e.NETWORK_ERROR="NETWORK_ERROR"}(Ba||(Ba={}));var ls,fs=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.cause=r,i.name="GeinsError",i}return o(t,e),t}(Error);function hs(t,n){if(!t)throw new fs("Token is required.",Ba.INVALID_ARGUMENT);var r=t.split(".");if(3!==r.length&&n||2!==r.length&&!n)throw new fs("Invalid JWT token format.",Ba.PARSE_ERROR);var i=r[0],o=r[1],a=r[2],s=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t);return decodeURIComponent(n.split("").map((function(e){return"%".concat(e.charCodeAt(0).toString(16).padStart(2,"0"))})).join(""))},c=JSON.parse(s(i)),u=JSON.parse(s(o));if(n&&e.createHmac("sha256",n).update("".concat(i,".").concat(o)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")!==a)throw new fs("Invalid token signature.",Ba.AUTH_FAILED);return{header:c,payload:u}}function ds(t,n){if(!t||"object"!=typeof t)throw new fs("Payload must be a valid object.",Ba.INVALID_ARGUMENT);var r=function(e){return btoa(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},i={alg:n?"HS256":"none",typ:"JWT"},o=r(JSON.stringify(i)),a=r(JSON.stringify(t));if(!n)return"".concat(o,".").concat(a);var s=e.createHmac("sha256",n).update("".concat(o,".").concat(a)).digest("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return"".concat(o,".").concat(a,".").concat(s)}var ps=function(){function e(e){this.currentLogLevel=e}return e.prototype.shouldLog=function(e){if(this.currentLogLevel===ma.NONE)return!1;var t=[ma.DEBUG,ma.INFO,ma.WARN,ma.ERROR];return t.indexOf(e)>=t.indexOf(this.currentLogLevel)},e.prototype.none=function(e){this.shouldLog(ma.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.debug=function(e){this.shouldLog(ma.DEBUG)&&console.debug("[DEBUG]: ".concat(e))},e.prototype.info=function(e){this.shouldLog(ma.INFO)&&console.info("[INFO]: ".concat(e))},e.prototype.warn=function(e){this.shouldLog(ma.WARN)&&console.warn("[WARN]: ".concat(e))},e.prototype.error=function(e){this.shouldLog(ma.ERROR)&&console.error("[ERROR]: ".concat(e))},e}(),vs="undefined"!=typeof process&&"test"===(null===(ls=process.env)||void 0===ls?void 0:ls.NODE_ENV)?ma.NONE:ma.WARN,ys=new ps(vs),ms=function(){function e(e){void 0===e&&(e=3e5),this.defaultTTL=e,this.cache=new Map}return e.prototype.set=function(e,t,n){void 0===n&&(n=this.defaultTTL);var r=Date.now()+n;this.cache.set(e,{value:t,expiry:r})},e.prototype.get=function(e){var t=this.cache.get(e);if(t&&t.expiry>Date.now())return t.value;this.cache.delete(e)},e.prototype.delete=function(e){this.cache.delete(e)},e.prototype.clear=function(){this.cache.clear()},e}();function gs(e){return d(this,arguments,(function(e,t){var n,r,i,o,a,s,c,l;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=null!==(c=t.take)&&void 0!==c?c:20,r=null!==(l=t.startSkip)&&void 0!==l?l:0,u.label=1;case 1:return[4,h(e(r,n))];case 2:return i=u.sent(),o=i.items,a=i.count,s=r+o.length<a,[4,h({items:o,count:a,hasMore:s,skip:r,take:n})];case 3:return[4,u.sent()];case 4:return u.sent(),s&&0!==o.length?(r+=o.length,[3,1]):[3,5];case 5:return[2]}}))}))}function bs(e){return c(this,arguments,void 0,(function(e,t){var n,r,i,o,a,s,c,l,f,h;return void 0===t&&(t={}),u(this,(function(u){switch(u.label){case 0:n=[],u.label=1;case 1:u.trys.push([1,6,7,12]),r=!0,i=p(gs(e,t)),u.label=2;case 2:return[4,i.next()];case 3:if(o=u.sent(),c=o.done)return[3,5];h=o.value,r=!1,a=h,n.push.apply(n,a.items),u.label=4;case 4:return r=!0,[3,2];case 5:return[3,12];case 6:return s=u.sent(),l={error:s},[3,12];case 7:return u.trys.push([7,,10,11]),r||c||!(f=i.return)?[3,9]:[4,f.call(i)];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:if(l)throw l.error;return[7];case 11:return[7];case 12:return[2,n]}}))}))}function Es(){return new Zr((function(e,t){var n="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),r=Date.now();return e.setContext((function(e){var t,i=e.headers;return{headers:a(a({},void 0===i?{}:i),(t={},t[es]=n,t[ts]="0.5.0",t)),requestId:n,requestStartTime:r}})),t(e)}))}var _s=function(e){function t(t,n,r,i){var o=e.call(this,t,n,i)||this;return o.requestId=r,o.name="NetworkRequestError",o}return o(t,e),t}(fs),Ts=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," timed out after ").concat(n,"ms"),Ba.REQUEST_TIMEOUT,t,r)||this;return i.timeoutMs=n,i.name="TimeoutError",i}return o(t,e),t}(_s),Ss=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," rate limited").concat(n?" (retry after ".concat(n,"ms)"):""),Ba.RATE_LIMITED,t,r)||this;return i.retryAfterMs=n,i.name="RateLimitError",i}return o(t,e),t}(_s),Os=function(e){function t(t,n,r){var i=e.call(this,"Request ".concat(t," failed after ").concat(n," attempts"),Ba.RETRY_EXHAUSTED,t,r)||this;return i.attempts=n,i.name="RetryExhaustedError",i}return o(t,e),t}(_s);var ws,ks,Is=function(){function e(e){var t,n=this;this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[],this._timer=null,this._onMetrics=e.onMetrics;var r=null!==(t=e.flushIntervalMs)&&void 0!==t?t:6e4;this._onMetrics&&r>0&&(this._timer=setInterval((function(){return n.flush()}),r),"object"==typeof this._timer&&"unref"in this._timer&&this._timer.unref())}return e.prototype.recordSuccess=function(e){this._totalRequests++,this._successCount++,this._durations.push(e)},e.prototype.recordError=function(e,t){this._totalRequests++,this._errorCount++,t&&this._timeoutCount++,this._durations.push(e)},e.prototype.recordRetry=function(){this._retryCount++},e.prototype.snapshot=function(){var e=f([],this._durations,!0).sort((function(e,t){return e-t})),t=e.length>0?e.reduce((function(e,t){return e+t}),0)/e.length:0,n=Math.max(0,Math.ceil(.95*e.length)-1),r=e.length>0?e[n]:0;return{totalRequests:this._totalRequests,successCount:this._successCount,errorCount:this._errorCount,timeoutCount:this._timeoutCount,retryCount:this._retryCount,avgDurationMs:Math.round(t),p95DurationMs:r}},e.prototype.flush=function(){this._onMetrics&&this._onMetrics(this.snapshot())},e.prototype.reset=function(){this._totalRequests=0,this._successCount=0,this._errorCount=0,this._timeoutCount=0,this._retryCount=0,this._durations=[]},e.prototype.destroy=function(){this._timer&&(clearInterval(this._timer),this._timer=null)},e}();!function(e){e.CACHE_FIRST="cache-first",e.NETWORK_ONLY="network-only",e.CACHE_ONLY="cache-only",e.NO_CACHE="no-cache",e.STANDBY="standby"}(ws||(ws={})),function(e){e.QUERY="query",e.MUTATION="mutation"}(ks||(ks={}));var Ns=function(){function e(e){this._telemetry=null,this.fetchPolicy=os()?ws.NO_CACHE:ws.CACHE_FIRST,this.pollInterval=0;var t=e.apiUrl,n=e.apiKey,r=e.fetchPolicy,i=e.settings;this._apolloClient=this.createClient(t,n,i),r&&(this.fetchPolicy=r)}return e.prototype.createClient=function(e,t,n){var r=new qo({typePolicies:{CartType:{fields:{items:{merge:function(e,t){return t}},appliedCampaigns:{merge:function(e,t){return t}}}}}}),i=this.createLinkChain(e,t,n);return new ra({link:i,cache:r})},e.prototype.createLinkChain=function(e,t,n){var r,i,o=null==n?void 0:n.requestConfig,s=[];s.push(Es()),s.push(new Zr((function(e,t){var n=Zt(e.query);return"OperationDefinition"===n.kind&&"mutation"===n.operation&&e.setContext((function(e){var t,n=e.headers;return{headers:a(a({},void 0===n?{}:n),(t={},t[ns]="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),t))}})),t(e)})));var c,u=new ps(null!==(r=null==n?void 0:n.logLevel)&&void 0!==r?r:ma.NONE);s.push(function(e){return new Zr((function(t,n){var r=t.getContext(),i=r.requestId,o=r.requestStartTime,a=t.operationName||"unknown";return e.debug("[".concat(i,"] Starting ").concat(a)),new Nr((function(r){var s=n(t).subscribe({next:function(t){var n=Date.now()-(o||Date.now());e.debug("[".concat(i,"] ").concat(a," completed in ").concat(n,"ms")),r.next(t)},error:function(t){var n=Date.now()-(o||Date.now());e.error("[".concat(i,"] ").concat(a," failed after ").concat(n,"ms: ").concat(t.message)),r.error(t)},complete:function(){r.complete()}});return function(){return s.unsubscribe()}}))}))}(u)),(null==o?void 0:o.interceptors)&&s.push((c=o.interceptors,new Zr((function(e,t){return new Nr((function(n){var r=e.getContext(),i=r.requestId||"unknown",o=r.requestStartTime||Date.now(),s=e.operationName||"unknown",u=function(){var a=t(e).subscribe({next:function(e){if(c.onResponse){var t={requestId:i,operationName:s,durationMs:Date.now()-o,data:e.data};try{c.onResponse(t)}catch(e){}}n.next(e)},error:function(e){if(c.onError){var t={requestId:i,operationName:s,durationMs:Date.now()-o,error:e,retryCount:r.retryCount||0};try{c.onError(t)}catch(e){}}n.error(e)},complete:function(){n.complete()}});return a};if(c.onRequest){var l,f=a({},r.headers||{}),h={requestId:i,operationName:s,headers:f,timestamp:o};try{var d=c.onRequest(h);d&&"function"==typeof d.then?d.then((function(){e.setContext((function(){return a(a({},r),{headers:h.headers})})),l=u()})).catch((function(e){n.error(e)})):(e.setContext((function(){return a(a({},r),{headers:h.headers})})),l=u())}catch(e){return void n.error(e)}return function(){null==l||l.unsubscribe()}}var p=u();return function(){return p.unsubscribe()}}))}))));var l,f=null!==(i=null==o?void 0:o.timeoutMs)&&void 0!==i?i:0;f>0&&s.push(function(e){return new Zr((function(t,n){return e<=0?n(t):new Nr((function(r){var i=!1,o=setTimeout((function(){if(!i){i=!0;var n=t.getContext().requestId;r.error(new Ts(n||"unknown",e))}}),e),a=n(t).subscribe({next:function(e){i||r.next(e)},error:function(e){i||(i=!0,clearTimeout(o),r.error(e))},complete:function(){i||(i=!0,clearTimeout(o),r.complete())}});return function(){i=!0,clearTimeout(o),a.unsubscribe()}}))}))}(f)),(null==o?void 0:o.telemetry)&&(this._telemetry=new Is(o.telemetry),s.push((l=this._telemetry,new Zr((function(e,t){return new Nr((function(n){var r=e.getContext().requestStartTime||Date.now(),i=t(e).subscribe({next:function(e){l.recordSuccess(Date.now()-r),n.next(e)},error:function(e){var t="TimeoutError"===(null==e?void 0:e.name);l.recordError(Date.now()-r,t),n.error(e)},complete:function(){n.complete()}});return function(){return i.unsubscribe()}}))}))))),(null==o?void 0:o.retry)&&s.push(this.createRetryLink(o.retry));var h=vi({uri:e,headers:{Accept:"application/json","x-apikey":t}});return s.push(h),Zr.from(s)},e.prototype.createRetryLink=function(e){var t=e.maxRetries,n=void 0===t?3:t,r=e.initialDelayMs,i=void 0===r?300:r,o=e.maxDelayMs,a=void 0===o?1e4:o,s=e.jitter;return new Ka({delay:{initial:i,max:a,jitter:void 0===s||s},attempts:{max:n+1,retryIf:function(e){var t;if(!e)return!1;var n=e,r=n.response,i=null!==(t=n.statusCode)&&void 0!==t?t:null==r?void 0:r.status;return 429===i||(!i||i>=500)}}})},e.prototype.getClient=function(){return this._apolloClient},Object.defineProperty(e.prototype,"telemetry",{get:function(){return this._telemetry},enumerable:!1,configurable:!0}),e.prototype.clearCacheAndRefetchQueries=function(){this._apolloClient.resetStore()},e.prototype.getFetchPolicy=function(e,t){return e===ks.QUERY?t||this.fetchPolicy:e===ks.MUTATION?ws.NETWORK_ONLY:t===ws.NO_CACHE||t===ws.NETWORK_ONLY?t:ws.NETWORK_ONLY},e.prototype.buildContext=function(e){if(e)return{headers:{Authorization:"Bearer ".concat(e)}}},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,a=t||fa(n||""),s=i||{},[2,this._apolloClient.query({query:a,variables:r,fetchPolicy:this.getFetchPolicy(ks.QUERY,s.fetchPolicy),pollInterval:s.pollInterval||this.pollInterval,context:this.buildContext(o)})]}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return u(this,(function(c){return t=e.query,n=e.queryAsString,r=e.variables,i=e.requestOptions,o=e.userToken,a=t||fa(n||""),s=i||{},[2,this._apolloClient.mutate({mutation:a,variables:r,fetchPolicy:this.getFetchPolicy(ks.MUTATION,s.fetchPolicy),context:this.buildContext(o)})]}))}))},e}(),As=function(){function e(e){this.baseUrl="https://mgmtapi.geins.io",this.apiKey=e.apiKey,this.authToken=this.createAuthToken(e)}return e.prototype.createAuthToken=function(e){return btoa("".concat(e.username,":").concat(e.password))},e.prototype.getEndpointUrl=function(e){return"".concat(this.baseUrl,"/").concat(e)},e.prototype.request=function(t,n){return c(this,arguments,void 0,(function(t,n,r){var i,o;return void 0===r&&(r={}),u(this,(function(s){switch(s.label){case 0:return i=this.getEndpointUrl(n),o={method:t,headers:{Accept:"application/json","Content-Type":"application/json","x-apikey":this.apiKey,Authorization:"Bearer ".concat(this.authToken)},body:JSON.stringify(r)},[4,fetch(i,a(a({},o),{signal:AbortSignal.timeout(e.FETCH_TIMEOUT_MS)})).then((function(e){return e.json()}))];case 1:return[2,s.sent()]}}))}))},e.FETCH_TIMEOUT_MS=1e4,e}(),Ds=function(){function e(e,t){if(this._apiClient=e,!t.channel)throw new fs("Channel is required",Ba.INVALID_ARGUMENT);this._geinsSettings=t,this._channelId="".concat(t.channel,"|").concat(t.tld)}return e.prototype.destroy=function(){this._apiClient=void 0},e.prototype.createVariables=function(e){var t=a({},e);if(delete t.userToken,!t.languageId){if(!this._geinsSettings.locale)throw new fs("Language is required",Ba.INVALID_ARGUMENT);t.languageId=this._geinsSettings.locale}if(!t.marketId){if(!this._geinsSettings.market)throw new fs("Market is required",Ba.INVALID_ARGUMENT);t.marketId=this._geinsSettings.market}return t.channelId||(t.channelId=this._channelId),t},e.prototype.createQueryOptions=function(e,t,n){var r=null!=n?n:{},i=r.userToken,o=s(r,["userToken"]),c=this.createVariables(a(a({},t),o));return a({query:e,variables:c},i?{userToken:i}:{})},e.prototype.runQuery=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new fs("Merchant API Client is not set",Ba.NOT_INITIALIZED);return[2,this._apiClient().runQuery(e)]}))}))},e.prototype.runQueryParsed=function(e){return c(this,void 0,void 0,(function(){var t,n;return u(this,(function(r){switch(r.label){case 0:return[4,this.runQuery(e)];case 1:return t=r.sent(),n=this.cleanObject(t),[2,this.parseResult(n)]}}))}))},e.prototype.runMutation=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this._apiClient)throw new fs("Merchant API Client is not set",Ba.NOT_INITIALIZED);return[2,this._apiClient().runMutation(e)]}))}))},e.prototype.parseResult=function(e){return e},e.prototype.cleanObject=function(e){var t=this,n=Object.entries(e).reduce((function(e,n){var r=n[0],i=n[1];return r.startsWith("__typename")||(Array.isArray(i)?e[r]=i.map((function(e){return e&&"object"==typeof e?t.cleanObject(e):e})):e[r]=i&&"object"==typeof i?t.cleanObject(i):i),e}),{});return n},e}(),Rs=function(){function e(e){if(this.core=e,!e)throw new fs("Core is required",Ba.NOT_INITIALIZED);if(!e.client)throw new fs("Merchant API Client is not set",Ba.NOT_INITIALIZED);if(!e.geinsSettings)throw new fs("Settings are required",Ba.NOT_INITIALIZED);var t=e.geinsSettings;this._geinsSettings=t,this._apiClient=function(){return e.client}}return e.prototype.pushEvent=function(e,t){var n=t?va[t]:void 0;if(n&&n.includes("_")){var r=n.split("_")[0];this.core.events.push(e,r)}this.core.events.push(e,n)},e.prototype.getCore=function(){return this.core},e}(),xs=function(e){function t(t,n,r){void 0===n&&(n=Ba.AUTH_FAILED);var i=e.call(this,t,n,r)||this;return i.name="AuthError",i}return o(t,e),t}(fs),Cs=function(e){function t(t,n){void 0===t&&(t="Token has expired");var r=e.call(this,t,Ba.AUTH_TOKEN_EXPIRED,n)||this;return r.name="TokenExpiredError",r}return o(t,e),t}(xs),Fs=function(e){function t(t,n){void 0===t&&(t="Token refresh failed");var r=e.call(this,t,Ba.AUTH_TOKEN_REFRESH_FAILED,n)||this;return r.name="TokenRefreshError",r}return o(t,e),t}(xs),Ls=function(e){function t(t,n,r){void 0===n&&(n=Ba.CART_OPERATION_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CartError",i}return o(t,e),t}(fs),Ps=function(e){function t(t,n,r){void 0===n&&(n=Ba.CHECKOUT_FAILED);var i=e.call(this,t,n,r)||this;return i.name="CheckoutError",i}return o(t,e),t}(fs),Ms=function(e){function t(t,n,r){void 0===n&&(n=Ba.ORDER_FAILED);var i=e.call(this,t,n,r)||this;return i.name="OrderError",i}return o(t,e),t}(fs),qs={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ChannelFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChannelType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultLanguageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"defaultMarketId"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};function js(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){js(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){js(e,t)})),e.definitions&&e.definitions.forEach((function(e){js(e,t)}))}qs.loc.source={body:"fragment ChannelFields on ChannelType {\n id\n name\n type\n url\n defaultLanguageId\n defaultMarketId\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Vs={};function Us(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}qs.definitions.forEach((function(e){if(e.name){var t=new Set;js(e,t),Vs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Us(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Vs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(Vs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Us(e,t);r&&n.definitions.push(r)}))}(qs,"ChannelFields");var Qs={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"LanguageFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"LanguageType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:63}};function Bs(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){Bs(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Bs(e,t)})),e.definitions&&e.definitions.forEach((function(e){Bs(e,t)}))}Qs.loc.source={body:"fragment LanguageFields on LanguageType {\n id\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var zs={};function Ks(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Qs.definitions.forEach((function(e){if(e.name){var t=new Set;Bs(e,t),zs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Ks(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=zs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(zs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ks(e,t);r&&n.definitions.push(r)}))}(Qs,"LanguageFields");var Gs={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CurrencyFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CurrencyType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"symbol"},arguments:[],directives:[]}]}}],loc:{start:0,end:60}};function Ws(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){Ws(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){Ws(e,t)})),e.definitions&&e.definitions.forEach((function(e){Ws(e,t)}))}Gs.loc.source={body:"fragment CurrencyFields on CurrencyType {\n code\n symbol\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Hs={};function Ys(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Gs.definitions.forEach((function(e){if(e.name){var t=new Set;Ws(e,t),Hs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Ys(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Hs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(Hs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Ys(e,t);r&&n.definitions.push(r)}))}(Gs,"CurrencyFields");var Js={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"CountryFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CountryType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"code"},arguments:[],directives:[]}]}}],loc:{start:0,end:56}};function $s(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){$s(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){$s(e,t)})),e.definitions&&e.definitions.forEach((function(e){$s(e,t)}))}Js.loc.source={body:"fragment CountryFields on CountryType {\n name\n code\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Xs={};function Zs(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}Js.definitions.forEach((function(e){if(e.name){var t=new Set;$s(e,t),Xs[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[Zs(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Xs[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(Xs[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=Zs(e,t);r&&n.definitions.push(r)}))}(Js,"CountryFields");var ec={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"MarketFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MarketType"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"alias"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"allowedLanguages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CountryFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CurrencyFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"onlyDisplayInCheckout"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtual"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"groupKey"},arguments:[],directives:[]}]}}],loc:{start:0,end:313}};ec.loc.source={body:"#import './currencyFields.gql'\n#import './countryFields.gql'\n#import './languageFields.gql'\nfragment MarketFields on MarketType {\n id\n alias\n allowedLanguages {\n ...LanguageFields\n }\n country {\n ...CountryFields\n }\n currency {\n ...CurrencyFields\n }\n onlyDisplayInCheckout\n virtual\n groupKey\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var tc={};function nc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!tc[t]&&(tc[t]=!0,!0)}))}function rc(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){rc(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){rc(e,t)})),e.definitions&&e.definitions.forEach((function(e){rc(e,t)}))}ec.definitions=ec.definitions.concat(nc(Gs.definitions)),ec.definitions=ec.definitions.concat(nc(Js.definitions)),ec.definitions=ec.definitions.concat(nc(Qs.definitions));var ic={};function oc(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ec.definitions.forEach((function(e){if(e.name){var t=new Set;rc(e,t),ic[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[oc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=ic[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(ic[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=oc(e,t);r&&n.definitions.push(r)}))}(ec,"MarketFields");var ac={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannel"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"channelId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"NullValue"},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channel"},arguments:[{kind:"Argument",name:{kind:"Name",value:"channelId"},value:{kind:"Variable",name:{kind:"Name",value:"channelId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:358}};ac.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannel($channelId: String = null) {\n channel(channelId: $channelId) {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var sc={};function cc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!sc[t]&&(sc[t]=!0,!0)}))}function uc(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){uc(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){uc(e,t)})),e.definitions&&e.definitions.forEach((function(e){uc(e,t)}))}ac.definitions=ac.definitions.concat(cc(qs.definitions)),ac.definitions=ac.definitions.concat(cc(Qs.definitions)),ac.definitions=ac.definitions.concat(cc(ec.definitions)),ac.definitions=ac.definitions.concat(cc(Gs.definitions));var lc={};function fc(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}ac.definitions.forEach((function(e){if(e.name){var t=new Set;uc(e,t),lc[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[fc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=lc[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(lc[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=fc(e,t);r&&n.definitions.push(r)}))}(ac,"getChannel");var hc={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getChannels"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"channels"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ChannelFields"},directives:[]},{kind:"Field",name:{kind:"Name",value:"markets"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MarketFields"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"languages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"LanguageFields"},directives:[]}]}}]}}]}}],loc:{start:0,end:310}};hc.loc.source={body:"#import './fragments/channelFields.gql'\n#import './fragments/languageFields.gql'\n#import './fragments/marketFields.gql'\n#import './fragments/currencyFields.gql'\n\nquery getChannels {\n channels {\n ...ChannelFields\n markets {\n ...MarketFields\n }\n languages {\n ...LanguageFields\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var dc={};function pc(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!dc[t]&&(dc[t]=!0,!0)}))}function vc(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){vc(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){vc(e,t)})),e.definitions&&e.definitions.forEach((function(e){vc(e,t)}))}hc.definitions=hc.definitions.concat(pc(qs.definitions)),hc.definitions=hc.definitions.concat(pc(Qs.definitions)),hc.definitions=hc.definitions.concat(pc(ec.definitions)),hc.definitions=hc.definitions.concat(pc(Gs.definitions));var yc={};function mc(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}hc.definitions.forEach((function(e){if(e.name){var t=new Set;vc(e,t),yc[e.name.value]=t}})),function(e,t){var n={kind:e.kind,definitions:[mc(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=yc[t]||new Set,i=new Set,o=new Set;for(r.forEach((function(e){o.add(e)}));o.size>0;){var a=o;o=new Set,a.forEach((function(e){i.has(e)||(i.add(e),(yc[e]||new Set).forEach((function(e){o.add(e)})))}))}i.forEach((function(t){var r=mc(e,t);r&&n.definitions.push(r)}))}(hc,"getChannels");var gc={channels:hc,channel:ac};function bc(e){if(!e||!e.id)throw new fs("Invalid result structure for channel",Ba.PARSE_ERROR);return{id:e.id,name:e.name,type:e.type,url:e.url,defaultMarketId:e.defaultMarketId,defaultLanguageId:e.defaultLanguageId,markets:e.markets?e.markets.filter((function(e){return null!=e})).map((function(e){return{id:(t=e).id,alias:t.alias,allowedLanguages:t.allowedLanguages?t.allowedLanguages.filter((function(e){return null!=e})).map((function(e){return _c(e)})):[],country:t.country?Ec(t.country):{name:"",code:""},currency:t.currency?Tc(t.currency):{code:"",symbol:"",name:"",rate:0},onlyDisplayInCheckout:t.onlyDisplayInCheckout,virtual:t.virtual,groupKey:t.groupKey,defaultLanguageId:t.defaultLanguageId};var t})):[],languages:e.languages?e.languages.filter((function(e){return null!=e})).map((function(e){return _c(e)})):[]}}function Ec(e){return{name:e.name,code:e.code}}function _c(e){return{id:e.id,name:e.name,code:e.code}}function Tc(e){return{code:e.code,symbol:e.symbol,name:e.name,rate:e.rate}}var Sc,Oc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new ms(9e5),r}return o(t,e),t.prototype.get=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i;return u(this,(function(o){switch(o.label){case 0:return t="channel_".concat(e),(n=this.cache.get(t))?[2,n]:(r={query:gc.channel,variables:{channelId:e}},[4,this.runQueryParsed(r)]);case 1:return(i=o.sent())&&this.cache.set(t,i),[2,i]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new fs("Invalid result structure for channel",Ba.PARSE_ERROR);var t=e.data.channel;if(t)return bc(t);ys.warn("No channel found")}(e)},t}(Ds),wc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.cache=new ms(18e5),r}return o(t,e),t.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t,n,r;return u(this,(function(i){switch(i.label){case 0:return e="all_channels",(t=this.cache.get(e))?[2,t]:(n={query:gc.channels,variables:{}},[4,this.runQueryParsed(n)]);case 1:return(r=i.sent())&&this.cache.set(e,r),[2,r]}}))}))},t.prototype.parseResult=function(e){return function(e){if(!e||!e.data)throw new fs("Invalid result structure for channels",Ba.PARSE_ERROR);var t=e.data.channels;if(t&&0!==t.length)return t.map((function(e){return bc(e)})).filter((function(e){return void 0!==e}));ys.warn("No channel found")}(e)},t}(Ds),kc=function(){function e(e){this.path="/",this.domain="",this.secure=!0,this.httpOnly=!0,this.sameSite="lax",this.cookie=t(),this.maxAge=0,e&&(e.path&&(this.path=e.path),e.domain&&(this.domain=e.domain),void 0!==e.secure&&(this.secure=e.secure),void 0!==e.httpOnly&&(this.httpOnly=e.httpOnly),void 0!==e.sameSite&&(this.sameSite=e.sameSite),void 0!==e.maxAge&&(this.maxAge=this.parseMaxAge(e.maxAge)))}return e.prototype.getConfig=function(){return{path:this.path,domain:this.domain,secure:this.secure,httpOnly:this.httpOnly,sameSite:this.sameSite,maxAge:this.maxAge}},e.prototype.parseMaxAge=function(e){if("string"==typeof e){var t=parseInt(e,10);return isNaN(t)?0:t}return e},e.prototype.configToCookieOptions=function(e){return{path:e.path,domain:e.domain,secure:e.secure,httpOnly:e.httpOnly,sameSite:e.sameSite,maxAge:void 0!==e.maxAge?this.parseMaxAge(e.maxAge):void 0}},e.prototype.getAll=function(){return this.cookie.getAll()},e.prototype.get=function(e){return this.cookie.get(e)||""},e.prototype.remove=function(e){this.cookie.remove(e)},e.prototype.set=function(e,t){var n=this.getConfig(),r=a(a(a({},n),t),e),i=this.configToCookieOptions(r);this.cookie.set(e.name,e.payload,i)},e}(),Ic=function(){function e(e){this._cookieService=null!=e?e:new kc}return e.prototype.get=function(e){return this._cookieService.get(e)||void 0},e.prototype.set=function(e,t,n){this._cookieService.set({name:e,payload:t,maxAge:null==n?void 0:n.maxAge})},e.prototype.remove=function(e){this._cookieService.remove(e)},e}(),Nc={exports:{}};var Ac,Dc=(Sc||(Sc=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||i&&!s[c].once||r&&s[c].context!==r)&&u.push(s[c]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(Nc)),Nc.exports),Rc=eo(Dc),xc=function(){function e(){this.eventName="geins-event",this.emitter=new Rc,this.broadcastChannelId="geins-channel",os()||(this.broadcast=new n(this.broadcastChannelId),this.addBroadcastListener())}return e.prototype.addBroadcastListener=function(){var e=this;this.broadcast&&(this.broadcast.onmessage=function(t){var n=t;e.emitter.emit(n.eventName,n.eventMessage)})},e.prototype.listenerAdd=function(e,t){void 0===t&&(t=this.eventName),this.emitter.on(t,e)},e.prototype.listenerOnce=function(e,t){void 0===t&&(t=this.eventName),this.emitter.once(t,e)},e.prototype.listenerRemove=function(e){void 0===e&&(e=this.eventName),this.emitter.removeAllListeners(e)},e.prototype.listenerCount=function(e){return void 0===e&&(e=this.eventName),this.emitter.listenerCount(e)},e.prototype.listenersGet=function(e){return void 0===e&&(e=this.eventName),this.emitter.listeners(e)},e.prototype.push=function(e,t){var n;void 0===t&&(t=this.eventName),this.emitter.emit(t,e),(null===(n=e.broadcast)||void 0===n||n)&&this.broadcast&&this.broadcast.postMessage({eventMessage:e,eventName:t})},e}(),Cc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.log_to_console=!1,r}return o(t,e),t.prototype.verifyQueryOptions=function(e){var t,n,r,i,o=a({},e);if(!e.query&&!e.queryAsString)throw new fs("Query or queryAsString is required",Ba.INVALID_ARGUMENT);try{e.queryAsString&&!e.query&&(o.query=fa(e.queryAsString))}catch(e){throw new fs("Error parsing string to query",Ba.PARSE_ERROR,e)}var s=o.query,c=s.definitions[0];if(!(c&&"OperationDefinition"===c.kind&&(null!==(n=null===(t=c.variableDefinitions)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0))return o;o.variables=this.createVariables(null!==(r=o.variables)&&void 0!==r?r:{});var u=(null===(i=s.definitions[0].variableDefinitions)||void 0===i?void 0:i.map((function(e){return e.variable.name.value})))||[];return Object.keys(o.variables).forEach((function(e){u.includes(e)||delete o.variables[e]})),o},t.prototype.query=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,this.verifyQueryOptions(e)];case 1:return t=i.sent(),(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&ys.debug("[Geins] queryOptions: ".concat(JSON.stringify(t))),[4,this.runQuery(t)];case 2:return n=i.sent(),r=this.cleanObject(n),[2,this.parseResult(r)]}}))}))},t.prototype.mutation=function(e){return c(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return(this.log_to_console||e.log_to_console)&&"prod"!==this._geinsSettings.environment&&ys.debug("[Geins] mutation options: ".concat(JSON.stringify(e))),[4,this.runMutation(e)];case 1:return t=n.sent(),[2,this.parseResult(t)]}}))}))},t.prototype.parseResult=function(e){var t=e;if(null==t?void 0:t.data)return t.data;if(null==t?void 0:t.errors)throw new fs("GraphQL errors",Ba.GRAPHQL_ERROR,t.errors);return null},t}(Ds),Fc=function(){function e(){this._store=new Map}return e.prototype.get=function(e){return this._store.get(e)},e.prototype.set=function(e,t,n){this._store.set(e,t)},e.prototype.remove=function(e){this._store.delete(e)},e.prototype.clear=function(){this._store.clear()},e}();!function(e){e[e.INIT=0]="INIT",e[e.FETCHING=1]="FETCHING",e[e.READY=2]="READY",e[e.ERROR=3]="ERROR"}(Ac||(Ac={}));var Lc=function(){function e(){this.initStore()}return e.prototype.initStore=function(){this.store=new r({stdTTL:86400,checkperiod:17280,useClones:!1})},e.prototype.setKey=function(e,t){return c(this,void 0,void 0,(function(){return u(this,(function(n){return void 0!==this.store&&this.store.set(e,t),[2]}))}))},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0!==this.store?[2,this.store.get(e)]:[2,null]}))}))},e.prototype.getKeys=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0===this.store?[2,[]]:[2,this.store.keys()]}))}))},e.prototype.deleteKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return void 0===this.store?[3,2]:[4,this.store.del(e)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.hasKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){return void 0===this.store?[2,!1]:[2,this.store.has(e)]}))}))},e.prototype.clearStore=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){return void 0!==this.store&&(this.store.flushAll(),this.store.close()),[2]}))}))},e.prototype.destroy=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.clearStore()];case 1:return e.sent(),this.store=void 0,[2]}}))}))},e}(),Pc=function(){function e(e){if(this.geinsSettings=e,!e.channel)throw new fs("Channel is required",Ba.INVALID_ARGUMENT);if(!e.apiKey)throw new fs("API Key is required",Ba.INVALID_ARGUMENT);this.store=new Lc,this.channelId="".concat(e.channel,"|").concat(e.tld),this.cache=new ms(36e5),this.initApiClient()}return e.prototype.initApiClient=function(){if(!this.geinsSettings.apiKey||!this.geinsSettings.accountName)throw new fs("API Key and Account Name are required",Ba.INVALID_ARGUMENT);var e={apiUrl:as(this.geinsSettings.apiKey,this.geinsSettings.accountName,this.geinsSettings.environment,this.geinsSettings.apiUrl).main,apiKey:this.geinsSettings.apiKey,requestOptions:{fetchPolicy:ws.CACHE_FIRST}};this._apiClient=function(){return new Ns(e)}},e.prototype.initChannelService=function(){var e=this;this.channelService=new Oc((function(){return e._apiClient()}),this.geinsSettings)},e.prototype.setKey=function(e,t){if(!this.store)throw new fs("Store is not initialized",Ba.NOT_INITIALIZED);this.store.setKey(e,t)},e.prototype.getKey=function(e){return c(this,void 0,void 0,(function(){return u(this,(function(t){if(!this.store)throw new fs("Store is not initialized",Ba.NOT_INITIALIZED);return[2,this.store.getKey(e)]}))}))},e.prototype.setChannel=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return this.channelService||(this._apiClient||this.initApiClient(),this.initChannelService()),[4,null===(t=this.channelService)||void 0===t?void 0:t.get(this.channelId)];case 1:return(e=n.sent())&&this.cache.set(this.channelId,e),[2,e]}}))}))},e.prototype.get=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return(e=this.cache.get(this.channelId))?[2,e]:[4,this.setChannel()];case 1:return[2,null!=(t=n.sent())?t:void 0]}}))}))},e}(),Mc=function(){function e(e){if(!e.channel)throw new fs("Channel is required",Ba.INVALID_ARGUMENT);if(!e.apiKey)throw new fs("API Key is required",Ba.INVALID_ARGUMENT);if(!e.accountName)throw new fs("Account name is required",Ba.INVALID_ARGUMENT);this._geinsSettings=a(a({},{environment:"prod"}),e),this._geinsSettings.apiKey&&this._geinsSettings.accountName&&(this._endpointsUrls=as(this._geinsSettings.apiKey,this._geinsSettings.accountName,this._geinsSettings.environment,this._geinsSettings.apiUrl)),os()||(this._cookieService=new kc),this._currentChannel=new Pc(this._geinsSettings),this._eventService=new xc}return e.prototype.initApiClient=function(){if(!this._geinsSettings.apiKey||!this._geinsSettings.accountName)throw new fs("Failed to initialize API Client",Ba.NOT_INITIALIZED);var e={apiUrl:this._endpointsUrls.main,apiKey:this._geinsSettings.apiKey,settings:this._geinsSettings};this._apiClient=new Ns(e)},e.prototype.initGraphQLService=function(){var e=this;this._graphQLService=new Cc((function(){return e.client}),this._geinsSettings)},Object.defineProperty(e.prototype,"channel",{get:function(){return{current:this.channelGet.bind(this),all:this.channelsGet.bind(this)}},enumerable:!1,configurable:!0}),e.prototype.channelGet=function(){return c(this,void 0,void 0,(function(){var e,t;return u(this,(function(n){if(this._currentChannel||(this._currentChannel=new Pc(this._geinsSettings)),!this._currentChannel)throw new fs("Failed to initialize channel",Ba.NOT_INITIALIZED);return[2,null!==(t=null===(e=this._currentChannel)||void 0===e?void 0:e.get())&&void 0!==t?t:void 0]}))}))},e.prototype.channelsGet=function(){return c(this,void 0,void 0,(function(){var e,t=this;return u(this,(function(n){return this._accountChannels||(this._accountChannels=new wc((function(){return t.client}),this._geinsSettings)),[2,null!==(e=this._accountChannels.get())&&void 0!==e?e:void 0]}))}))},Object.defineProperty(e.prototype,"endpoints",{get:function(){if(!this._endpointsUrls)throw new fs("Endpoints are not set",Ba.NOT_INITIALIZED);return this._endpointsUrls},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"client",{get:function(){if(!this._endpointsUrls)throw new fs("Endpoints are not set",Ba.NOT_INITIALIZED);return this._apiClient||this.initApiClient(),this._apiClient},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"graphql",{get:function(){return this._graphQLService||this.initGraphQLService(),this._graphQLService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geinsSettings",{get:function(){return this._geinsSettings},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this._eventService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cookies",{get:function(){return this._cookieService||(this._cookieService=new kc),this._cookieService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"telemetry",{get:function(){var e,t;return null!==(t=null===(e=this._apiClient)||void 0===e?void 0:e.telemetry)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),e.encodeJWT=function(e,t){return ds(e,t)},e.decodeJWT=function(e,t){return hs(e,t).payload},e}();function qc(e,t,n,r){return e&&r?"".concat(e,"/").concat(t,"/").concat(n,"/").concat(encodeURIComponent(r)):""}function jc(e,t,n){return qc(e,t,is.RAW,n)}function Vc(e,t,n){return qc(e,t,is.THUMB,n)}export{Za as AUTH_HEADERS,Ga as AUTH_STORAGE_KEYS,Ha as AUTH_STORAGE_MAX_AGE,Ea as AuthClientConnectionModes,xs as AuthError,Ds as BaseApiService,Rs as BasePackage,Wa as CART_STORAGE_KEYS,Ya as CART_STORAGE_MAX_AGE,rs as CHECKOUT_PARAMETERS,Ls as CartError,Pc as Channel,Ps as CheckoutError,kc as CookieService,Ic as CookieStorageAdapter,ya as CustomerType,La as DiscountType,xc as EventService,ws as FetchPolicyOptions,Sa as FilterSystemEntityTypes,is as GEINS_IMAGE_FOLDER,Oa as GeinsCheckoutStatus,Mc as GeinsCore,wa as GeinsCustomerType,ka as GeinsDiscountType,fs as GeinsError,Ba as GeinsErrorCode,va as GeinsEventType,Ia as GeinsFilterMode,Na as GeinsGender,Aa as GeinsGenderType,Da as GeinsIncludeMode,ma as GeinsLogLevel,Ra as GeinsPaymentCheckout,xa as GeinsPaymentType,Ca as GeinsProductRelation,Fa as GeinsSortType,Pa as Gender,Cc as GraphQLService,da as ItemType,Ja as LISTS_STORAGE_KEYS,$a as LISTS_STORAGE_MAX_AGE,ba as LinkAttributeRelEnum,ps as Logger,As as ManagementApiClient,Fc as MemoryStorage,Ns as MerchantApiClient,_s as NetworkRequestError,ks as OperationType,Ms as OrderError,Ma as PaymentOptionCheckoutType,Ta as ProductFilterModeType,_a as ProductListSortType,Ss as RateLimitError,Os as RetryExhaustedError,ga as RuntimeContext,Is as TelemetryCollector,Ts as TimeoutError,Cs as TokenExpiredError,Fs as TokenRefreshError,as as buildEndpoints,qc as buildGeinsImageUrl,jc as buildGeinsRawUrl,Vc as buildGeinsThumbnailUrl,hs as decodeJWT,ds as encodeJWT,cs as extractParametersFromUrl,ss as findObjectWithProperty,fa as gql,os as isServerContext,gs as paginate,bs as paginateAll,us as parseErrorMessage,ys as sdkLogger};