@spritz-finance/api-client 0.3.0 → 0.3.2

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.
@@ -1,6 +1,6 @@
1
- "use strict";var Ma=require("cross-fetch"),me=require("zod"),tt=(e=>(e.Staging="staging",e.Production="production",e))(tt||{}),ja=Object.getOwnPropertyNames,ee=(e,n)=>function(){return n||(0,e[ja(e)[0]])((n={exports:{}}).exports,n),n.exports};function tn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tn=function(t){return typeof t}:tn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(e)}function se(e){return tn(e)=="object"&&e!==null}var Kt=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",G=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function it(e,n){for(var t=/\r\n|[\n\r]/g,i=1,a=n+1,r;(r=t.exec(e.body))&&r.index<n;)i+=1,a=n+1-(r.index+r[0].length);return{line:i,column:a}}function Ga(e){return Xt(e.source,it(e.source,e.start))}function Xt(e,n){var t=e.locationOffset.column-1,i=an(t)+e.body,a=n.line-1,r=e.locationOffset.line-1,u=n.line+r,o=n.line===1?t:0,s=n.column+o,c="".concat(e.name,":").concat(u,":").concat(s,`
1
+ "use strict";var Ma=require("cross-fetch"),me=require("zod"),tt=(e=>(e.Staging="staging",e.Production="production",e))(tt||{}),ja=Object.getOwnPropertyNames,ee=(e,n)=>function(){return n||(0,e[ja(e)[0]])((n={exports:{}}).exports,n),n.exports};function tn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tn=function(t){return typeof t}:tn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(e)}function se(e){return tn(e)=="object"&&e!==null}var Yt=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",G=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function it(e,n){for(var t=/\r\n|[\n\r]/g,i=1,a=n+1,r;(r=t.exec(e.body))&&r.index<n;)i+=1,a=n+1-(r.index+r[0].length);return{line:i,column:a}}function Ga(e){return Xt(e.source,it(e.source,e.start))}function Xt(e,n){var t=e.locationOffset.column-1,i=an(t)+e.body,a=n.line-1,r=e.locationOffset.line-1,u=n.line+r,o=n.line===1?t:0,s=n.column+o,c="".concat(e.name,":").concat(u,":").concat(s,`
2
2
  `),k=i.split(/\r\n|[\n\r]/g),T=k[a];if(T.length>120){for(var y=Math.floor(s/80),f=s%80,N=[],I=0;I<T.length;I+=80)N.push(T.slice(I,I+80));return c+Wt([["".concat(u),N[0]]].concat(N.slice(1,y+1).map(function(A){return["",A]}),[[" ",an(f-1)+"^"],["",N[y+1]]]))}return c+Wt([["".concat(u-1),k[a-1]],["".concat(u),T],["",an(s-1)+"^"],["".concat(u+1),k[a+1]]])}function Wt(e){var n=e.filter(function(i){i[0];var a=i[1];return a!==void 0}),t=Math.max.apply(Math,n.map(function(i){var a=i[0];return a.length}));return n.map(function(i){var a=i[0],r=i[1];return Qa(t,a)+(r?" | "+r:" |")}).join(`
3
- `)}function an(e){return Array(e+1).join(" ")}function Qa(e,n){return an(e-n.length)+n}function rn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rn=function(t){return typeof t}:rn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rn(e)}function Zt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function za(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Zt(Object(t),!0).forEach(function(i){Ha(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zt(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ha(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ja(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function ei(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ya(e,n,t){return n&&ei(e.prototype,n),t&&ei(e,t),e}function Ka(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&$e(e,n)}function Xa(e){var n=ti();return function(){var i=xe(e),a;if(n){var r=xe(this).constructor;a=Reflect.construct(i,arguments,r)}else a=i.apply(this,arguments);return ni(this,a)}}function ni(e,n){return n&&(rn(n)==="object"||typeof n=="function")?n:Ce(e)}function Ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function at(e){var n=typeof Map=="function"?new Map:void 0;return at=function(i){if(i===null||!Wa(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(i))return n.get(i);n.set(i,a)}function a(){return on(i,arguments,xe(this).constructor)}return a.prototype=Object.create(i.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),$e(a,i)},at(e)}function on(e,n,t){return ti()?on=Reflect.construct:on=function(a,r,u){var o=[null];o.push.apply(o,r);var s=Function.bind.apply(a,o),c=new s;return u&&$e(c,u.prototype),c},on.apply(null,arguments)}function ti(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Wa(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function $e(e,n){return $e=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},$e(e,n)}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(e)}var B=function(e){Ka(t,e);var n=Xa(t);function t(i,a,r,u,o,s,c){var k,T,y,f;Ja(this,t),f=n.call(this,i),f.name="GraphQLError",f.originalError=s??void 0,f.nodes=ii(Array.isArray(a)?a:a?[a]:void 0);for(var N=[],I=0,A=(D=f.nodes)!==null&&D!==void 0?D:[];I<A.length;I++){var D,P=A[I],_=P.loc;_!=null&&N.push(_)}N=ii(N),f.source=r??((k=N)===null||k===void 0?void 0:k[0].source),f.positions=u??((T=N)===null||T===void 0?void 0:T.map(function(l){return l.start})),f.locations=u&&r?u.map(function(l){return it(r,l)}):(y=N)===null||y===void 0?void 0:y.map(function(l){return it(l.source,l.start)}),f.path=o??void 0;var d=s?.extensions;return c==null&&se(d)?f.extensions=za({},d):f.extensions=c??{},Object.defineProperties(Ce(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?(Object.defineProperty(Ce(f),"stack",{value:s.stack,writable:!0,configurable:!0}),ni(f)):(Error.captureStackTrace?Error.captureStackTrace(Ce(f),t):Object.defineProperty(Ce(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Ya(t,[{key:"toString",value:function(){return Za(this)}},{key:G,get:function(){return"Object"}}]),t}(at(Error));function ii(e){return e===void 0||e.length===0?void 0:e}function Za(e){var n=e.message;if(e.nodes)for(var t=0,i=e.nodes;t<i.length;t++){var a=i[t];a.loc&&(n+=`
3
+ `)}function an(e){return Array(e+1).join(" ")}function Qa(e,n){return an(e-n.length)+n}function rn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rn=function(t){return typeof t}:rn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rn(e)}function Zt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function za(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Zt(Object(t),!0).forEach(function(i){Ha(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zt(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ha(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ja(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function ei(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ka(e,n,t){return n&&ei(e.prototype,n),t&&ei(e,t),e}function Ya(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&$e(e,n)}function Xa(e){var n=ti();return function(){var i=xe(e),a;if(n){var r=xe(this).constructor;a=Reflect.construct(i,arguments,r)}else a=i.apply(this,arguments);return ni(this,a)}}function ni(e,n){return n&&(rn(n)==="object"||typeof n=="function")?n:Ce(e)}function Ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function at(e){var n=typeof Map=="function"?new Map:void 0;return at=function(i){if(i===null||!Wa(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(i))return n.get(i);n.set(i,a)}function a(){return on(i,arguments,xe(this).constructor)}return a.prototype=Object.create(i.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),$e(a,i)},at(e)}function on(e,n,t){return ti()?on=Reflect.construct:on=function(a,r,u){var o=[null];o.push.apply(o,r);var s=Function.bind.apply(a,o),c=new s;return u&&$e(c,u.prototype),c},on.apply(null,arguments)}function ti(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Wa(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function $e(e,n){return $e=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},$e(e,n)}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(e)}var B=function(e){Ya(t,e);var n=Xa(t);function t(i,a,r,u,o,s,c){var k,T,y,f;Ja(this,t),f=n.call(this,i),f.name="GraphQLError",f.originalError=s??void 0,f.nodes=ii(Array.isArray(a)?a:a?[a]:void 0);for(var N=[],I=0,A=(D=f.nodes)!==null&&D!==void 0?D:[];I<A.length;I++){var D,P=A[I],_=P.loc;_!=null&&N.push(_)}N=ii(N),f.source=r??((k=N)===null||k===void 0?void 0:k[0].source),f.positions=u??((T=N)===null||T===void 0?void 0:T.map(function(l){return l.start})),f.locations=u&&r?u.map(function(l){return it(r,l)}):(y=N)===null||y===void 0?void 0:y.map(function(l){return it(l.source,l.start)}),f.path=o??void 0;var d=s?.extensions;return c==null&&se(d)?f.extensions=za({},d):f.extensions=c??{},Object.defineProperties(Ce(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?(Object.defineProperty(Ce(f),"stack",{value:s.stack,writable:!0,configurable:!0}),ni(f)):(Error.captureStackTrace?Error.captureStackTrace(Ce(f),t):Object.defineProperty(Ce(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Ka(t,[{key:"toString",value:function(){return Za(this)}},{key:G,get:function(){return"Object"}}]),t}(at(Error));function ii(e){return e===void 0||e.length===0?void 0:e}function Za(e){var n=e.message;if(e.nodes)for(var t=0,i=e.nodes;t<i.length;t++){var a=i[t];a.loc&&(n+=`
4
4
 
5
5
  `+Ga(a.loc))}else if(e.source&&e.locations)for(var r=0,u=e.locations;r<u.length;r++){var o=u[r];n+=`
6
6
 
@@ -22,24 +22,24 @@ spurious results.`))}}return!1};function ri(e,n){for(var t=0;t<n.length;t++){var
22
22
  `),'"""'+s.replace(/"""/g,'\\"""')+'"""'}var dr={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"]},fr=Object.freeze({});function oi(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dr,i=void 0,a=Array.isArray(e),r=[e],u=-1,o=[],s=void 0,c=void 0,k=void 0,T=[],y=[],f=e;do{u++;var N=u===r.length,I=N&&o.length!==0;if(N){if(c=y.length===0?void 0:T[T.length-1],s=k,k=y.pop(),I){if(a)s=s.slice();else{for(var A={},D=0,P=Object.keys(s);D<P.length;D++){var _=P[D];A[_]=s[_]}s=A}for(var d=0,l=0;l<o.length;l++){var S=o[l][0],m=o[l][1];a&&(S-=d),a&&m===null?(s.splice(S,1),d++):s[S]=m}}u=i.index,r=i.keys,o=i.edits,a=i.inArray,i=i.prev}else{if(c=k?a?u:r[u]:void 0,s=k?k[c]:f,s==null)continue;k&&T.push(c)}var E=void 0;if(!Array.isArray(s)){if(!ot(s))throw new Error("Invalid AST Node: ".concat(R(s),"."));var F=st(n,s.kind,N);if(F){if(E=F.call(n,s,c,k,T,y),E===fr)break;if(E===!1){if(!N){T.pop();continue}}else if(E!==void 0&&(o.push([c,E]),!N))if(ot(E))s=E;else{T.pop();continue}}}if(E===void 0&&I&&o.push([c,s]),N)T.pop();else{var p;i={inArray:a,index:u,keys:r,edits:o,prev:i},a=Array.isArray(s),r=a?s:(p=t[s.kind])!==null&&p!==void 0?p:[],u=-1,o=[],k&&y.push(k),k=s}}while(i!==void 0);return o.length!==0&&(f=o[o.length-1][1]),f}function st(e,n,t){var i=e[n];if(i){if(!t&&typeof i=="function")return i;var a=t?i.leave:i.enter;if(typeof a=="function")return a}else{var r=t?e.leave:e.enter;if(r){if(typeof r=="function")return r;var u=r[n];if(typeof u=="function")return u}}}var mr=Array.prototype.find?function(e,n){return Array.prototype.find.call(e,n)}:function(e,n){for(var t=0;t<e.length;t++){var i=e[t];if(n(i))return i}},si=mr,vr=Object.values||function(e){return Object.keys(e).map(function(n){return e[n]})},ue=vr,pr=Object.entries||function(e){return Object.keys(e).map(function(n){return[n,e[n]]})},je=pr;function ui(e,n){return e.reduce(function(t,i){return t[n(i)]=i,t},Object.create(null))}function ln(e,n){for(var t=Object.create(null),i=0,a=je(e);i<a.length;i++){var r=a[i],u=r[0],o=r[1];t[u]=n(o,u)}return t}function M(e){if(Object.getPrototypeOf(e)===null)return e;for(var n=Object.create(null),t=0,i=je(e);t<i.length;t++){var a=i[t],r=a[0],u=a[1];n[r]=u}return n}function ut(e,n,t){return e.reduce(function(i,a){return i[n(a)]=t(a),i},Object.create(null))}var hr=5;function yr(e,n){var t=typeof e=="string"?[e,n]:[void 0,e],i=t[0],a=t[1],r=" Did you mean ";i&&(r+=i+" ");var u=a.map(function(c){return'"'.concat(c,'"')});switch(u.length){case 0:return"";case 1:return r+u[0]+"?";case 2:return r+u[0]+" or "+u[1]+"?"}var o=u.slice(0,hr),s=o.pop();return r+o.join(", ")+", or "+s+"?"}function ci(e){return e}function kr(e,n){for(var t=0,i=0;t<e.length&&i<n.length;){var a=e.charCodeAt(t),r=n.charCodeAt(i);if(dn(a)&&dn(r)){var u=0;do++t,u=u*10+a-ct,a=e.charCodeAt(t);while(dn(a)&&u>0);var o=0;do++i,o=o*10+r-ct,r=n.charCodeAt(i);while(dn(r)&&o>0);if(u<o)return-1;if(u>o)return 1}else{if(a<r)return-1;if(a>r)return 1;++t,++i}}return e.length-n.length}var ct=48,gr=57;function dn(e){return!isNaN(e)&&ct<=e&&e<=gr}function Sr(e,n){for(var t=Object.create(null),i=new br(e),a=Math.floor(e.length*.4)+1,r=0;r<n.length;r++){var u=n[r],o=i.measure(u,a);o!==void 0&&(t[u]=o)}return Object.keys(t).sort(function(s,c){var k=t[s]-t[c];return k!==0?k:kr(s,c)})}var br=function(){function e(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=li(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}var n=e.prototype;return n.measure=function(i,a){if(this._input===i)return 0;var r=i.toLowerCase();if(this._inputLowerCase===r)return 1;var u=li(r),o=this._inputArray;if(u.length<o.length){var s=u;u=o,o=s}var c=u.length,k=o.length;if(!(c-k>a)){for(var T=this._rows,y=0;y<=k;y++)T[0][y]=y;for(var f=1;f<=c;f++){for(var N=T[(f-1)%3],I=T[f%3],A=I[0]=f,D=1;D<=k;D++){var P=u[f-1]===o[D-1]?0:1,_=Math.min(N[D]+1,I[D-1]+1,N[D-1]+P);if(f>1&&D>1&&u[f-1]===o[D-2]&&u[f-2]===o[D-1]){var d=T[(f-2)%3][D-2];_=Math.min(_,d+1)}_<A&&(A=_),I[D]=_}if(A>a)return}var l=T[c%3][k];return l<=a?l:void 0}},e}();function li(e){for(var n=e.length,t=new Array(n),i=0;i<n;++i)t[i]=e.charCodeAt(i);return t}function te(e){return oi(e,{leave:Er})}var Nr=80,Er={Name:function(n){return n.value},Variable:function(n){return"$"+n.name},Document:function(n){return g(n.definitions,`
23
23
 
24
24
  `)+`
25
- `},OperationDefinition:function(n){var t=n.operation,i=n.name,a=V("(",g(n.variableDefinitions,", "),")"),r=g(n.directives," "),u=n.selectionSet;return!i&&!r&&!a&&t==="query"?u:g([t,g([i,a]),r,u]," ")},VariableDefinition:function(n){var t=n.variable,i=n.type,a=n.defaultValue,r=n.directives;return t+": "+i+V(" = ",a)+V(" ",g(r," "))},SelectionSet:function(n){var t=n.selections;return K(t)},Field:function(n){var t=n.alias,i=n.name,a=n.arguments,r=n.directives,u=n.selectionSet,o=V("",t,": ")+i,s=o+V("(",g(a,", "),")");return s.length>Nr&&(s=o+V(`(
25
+ `},OperationDefinition:function(n){var t=n.operation,i=n.name,a=V("(",g(n.variableDefinitions,", "),")"),r=g(n.directives," "),u=n.selectionSet;return!i&&!r&&!a&&t==="query"?u:g([t,g([i,a]),r,u]," ")},VariableDefinition:function(n){var t=n.variable,i=n.type,a=n.defaultValue,r=n.directives;return t+": "+i+V(" = ",a)+V(" ",g(r," "))},SelectionSet:function(n){var t=n.selections;return Y(t)},Field:function(n){var t=n.alias,i=n.name,a=n.arguments,r=n.directives,u=n.selectionSet,o=V("",t,": ")+i,s=o+V("(",g(a,", "),")");return s.length>Nr&&(s=o+V(`(
26
26
  `,fn(g(a,`
27
27
  `)),`
28
- )`)),g([s,g(r," "),u]," ")},Argument:function(n){var t=n.name,i=n.value;return t+": "+i},FragmentSpread:function(n){var t=n.name,i=n.directives;return"..."+t+V(" ",g(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,a=n.selectionSet;return g(["...",V("on ",t),g(i," "),a]," ")},FragmentDefinition:function(n){var t=n.name,i=n.typeCondition,a=n.variableDefinitions,r=n.directives,u=n.selectionSet;return"fragment ".concat(t).concat(V("(",g(a,", "),")")," ")+"on ".concat(i," ").concat(V("",g(r," ")," "))+u},IntValue:function(n){var t=n.value;return t},FloatValue:function(n){var t=n.value;return t},StringValue:function(n,t){var i=n.value,a=n.block;return a?lr(i,t==="description"?"":" "):JSON.stringify(i)},BooleanValue:function(n){var t=n.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(n){var t=n.value;return t},ListValue:function(n){var t=n.values;return"["+g(t,", ")+"]"},ObjectValue:function(n){var t=n.fields;return"{"+g(t,", ")+"}"},ObjectField:function(n){var t=n.name,i=n.value;return t+": "+i},Directive:function(n){var t=n.name,i=n.arguments;return"@"+t+V("(",g(i,", "),")")},NamedType:function(n){var t=n.name;return t},ListType:function(n){var t=n.type;return"["+t+"]"},NonNullType:function(n){var t=n.type;return t+"!"},SchemaDefinition:Y(function(e){var n=e.directives,t=e.operationTypes;return g(["schema",g(n," "),K(t)]," ")}),OperationTypeDefinition:function(n){var t=n.operation,i=n.type;return t+": "+i},ScalarTypeDefinition:Y(function(e){var n=e.name,t=e.directives;return g(["scalar",n,g(t," ")]," ")}),ObjectTypeDefinition:Y(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return g(["type",n,V("implements ",g(t," & ")),g(i," "),K(a)]," ")}),FieldDefinition:Y(function(e){var n=e.name,t=e.arguments,i=e.type,a=e.directives;return n+(di(t)?V(`(
28
+ )`)),g([s,g(r," "),u]," ")},Argument:function(n){var t=n.name,i=n.value;return t+": "+i},FragmentSpread:function(n){var t=n.name,i=n.directives;return"..."+t+V(" ",g(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,a=n.selectionSet;return g(["...",V("on ",t),g(i," "),a]," ")},FragmentDefinition:function(n){var t=n.name,i=n.typeCondition,a=n.variableDefinitions,r=n.directives,u=n.selectionSet;return"fragment ".concat(t).concat(V("(",g(a,", "),")")," ")+"on ".concat(i," ").concat(V("",g(r," ")," "))+u},IntValue:function(n){var t=n.value;return t},FloatValue:function(n){var t=n.value;return t},StringValue:function(n,t){var i=n.value,a=n.block;return a?lr(i,t==="description"?"":" "):JSON.stringify(i)},BooleanValue:function(n){var t=n.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(n){var t=n.value;return t},ListValue:function(n){var t=n.values;return"["+g(t,", ")+"]"},ObjectValue:function(n){var t=n.fields;return"{"+g(t,", ")+"}"},ObjectField:function(n){var t=n.name,i=n.value;return t+": "+i},Directive:function(n){var t=n.name,i=n.arguments;return"@"+t+V("(",g(i,", "),")")},NamedType:function(n){var t=n.name;return t},ListType:function(n){var t=n.type;return"["+t+"]"},NonNullType:function(n){var t=n.type;return t+"!"},SchemaDefinition:K(function(e){var n=e.directives,t=e.operationTypes;return g(["schema",g(n," "),Y(t)]," ")}),OperationTypeDefinition:function(n){var t=n.operation,i=n.type;return t+": "+i},ScalarTypeDefinition:K(function(e){var n=e.name,t=e.directives;return g(["scalar",n,g(t," ")]," ")}),ObjectTypeDefinition:K(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return g(["type",n,V("implements ",g(t," & ")),g(i," "),Y(a)]," ")}),FieldDefinition:K(function(e){var n=e.name,t=e.arguments,i=e.type,a=e.directives;return n+(di(t)?V(`(
29
29
  `,fn(g(t,`
30
30
  `)),`
31
- )`):V("(",g(t,", "),")"))+": "+i+V(" ",g(a," "))}),InputValueDefinition:Y(function(e){var n=e.name,t=e.type,i=e.defaultValue,a=e.directives;return g([n+": "+t,V("= ",i),g(a," ")]," ")}),InterfaceTypeDefinition:Y(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return g(["interface",n,V("implements ",g(t," & ")),g(i," "),K(a)]," ")}),UnionTypeDefinition:Y(function(e){var n=e.name,t=e.directives,i=e.types;return g(["union",n,g(t," "),i&&i.length!==0?"= "+g(i," | "):""]," ")}),EnumTypeDefinition:Y(function(e){var n=e.name,t=e.directives,i=e.values;return g(["enum",n,g(t," "),K(i)]," ")}),EnumValueDefinition:Y(function(e){var n=e.name,t=e.directives;return g([n,g(t," ")]," ")}),InputObjectTypeDefinition:Y(function(e){var n=e.name,t=e.directives,i=e.fields;return g(["input",n,g(t," "),K(i)]," ")}),DirectiveDefinition:Y(function(e){var n=e.name,t=e.arguments,i=e.repeatable,a=e.locations;return"directive @"+n+(di(t)?V(`(
31
+ )`):V("(",g(t,", "),")"))+": "+i+V(" ",g(a," "))}),InputValueDefinition:K(function(e){var n=e.name,t=e.type,i=e.defaultValue,a=e.directives;return g([n+": "+t,V("= ",i),g(a," ")]," ")}),InterfaceTypeDefinition:K(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return g(["interface",n,V("implements ",g(t," & ")),g(i," "),Y(a)]," ")}),UnionTypeDefinition:K(function(e){var n=e.name,t=e.directives,i=e.types;return g(["union",n,g(t," "),i&&i.length!==0?"= "+g(i," | "):""]," ")}),EnumTypeDefinition:K(function(e){var n=e.name,t=e.directives,i=e.values;return g(["enum",n,g(t," "),Y(i)]," ")}),EnumValueDefinition:K(function(e){var n=e.name,t=e.directives;return g([n,g(t," ")]," ")}),InputObjectTypeDefinition:K(function(e){var n=e.name,t=e.directives,i=e.fields;return g(["input",n,g(t," "),Y(i)]," ")}),DirectiveDefinition:K(function(e){var n=e.name,t=e.arguments,i=e.repeatable,a=e.locations;return"directive @"+n+(di(t)?V(`(
32
32
  `,fn(g(t,`
33
33
  `)),`
34
- )`):V("(",g(t,", "),")"))+(i?" repeatable":"")+" on "+g(a," | ")}),SchemaExtension:function(n){var t=n.directives,i=n.operationTypes;return g(["extend schema",g(t," "),K(i)]," ")},ScalarTypeExtension:function(n){var t=n.name,i=n.directives;return g(["extend scalar",t,g(i," ")]," ")},ObjectTypeExtension:function(n){var t=n.name,i=n.interfaces,a=n.directives,r=n.fields;return g(["extend type",t,V("implements ",g(i," & ")),g(a," "),K(r)]," ")},InterfaceTypeExtension:function(n){var t=n.name,i=n.interfaces,a=n.directives,r=n.fields;return g(["extend interface",t,V("implements ",g(i," & ")),g(a," "),K(r)]," ")},UnionTypeExtension:function(n){var t=n.name,i=n.directives,a=n.types;return g(["extend union",t,g(i," "),a&&a.length!==0?"= "+g(a," | "):""]," ")},EnumTypeExtension:function(n){var t=n.name,i=n.directives,a=n.values;return g(["extend enum",t,g(i," "),K(a)]," ")},InputObjectTypeExtension:function(n){var t=n.name,i=n.directives,a=n.fields;return g(["extend input",t,g(i," "),K(a)]," ")}};function Y(e){return function(n){return g([n.description,e(n)],`
35
- `)}}function g(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(n=e?.filter(function(i){return i}).join(t))!==null&&n!==void 0?n:""}function K(e){return V(`{
34
+ )`):V("(",g(t,", "),")"))+(i?" repeatable":"")+" on "+g(a," | ")}),SchemaExtension:function(n){var t=n.directives,i=n.operationTypes;return g(["extend schema",g(t," "),Y(i)]," ")},ScalarTypeExtension:function(n){var t=n.name,i=n.directives;return g(["extend scalar",t,g(i," ")]," ")},ObjectTypeExtension:function(n){var t=n.name,i=n.interfaces,a=n.directives,r=n.fields;return g(["extend type",t,V("implements ",g(i," & ")),g(a," "),Y(r)]," ")},InterfaceTypeExtension:function(n){var t=n.name,i=n.interfaces,a=n.directives,r=n.fields;return g(["extend interface",t,V("implements ",g(i," & ")),g(a," "),Y(r)]," ")},UnionTypeExtension:function(n){var t=n.name,i=n.directives,a=n.types;return g(["extend union",t,g(i," "),a&&a.length!==0?"= "+g(a," | "):""]," ")},EnumTypeExtension:function(n){var t=n.name,i=n.directives,a=n.values;return g(["extend enum",t,g(i," "),Y(a)]," ")},InputObjectTypeExtension:function(n){var t=n.name,i=n.directives,a=n.fields;return g(["extend input",t,g(i," "),Y(a)]," ")}};function K(e){return function(n){return g([n.description,e(n)],`
35
+ `)}}function g(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(n=e?.filter(function(i){return i}).join(t))!==null&&n!==void 0?n:""}function Y(e){return V(`{
36
36
  `,fn(g(e,`
37
37
  `)),`
38
38
  }`)}function V(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return n!=null&&n!==""?e+n+t:""}function fn(e){return V(" ",e.replace(/\n/g,`
39
39
  `))}function Tr(e){return e.indexOf(`
40
- `)!==-1}function di(e){return e!=null&&e.some(Tr)}function lt(e,n){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map(function(t){return lt(t,n)});case h.OBJECT:return ut(e.fields,function(t){return t.name.value},function(t){return lt(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Me(0,"Unexpected value node: "+R(e))}function fi(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ve(e,n,t){return n&&fi(e.prototype,n),t&&fi(e,t),e}function mi(e){return Ge(e)||Z(e)||Q(e)||ie(e)||ae(e)||ce(e)||Qe(e)||pe(e)}function wr(e){if(!mi(e))throw new Error("Expected ".concat(R(e)," to be a GraphQL type."));return e}function Ge(e){return ne(e,le)}function Z(e){return ne(e,re)}function Q(e){return ne(e,ki)}function ie(e){return ne(e,gi)}function ae(e){return ne(e,pn)}function ce(e){return ne(e,Si)}function Qe(e){return ne(e,$)}function pe(e){return ne(e,w)}function he(e){return Ge(e)||ae(e)||ce(e)||ft(e)&&he(e.ofType)}function mn(e){return Ge(e)||Z(e)||Q(e)||ie(e)||ae(e)||ft(e)&&mn(e.ofType)}function Ir(e){return Ge(e)||ae(e)}function dt(e){return Z(e)||Q(e)||ie(e)}function Fr(e){return Q(e)||ie(e)}function $(e){if(this instanceof $)this.ofType=wr(e);else return new $(e)}$.prototype.toString=function(){return"["+String(this.ofType)+"]"},$.prototype.toJSON=function(){return this.toString()},Object.defineProperty($.prototype,G,{get:function(){return"GraphQLList"}}),J($);function w(e){if(this instanceof w)this.ofType=Ar(e);else return new w(e)}w.prototype.toString=function(){return String(this.ofType)+"!"},w.prototype.toJSON=function(){return this.toString()},Object.defineProperty(w.prototype,G,{get:function(){return"GraphQLNonNull"}}),J(w);function ft(e){return Qe(e)||pe(e)}function Dr(e){return mi(e)&&!pe(e)}function Ar(e){if(!Dr(e))throw new Error("Expected ".concat(R(e)," to be a GraphQL nullable type."));return e}function Or(e){if(e)return pe(e)?e.ofType:e}function ze(e){if(e){for(var n=e;ft(n);)n=n.ofType;return n}}function vn(e){return typeof e=="function"?e():e}function ye(e){return e&&e.length>0?e:void 0}var le=function(){function e(t){var i,a,r,u=(i=t.parseValue)!==null&&i!==void 0?i:ci;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(a=t.serialize)!==null&&a!==void 0?a:ci,this.parseValue=u,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return u(lt(o,s))},this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),typeof t.name=="string"||O(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||O(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(R(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||O(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||O(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var n=e.prototype;return n.toConfig=function(){var i;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLScalarType"}}]),e}();J(le);var re=function(){function e(t){this.name=t.name,this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._fields=pi.bind(void 0,t),this._interfaces=vi.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||O(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(R(t.isTypeOf),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:hi(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();J(re);function vi(e){var n,t=(n=vn(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||O(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function pi(e){var n=vn(e.fields);return ke(n)||O(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),ln(n,function(t,i){var a;ke(t)||O(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||O(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||O(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(R(t.resolve),"."));var r=(a=t.args)!==null&&a!==void 0?a:{};ke(r)||O(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var u=je(r).map(function(o){var s=o[0],c=o[1];return{name:s,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&M(c.extensions),astNode:c.astNode}});return{name:i,description:t.description,type:t.type,args:u,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:t.deprecationReason!=null,deprecationReason:t.deprecationReason,extensions:t.extensions&&M(t.extensions),astNode:t.astNode}})}function ke(e){return se(e)&&!Array.isArray(e)}function hi(e){return ln(e,function(n){return{description:n.description,type:n.type,args:yi(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function yi(e){return ut(e,function(n){return n.name},function(n){return{description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}var ki=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._fields=pi.bind(void 0,t),this._interfaces=vi.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||O(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(R(t.resolveType),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:hi(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();J(ki);var gi=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._types=Rr.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||O(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(R(t.resolveType),"."))}var n=e.prototype;return n.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},n.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();J(gi);function Rr(e){var n=vn(e.types);return Array.isArray(n)||O(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var pn=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._values=_r(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=ui(this._values,function(i){return i.name}),typeof t.name=="string"||O(0,"Must provide name.")}var n=e.prototype;return n.getValues=function(){return this._values},n.getValue=function(i){return this._nameLookup[i]},n.serialize=function(i){var a=this._valueLookup.get(i);if(a===void 0)throw new B('Enum "'.concat(this.name,'" cannot represent value: ').concat(R(i)));return a.name},n.parseValue=function(i){if(typeof i!="string"){var a=R(i);throw new B('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(a,".")+hn(this,a))}var r=this.getValue(i);if(r==null)throw new B('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+hn(this,i));return r.value},n.parseLiteral=function(i,a){if(i.kind!==h.ENUM){var r=te(i);throw new B('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(r,".")+hn(this,r),i)}var u=this.getValue(i.value);if(u==null){var o=te(i);throw new B('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+hn(this,o),i)}return u.value},n.toConfig=function(){var i,a=ut(this.getValues(),function(r){return r.name},function(r){return{description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,values:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();J(pn);function hn(e,n){var t=e.getValues().map(function(a){return a.name}),i=Sr(n,t);return yr("the enum value",i)}function _r(e,n){return ke(n)||O(0,"".concat(e," values must be an object with value names as keys.")),je(n).map(function(t){var i=t[0],a=t[1];return ke(a)||O(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(R(a),".")),!("isDeprecated"in a)||O(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:a.description,value:a.value!==void 0?a.value:i,isDeprecated:a.deprecationReason!=null,deprecationReason:a.deprecationReason,extensions:a.extensions&&M(a.extensions),astNode:a.astNode}})}var Si=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._fields=Lr.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name.")}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.toConfig=function(){var i,a=ln(this.getFields(),function(r){return{description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,fields:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();J(Si);function Lr(e){var n=vn(e.fields);return ke(n)||O(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),ln(n,function(t,i){return!("resolve"in t)||O(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&M(t.extensions),astNode:t.astNode}})}var Pr=Array.from||function(e,n,t){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[Kt];if(typeof i=="function"){for(var a=i.call(e),r=[],u,o=0;!(u=a.next()).done;++o)if(r.push(n.call(t,u.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return r}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var c=[],k=0;k<s;++k)Object.prototype.hasOwnProperty.call(e,k)&&c.push(n.call(t,e[k],k));return c}return[]},Br=Pr,Vr=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},He=Vr;function yn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yn=function(t){return typeof t}:yn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(e)}function Ur(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k){return k};if(e==null||yn(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[Kt];if(typeof t=="function"){for(var i=t.call(e),a=[],r,u=0;!(r=i.next()).done;++u)a.push(n(r.value,u));return a}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var s=[],c=0;c<o;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;s.push(n(e[String(c)],c))}return s}return null}var qr=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},kn=qr,mt=2147483647,vt=-2147483648;function Cr(e){var n=Je(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!kn(t))throw new B("Int cannot represent non-integer value: ".concat(R(n)));if(t>mt||t<vt)throw new B("Int cannot represent non 32-bit signed integer value: "+R(n));return t}function $r(e){if(!kn(e))throw new B("Int cannot represent non-integer value: ".concat(R(e)));if(e>mt||e<vt)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var xr=new le({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:Cr,parseValue:$r,parseLiteral:function(n){if(n.kind!==h.INT)throw new B("Int cannot represent non-integer value: ".concat(te(n)),n);var t=parseInt(n.value,10);if(t>mt||t<vt)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function Mr(e){var n=Je(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!He(t))throw new B("Float cannot represent non numeric value: ".concat(R(n)));return t}function jr(e){if(!He(e))throw new B("Float cannot represent non numeric value: ".concat(R(e)));return e}var Gr=new le({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:Mr,parseValue:jr,parseLiteral:function(n){if(n.kind!==h.FLOAT&&n.kind!==h.INT)throw new B("Float cannot represent non numeric value: ".concat(te(n)),n);return parseFloat(n.value)}});function Je(e){if(se(e)){if(typeof e.valueOf=="function"){var n=e.valueOf();if(!se(n))return n}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Qr(e){var n=Je(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(He(n))return n.toString();throw new B("String cannot represent value: ".concat(R(e)))}function zr(e){if(typeof e!="string")throw new B("String cannot represent a non string value: ".concat(R(e)));return e}var U=new le({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:Qr,parseValue:zr,parseLiteral:function(n){if(n.kind!==h.STRING)throw new B("String cannot represent a non string value: ".concat(te(n)),n);return n.value}});function Hr(e){var n=Je(e);if(typeof n=="boolean")return n;if(He(n))return n!==0;throw new B("Boolean cannot represent a non boolean value: ".concat(R(n)))}function Jr(e){if(typeof e!="boolean")throw new B("Boolean cannot represent a non boolean value: ".concat(R(e)));return e}var z=new le({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Hr,parseValue:Jr,parseLiteral:function(n){if(n.kind!==h.BOOLEAN)throw new B("Boolean cannot represent a non boolean value: ".concat(te(n)),n);return n.value}});function Yr(e){var n=Je(e);if(typeof n=="string")return n;if(kn(n))return String(n);throw new B("ID cannot represent value: ".concat(R(e)))}function Kr(e){if(typeof e=="string")return e;if(kn(e))return e.toString();throw new B("ID cannot represent value: ".concat(R(e)))}var bi=new le({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:Yr,parseValue:Kr,parseLiteral:function(n){if(n.kind!==h.STRING&&n.kind!==h.INT)throw new B("ID cannot represent a non-string and non-integer value: "+te(n),n);return n.value}}),Ni=Object.freeze([U,xr,Gr,z,bi]);function Ye(e,n){if(pe(n)){var t=Ye(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if(Qe(n)){var i=n.ofType,a=Ur(e);if(a!=null){for(var r=[],u=0;u<a.length;u++){var o=a[u],s=Ye(o,i);s!=null&&r.push(s)}return{kind:h.LIST,values:r}}return Ye(e,i)}if(ce(n)){if(!se(e))return null;for(var c=[],k=0,T=ue(n.getFields());k<T.length;k++){var y=T[k],f=Ye(e[y.name],y.type);f&&c.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:f})}return{kind:h.OBJECT,fields:c}}if(Ir(n)){var N=n.serialize(e);if(N==null)return null;if(typeof N=="boolean")return{kind:h.BOOLEAN,value:N};if(typeof N=="number"&&He(N)){var I=String(N);return Ei.test(I)?{kind:h.INT,value:I}:{kind:h.FLOAT,value:I}}if(typeof N=="string")return ae(n)?{kind:h.ENUM,value:N}:n===bi&&Ei.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(R(N),"."))}Me(0,"Unexpected input type: "+R(n))}var Ei=/^-?(?:0|[1-9][0-9]*)$/,pt=new re({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:U,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new w(new $(new w(X))),resolve:function(t){return ue(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new w(X),resolve:function(t){return t.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:X,resolve:function(t){return t.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:X,resolve:function(t){return t.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new w(new $(new w(Ti))),resolve:function(t){return t.getDirectives()}}}}}),Ti=new re({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
40
+ `)!==-1}function di(e){return e!=null&&e.some(Tr)}function lt(e,n){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map(function(t){return lt(t,n)});case h.OBJECT:return ut(e.fields,function(t){return t.name.value},function(t){return lt(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Me(0,"Unexpected value node: "+R(e))}function fi(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ve(e,n,t){return n&&fi(e.prototype,n),t&&fi(e,t),e}function mi(e){return Ge(e)||Z(e)||Q(e)||ie(e)||ae(e)||ce(e)||Qe(e)||pe(e)}function wr(e){if(!mi(e))throw new Error("Expected ".concat(R(e)," to be a GraphQL type."));return e}function Ge(e){return ne(e,le)}function Z(e){return ne(e,re)}function Q(e){return ne(e,ki)}function ie(e){return ne(e,gi)}function ae(e){return ne(e,pn)}function ce(e){return ne(e,Si)}function Qe(e){return ne(e,$)}function pe(e){return ne(e,w)}function he(e){return Ge(e)||ae(e)||ce(e)||ft(e)&&he(e.ofType)}function mn(e){return Ge(e)||Z(e)||Q(e)||ie(e)||ae(e)||ft(e)&&mn(e.ofType)}function Ir(e){return Ge(e)||ae(e)}function dt(e){return Z(e)||Q(e)||ie(e)}function Fr(e){return Q(e)||ie(e)}function $(e){if(this instanceof $)this.ofType=wr(e);else return new $(e)}$.prototype.toString=function(){return"["+String(this.ofType)+"]"},$.prototype.toJSON=function(){return this.toString()},Object.defineProperty($.prototype,G,{get:function(){return"GraphQLList"}}),J($);function w(e){if(this instanceof w)this.ofType=Ar(e);else return new w(e)}w.prototype.toString=function(){return String(this.ofType)+"!"},w.prototype.toJSON=function(){return this.toString()},Object.defineProperty(w.prototype,G,{get:function(){return"GraphQLNonNull"}}),J(w);function ft(e){return Qe(e)||pe(e)}function Dr(e){return mi(e)&&!pe(e)}function Ar(e){if(!Dr(e))throw new Error("Expected ".concat(R(e)," to be a GraphQL nullable type."));return e}function Or(e){if(e)return pe(e)?e.ofType:e}function ze(e){if(e){for(var n=e;ft(n);)n=n.ofType;return n}}function vn(e){return typeof e=="function"?e():e}function ye(e){return e&&e.length>0?e:void 0}var le=function(){function e(t){var i,a,r,u=(i=t.parseValue)!==null&&i!==void 0?i:ci;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(a=t.serialize)!==null&&a!==void 0?a:ci,this.parseValue=u,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return u(lt(o,s))},this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),typeof t.name=="string"||O(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||O(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(R(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||O(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||O(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var n=e.prototype;return n.toConfig=function(){var i;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLScalarType"}}]),e}();J(le);var re=function(){function e(t){this.name=t.name,this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._fields=pi.bind(void 0,t),this._interfaces=vi.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||O(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(R(t.isTypeOf),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:hi(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();J(re);function vi(e){var n,t=(n=vn(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||O(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function pi(e){var n=vn(e.fields);return ke(n)||O(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),ln(n,function(t,i){var a;ke(t)||O(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||O(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||O(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(R(t.resolve),"."));var r=(a=t.args)!==null&&a!==void 0?a:{};ke(r)||O(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var u=je(r).map(function(o){var s=o[0],c=o[1];return{name:s,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&M(c.extensions),astNode:c.astNode}});return{name:i,description:t.description,type:t.type,args:u,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:t.deprecationReason!=null,deprecationReason:t.deprecationReason,extensions:t.extensions&&M(t.extensions),astNode:t.astNode}})}function ke(e){return se(e)&&!Array.isArray(e)}function hi(e){return ln(e,function(n){return{description:n.description,type:n.type,args:yi(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function yi(e){return ut(e,function(n){return n.name},function(n){return{description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}var ki=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._fields=pi.bind(void 0,t),this._interfaces=vi.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||O(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(R(t.resolveType),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:hi(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();J(ki);var gi=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._types=Rr.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||O(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(R(t.resolveType),"."))}var n=e.prototype;return n.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},n.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();J(gi);function Rr(e){var n=vn(e.types);return Array.isArray(n)||O(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var pn=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._values=_r(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=ui(this._values,function(i){return i.name}),typeof t.name=="string"||O(0,"Must provide name.")}var n=e.prototype;return n.getValues=function(){return this._values},n.getValue=function(i){return this._nameLookup[i]},n.serialize=function(i){var a=this._valueLookup.get(i);if(a===void 0)throw new B('Enum "'.concat(this.name,'" cannot represent value: ').concat(R(i)));return a.name},n.parseValue=function(i){if(typeof i!="string"){var a=R(i);throw new B('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(a,".")+hn(this,a))}var r=this.getValue(i);if(r==null)throw new B('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+hn(this,i));return r.value},n.parseLiteral=function(i,a){if(i.kind!==h.ENUM){var r=te(i);throw new B('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(r,".")+hn(this,r),i)}var u=this.getValue(i.value);if(u==null){var o=te(i);throw new B('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+hn(this,o),i)}return u.value},n.toConfig=function(){var i,a=ut(this.getValues(),function(r){return r.name},function(r){return{description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,values:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();J(pn);function hn(e,n){var t=e.getValues().map(function(a){return a.name}),i=Sr(n,t);return yr("the enum value",i)}function _r(e,n){return ke(n)||O(0,"".concat(e," values must be an object with value names as keys.")),je(n).map(function(t){var i=t[0],a=t[1];return ke(a)||O(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(R(a),".")),!("isDeprecated"in a)||O(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:a.description,value:a.value!==void 0?a.value:i,isDeprecated:a.deprecationReason!=null,deprecationReason:a.deprecationReason,extensions:a.extensions&&M(a.extensions),astNode:a.astNode}})}var Si=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=ye(t.extensionASTNodes),this._fields=Lr.bind(void 0,t),typeof t.name=="string"||O(0,"Must provide name.")}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.toConfig=function(){var i,a=ln(this.getFields(),function(r){return{description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,fields:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},ve(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();J(Si);function Lr(e){var n=vn(e.fields);return ke(n)||O(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),ln(n,function(t,i){return!("resolve"in t)||O(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&M(t.extensions),astNode:t.astNode}})}var Pr=Array.from||function(e,n,t){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[Yt];if(typeof i=="function"){for(var a=i.call(e),r=[],u,o=0;!(u=a.next()).done;++o)if(r.push(n.call(t,u.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return r}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var c=[],k=0;k<s;++k)Object.prototype.hasOwnProperty.call(e,k)&&c.push(n.call(t,e[k],k));return c}return[]},Br=Pr,Vr=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},He=Vr;function yn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yn=function(t){return typeof t}:yn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(e)}function Ur(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k){return k};if(e==null||yn(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[Yt];if(typeof t=="function"){for(var i=t.call(e),a=[],r,u=0;!(r=i.next()).done;++u)a.push(n(r.value,u));return a}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var s=[],c=0;c<o;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;s.push(n(e[String(c)],c))}return s}return null}var qr=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},kn=qr,mt=2147483647,vt=-2147483648;function Cr(e){var n=Je(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!kn(t))throw new B("Int cannot represent non-integer value: ".concat(R(n)));if(t>mt||t<vt)throw new B("Int cannot represent non 32-bit signed integer value: "+R(n));return t}function $r(e){if(!kn(e))throw new B("Int cannot represent non-integer value: ".concat(R(e)));if(e>mt||e<vt)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var xr=new le({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:Cr,parseValue:$r,parseLiteral:function(n){if(n.kind!==h.INT)throw new B("Int cannot represent non-integer value: ".concat(te(n)),n);var t=parseInt(n.value,10);if(t>mt||t<vt)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function Mr(e){var n=Je(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!He(t))throw new B("Float cannot represent non numeric value: ".concat(R(n)));return t}function jr(e){if(!He(e))throw new B("Float cannot represent non numeric value: ".concat(R(e)));return e}var Gr=new le({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:Mr,parseValue:jr,parseLiteral:function(n){if(n.kind!==h.FLOAT&&n.kind!==h.INT)throw new B("Float cannot represent non numeric value: ".concat(te(n)),n);return parseFloat(n.value)}});function Je(e){if(se(e)){if(typeof e.valueOf=="function"){var n=e.valueOf();if(!se(n))return n}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Qr(e){var n=Je(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(He(n))return n.toString();throw new B("String cannot represent value: ".concat(R(e)))}function zr(e){if(typeof e!="string")throw new B("String cannot represent a non string value: ".concat(R(e)));return e}var U=new le({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:Qr,parseValue:zr,parseLiteral:function(n){if(n.kind!==h.STRING)throw new B("String cannot represent a non string value: ".concat(te(n)),n);return n.value}});function Hr(e){var n=Je(e);if(typeof n=="boolean")return n;if(He(n))return n!==0;throw new B("Boolean cannot represent a non boolean value: ".concat(R(n)))}function Jr(e){if(typeof e!="boolean")throw new B("Boolean cannot represent a non boolean value: ".concat(R(e)));return e}var z=new le({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Hr,parseValue:Jr,parseLiteral:function(n){if(n.kind!==h.BOOLEAN)throw new B("Boolean cannot represent a non boolean value: ".concat(te(n)),n);return n.value}});function Kr(e){var n=Je(e);if(typeof n=="string")return n;if(kn(n))return String(n);throw new B("ID cannot represent value: ".concat(R(e)))}function Yr(e){if(typeof e=="string")return e;if(kn(e))return e.toString();throw new B("ID cannot represent value: ".concat(R(e)))}var bi=new le({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:Kr,parseValue:Yr,parseLiteral:function(n){if(n.kind!==h.STRING&&n.kind!==h.INT)throw new B("ID cannot represent a non-string and non-integer value: "+te(n),n);return n.value}}),Ni=Object.freeze([U,xr,Gr,z,bi]);function Ke(e,n){if(pe(n)){var t=Ke(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if(Qe(n)){var i=n.ofType,a=Ur(e);if(a!=null){for(var r=[],u=0;u<a.length;u++){var o=a[u],s=Ke(o,i);s!=null&&r.push(s)}return{kind:h.LIST,values:r}}return Ke(e,i)}if(ce(n)){if(!se(e))return null;for(var c=[],k=0,T=ue(n.getFields());k<T.length;k++){var y=T[k],f=Ke(e[y.name],y.type);f&&c.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:f})}return{kind:h.OBJECT,fields:c}}if(Ir(n)){var N=n.serialize(e);if(N==null)return null;if(typeof N=="boolean")return{kind:h.BOOLEAN,value:N};if(typeof N=="number"&&He(N)){var I=String(N);return Ei.test(I)?{kind:h.INT,value:I}:{kind:h.FLOAT,value:I}}if(typeof N=="string")return ae(n)?{kind:h.ENUM,value:N}:n===bi&&Ei.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(R(N),"."))}Me(0,"Unexpected input type: "+R(n))}var Ei=/^-?(?:0|[1-9][0-9]*)$/,pt=new re({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:U,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new w(new $(new w(X))),resolve:function(t){return ue(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new w(X),resolve:function(t){return t.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:X,resolve:function(t){return t.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:X,resolve:function(t){return t.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new w(new $(new w(Ti))),resolve:function(t){return t.getDirectives()}}}}}),Ti=new re({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
41
41
 
42
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},isRepeatable:{type:new w(z),resolve:function(t){return t.isRepeatable}},locations:{type:new w(new $(new w(wi))),resolve:function(t){return t.locations}},args:{type:new w(new $(new w(gn))),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;return a?t.args:t.args.filter(function(r){return r.deprecationReason==null})}}}}}),wi=new pn({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:L.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:L.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:L.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:L.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:L.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:L.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:L.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:L.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:L.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:L.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:L.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:L.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:L.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:L.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:L.UNION,description:"Location adjacent to a union definition."},ENUM:{value:L.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:L.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:L.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:L.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),X=new re({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new w(Di),resolve:function(t){if(Ge(t))return x.SCALAR;if(Z(t))return x.OBJECT;if(Q(t))return x.INTERFACE;if(ie(t))return x.UNION;if(ae(t))return x.ENUM;if(ce(t))return x.INPUT_OBJECT;if(Qe(t))return x.LIST;if(pe(t))return x.NON_NULL;Me(0,'Unexpected type: "'.concat(R(t),'".'))}},name:{type:U,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:U,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:U,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new $(new w(Ii)),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(Z(t)||Q(t)){var r=ue(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new $(new w(X)),resolve:function(t){if(Z(t)||Q(t))return t.getInterfaces()}},possibleTypes:{type:new $(new w(X)),resolve:function(t,i,a,r){var u=r.schema;if(Fr(t))return u.getPossibleTypes(t)}},enumValues:{type:new $(new w(Fi)),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(ae(t)){var r=t.getValues();return a?r:r.filter(function(u){return u.deprecationReason==null})}}},inputFields:{type:new $(new w(gn)),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(ce(t)){var r=ue(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},ofType:{type:X,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Ii=new re({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},args:{type:new w(new $(new w(gn))),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;return a?t.args:t.args.filter(function(r){return r.deprecationReason==null})}},type:{type:new w(X),resolve:function(t){return t.type}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:U,resolve:function(t){return t.deprecationReason}}}}}),gn=new re({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},type:{type:new w(X),resolve:function(t){return t.type}},defaultValue:{type:U,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,a=t.defaultValue,r=Ye(a,i);return r?te(r):null}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:U,resolve:function(t){return t.deprecationReason}}}}}),Fi=new re({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:U,resolve:function(t){return t.deprecationReason}}}}}),x=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Di=new pn({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:x.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:x.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:x.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:x.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:x.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:x.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:x.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:x.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Ai={name:"__schema",type:new w(pt),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,i,a){var r=a.schema;return r},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Oi={name:"__type",type:X,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new w(U),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,i,a){var r=t.name,u=a.schema;return u.getType(r)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Ri={name:"__typename",type:new w(U),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,i,a){var r=a.parentType;return r.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},_i=Object.freeze([pt,Ti,wi,X,Ii,gn,Fi,Di]);function Li(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Xr(e,n,t){return n&&Li(e.prototype,n),t&&Li(e,t),e}function Wr(e){return ne(e,ge)}var ge=function(){function e(t){var i,a;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(i=t.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,t.name||O(0,"Directive must be named."),Array.isArray(t.locations)||O(0,"@".concat(t.name," locations must be an Array."));var r=(a=t.args)!==null&&a!==void 0?a:{};se(r)&&!Array.isArray(r)||O(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=je(r).map(function(u){var o=u[0],s=u[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&M(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:yi(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Xr(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();J(ge);var Zr=new ge({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new w(z),description:"Included when true."}}}),eo=new ge({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new w(z),description:"Skipped when true."}}}),no="No longer supported",to=new ge({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[L.FIELD_DEFINITION,L.ARGUMENT_DEFINITION,L.INPUT_FIELD_DEFINITION,L.ENUM_VALUE],args:{reason:{type:U,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:no}}}),io=new ge({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[L.SCALAR],args:{url:{type:new w(U),description:"The URL that specifies the behaviour of this scalar."}}}),ao=Object.freeze([Zr,eo,to,io]);function Pi(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ro(e,n,t){return n&&Pi(e.prototype,n),t&&Pi(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,se(t)||O(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||O(0,'"types" must be Array if provided but got: '.concat(R(t.types),".")),!t.directives||Array.isArray(t.directives)||O(0,'"directives" must be Array if provided but got: '+"".concat(R(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:ao;var a=new Set(t.types);if(t.types!=null)for(var r=0,u=t.types;r<u.length;r++){var o=u[r];a.delete(o),W(o,a)}this._queryType!=null&&W(this._queryType,a),this._mutationType!=null&&W(this._mutationType,a),this._subscriptionType!=null&&W(this._subscriptionType,a);for(var s=0,c=this._directives;s<c.length;s++){var k=c[s];if(Wr(k))for(var T=0,y=k.args;T<y.length;T++){var f=y[T];W(f.type,a)}}W(pt,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,I=Br(a);N<I.length;N++){var A=I[N];if(A!=null){var D=A.name;if(D||O(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[D]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(D,'".'));if(this._typeMap[D]=A,Q(A))for(var P=0,_=A.getInterfaces();P<_.length;P++){var d=_[P];if(Q(d)){var l=this._implementationsMap[d.name];l===void 0&&(l=this._implementationsMap[d.name]={objects:[],interfaces:[]}),l.interfaces.push(A)}}else if(Z(A))for(var S=0,m=A.getInterfaces();S<m.length;S++){var E=m[S];if(Q(E)){var F=this._implementationsMap[E.name];F===void 0&&(F=this._implementationsMap[E.name]={objects:[],interfaces:[]}),F.objects.push(A)}}}}}var n=e.prototype;return n.getQueryType=function(){return this._queryType},n.getMutationType=function(){return this._mutationType},n.getSubscriptionType=function(){return this._subscriptionType},n.getTypeMap=function(){return this._typeMap},n.getType=function(i){return this.getTypeMap()[i]},n.getPossibleTypes=function(i){return ie(i)?i.getTypes():this.getImplementations(i).objects},n.getImplementations=function(i){var a=this._implementationsMap[i.name];return a??{objects:[],interfaces:[]}},n.isPossibleType=function(i,a){return this.isSubType(i,a)},n.isSubType=function(i,a){var r=this._subTypeMap[i.name];if(r===void 0){if(r=Object.create(null),ie(i))for(var u=0,o=i.getTypes();u<o.length;u++){var s=o[u];r[s.name]=!0}else{for(var c=this.getImplementations(i),k=0,T=c.objects;k<T.length;k++){var y=T[k];r[y.name]=!0}for(var f=0,N=c.interfaces;f<N.length;f++){var I=N[f];r[I.name]=!0}}this._subTypeMap[i.name]=r}return r[a.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(i){return si(this.getDirectives(),function(a){return a.name===i})},n.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:ue(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},ro(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function W(e,n){var t=ze(e);if(!n.has(t)){if(n.add(t),ie(t))for(var i=0,a=t.getTypes();i<a.length;i++){var r=a[i];W(r,n)}else if(Z(t)||Q(t)){for(var u=0,o=t.getInterfaces();u<o.length;u++){var s=o[u];W(s,n)}for(var c=0,k=ue(t.getFields());c<k.length;c++){var T=k[c];W(T.type,n);for(var y=0,f=T.args;y<f.length;y++){var N=f[y];W(N.type,n)}}}else if(ce(t))for(var I=0,A=ue(t.getFields());I<A.length;I++){var D=A[I];W(D.type,n)}}return n}function Sn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=Sn(e,n.type),t&&new $(t);if(n.kind===h.NON_NULL_TYPE)return t=Sn(e,n.type),t&&new w(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Me(0,"Unexpected type node: "+R(n))}var oo=function(){function e(t,i,a){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??so,a&&(he(a)&&this._inputTypeStack.push(a),dt(a)&&this._parentTypeStack.push(a),mn(a)&&this._typeStack.push(a))}var n=e.prototype;return n.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},n.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},n.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},n.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},n.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},n.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},n.getDirective=function(){return this._directive},n.getArgument=function(){return this._argument},n.getEnumValue=function(){return this._enumValue},n.enter=function(i){var a=this._schema;switch(i.kind){case h.SELECTION_SET:{var r=ze(this.getType());this._parentTypeStack.push(dt(r)?r:void 0);break}case h.FIELD:{var u=this.getParentType(),o,s;u&&(o=this._getFieldDef(a,u,i),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(mn(s)?s:void 0);break}case h.DIRECTIVE:this._directive=a.getDirective(i.name.value);break;case h.OPERATION_DEFINITION:{var c;switch(i.operation){case"query":c=a.getQueryType();break;case"mutation":c=a.getMutationType();break;case"subscription":c=a.getSubscriptionType();break}this._typeStack.push(Z(c)?c:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{var k=i.typeCondition,T=k?Sn(a,k):ze(this.getType());this._typeStack.push(mn(T)?T:void 0);break}case h.VARIABLE_DEFINITION:{var y=Sn(a,i.type);this._inputTypeStack.push(he(y)?y:void 0);break}case h.ARGUMENT:{var f,N,I,A=(f=this.getDirective())!==null&&f!==void 0?f:this.getFieldDef();A&&(N=si(A.args,function(E){return E.name===i.name.value}),N&&(I=N.type)),this._argument=N,this._defaultValueStack.push(N?N.defaultValue:void 0),this._inputTypeStack.push(he(I)?I:void 0);break}case h.LIST:{var D=Or(this.getInputType()),P=Qe(D)?D.ofType:D;this._defaultValueStack.push(void 0),this._inputTypeStack.push(he(P)?P:void 0);break}case h.OBJECT_FIELD:{var _=ze(this.getInputType()),d,l;ce(_)&&(l=_.getFields()[i.name.value],l&&(d=l.type)),this._defaultValueStack.push(l?l.defaultValue:void 0),this._inputTypeStack.push(he(d)?d:void 0);break}case h.ENUM:{var S=ze(this.getInputType()),m;ae(S)&&(m=S.getValue(i.value)),this._enumValue=m;break}}},n.leave=function(i){switch(i.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null;break}},e}();function so(e,n,t){var i=t.name.value;if(i===Ai.name&&e.getQueryType()===n)return Ai;if(i===Oi.name&&e.getQueryType()===n)return Oi;if(i===Ri.name&&dt(n))return Ri;if(Z(n)||Q(n))return n.getFields()[i]}function uo(e,n){return{enter:function(i){e.enter(i);var a=st(n,i.kind,!1);if(a){var r=a.apply(n,arguments);return r!==void 0&&(e.leave(i),ot(r)&&e.enter(r)),r}},leave:function(i){var a=st(n,i.kind,!0),r;return a&&(r=a.apply(n,arguments)),e.leave(i),r}}}[].concat(Ni,_i).map(function(e){return e.name});var oe;function Se(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}oe={},Se(oe,h.SCALAR_TYPE_DEFINITION,h.SCALAR_TYPE_EXTENSION),Se(oe,h.OBJECT_TYPE_DEFINITION,h.OBJECT_TYPE_EXTENSION),Se(oe,h.INTERFACE_TYPE_DEFINITION,h.INTERFACE_TYPE_EXTENSION),Se(oe,h.UNION_TYPE_DEFINITION,h.UNION_TYPE_EXTENSION),Se(oe,h.ENUM_TYPE_DEFINITION,h.ENUM_TYPE_EXTENSION),Se(oe,h.INPUT_OBJECT_TYPE_DEFINITION,h.INPUT_OBJECT_TYPE_EXTENSION);function Bi(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Vi=function(){function e(t,i){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var n=e.prototype;return n.reportError=function(i){this._onError(i)},n.getDocument=function(){return this._ast},n.getFragment=function(i){var a=this._fragments;return a||(this._fragments=a=this.getDocument().definitions.reduce(function(r,u){return u.kind===h.FRAGMENT_DEFINITION&&(r[u.name.value]=u),r},Object.create(null))),a[i]},n.getFragmentSpreads=function(i){var a=this._fragmentSpreads.get(i);if(!a){a=[];for(var r=[i];r.length!==0;)for(var u=r.pop(),o=0,s=u.selections;o<s.length;o++){var c=s[o];c.kind===h.FRAGMENT_SPREAD?a.push(c):c.selectionSet&&r.push(c.selectionSet)}this._fragmentSpreads.set(i,a)}return a},n.getRecursivelyReferencedFragments=function(i){var a=this._recursivelyReferencedFragments.get(i);if(!a){a=[];for(var r=Object.create(null),u=[i.selectionSet];u.length!==0;)for(var o=u.pop(),s=0,c=this.getFragmentSpreads(o);s<c.length;s++){var k=c[s],T=k.name.value;if(r[T]!==!0){r[T]=!0;var y=this.getFragment(T);y&&(a.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,a)}return a},e}();(function(e){Bi(n,e);function n(i,a,r){var u;return u=e.call(this,i,r)||this,u._schema=a,u}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Vi),function(e){Bi(n,e);function n(i,a,r,u){var o;return o=e.call(this,a,u)||this,o._schema=i,o._typeInfo=r,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(a){var r=this._variableUsages.get(a);if(!r){var u=[],o=new oo(this._schema);oi(a,uo(o,{VariableDefinition:function(){return!1},Variable:function(c){u.push({node:c,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),r=u,this._variableUsages.set(a,r)}return r},t.getRecursiveVariableUsages=function(a){var r=this._recursiveVariableUsages.get(a);if(!r){r=this.getVariableUsages(a);for(var u=0,o=this.getRecursivelyReferencedFragments(a);u<o.length;u++){var s=o[u];r=r.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(a,r)}return r},t.getType=function(){return this._typeInfo.getType()},t.getParentType=function(){return this._typeInfo.getParentType()},t.getInputType=function(){return this._typeInfo.getInputType()},t.getParentInputType=function(){return this._typeInfo.getParentInputType()},t.getFieldDef=function(){return this._typeInfo.getFieldDef()},t.getDirective=function(){return this._typeInfo.getDirective()},t.getArgument=function(){return this._typeInfo.getArgument()},t.getEnumValue=function(){return this._typeInfo.getEnumValue()},n}(Vi),ui(Ni.concat(_i),function(e){return e.name});const Ui=e=>e instanceof Error?e:new Error(e),co=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",qi={staging:{baseEndpoint:"https://api-staging.spritz.finance",graphEndpoint:"https://api-staging.spritz.finance/router/graph"},production:{baseEndpoint:"https://api.spritz.finance",graphEndpoint:"https://api.spritz.finance/router/graph"}},lo=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Error(`${e} must be an integer`);if(n<0)throw new Error(`${e} must be a positive integer`);return n};class fo extends Error{timestamp;headers;constructor(n,t,...i){super(...i),this.name="SpritzApiError",this.message=n,this.headers=t??{},this.timestamp=new Date().toISOString()}}class j extends Error{status;headers;timestamp;constructor(n,t,i,a){super(j.makeMessage(t,i)),this.status=n,this.headers=a,this.timestamp=new Date().toISOString()}static makeMessage(n,t){return n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):t||"Unknown error occurred"}static generate(n,t,i,a){return n?n===400?new vo(n,t,i,a):n===401?new po(n,t,i,a):n===403?new ho(n,t,i,a):n===404?new yo(n,t,i,a):n===409?new ko(n,t,i,a):n===422?new go(n,t,i,a):n===429?new So(n,t,i,a):n>=500?new bo(n,t,i,a):new j(n,t,i,a):new ht({cause:Ui(t)})}}class ht extends j{status=void 0;constructor({message:n,cause:t}){super(void 0,void 0,n||"Connection error.",void 0),t&&(this.cause=t)}}class mo extends ht{constructor(){super({message:"Request timed out."})}}class vo extends j{name="BadRequestError";status=400}class po extends j{name="AuthenticationError";status=401}class ho extends j{name="PermissionDeniedError";status=403}class yo extends j{name="NotFoundError";status=404}class ko extends j{name="ConflictError";status=409}class go extends j{name="UnprocessableEntityError";status=422}class So extends j{name="RateLimitError";status=429}class bo extends j{name="InternalServerError"}const No=e=>{try{return JSON.parse(e)}catch{return}};async function Ci(e){const{response:n}=e;return n.headers.get("content-type")?.includes("application/json")?{response:await n.json(),headers:e.headers}:{response:await n.text(),headers:e.headers}}class Eo{baseGraphURL;baseRestURL;timeout;apiKey;integrationKey;constructor({environment:n,timeout:t=3e5,apiKey:i,integrationKey:a}){this.apiKey=i,this.integrationKey=a,this.baseGraphURL=qi[n].graphEndpoint,this.baseRestURL=qi[n].baseEndpoint,this.timeout=lo("timeout",t)}async query({query:n,variables:t}){return this.sendQuery({query:n,variables:t}).then(i=>Ci(i)).then(({response:i,headers:a})=>{if(i.data)return i.data;if(i.errors){const r=i.errors[0]??{message:"Unknown error"};throw new fo(r.message,a)}else throw new Error("Unknown error")})}async request({method:n,path:t,body:i=void 0}){return this.sendRequest({method:n,path:t,body:i}).then(a=>Ci(a)).then(({response:a})=>a)}async sendQuery({query:n,variables:t}){const{url:i,req:a,timeout:r}=this.buildGraphRequest({query:n,variables:t});return this.sendHTTPRequest({url:i,req:a,timeout:r})}async sendRequest({method:n,path:t,body:i}){const{url:a,req:r,timeout:u}=this.buildRestRequest(n,t,i);return this.sendHTTPRequest({url:a,req:r,timeout:u})}async sendHTTPRequest({url:n,req:t,timeout:i}){const a=new AbortController,r=await this.fetchWithTimeout(n,t,i,a).catch(Ui);if(r instanceof Error)throw r.name==="AbortError"?new mo:new ht({cause:r});const u=this.getResponseHeaders(r.headers);if(!r.ok){const o=await r.text().catch(()=>"Unknown error"),s=No(o);throw this.makeStatusError(r.status,s,s?void 0:o,u)}return{response:r,controller:a,headers:u}}getResponseHeaders(n){const t=n.get("x-amzn-trace-id"),i=n.get("x-amzn-requestid");return{traceId:t,requestId:i}}async fetchWithTimeout(n,t,i,a){const{signal:r,...u}=t||{};r&&r.addEventListener("abort",()=>a.abort());const o=setTimeout(()=>a.abort(),i);return Ma(n,{...u}).finally(()=>{clearTimeout(o)})}buildGraphRequest({query:n,variables:t}){const i={query:te(n),variables:t,operationName:n?.definitions?.[0]?.name?.value},a=i?JSON.stringify(i,null,2):null,r=this.calculateContentLength(a),u=this.timeout,o={...r&&{"Content-Length":r},...this.defaultHeaders()};Object.keys(o).forEach(c=>o[c]===null&&delete o[c]);const s={method:"POST",...a&&{body:a},headers:o};return{url:this.baseGraphURL,req:s,timeout:u}}buildRestRequest(n,t,i){const a=i?JSON.stringify(i,null,2):null,r=this.calculateContentLength(a),u=this.timeout,o={...r&&{"Content-Length":r},...this.defaultHeaders()};Object.keys(o).forEach(c=>o[c]===null&&delete o[c]);const s={method:n,...a&&{body:a},headers:o};return{url:`${this.baseRestURL}${t.startsWith("/")?t:"/"+t}`,req:s,timeout:u}}defaultHeaders(){return{Accept:"application/json","Content-Type":"application/json",...this.authHeaders()}}calculateContentLength(n){if(typeof n=="string"){if(typeof Buffer<"u")return Buffer.byteLength(n,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(n).length.toString()}return null}authHeaders(){return{Authorization:"Bearer "+this.apiKey,...this.integrationKey?{"X-INTEGRATION-KEY":this.integrationKey}:{}}}makeStatusError(n,t,i,a){return j.generate(n,t,i,a)}}var be={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},arguments:[],directives:[]}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],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:"logo"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:1289}};be.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
42
+ In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},isRepeatable:{type:new w(z),resolve:function(t){return t.isRepeatable}},locations:{type:new w(new $(new w(wi))),resolve:function(t){return t.locations}},args:{type:new w(new $(new w(gn))),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;return a?t.args:t.args.filter(function(r){return r.deprecationReason==null})}}}}}),wi=new pn({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:L.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:L.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:L.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:L.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:L.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:L.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:L.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:L.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:L.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:L.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:L.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:L.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:L.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:L.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:L.UNION,description:"Location adjacent to a union definition."},ENUM:{value:L.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:L.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:L.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:L.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),X=new re({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new w(Di),resolve:function(t){if(Ge(t))return x.SCALAR;if(Z(t))return x.OBJECT;if(Q(t))return x.INTERFACE;if(ie(t))return x.UNION;if(ae(t))return x.ENUM;if(ce(t))return x.INPUT_OBJECT;if(Qe(t))return x.LIST;if(pe(t))return x.NON_NULL;Me(0,'Unexpected type: "'.concat(R(t),'".'))}},name:{type:U,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:U,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:U,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new $(new w(Ii)),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(Z(t)||Q(t)){var r=ue(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new $(new w(X)),resolve:function(t){if(Z(t)||Q(t))return t.getInterfaces()}},possibleTypes:{type:new $(new w(X)),resolve:function(t,i,a,r){var u=r.schema;if(Fr(t))return u.getPossibleTypes(t)}},enumValues:{type:new $(new w(Fi)),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(ae(t)){var r=t.getValues();return a?r:r.filter(function(u){return u.deprecationReason==null})}}},inputFields:{type:new $(new w(gn)),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(ce(t)){var r=ue(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},ofType:{type:X,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Ii=new re({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},args:{type:new w(new $(new w(gn))),args:{includeDeprecated:{type:z,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;return a?t.args:t.args.filter(function(r){return r.deprecationReason==null})}},type:{type:new w(X),resolve:function(t){return t.type}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:U,resolve:function(t){return t.deprecationReason}}}}}),gn=new re({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},type:{type:new w(X),resolve:function(t){return t.type}},defaultValue:{type:U,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,a=t.defaultValue,r=Ke(a,i);return r?te(r):null}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:U,resolve:function(t){return t.deprecationReason}}}}}),Fi=new re({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new w(U),resolve:function(t){return t.name}},description:{type:U,resolve:function(t){return t.description}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:U,resolve:function(t){return t.deprecationReason}}}}}),x=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Di=new pn({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:x.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:x.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:x.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:x.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:x.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:x.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:x.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:x.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Ai={name:"__schema",type:new w(pt),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,i,a){var r=a.schema;return r},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Oi={name:"__type",type:X,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new w(U),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,i,a){var r=t.name,u=a.schema;return u.getType(r)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Ri={name:"__typename",type:new w(U),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,i,a){var r=a.parentType;return r.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},_i=Object.freeze([pt,Ti,wi,X,Ii,gn,Fi,Di]);function Li(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Xr(e,n,t){return n&&Li(e.prototype,n),t&&Li(e,t),e}function Wr(e){return ne(e,ge)}var ge=function(){function e(t){var i,a;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(i=t.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,t.name||O(0,"Directive must be named."),Array.isArray(t.locations)||O(0,"@".concat(t.name," locations must be an Array."));var r=(a=t.args)!==null&&a!==void 0?a:{};se(r)&&!Array.isArray(r)||O(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=je(r).map(function(u){var o=u[0],s=u[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&M(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:yi(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Xr(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();J(ge);var Zr=new ge({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new w(z),description:"Included when true."}}}),eo=new ge({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new w(z),description:"Skipped when true."}}}),no="No longer supported",to=new ge({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[L.FIELD_DEFINITION,L.ARGUMENT_DEFINITION,L.INPUT_FIELD_DEFINITION,L.ENUM_VALUE],args:{reason:{type:U,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:no}}}),io=new ge({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[L.SCALAR],args:{url:{type:new w(U),description:"The URL that specifies the behaviour of this scalar."}}}),ao=Object.freeze([Zr,eo,to,io]);function Pi(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ro(e,n,t){return n&&Pi(e.prototype,n),t&&Pi(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,se(t)||O(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||O(0,'"types" must be Array if provided but got: '.concat(R(t.types),".")),!t.directives||Array.isArray(t.directives)||O(0,'"directives" must be Array if provided but got: '+"".concat(R(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&M(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:ao;var a=new Set(t.types);if(t.types!=null)for(var r=0,u=t.types;r<u.length;r++){var o=u[r];a.delete(o),W(o,a)}this._queryType!=null&&W(this._queryType,a),this._mutationType!=null&&W(this._mutationType,a),this._subscriptionType!=null&&W(this._subscriptionType,a);for(var s=0,c=this._directives;s<c.length;s++){var k=c[s];if(Wr(k))for(var T=0,y=k.args;T<y.length;T++){var f=y[T];W(f.type,a)}}W(pt,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,I=Br(a);N<I.length;N++){var A=I[N];if(A!=null){var D=A.name;if(D||O(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[D]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(D,'".'));if(this._typeMap[D]=A,Q(A))for(var P=0,_=A.getInterfaces();P<_.length;P++){var d=_[P];if(Q(d)){var l=this._implementationsMap[d.name];l===void 0&&(l=this._implementationsMap[d.name]={objects:[],interfaces:[]}),l.interfaces.push(A)}}else if(Z(A))for(var S=0,m=A.getInterfaces();S<m.length;S++){var E=m[S];if(Q(E)){var F=this._implementationsMap[E.name];F===void 0&&(F=this._implementationsMap[E.name]={objects:[],interfaces:[]}),F.objects.push(A)}}}}}var n=e.prototype;return n.getQueryType=function(){return this._queryType},n.getMutationType=function(){return this._mutationType},n.getSubscriptionType=function(){return this._subscriptionType},n.getTypeMap=function(){return this._typeMap},n.getType=function(i){return this.getTypeMap()[i]},n.getPossibleTypes=function(i){return ie(i)?i.getTypes():this.getImplementations(i).objects},n.getImplementations=function(i){var a=this._implementationsMap[i.name];return a??{objects:[],interfaces:[]}},n.isPossibleType=function(i,a){return this.isSubType(i,a)},n.isSubType=function(i,a){var r=this._subTypeMap[i.name];if(r===void 0){if(r=Object.create(null),ie(i))for(var u=0,o=i.getTypes();u<o.length;u++){var s=o[u];r[s.name]=!0}else{for(var c=this.getImplementations(i),k=0,T=c.objects;k<T.length;k++){var y=T[k];r[y.name]=!0}for(var f=0,N=c.interfaces;f<N.length;f++){var I=N[f];r[I.name]=!0}}this._subTypeMap[i.name]=r}return r[a.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(i){return si(this.getDirectives(),function(a){return a.name===i})},n.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:ue(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},ro(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function W(e,n){var t=ze(e);if(!n.has(t)){if(n.add(t),ie(t))for(var i=0,a=t.getTypes();i<a.length;i++){var r=a[i];W(r,n)}else if(Z(t)||Q(t)){for(var u=0,o=t.getInterfaces();u<o.length;u++){var s=o[u];W(s,n)}for(var c=0,k=ue(t.getFields());c<k.length;c++){var T=k[c];W(T.type,n);for(var y=0,f=T.args;y<f.length;y++){var N=f[y];W(N.type,n)}}}else if(ce(t))for(var I=0,A=ue(t.getFields());I<A.length;I++){var D=A[I];W(D.type,n)}}return n}function Sn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=Sn(e,n.type),t&&new $(t);if(n.kind===h.NON_NULL_TYPE)return t=Sn(e,n.type),t&&new w(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Me(0,"Unexpected type node: "+R(n))}var oo=function(){function e(t,i,a){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??so,a&&(he(a)&&this._inputTypeStack.push(a),dt(a)&&this._parentTypeStack.push(a),mn(a)&&this._typeStack.push(a))}var n=e.prototype;return n.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},n.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},n.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},n.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},n.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},n.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},n.getDirective=function(){return this._directive},n.getArgument=function(){return this._argument},n.getEnumValue=function(){return this._enumValue},n.enter=function(i){var a=this._schema;switch(i.kind){case h.SELECTION_SET:{var r=ze(this.getType());this._parentTypeStack.push(dt(r)?r:void 0);break}case h.FIELD:{var u=this.getParentType(),o,s;u&&(o=this._getFieldDef(a,u,i),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(mn(s)?s:void 0);break}case h.DIRECTIVE:this._directive=a.getDirective(i.name.value);break;case h.OPERATION_DEFINITION:{var c;switch(i.operation){case"query":c=a.getQueryType();break;case"mutation":c=a.getMutationType();break;case"subscription":c=a.getSubscriptionType();break}this._typeStack.push(Z(c)?c:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{var k=i.typeCondition,T=k?Sn(a,k):ze(this.getType());this._typeStack.push(mn(T)?T:void 0);break}case h.VARIABLE_DEFINITION:{var y=Sn(a,i.type);this._inputTypeStack.push(he(y)?y:void 0);break}case h.ARGUMENT:{var f,N,I,A=(f=this.getDirective())!==null&&f!==void 0?f:this.getFieldDef();A&&(N=si(A.args,function(E){return E.name===i.name.value}),N&&(I=N.type)),this._argument=N,this._defaultValueStack.push(N?N.defaultValue:void 0),this._inputTypeStack.push(he(I)?I:void 0);break}case h.LIST:{var D=Or(this.getInputType()),P=Qe(D)?D.ofType:D;this._defaultValueStack.push(void 0),this._inputTypeStack.push(he(P)?P:void 0);break}case h.OBJECT_FIELD:{var _=ze(this.getInputType()),d,l;ce(_)&&(l=_.getFields()[i.name.value],l&&(d=l.type)),this._defaultValueStack.push(l?l.defaultValue:void 0),this._inputTypeStack.push(he(d)?d:void 0);break}case h.ENUM:{var S=ze(this.getInputType()),m;ae(S)&&(m=S.getValue(i.value)),this._enumValue=m;break}}},n.leave=function(i){switch(i.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null;break}},e}();function so(e,n,t){var i=t.name.value;if(i===Ai.name&&e.getQueryType()===n)return Ai;if(i===Oi.name&&e.getQueryType()===n)return Oi;if(i===Ri.name&&dt(n))return Ri;if(Z(n)||Q(n))return n.getFields()[i]}function uo(e,n){return{enter:function(i){e.enter(i);var a=st(n,i.kind,!1);if(a){var r=a.apply(n,arguments);return r!==void 0&&(e.leave(i),ot(r)&&e.enter(r)),r}},leave:function(i){var a=st(n,i.kind,!0),r;return a&&(r=a.apply(n,arguments)),e.leave(i),r}}}[].concat(Ni,_i).map(function(e){return e.name});var oe;function Se(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}oe={},Se(oe,h.SCALAR_TYPE_DEFINITION,h.SCALAR_TYPE_EXTENSION),Se(oe,h.OBJECT_TYPE_DEFINITION,h.OBJECT_TYPE_EXTENSION),Se(oe,h.INTERFACE_TYPE_DEFINITION,h.INTERFACE_TYPE_EXTENSION),Se(oe,h.UNION_TYPE_DEFINITION,h.UNION_TYPE_EXTENSION),Se(oe,h.ENUM_TYPE_DEFINITION,h.ENUM_TYPE_EXTENSION),Se(oe,h.INPUT_OBJECT_TYPE_DEFINITION,h.INPUT_OBJECT_TYPE_EXTENSION);function Bi(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Vi=function(){function e(t,i){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var n=e.prototype;return n.reportError=function(i){this._onError(i)},n.getDocument=function(){return this._ast},n.getFragment=function(i){var a=this._fragments;return a||(this._fragments=a=this.getDocument().definitions.reduce(function(r,u){return u.kind===h.FRAGMENT_DEFINITION&&(r[u.name.value]=u),r},Object.create(null))),a[i]},n.getFragmentSpreads=function(i){var a=this._fragmentSpreads.get(i);if(!a){a=[];for(var r=[i];r.length!==0;)for(var u=r.pop(),o=0,s=u.selections;o<s.length;o++){var c=s[o];c.kind===h.FRAGMENT_SPREAD?a.push(c):c.selectionSet&&r.push(c.selectionSet)}this._fragmentSpreads.set(i,a)}return a},n.getRecursivelyReferencedFragments=function(i){var a=this._recursivelyReferencedFragments.get(i);if(!a){a=[];for(var r=Object.create(null),u=[i.selectionSet];u.length!==0;)for(var o=u.pop(),s=0,c=this.getFragmentSpreads(o);s<c.length;s++){var k=c[s],T=k.name.value;if(r[T]!==!0){r[T]=!0;var y=this.getFragment(T);y&&(a.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,a)}return a},e}();(function(e){Bi(n,e);function n(i,a,r){var u;return u=e.call(this,i,r)||this,u._schema=a,u}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Vi),function(e){Bi(n,e);function n(i,a,r,u){var o;return o=e.call(this,a,u)||this,o._schema=i,o._typeInfo=r,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(a){var r=this._variableUsages.get(a);if(!r){var u=[],o=new oo(this._schema);oi(a,uo(o,{VariableDefinition:function(){return!1},Variable:function(c){u.push({node:c,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),r=u,this._variableUsages.set(a,r)}return r},t.getRecursiveVariableUsages=function(a){var r=this._recursiveVariableUsages.get(a);if(!r){r=this.getVariableUsages(a);for(var u=0,o=this.getRecursivelyReferencedFragments(a);u<o.length;u++){var s=o[u];r=r.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(a,r)}return r},t.getType=function(){return this._typeInfo.getType()},t.getParentType=function(){return this._typeInfo.getParentType()},t.getInputType=function(){return this._typeInfo.getInputType()},t.getParentInputType=function(){return this._typeInfo.getParentInputType()},t.getFieldDef=function(){return this._typeInfo.getFieldDef()},t.getDirective=function(){return this._typeInfo.getDirective()},t.getArgument=function(){return this._typeInfo.getArgument()},t.getEnumValue=function(){return this._typeInfo.getEnumValue()},n}(Vi),ui(Ni.concat(_i),function(e){return e.name});const Ui=e=>e instanceof Error?e:new Error(e),co=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",qi={staging:{baseEndpoint:"https://api-staging.spritz.finance",graphEndpoint:"https://api-staging.spritz.finance/router/graph"},production:{baseEndpoint:"https://api.spritz.finance",graphEndpoint:"https://api.spritz.finance/router/graph"}},lo=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Error(`${e} must be an integer`);if(n<0)throw new Error(`${e} must be a positive integer`);return n};class fo extends Error{timestamp;headers;constructor(n,t,...i){super(...i),this.name="SpritzApiError",this.message=n,this.headers=t??{},this.timestamp=new Date().toISOString()}}class j extends Error{status;headers;timestamp;constructor(n,t,i,a){super(j.makeMessage(t,i)),this.status=n,this.headers=a,this.timestamp=new Date().toISOString()}static makeMessage(n,t){return n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):t||"Unknown error occurred"}static generate(n,t,i,a){return n?n===400?new vo(n,t,i,a):n===401?new po(n,t,i,a):n===403?new ho(n,t,i,a):n===404?new yo(n,t,i,a):n===409?new ko(n,t,i,a):n===422?new go(n,t,i,a):n===429?new So(n,t,i,a):n>=500?new bo(n,t,i,a):new j(n,t,i,a):new ht({cause:Ui(t)})}}class ht extends j{status=void 0;constructor({message:n,cause:t}){super(void 0,void 0,n||"Connection error.",void 0),t&&(this.cause=t)}}class mo extends ht{constructor(){super({message:"Request timed out."})}}class vo extends j{name="BadRequestError";status=400}class po extends j{name="AuthenticationError";status=401}class ho extends j{name="PermissionDeniedError";status=403}class yo extends j{name="NotFoundError";status=404}class ko extends j{name="ConflictError";status=409}class go extends j{name="UnprocessableEntityError";status=422}class So extends j{name="RateLimitError";status=429}class bo extends j{name="InternalServerError"}const No=e=>{try{return JSON.parse(e)}catch{return}};async function Ci(e){const{response:n}=e;return n.headers.get("content-type")?.includes("application/json")?{response:await n.json(),headers:e.headers}:{response:await n.text(),headers:e.headers}}class Eo{baseGraphURL;baseRestURL;timeout;apiKey;integrationKey;constructor({environment:n,timeout:t=3e5,apiKey:i,integrationKey:a}){this.apiKey=i,this.integrationKey=a,this.baseGraphURL=qi[n].graphEndpoint,this.baseRestURL=qi[n].baseEndpoint,this.timeout=lo("timeout",t)}async query({query:n,variables:t}){return this.sendQuery({query:n,variables:t}).then(i=>Ci(i)).then(({response:i,headers:a})=>{if(i.data)return i.data;if(i.errors){const r=i.errors[0]??{message:"Unknown error"};throw new fo(r.message,a)}else throw new Error("Unknown error")})}async request({method:n,path:t,body:i=void 0}){return this.sendRequest({method:n,path:t,body:i}).then(a=>Ci(a)).then(({response:a})=>a)}async sendQuery({query:n,variables:t}){const{url:i,req:a,timeout:r}=this.buildGraphRequest({query:n,variables:t});return this.sendHTTPRequest({url:i,req:a,timeout:r})}async sendRequest({method:n,path:t,body:i}){const{url:a,req:r,timeout:u}=this.buildRestRequest(n,t,i);return this.sendHTTPRequest({url:a,req:r,timeout:u})}async sendHTTPRequest({url:n,req:t,timeout:i}){const a=new AbortController,r=await this.fetchWithTimeout(n,t,i,a).catch(Ui);if(r instanceof Error)throw r.name==="AbortError"?new mo:new ht({cause:r});const u=this.getResponseHeaders(r.headers);if(!r.ok){const o=await r.text().catch(()=>"Unknown error"),s=No(o);throw this.makeStatusError(r.status,s,s?void 0:o,u)}return{response:r,controller:a,headers:u}}getResponseHeaders(n){const t=n.get("x-amzn-trace-id"),i=n.get("x-amzn-requestid");return{traceId:t,requestId:i}}async fetchWithTimeout(n,t,i,a){const{signal:r,...u}=t||{};r&&r.addEventListener("abort",()=>a.abort());const o=setTimeout(()=>a.abort(),i);return Ma(n,{...u}).finally(()=>{clearTimeout(o)})}buildGraphRequest({query:n,variables:t}){const i={query:te(n),variables:t,operationName:n?.definitions?.[0]?.name?.value},a=i?JSON.stringify(i,null,2):null,r=this.calculateContentLength(a),u=this.timeout,o={...r&&{"Content-Length":r},...this.defaultHeaders()};Object.keys(o).forEach(c=>o[c]===null&&delete o[c]);const s={method:"POST",...a&&{body:a},headers:o};return{url:this.baseGraphURL,req:s,timeout:u}}buildRestRequest(n,t,i){const a=i?JSON.stringify(i,null,2):null,r=this.calculateContentLength(a),u=this.timeout,o={...r&&{"Content-Length":r},...this.defaultHeaders()};Object.keys(o).forEach(c=>o[c]===null&&delete o[c]);const s={method:n,...a&&{body:a},headers:o};return{url:`${this.baseRestURL}${t.startsWith("/")?t:"/"+t}`,req:s,timeout:u}}defaultHeaders(){return{Accept:"application/json","Content-Type":"application/json",...this.authHeaders()}}calculateContentLength(n){if(typeof n=="string"){if(typeof Buffer<"u")return Buffer.byteLength(n,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(n).length.toString()}return null}authHeaders(){return{Authorization:"Bearer "+this.apiKey,...this.integrationKey?{"X-INTEGRATION-KEY":this.integrationKey}:{}}}makeStatusError(n,t,i,a){return j.generate(n,t,i,a)}}var be={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},arguments:[],directives:[]}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],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:"logo"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:1289}};be.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
43
43
  id
44
44
  name
45
45
  userId
@@ -120,7 +120,7 @@ mutation DeletePayableAccount($accountId: String!) {
120
120
  ...PayableAccountFragment
121
121
  }
122
122
  }
123
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var ji={};function Fo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ji[t]?!1:(ji[t]=!0,!0)})}de.definitions=de.definitions.concat(Fo(be.definitions));function En(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){En(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){En(i,n)}),e.definitions&&e.definitions.forEach(function(i){En(i,n)})}var gt={};(function(){de.definitions.forEach(function(n){if(n.name){var t=new Set;En(n,t),gt[n.name.value]=t}})})();function Gi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Do(e,n){var t={kind:e.kind,definitions:[Gi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=gt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=gt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Gi(e,o);s&&t.definitions.push(s)}),t}Do(de,"DeletePayableAccount");var Ke={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BankAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"deliveryMethods"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],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:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:519}};Ke.loc.source={body:`fragment BankAccountFragment on BankAccount {
123
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var ji={};function Fo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ji[t]?!1:(ji[t]=!0,!0)})}de.definitions=de.definitions.concat(Fo(be.definitions));function En(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){En(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){En(i,n)}),e.definitions&&e.definitions.forEach(function(i){En(i,n)})}var gt={};(function(){de.definitions.forEach(function(n){if(n.name){var t=new Set;En(n,t),gt[n.name.value]=t}})})();function Gi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Do(e,n){var t={kind:e.kind,definitions:[Gi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=gt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=gt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Gi(e,o);s&&t.definitions.push(s)}),t}Do(de,"DeletePayableAccount");var Ye={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BankAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"deliveryMethods"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],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:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:580}};Ye.loc.source={body:`fragment BankAccountFragment on BankAccount {
124
124
  id
125
125
  name
126
126
  userId
@@ -149,22 +149,26 @@ mutation DeletePayableAccount($accountId: String!) {
149
149
  country
150
150
  currency
151
151
  }
152
+ paymentAddresses {
153
+ network
154
+ address
155
+ }
152
156
  }
153
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Tn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Tn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Tn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Tn(i,n)})}var St={};(function(){Ke.definitions.forEach(function(n){if(n.name){var t=new Set;Tn(n,t),St[n.name.value]=t}})})();function Qi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ao(e,n){var t={kind:e.kind,definitions:[Qi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=St[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=St[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Qi(e,o);s&&t.definitions.push(s)}),t}Ao(Ke,"BankAccountFragment");var Ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RenameBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"renamePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:218}};Ee.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
157
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Tn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Tn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Tn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Tn(i,n)})}var St={};(function(){Ye.definitions.forEach(function(n){if(n.name){var t=new Set;Tn(n,t),St[n.name.value]=t}})})();function Qi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ao(e,n){var t={kind:e.kind,definitions:[Qi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=St[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=St[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Qi(e,o);s&&t.definitions.push(s)}),t}Ao(Ye,"BankAccountFragment");var Ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RenameBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"renamePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:218}};Ee.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
154
158
 
155
159
  mutation RenameBankAccount($accountId: String!, $name: String!) {
156
160
  renamePayableAccount(accountId: $accountId, name: $name) {
157
161
  ...BankAccountFragment
158
162
  }
159
163
  }
160
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var zi={};function Oo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return zi[t]?!1:(zi[t]=!0,!0)})}Ee.definitions=Ee.definitions.concat(Oo(Ke.definitions));function wn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){wn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){wn(i,n)}),e.definitions&&e.definitions.forEach(function(i){wn(i,n)})}var bt={};(function(){Ee.definitions.forEach(function(n){if(n.name){var t=new Set;wn(n,t),bt[n.name.value]=t}})})();function Hi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ro(e,n){var t={kind:e.kind,definitions:[Hi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=bt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=bt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Hi(e,o);s&&t.definitions.push(s)}),t}Ro(Ee,"RenameBankAccount");var Te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBankAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bankAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:124}};Te.loc.source={body:`#import "./bankAccountFragment.graphql"
164
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var zi={};function Oo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return zi[t]?!1:(zi[t]=!0,!0)})}Ee.definitions=Ee.definitions.concat(Oo(Ye.definitions));function wn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){wn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){wn(i,n)}),e.definitions&&e.definitions.forEach(function(i){wn(i,n)})}var bt={};(function(){Ee.definitions.forEach(function(n){if(n.name){var t=new Set;wn(n,t),bt[n.name.value]=t}})})();function Hi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ro(e,n){var t={kind:e.kind,definitions:[Hi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=bt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=bt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Hi(e,o);s&&t.definitions.push(s)}),t}Ro(Ee,"RenameBankAccount");var Te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBankAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bankAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:124}};Te.loc.source={body:`#import "./bankAccountFragment.graphql"
161
165
 
162
166
  query UserBankAccounts {
163
167
  bankAccounts {
164
168
  ...BankAccountFragment
165
169
  }
166
170
  }
167
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ji={};function _o(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Ji[t]?!1:(Ji[t]=!0,!0)})}Te.definitions=Te.definitions.concat(_o(Ke.definitions));function In(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){In(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){In(i,n)}),e.definitions&&e.definitions.forEach(function(i){In(i,n)})}var Nt={};(function(){Te.definitions.forEach(function(n){if(n.name){var t=new Set;In(n,t),Nt[n.name.value]=t}})})();function Yi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Lo(e,n){var t={kind:e.kind,definitions:[Yi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Nt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Nt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Yi(e,o);s&&t.definitions.push(s)}),t}Lo(Te,"UserBankAccounts");function Po(e){throw new Error(e)}var Bo=(e=>(e.CHECKBOOK="CHECKBOOK",e.METHOD_FI="METHOD_FI",e))(Bo||{}),Vo=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(Vo||{}),Ki=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(Ki||{}),Fn=(e=>(e.CABankAccount="CABankAccount",e.USBankAccount="USBankAccount",e))(Fn||{}),Xi=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Xi||{}),Wi=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Wi||{}),Uo=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(Uo||{}),qo=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.PENDING="PENDING",e))(qo||{}),Co=(e=>(e.Provider="Provider",e.User="User",e))(Co||{}),Zi=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.VirtualCard="VirtualCard",e))(Zi||{}),$o=(e=>(e.INSTANT="INSTANT",e.STANDARD="STANDARD",e))($o||{}),ea=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(ea||{}),Et=(e=>(e.USVirtualDebitCard="USVirtualDebitCard",e))(Et||{});const xo=me.z.object({transitNumber:me.z.string().length(5,{message:"Transit number must be exactly 5 characters long"}).regex(/^[0-9]{5}$/,"Transit number should contain only digits."),institutionNumber:me.z.string().length(3,{message:"Institution number must be exactly 3 characters long"}).regex(/^[0-9]{3}$/,"Institution number should contain only digits.")}),Mo=me.z.object({routingNumber:me.z.string().length(9,{message:"Routing number must be exactly 9 characters long"}).regex(/^[0-9]{9}$/,"Routing number should contain only digits.")}),jo={[Fn.CABankAccount]:xo,[Fn.USBankAccount]:Mo};class Go{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Te}))?.bankAccounts??[]}async rename(n,t){return(await this.client.query({query:Ee,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:de,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const i=jo[n]??Po("Invalid bank account type");try{const a=i.parse(t);return(await this.client.query({query:Ne,variables:{createAccountInput:{accountNumber:t.accountNumber,name:t.name,type:n,subType:t.subType,details:a,email:t.email??null,ownedByUser:t.ownedByUser??null,holder:t.holder??null}}}))?.createBankAccount??null}catch(a){throw a instanceof me.z.ZodError?new Error(a?.issues?.[0]?.message??"Input validation failure"):a}}}var Xe={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],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:"logo"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:527}};Xe.loc.source={body:`fragment BillFragment on Bill {
171
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ji={};function _o(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Ji[t]?!1:(Ji[t]=!0,!0)})}Te.definitions=Te.definitions.concat(_o(Ye.definitions));function In(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){In(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){In(i,n)}),e.definitions&&e.definitions.forEach(function(i){In(i,n)})}var Nt={};(function(){Te.definitions.forEach(function(n){if(n.name){var t=new Set;In(n,t),Nt[n.name.value]=t}})})();function Ki(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Lo(e,n){var t={kind:e.kind,definitions:[Ki(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Nt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Nt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Ki(e,o);s&&t.definitions.push(s)}),t}Lo(Te,"UserBankAccounts");function Po(e){throw new Error(e)}var Bo=(e=>(e.CHECKBOOK="CHECKBOOK",e.METHOD_FI="METHOD_FI",e.UNBLOCK="UNBLOCK",e))(Bo||{}),Vo=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(Vo||{}),Yi=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(Yi||{}),Fn=(e=>(e.CABankAccount="CABankAccount",e.IbanAccount="IbanAccount",e.UKBankAccount="UKBankAccount",e.USBankAccount="USBankAccount",e))(Fn||{}),Xi=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Xi||{}),Wi=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Wi||{}),Uo=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(Uo||{}),qo=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.PENDING="PENDING",e))(qo||{}),Co=(e=>(e.Provider="Provider",e.User="User",e))(Co||{}),Zi=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.VirtualCard="VirtualCard",e))(Zi||{}),$o=(e=>(e.INSTANT="INSTANT",e.STANDARD="STANDARD",e))($o||{}),ea=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(ea||{}),Et=(e=>(e.USVirtualDebitCard="USVirtualDebitCard",e))(Et||{});const xo=me.z.object({transitNumber:me.z.string().length(5,{message:"Transit number must be exactly 5 characters long"}).regex(/^[0-9]{5}$/,"Transit number should contain only digits."),institutionNumber:me.z.string().length(3,{message:"Institution number must be exactly 3 characters long"}).regex(/^[0-9]{3}$/,"Institution number should contain only digits.")}),Mo=me.z.object({routingNumber:me.z.string().length(9,{message:"Routing number must be exactly 9 characters long"}).regex(/^[0-9]{9}$/,"Routing number should contain only digits.")}),jo={[Fn.CABankAccount]:xo,[Fn.USBankAccount]:Mo};class Go{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Te}))?.bankAccounts??[]}async rename(n,t){return(await this.client.query({query:Ee,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:de,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const i=jo[n]??Po("Invalid bank account type");try{const a=i.parse(t);return(await this.client.query({query:Ne,variables:{createAccountInput:{accountNumber:t.accountNumber,name:t.name,type:n,subType:t.subType,details:a,email:t.email??null,ownedByUser:t.ownedByUser??null,holder:t.holder??null}}}))?.createBankAccount??null}catch(a){throw a instanceof me.z.ZodError?new Error(a?.issues?.[0]?.message??"Input validation failure"):a}}}var Xe={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],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:"logo"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:588}};Xe.loc.source={body:`fragment BillFragment on Bill {
168
172
  id
169
173
  name
170
174
  userId
@@ -195,6 +199,10 @@ query UserBankAccounts {
195
199
  name
196
200
  logo
197
201
  }
202
+ paymentAddresses {
203
+ network
204
+ address
205
+ }
198
206
  }
199
207
  `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Dn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Dn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Dn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Dn(i,n)})}var Tt={};(function(){Xe.definitions.forEach(function(n){if(n.name){var t=new Set;Dn(n,t),Tt[n.name.value]=t}})})();function na(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Qo(e,n){var t={kind:e.kind,definitions:[na(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Tt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Tt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=na(e,o);s&&t.definitions.push(s)}),t}Qo(Xe,"BillFragment");var we={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSBill"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"institutionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountNumber"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NamedType",name:{kind:"Name",value:"BillType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addUSBill"},arguments:[{kind:"Argument",name:{kind:"Name",value:"institutionId"},value:{kind:"Variable",name:{kind:"Name",value:"institutionId"}}},{kind:"Argument",name:{kind:"Name",value:"accountNumber"},value:{kind:"Variable",name:{kind:"Name",value:"accountNumber"}}},{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BillFragment"},directives:[]}]}}]}}],loc:{start:0,end:257}};we.loc.source={body:`#import "../queries/billFragment.graphql"
200
208
 
@@ -210,14 +218,14 @@ mutation RenamePayableAccount($accountId: String!, $name: String!) {
210
218
  ...PayableAccountFragment
211
219
  }
212
220
  }
213
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var aa={};function Jo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return aa[t]?!1:(aa[t]=!0,!0)})}Ie.definitions=Ie.definitions.concat(Jo(be.definitions));function On(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){On(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){On(i,n)}),e.definitions&&e.definitions.forEach(function(i){On(i,n)})}var It={};(function(){Ie.definitions.forEach(function(n){if(n.name){var t=new Set;On(n,t),It[n.name.value]=t}})})();function ra(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Yo(e,n){var t={kind:e.kind,definitions:[ra(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=It[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=It[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=ra(e,o);s&&t.definitions.push(s)}),t}Yo(Ie,"RenamePayableAccount");var Fe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBills"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bills"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BillFragment"},directives:[]}]}}]}}],loc:{start:0,end:96}};Fe.loc.source={body:`#import "./billFragment.graphql"
221
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var aa={};function Jo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return aa[t]?!1:(aa[t]=!0,!0)})}Ie.definitions=Ie.definitions.concat(Jo(be.definitions));function On(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){On(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){On(i,n)}),e.definitions&&e.definitions.forEach(function(i){On(i,n)})}var It={};(function(){Ie.definitions.forEach(function(n){if(n.name){var t=new Set;On(n,t),It[n.name.value]=t}})})();function ra(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ko(e,n){var t={kind:e.kind,definitions:[ra(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=It[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=It[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=ra(e,o);s&&t.definitions.push(s)}),t}Ko(Ie,"RenamePayableAccount");var Fe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBills"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bills"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BillFragment"},directives:[]}]}}]}}],loc:{start:0,end:96}};Fe.loc.source={body:`#import "./billFragment.graphql"
214
222
 
215
223
  query UserBills {
216
224
  bills {
217
225
  ...BillFragment
218
226
  }
219
227
  }
220
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var oa={};function Ko(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return oa[t]?!1:(oa[t]=!0,!0)})}Fe.definitions=Fe.definitions.concat(Ko(Xe.definitions));function Rn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Rn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Rn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Rn(i,n)})}var Ft={};(function(){Fe.definitions.forEach(function(n){if(n.name){var t=new Set;Rn(n,t),Ft[n.name.value]=t}})})();function sa(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Xo(e,n){var t={kind:e.kind,definitions:[sa(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Ft[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Ft[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=sa(e,o);s&&t.definitions.push(s)}),t}Xo(Fe,"UserBills");class Wo{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Fe}))?.bills??[]}async rename(n,t){return(await this.client.query({query:Ie,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:de,variables:{accountId:n}}))?.deletePayableAccount??null}async add(n,t,i){return(await this.client.query({query:we,variables:{institutionId:n,accountNumber:t,type:i??null}}))?.addUSBill??null}}var We={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccountInstitution"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}}],loc:{start:0,end:126}};We.loc.source={body:`fragment PayableAccountInstitutionFragment on PayableAccountInstitution {
228
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var oa={};function Yo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return oa[t]?!1:(oa[t]=!0,!0)})}Fe.definitions=Fe.definitions.concat(Yo(Xe.definitions));function Rn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Rn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Rn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Rn(i,n)})}var Ft={};(function(){Fe.definitions.forEach(function(n){if(n.name){var t=new Set;Rn(n,t),Ft[n.name.value]=t}})})();function sa(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Xo(e,n){var t={kind:e.kind,definitions:[sa(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Ft[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Ft[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=sa(e,o);s&&t.definitions.push(s)}),t}Xo(Fe,"UserBills");class Wo{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Fe}))?.bills??[]}async rename(n,t){return(await this.client.query({query:Ie,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:de,variables:{accountId:n}}))?.deletePayableAccount??null}async add(n,t,i){return(await this.client.query({query:we,variables:{institutionId:n,accountNumber:t,type:i??null}}))?.addUSBill??null}}var We={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccountInstitution"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}}],loc:{start:0,end:126}};We.loc.source={body:`fragment PayableAccountInstitutionFragment on PayableAccountInstitution {
221
229
  id
222
230
  country
223
231
  currency
@@ -372,7 +380,7 @@ query CurrentUser {
372
380
  ...UserFragment
373
381
  }
374
382
  }
375
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var _a={};function Vs(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return _a[t]?!1:(_a[t]=!0,!0)})}Ve.definitions=Ve.definitions.concat(Vs(Hn.definitions));function Yn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Yn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Yn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Yn(i,n)})}var Gt={};(function(){Ve.definitions.forEach(function(n){if(n.name){var t=new Set;Yn(n,t),Gt[n.name.value]=t}})})();function La(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Us(e,n){var t={kind:e.kind,definitions:[La(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Gt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Gt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=La(e,o);s&&t.definitions.push(s)}),t}Us(Ve,"CurrentUser");var Kn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:297}};Kn.loc.source={body:`query UserVerification {
383
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var _a={};function Vs(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return _a[t]?!1:(_a[t]=!0,!0)})}Ve.definitions=Ve.definitions.concat(Vs(Hn.definitions));function Kn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Kn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Kn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Kn(i,n)})}var Gt={};(function(){Ve.definitions.forEach(function(n){if(n.name){var t=new Set;Kn(n,t),Gt[n.name.value]=t}})})();function La(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Us(e,n){var t={kind:e.kind,definitions:[La(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Gt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Gt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=La(e,o);s&&t.definitions.push(s)}),t}Us(Ve,"CurrentUser");var Yn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:297}};Yn.loc.source={body:`query UserVerification {
376
384
  verification {
377
385
  userId
378
386
  identity {
@@ -388,7 +396,7 @@ query CurrentUser {
388
396
  }
389
397
  }
390
398
  }
391
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Xn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Xn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Xn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Xn(i,n)})}var Qt={};(function(){Kn.definitions.forEach(function(n){if(n.name){var t=new Set;Xn(n,t),Qt[n.name.value]=t}})})();function Pa(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function qs(e,n){var t={kind:e.kind,definitions:[Pa(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Qt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Qt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Pa(e,o);s&&t.definitions.push(s)}),t}qs(Kn,"UserVerification");class Cs{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getCurrentUser(){return(await this.client.query({query:Ve}))?.me??null}async getUserVerification(){return(await this.client.query({query:Kn}))?.verification??null}}var en={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:408}};en.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
399
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Xn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Xn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Xn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Xn(i,n)})}var Qt={};(function(){Yn.definitions.forEach(function(n){if(n.name){var t=new Set;Xn(n,t),Qt[n.name.value]=t}})})();function Pa(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function qs(e,n){var t={kind:e.kind,definitions:[Pa(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Qt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Qt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Pa(e,o);s&&t.definitions.push(s)}),t}qs(Yn,"UserVerification");class Cs{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getCurrentUser(){return(await this.client.query({query:Ve}))?.me??null}async getUserVerification(){return(await this.client.query({query:Yn}))?.verification??null}}var en={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:469}};en.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
392
400
  id
393
401
  name
394
402
  userId
@@ -413,6 +421,10 @@ query CurrentUser {
413
421
  countryCode
414
422
  }
415
423
  }
424
+ paymentAddresses {
425
+ network
426
+ address
427
+ }
416
428
  }
417
429
  `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Wn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Wn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Wn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Wn(i,n)})}var zt={};(function(){en.definitions.forEach(function(n){if(n.name){var t=new Set;Wn(n,t),zt[n.name.value]=t}})})();function Ba(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function $s(e,n){var t={kind:e.kind,definitions:[Ba(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=zt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=zt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Ba(e,o);s&&t.definitions.push(s)}),t}$s(en,"VirtualDebitCardFragment");var Ue={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createUSVirtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:166}};Ue.loc.source={body:`#import "../queries/virtualDebitCardFragment.graphql"
418
430
 
@@ -428,10 +440,10 @@ query UserVirtualDebitCard {
428
440
  ...VirtualDebitCardFragment
429
441
  }
430
442
  }
431
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var qa={};function js(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return qa[t]?!1:(qa[t]=!0,!0)})}qe.definitions=qe.definitions.concat(js(en.definitions));function et(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){et(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){et(i,n)}),e.definitions&&e.definitions.forEach(function(i){et(i,n)})}var Jt={};(function(){qe.definitions.forEach(function(n){if(n.name){var t=new Set;et(n,t),Jt[n.name.value]=t}})})();function Ca(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Gs(e,n){var t={kind:e.kind,definitions:[Ca(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Jt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Jt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Ca(e,o);s&&t.definitions.push(s)}),t}Gs(qe,"UserVirtualDebitCard");const Qs={[Et.USVirtualDebitCard]:e=>({query:Ue,variables:void 0,response:"createUSVirtualDebitCard"})},zs=(e,n)=>Qs[e]?.(n)??null;class Hs{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:qe}))?.virtualDebitCard??null}async create(n,t){const i=zs(n,t);if(!i)throw new Error("Invalid virtual card type");return(await this.client.query({query:i.query,variables:i.variables}))?.[i.response]??null}}class Js{client;constructor(n){this.client=n}async create(n){return this.client.request({method:"post",path:"/users/integrators/webhooks",body:n})}}class Yt{environment;apiKey;integrationKey;client;user;bankAccount;paymentRequest;payment;onrampPayment;virtualCard;bill;institution;webhook;constructor(n,t,i,a){if(t===void 0&&i===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(this.environment=n,this.apiKey=t,this.integrationKey=i,!a&&co())throw new Error(`It seems you're operating within a browser environment.
443
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var qa={};function js(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return qa[t]?!1:(qa[t]=!0,!0)})}qe.definitions=qe.definitions.concat(js(en.definitions));function et(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){et(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){et(i,n)}),e.definitions&&e.definitions.forEach(function(i){et(i,n)})}var Jt={};(function(){qe.definitions.forEach(function(n){if(n.name){var t=new Set;et(n,t),Jt[n.name.value]=t}})})();function Ca(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Gs(e,n){var t={kind:e.kind,definitions:[Ca(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Jt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Jt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Ca(e,o);s&&t.definitions.push(s)}),t}Gs(qe,"UserVirtualDebitCard");const Qs={[Et.USVirtualDebitCard]:e=>({query:Ue,variables:void 0,response:"createUSVirtualDebitCard"})},zs=(e,n)=>Qs[e]?.(n)??null;class Hs{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:qe}))?.virtualDebitCard??null}async create(n,t){const i=zs(n,t);if(!i)throw new Error("Invalid virtual card type");return(await this.client.query({query:i.query,variables:i.variables}))?.[i.response]??null}}class Js{client;constructor(n){this.client=n}async create(n){return this.client.request({method:"post",path:"/users/integrators/webhooks",body:n})}}class Kt{environment;apiKey;integrationKey;client;user;bankAccount;paymentRequest;payment;onrampPayment;virtualCard;bill;institution;webhook;constructor(n,t,i,a){if(t===void 0&&i===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(this.environment=n,this.apiKey=t,this.integrationKey=i,!a&&co())throw new Error(`It seems you're operating within a browser environment.
432
444
 
433
445
  By default, this is deactivated due to the potential risk of exposing your confidential integrator credentials.
434
446
  If you're aware of these risks and have taken necessary security measures, you can enable the \`dangerouslyAllowBrowser\` option, e.g.,
435
447
 
436
448
  SpritzApiClient.initialize({ apiKey, dangerouslyAllowBrowser: true });
437
- `)}static initialize({environment:n=tt.Staging,apiKey:t=void 0,integrationKey:i=void 0,dangerouslyAllowBrowser:a=!1}){const r=new Yt(n,t,i,a);return r.init(),r}init(){this.client=new Eo({environment:this.environment,apiKey:this.apiKey,integrationKey:this.integrationKey}),this.user=new Cs(this.client),this.bankAccount=new Go(this.client),this.paymentRequest=new Ps(this.client),this.payment=new ks(this.client),this.onrampPayment=new ls(this.client),this.virtualCard=new Hs(this.client),this.bill=new Wo(this.client),this.institution=new as(this.client),this.webhook=new Js(this.client)}setApiKey(n){return this.apiKey=n,this.init(),this}}var $a=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Bitcoin="bitcoin",e.BitcoinTestnet="bitcoin-testnet",e.Dash="dash",e.DashTestnet="dash-testnet",e))($a||{});exports.BankAccountSubType=Ki,exports.BankAccountType=Fn,exports.BillType=Xi,exports.Environment=tt,exports.PayableAccountType=Zi,exports.PaymentNetwork=$a,exports.PaymentRequestStatus=Wi,exports.PaymentStatus=ea,exports.SpritzApiClient=Yt,exports.VirtualCardType=Et;
449
+ `)}static initialize({environment:n=tt.Staging,apiKey:t=void 0,integrationKey:i=void 0,dangerouslyAllowBrowser:a=!1}){const r=new Kt(n,t,i,a);return r.init(),r}init(){this.client=new Eo({environment:this.environment,apiKey:this.apiKey,integrationKey:this.integrationKey}),this.user=new Cs(this.client),this.bankAccount=new Go(this.client),this.paymentRequest=new Ps(this.client),this.payment=new ks(this.client),this.onrampPayment=new ls(this.client),this.virtualCard=new Hs(this.client),this.bill=new Wo(this.client),this.institution=new as(this.client),this.webhook=new Js(this.client)}setApiKey(n){return this.apiKey=n,this.init(),this}}var $a=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Bitcoin="bitcoin",e.BitcoinTestnet="bitcoin-testnet",e.Dash="dash",e.DashTestnet="dash-testnet",e))($a||{});exports.BankAccountSubType=Yi,exports.BankAccountType=Fn,exports.BillType=Xi,exports.Environment=tt,exports.PayableAccountType=Zi,exports.PaymentNetwork=$a,exports.PaymentRequestStatus=Wi,exports.PaymentStatus=ea,exports.SpritzApiClient=Kt,exports.VirtualCardType=Et;