@spritz-finance/api-client 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -1
- package/dist/spritz-api-client.d.ts +37 -7
- package/dist/spritz-api-client.js +43 -39
- package/dist/spritz-api-client.mjs +43 -39
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`),k=i.split(/\r\n|[\n\r]/g),E=k[a];if(E.length>120){for(var y=Math.floor(s/80),f=s%80,N=[],I=0;I<E.length;I+=80)N.push(E.slice(I,I+80));return c+xt([["".concat(u),N[0]]].concat(N.slice(1,y+1).map(function(A){return["",A]}),[[" ",Ze(f-1)+"^"],["",N[y+1]]]))}return c+xt([["".concat(u-1),k[a-1]],["".concat(u),E],["",Ze(s-1)+"^"],["".concat(u+1),k[a+1]]])}function xt(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
|
|
3
|
-
`)}function Ze(e){return Array(e+1).join(" ")}function
|
|
1
|
+
"use strict";var Ta=require("cross-fetch"),ve=require("zod"),Jn=(e=>(e.Staging="staging",e.Production="production",e))(Jn||{}),Ea=Object.getOwnPropertyNames,ee=(e,n)=>function(){return n||(0,e[Ea(e)[0]])((n={exports:{}}).exports,n),n.exports};function We(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?We=function(t){return typeof t}:We=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(e)}function se(e){return We(e)=="object"&&e!==null}var qt=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",G=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Yn(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 wa(e){return Ct(e.source,Yn(e.source,e.start))}function Ct(e,n){var t=e.locationOffset.column-1,i=Ze(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
|
+
`),k=i.split(/\r\n|[\n\r]/g),E=k[a];if(E.length>120){for(var y=Math.floor(s/80),f=s%80,N=[],I=0;I<E.length;I+=80)N.push(E.slice(I,I+80));return c+xt([["".concat(u),N[0]]].concat(N.slice(1,y+1).map(function(A){return["",A]}),[[" ",Ze(f-1)+"^"],["",N[y+1]]]))}return c+xt([["".concat(u-1),k[a-1]],["".concat(u),E],["",Ze(s-1)+"^"],["".concat(u+1),k[a+1]]])}function xt(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 Ia(t,a)+(r?" | "+r:" |")}).join(`
|
|
3
|
+
`)}function Ze(e){return Array(e+1).join(" ")}function Ia(e,n){return Ze(e-n.length)+n}function en(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?en=function(t){return typeof t}:en=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},en(e)}function $t(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 Da(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?$t(Object(t),!0).forEach(function(i){Fa(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$t(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Fa(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Aa(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Mt(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 Oa(e,n,t){return n&&Mt(e.prototype,n),t&&Mt(e,t),e}function Ra(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&&Ue(e,n)}function _a(e){var n=Gt();return function(){var i=Ve(e),a;if(n){var r=Ve(this).constructor;a=Reflect.construct(i,arguments,r)}else a=i.apply(this,arguments);return jt(this,a)}}function jt(e,n){return n&&(en(n)==="object"||typeof n=="function")?n:Be(e)}function Be(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kn(e){var n=typeof Map=="function"?new Map:void 0;return Kn=function(i){if(i===null||!La(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 nn(i,arguments,Ve(this).constructor)}return a.prototype=Object.create(i.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Ue(a,i)},Kn(e)}function nn(e,n,t){return Gt()?nn=Reflect.construct:nn=function(a,r,u){var o=[null];o.push.apply(o,r);var s=Function.bind.apply(a,o),c=new s;return u&&Ue(c,u.prototype),c},nn.apply(null,arguments)}function Gt(){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 La(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ue(e,n){return Ue=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},Ue(e,n)}function Ve(e){return Ve=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ve(e)}var B=function(e){Ra(t,e);var n=_a(t);function t(i,a,r,u,o,s,c){var k,E,y,f;Aa(this,t),f=n.call(this,i),f.name="GraphQLError",f.originalError=s??void 0,f.nodes=Qt(Array.isArray(a)?a:a?[a]:void 0);for(var N=[],I=0,A=(F=f.nodes)!==null&&F!==void 0?F:[];I<A.length;I++){var F,P=A[I],_=P.loc;_!=null&&N.push(_)}N=Qt(N),f.source=r??((k=N)===null||k===void 0?void 0:k[0].source),f.positions=u??((E=N)===null||E===void 0?void 0:E.map(function(l){return l.start})),f.locations=u&&r?u.map(function(l){return Yn(r,l)}):(y=N)===null||y===void 0?void 0:y.map(function(l){return Yn(l.source,l.start)}),f.path=o??void 0;var d=s?.extensions;return c==null&&se(d)?f.extensions=Da({},d):f.extensions=c??{},Object.defineProperties(Be(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(Be(f),"stack",{value:s.stack,writable:!0,configurable:!0}),jt(f)):(Error.captureStackTrace?Error.captureStackTrace(Be(f),t):Object.defineProperty(Be(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Oa(t,[{key:"toString",value:function(){return Pa(this)}},{key:G,get:function(){return"Object"}}]),t}(Kn(Error));function Qt(e){return e===void 0||e.length===0?void 0:e}function Pa(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
|
+
`+wa(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
|
|
|
7
|
-
`+Ct(e.source,o)}return n}var h=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function qe(e,n){var t=!!e;if(!t)throw new Error(n??"Unexpected invariant triggered.")}var
|
|
7
|
+
`+Ct(e.source,o)}return n}var h=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function qe(e,n){var t=!!e;if(!t)throw new Error(n??"Unexpected invariant triggered.")}var Ba=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Xn=Ba;function J(e){var n=e.prototype.toJSON;typeof n=="function"||qe(0),e.prototype.inspect=n,Xn&&(e.prototype[Xn]=n)}var Ua=function(){function e(t,i,a){this.start=t.start,this.end=i.end,this.startToken=t,this.endToken=i,this.source=a}var n=e.prototype;return n.toJSON=function(){return{start:this.start,end:this.end}},e}();J(Ua);var Va=function(){function e(t,i,a,r,u,o,s){this.kind=t,this.start=i,this.end=a,this.line=r,this.column=u,this.value=s,this.prev=o,this.next=null}var n=e.prototype;return n.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();J(Va);function Wn(e){return e!=null&&typeof e.kind=="string"}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)}var qa=10,zt=2;function R(e){return an(e,[])}function an(e,n){switch(tn(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":Ca(e,n);default:return String(e)}}function Ca(e,n){if(n.indexOf(e)!==-1)return"[Circular]";var t=[].concat(n,[e]),i=Ma(e);if(i!==void 0){var a=i.call(e);if(a!==e)return typeof a=="string"?a:an(a,t)}else if(Array.isArray(e))return $a(e,t);return xa(e,t)}function xa(e,n){var t=Object.keys(e);if(t.length===0)return"{}";if(n.length>zt)return"["+ja(e)+"]";var i=t.map(function(a){var r=an(e[a],n);return a+": "+r});return"{ "+i.join(", ")+" }"}function $a(e,n){if(e.length===0)return"[]";if(n.length>zt)return"[Array]";for(var t=Math.min(qa,e.length),i=e.length-t,a=[],r=0;r<t;++r)a.push(an(e[r],n));return i===1?a.push("... 1 more item"):i>1&&a.push("... ".concat(i," more items")),"["+a.join(", ")+"]"}function Ma(e){var n=e[String(Xn)];if(typeof n=="function")return n;if(typeof e.inspect=="function")return e.inspect}function ja(e){var n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(n==="Object"&&typeof e.constructor=="function"){var t=e.constructor.name;if(typeof t=="string"&&t!=="")return t}return n}function O(e,n){var t=!!e;if(!t)throw new Error(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)}var ne=function(n,t){if(n instanceof t)return!0;if(rn(n)==="object"&&n!==null){var i,a=t.prototype[Symbol.toStringTag],r=Symbol.toStringTag in n?n[Symbol.toStringTag]:(i=n.constructor)===null||i===void 0?void 0:i.name;if(a===r){var u=R(n);throw new Error("Cannot use ".concat(a,' "').concat(u,`" from another module or realm.
|
|
8
8
|
|
|
9
9
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
10
10
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -15,17 +15,17 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
15
15
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
16
16
|
versions may have different capabilities and behavior. The data from one
|
|
17
17
|
version used in the function from another could produce confusing and
|
|
18
|
-
spurious results.`))}}return!1};function Ht(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
|
|
18
|
+
spurious results.`))}}return!1};function Ht(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 Ga(e,n,t){return n&&Ht(e.prototype,n),t&&Ht(e,t),e}(function(){function e(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof n=="string"||O(0,"Body must be a string. Received: ".concat(R(n),".")),this.body=n,this.name=t,this.locationOffset=i,this.locationOffset.line>0||O(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||O(0,"column in locationOffset is 1-indexed and must be positive.")}return Ga(e,[{key:G,get:function(){return"Source"}}]),e})();var L=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function Qa(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.indexOf(`
|
|
19
19
|
`)===-1,a=e[0]===" "||e[0]===" ",r=e[e.length-1]==='"',u=e[e.length-1]==="\\",o=!i||r||u||t,s="";return o&&!(i&&a)&&(s+=`
|
|
20
20
|
`+n),s+=n?e.replace(/\n/g,`
|
|
21
21
|
`+n):e,o&&(s+=`
|
|
22
|
-
`),'"""'+s.replace(/"""/g,'\\"""')+'"""'}var
|
|
22
|
+
`),'"""'+s.replace(/"""/g,'\\"""')+'"""'}var za={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"]},Ha=Object.freeze({});function Jt(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:za,i=void 0,a=Array.isArray(e),r=[e],u=-1,o=[],s=void 0,c=void 0,k=void 0,E=[],y=[],f=e;do{u++;var N=u===r.length,I=N&&o.length!==0;if(N){if(c=y.length===0?void 0:E[E.length-1],s=k,k=y.pop(),I){if(a)s=s.slice();else{for(var A={},F=0,P=Object.keys(s);F<P.length;F++){var _=P[F];A[_]=s[_]}s=A}for(var d=0,l=0;l<o.length;l++){var S=o[l][0],v=o[l][1];a&&(S-=d),a&&v===null?(s.splice(S,1),d++):s[S]=v}}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&&E.push(c)}var T=void 0;if(!Array.isArray(s)){if(!Wn(s))throw new Error("Invalid AST Node: ".concat(R(s),"."));var D=Zn(n,s.kind,N);if(D){if(T=D.call(n,s,c,k,E,y),T===Ha)break;if(T===!1){if(!N){E.pop();continue}}else if(T!==void 0&&(o.push([c,T]),!N))if(Wn(T))s=T;else{E.pop();continue}}}if(T===void 0&&I&&o.push([c,s]),N)E.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 Zn(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 Ja=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}},Yt=Ja,Ya=Object.values||function(e){return Object.keys(e).map(function(n){return e[n]})},ue=Ya,Ka=Object.entries||function(e){return Object.keys(e).map(function(n){return[n,e[n]]})},Ce=Ka;function Kt(e,n){return e.reduce(function(t,i){return t[n(i)]=i,t},Object.create(null))}function on(e,n){for(var t=Object.create(null),i=0,a=Ce(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=Ce(e);t<i.length;t++){var a=i[t],r=a[0],u=a[1];n[r]=u}return n}function et(e,n,t){return e.reduce(function(i,a){return i[n(a)]=t(a),i},Object.create(null))}var Xa=5;function Wa(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,Xa),s=o.pop();return r+o.join(", ")+", or "+s+"?"}function Xt(e){return e}function Za(e,n){for(var t=0,i=0;t<e.length&&i<n.length;){var a=e.charCodeAt(t),r=n.charCodeAt(i);if(sn(a)&&sn(r)){var u=0;do++t,u=u*10+a-nt,a=e.charCodeAt(t);while(sn(a)&&u>0);var o=0;do++i,o=o*10+r-nt,r=n.charCodeAt(i);while(sn(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 nt=48,er=57;function sn(e){return!isNaN(e)&&nt<=e&&e<=er}function nr(e,n){for(var t=Object.create(null),i=new tr(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:Za(s,c)})}var tr=function(){function e(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=Wt(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=Wt(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 E=this._rows,y=0;y<=k;y++)E[0][y]=y;for(var f=1;f<=c;f++){for(var N=E[(f-1)%3],I=E[f%3],A=I[0]=f,F=1;F<=k;F++){var P=u[f-1]===o[F-1]?0:1,_=Math.min(N[F]+1,I[F-1]+1,N[F-1]+P);if(f>1&&F>1&&u[f-1]===o[F-2]&&u[f-2]===o[F-1]){var d=E[(f-2)%3][F-2];_=Math.min(_,d+1)}_<A&&(A=_),I[F]=_}if(A>a)return}var l=E[c%3][k];return l<=a?l:void 0}},e}();function Wt(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 Jt(e,{leave:ar})}var ir=80,ar={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=U("(",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+U(" = ",a)+U(" ",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=U("",t,": ")+i,s=o+U("(",g(a,", "),")");return s.length>
|
|
25
|
+
`},OperationDefinition:function(n){var t=n.operation,i=n.name,a=U("(",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+U(" = ",a)+U(" ",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=U("",t,": ")+i,s=o+U("(",g(a,", "),")");return s.length>ir&&(s=o+U(`(
|
|
26
26
|
`,un(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+U(" ",g(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,a=n.selectionSet;return g(["...",U("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(U("(",g(a,", "),")")," ")+"on ".concat(i," ").concat(U("",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?
|
|
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+U(" ",g(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,a=n.selectionSet;return g(["...",U("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(U("(",g(a,", "),")")," ")+"on ".concat(i," ").concat(U("",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?Qa(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+U("(",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,U("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+(Zt(t)?U(`(
|
|
29
29
|
`,un(g(t,`
|
|
30
30
|
`)),`
|
|
31
31
|
)`):U("(",g(t,", "),")"))+": "+i+U(" ",g(a," "))}),InputValueDefinition:Y(function(e){var n=e.name,t=e.type,i=e.defaultValue,a=e.directives;return g([n+": "+t,U("= ",i),g(a," ")]," ")}),InterfaceTypeDefinition:Y(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return g(["interface",n,U("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+(Zt(t)?U(`(
|
|
@@ -36,10 +36,10 @@ spurious results.`))}}return!1};function Ht(e,n){for(var t=0;t<n.length;t++){var
|
|
|
36
36
|
`,un(g(e,`
|
|
37
37
|
`)),`
|
|
38
38
|
}`)}function U(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return n!=null&&n!==""?e+n+t:""}function un(e){return U(" ",e.replace(/\n/g,`
|
|
39
|
-
`))}function
|
|
40
|
-
`)!==-1}function Zt(e){return e!=null&&e.some(or)}function tt(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 tt(t,n)});case h.OBJECT:return et(e.fields,function(t){return t.name.value},function(t){return tt(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}qe(0,"Unexpected value node: "+_(e))}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 me(e,n,t){return n&&ei(e.prototype,n),t&&ei(e,t),e}function ni(e){return xe(e)||Z(e)||Q(e)||ie(e)||ae(e)||ce(e)||$e(e)||pe(e)}function sr(e){if(!ni(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL type."));return e}function xe(e){return ne(e,le)}function Z(e){return ne(e,re)}function Q(e){return ne(e,oi)}function ie(e){return ne(e,si)}function ae(e){return ne(e,dn)}function ce(e){return ne(e,ui)}function $e(e){return ne(e,x)}function pe(e){return ne(e,w)}function he(e){return xe(e)||ae(e)||ce(e)||at(e)&&he(e.ofType)}function cn(e){return xe(e)||Z(e)||Q(e)||ie(e)||ae(e)||at(e)&&cn(e.ofType)}function ur(e){return xe(e)||ae(e)}function it(e){return Z(e)||Q(e)||ie(e)}function cr(e){return Q(e)||ie(e)}function x(e){if(this instanceof x)this.ofType=sr(e);else return new x(e)}x.prototype.toString=function(){return"["+String(this.ofType)+"]"},x.prototype.toJSON=function(){return this.toString()},Object.defineProperty(x.prototype,G,{get:function(){return"GraphQLList"}}),J(x);function w(e){if(this instanceof w)this.ofType=dr(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 at(e){return $e(e)||pe(e)}function lr(e){return ni(e)&&!pe(e)}function dr(e){if(!lr(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL nullable type."));return e}function fr(e){if(e)return pe(e)?e.ofType:e}function Me(e){if(e){for(var n=e;at(n);)n=n.ofType;return n}}function ln(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:Xt;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(a=t.serialize)!==null&&a!==void 0?a:Xt,this.parseValue=u,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return u(tt(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(_(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()},me(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=ii.bind(void 0,t),this._interfaces=ti.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(_(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:ai(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()},me(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();J(re);function ti(e){var n,t=(n=ln(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 ii(e){var n=ln(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.")),on(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(_(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=Ce(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 ai(e){return on(e,function(n){return{description:n.description,type:n.type,args:ri(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function ri(e){return et(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 oi=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=ii.bind(void 0,t),this._interfaces=ti.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(_(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:ai(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()},me(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();J(oi);var si=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=vr.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(_(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()},me(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();J(si);function vr(e){var n=ln(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 dn=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=mr(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=Kt(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(_(i)));return a.name},n.parseValue=function(i){if(typeof i!="string"){var a=_(i);throw new B('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(a,".")+fn(this,a))}var r=this.getValue(i);if(r==null)throw new B('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+fn(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,".")+fn(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.')+fn(this,o),i)}return u.value},n.toConfig=function(){var i,a=et(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()},me(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();J(dn);function fn(e,n){var t=e.getValues().map(function(a){return a.name}),i=tr(n,t);return Za("the enum value",i)}function mr(e,n){return ke(n)||O(0,"".concat(e," values must be an object with value names as keys.")),Ce(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(_(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 ui=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=pr.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=on(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()},me(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();J(ui);function pr(e){var n=ln(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.")),on(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 hr=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[qt];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[]},yr=hr,kr=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},je=kr;function vn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vn=function(t){return typeof t}:vn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(e)}function gr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k){return k};if(e==null||vn(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[qt];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 Sr=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},mn=Sr,rt=2147483647,ot=-2147483648;function br(e){var n=Ge(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!mn(t))throw new B("Int cannot represent non-integer value: ".concat(_(n)));if(t>rt||t<ot)throw new B("Int cannot represent non 32-bit signed integer value: "+_(n));return t}function Nr(e){if(!mn(e))throw new B("Int cannot represent non-integer value: ".concat(_(e)));if(e>rt||e<ot)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var Tr=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:br,parseValue:Nr,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>rt||t<ot)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function Er(e){var n=Ge(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!je(t))throw new B("Float cannot represent non numeric value: ".concat(_(n)));return t}function wr(e){if(!je(e))throw new B("Float cannot represent non numeric value: ".concat(_(e)));return e}var Ir=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:Er,parseValue:wr,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 Ge(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 Dr(e){var n=Ge(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(je(n))return n.toString();throw new B("String cannot represent value: ".concat(_(e)))}function Fr(e){if(typeof e!="string")throw new B("String cannot represent a non string value: ".concat(_(e)));return e}var V=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:Dr,parseValue:Fr,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 Ar(e){var n=Ge(e);if(typeof n=="boolean")return n;if(je(n))return n!==0;throw new B("Boolean cannot represent a non boolean value: ".concat(_(n)))}function Or(e){if(typeof e!="boolean")throw new B("Boolean cannot represent a non boolean value: ".concat(_(e)));return e}var z=new le({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Ar,parseValue:Or,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 _r(e){var n=Ge(e);if(typeof n=="string")return n;if(mn(n))return String(n);throw new B("ID cannot represent value: ".concat(_(e)))}function Rr(e){if(typeof e=="string")return e;if(mn(e))return e.toString();throw new B("ID cannot represent value: ".concat(_(e)))}var ci=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:_r,parseValue:Rr,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}}),li=Object.freeze([V,Tr,Ir,z,ci]);function Qe(e,n){if(pe(n)){var t=Qe(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if($e(n)){var i=n.ofType,a=gr(e);if(a!=null){for(var r=[],u=0;u<a.length;u++){var o=a[u],s=Qe(o,i);s!=null&&r.push(s)}return{kind:h.LIST,values:r}}return Qe(e,i)}if(ce(n)){if(!se(e))return null;for(var c=[],k=0,E=ue(n.getFields());k<E.length;k++){var y=E[k],f=Qe(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(ur(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"&&je(N)){var I=String(N);return di.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===ci&&di.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(_(N),"."))}qe(0,"Unexpected input type: "+_(n))}var di=/^-?(?:0|[1-9][0-9]*)$/,st=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:V,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new w(new x(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 x(new w(fi))),resolve:function(t){return t.getDirectives()}}}}}),fi=new re({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
39
|
+
`))}function rr(e){return e.indexOf(`
|
|
40
|
+
`)!==-1}function Zt(e){return e!=null&&e.some(rr)}function tt(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 tt(t,n)});case h.OBJECT:return et(e.fields,function(t){return t.name.value},function(t){return tt(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}qe(0,"Unexpected value node: "+R(e))}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 me(e,n,t){return n&&ei(e.prototype,n),t&&ei(e,t),e}function ni(e){return xe(e)||Z(e)||Q(e)||ie(e)||ae(e)||ce(e)||$e(e)||pe(e)}function or(e){if(!ni(e))throw new Error("Expected ".concat(R(e)," to be a GraphQL type."));return e}function xe(e){return ne(e,le)}function Z(e){return ne(e,re)}function Q(e){return ne(e,oi)}function ie(e){return ne(e,si)}function ae(e){return ne(e,dn)}function ce(e){return ne(e,ui)}function $e(e){return ne(e,x)}function pe(e){return ne(e,w)}function he(e){return xe(e)||ae(e)||ce(e)||at(e)&&he(e.ofType)}function cn(e){return xe(e)||Z(e)||Q(e)||ie(e)||ae(e)||at(e)&&cn(e.ofType)}function sr(e){return xe(e)||ae(e)}function it(e){return Z(e)||Q(e)||ie(e)}function ur(e){return Q(e)||ie(e)}function x(e){if(this instanceof x)this.ofType=or(e);else return new x(e)}x.prototype.toString=function(){return"["+String(this.ofType)+"]"},x.prototype.toJSON=function(){return this.toString()},Object.defineProperty(x.prototype,G,{get:function(){return"GraphQLList"}}),J(x);function w(e){if(this instanceof w)this.ofType=lr(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 at(e){return $e(e)||pe(e)}function cr(e){return ni(e)&&!pe(e)}function lr(e){if(!cr(e))throw new Error("Expected ".concat(R(e)," to be a GraphQL nullable type."));return e}function dr(e){if(e)return pe(e)?e.ofType:e}function Me(e){if(e){for(var n=e;at(n);)n=n.ofType;return n}}function ln(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:Xt;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(a=t.serialize)!==null&&a!==void 0?a:Xt,this.parseValue=u,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return u(tt(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()},me(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=ii.bind(void 0,t),this._interfaces=ti.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:ai(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()},me(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();J(re);function ti(e){var n,t=(n=ln(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 ii(e){var n=ln(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.")),on(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=Ce(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 ai(e){return on(e,function(n){return{description:n.description,type:n.type,args:ri(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function ri(e){return et(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 oi=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=ii.bind(void 0,t),this._interfaces=ti.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:ai(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()},me(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();J(oi);var si=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=fr.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()},me(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();J(si);function fr(e){var n=ln(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 dn=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=vr(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=Kt(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,".")+fn(this,a))}var r=this.getValue(i);if(r==null)throw new B('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+fn(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,".")+fn(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.')+fn(this,o),i)}return u.value},n.toConfig=function(){var i,a=et(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()},me(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();J(dn);function fn(e,n){var t=e.getValues().map(function(a){return a.name}),i=nr(n,t);return Wa("the enum value",i)}function vr(e,n){return ke(n)||O(0,"".concat(e," values must be an object with value names as keys.")),Ce(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 ui=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=mr.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=on(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()},me(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();J(ui);function mr(e){var n=ln(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.")),on(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[qt];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[]},hr=pr,yr=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},je=yr;function vn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vn=function(t){return typeof t}:vn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(e)}function kr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k){return k};if(e==null||vn(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[qt];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 gr=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},mn=gr,rt=2147483647,ot=-2147483648;function Sr(e){var n=Ge(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!mn(t))throw new B("Int cannot represent non-integer value: ".concat(R(n)));if(t>rt||t<ot)throw new B("Int cannot represent non 32-bit signed integer value: "+R(n));return t}function br(e){if(!mn(e))throw new B("Int cannot represent non-integer value: ".concat(R(e)));if(e>rt||e<ot)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var Nr=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:Sr,parseValue:br,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>rt||t<ot)throw new B("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function Tr(e){var n=Ge(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!je(t))throw new B("Float cannot represent non numeric value: ".concat(R(n)));return t}function Er(e){if(!je(e))throw new B("Float cannot represent non numeric value: ".concat(R(e)));return e}var wr=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:Tr,parseValue:Er,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 Ge(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 Ir(e){var n=Ge(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(je(n))return n.toString();throw new B("String cannot represent value: ".concat(R(e)))}function Dr(e){if(typeof e!="string")throw new B("String cannot represent a non string value: ".concat(R(e)));return e}var V=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:Ir,parseValue:Dr,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 Fr(e){var n=Ge(e);if(typeof n=="boolean")return n;if(je(n))return n!==0;throw new B("Boolean cannot represent a non boolean value: ".concat(R(n)))}function Ar(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:Fr,parseValue:Ar,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 Or(e){var n=Ge(e);if(typeof n=="string")return n;if(mn(n))return String(n);throw new B("ID cannot represent value: ".concat(R(e)))}function Rr(e){if(typeof e=="string")return e;if(mn(e))return e.toString();throw new B("ID cannot represent value: ".concat(R(e)))}var ci=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:Or,parseValue:Rr,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}}),li=Object.freeze([V,Nr,wr,z,ci]);function Qe(e,n){if(pe(n)){var t=Qe(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if($e(n)){var i=n.ofType,a=kr(e);if(a!=null){for(var r=[],u=0;u<a.length;u++){var o=a[u],s=Qe(o,i);s!=null&&r.push(s)}return{kind:h.LIST,values:r}}return Qe(e,i)}if(ce(n)){if(!se(e))return null;for(var c=[],k=0,E=ue(n.getFields());k<E.length;k++){var y=E[k],f=Qe(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(sr(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"&&je(N)){var I=String(N);return di.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===ci&&di.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(R(N),"."))}qe(0,"Unexpected input type: "+R(n))}var di=/^-?(?:0|[1-9][0-9]*)$/,st=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:V,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new w(new x(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 x(new w(fi))),resolve:function(t){return t.getDirectives()}}}}}),fi=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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isRepeatable:{type:new w(z),resolve:function(t){return t.isRepeatable}},locations:{type:new w(new x(new w(vi))),resolve:function(t){return t.locations}},args:{type:new w(new x(new w(pn))),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})}}}}}),vi=new dn({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(hi),resolve:function(t){if(xe(t))return $.SCALAR;if(Z(t))return $.OBJECT;if(Q(t))return $.INTERFACE;if(ie(t))return $.UNION;if(ae(t))return $.ENUM;if(ce(t))return $.INPUT_OBJECT;if($e(t))return $.LIST;if(pe(t))return $.NON_NULL;qe(0,'Unexpected type: "'.concat(_(t),'".'))}},name:{type:V,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:V,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:V,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new x(new w(mi)),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 x(new w(X)),resolve:function(t){if(Z(t)||Q(t))return t.getInterfaces()}},possibleTypes:{type:new x(new w(X)),resolve:function(t,i,a,r){var u=r.schema;if(cr(t))return u.getPossibleTypes(t)}},enumValues:{type:new x(new w(pi)),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 x(new w(pn)),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}}}}}),mi=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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},args:{type:new w(new x(new w(pn))),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:V,resolve:function(t){return t.deprecationReason}}}}}),pn=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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},type:{type:new w(X),resolve:function(t){return t.type}},defaultValue:{type:V,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,a=t.defaultValue,r=Qe(a,i);return r?te(r):null}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),pi=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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),$=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),hi=new dn({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:$.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:$.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:$.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:$.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:$.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:$.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:$.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:$.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),yi={name:"__schema",type:new w(st),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},ki={name:"__type",type:X,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new w(V),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},gi={name:"__typename",type:new w(V),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},Si=Object.freeze([st,fi,vi,X,mi,pn,pi,hi]);function bi(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 Lr(e,n,t){return n&&bi(e.prototype,n),t&&bi(e,t),e}function Pr(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=Ce(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:ri(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Lr(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();J(ge);var Br=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."}}}),Ur=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."}}}),Vr="No longer supported",qr=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:V,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:Vr}}}),Cr=new ge({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[L.SCALAR],args:{url:{type:new w(V),description:"The URL that specifies the behaviour of this scalar."}}}),xr=Object.freeze([Br,Ur,qr,Cr]);function Ni(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 $r(e,n,t){return n&&Ni(e.prototype,n),t&&Ni(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(_(t.types),".")),!t.directives||Array.isArray(t.directives)||O(0,'"directives" must be Array if provided but got: '+"".concat(_(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:xr;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(Pr(k))for(var E=0,y=k.args;E<y.length;E++){var f=y[E];W(f.type,a)}}W(st,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,I=yr(a);N<I.length;N++){var A=I[N];if(A!=null){var F=A.name;if(F||O(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[F]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(F,'".'));if(this._typeMap[F]=A,Q(A))for(var P=0,R=A.getInterfaces();P<R.length;P++){var d=R[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,v=A.getInterfaces();S<v.length;S++){var T=v[S];if(Q(T)){var D=this._implementationsMap[T.name];D===void 0&&(D=this._implementationsMap[T.name]={objects:[],interfaces:[]}),D.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,E=c.objects;k<E.length;k++){var y=E[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 Yt(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}},$r(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function W(e,n){var t=Me(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 E=k[c];W(E.type,n);for(var y=0,f=E.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 F=A[I];W(F.type,n)}}return n}function hn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=hn(e,n.type),t&&new x(t);if(n.kind===h.NON_NULL_TYPE)return t=hn(e,n.type),t&&new w(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);qe(0,"Unexpected type node: "+_(n))}var Mr=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??jr,a&&(he(a)&&this._inputTypeStack.push(a),it(a)&&this._parentTypeStack.push(a),cn(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=Me(this.getType());this._parentTypeStack.push(it(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(cn(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,E=k?hn(a,k):Me(this.getType());this._typeStack.push(cn(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=hn(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=Yt(A.args,function(T){return T.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 F=fr(this.getInputType()),P=$e(F)?F.ofType:F;this._defaultValueStack.push(void 0),this._inputTypeStack.push(he(P)?P:void 0);break}case h.OBJECT_FIELD:{var R=Me(this.getInputType()),d,l;ce(R)&&(l=R.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=Me(this.getInputType()),v;ae(S)&&(v=S.getValue(i.value)),this._enumValue=v;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 jr(e,n,t){var i=t.name.value;if(i===yi.name&&e.getQueryType()===n)return yi;if(i===ki.name&&e.getQueryType()===n)return ki;if(i===gi.name&&it(n))return gi;if(Z(n)||Q(n))return n.getFields()[i]}function Gr(e,n){return{enter:function(i){e.enter(i);var a=Zn(n,i.kind,!1);if(a){var r=a.apply(n,arguments);return r!==void 0&&(e.leave(i),Wn(r)&&e.enter(r)),r}},leave:function(i){var a=Zn(n,i.kind,!0),r;return a&&(r=a.apply(n,arguments)),e.leave(i),r}}}[].concat(li,Si).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 Ti(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Ei=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],E=k.name.value;if(r[E]!==!0){r[E]=!0;var y=this.getFragment(E);y&&(a.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,a)}return a},e}();(function(e){Ti(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})(Ei),function(e){Ti(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 Mr(this._schema);Jt(a,Gr(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}(Ei),Kt(li.concat(Si),function(e){return e.name});const wi=e=>e instanceof Error?e:new Error(e),Qr=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",Ii={staging:{baseEndpoint:"https://api-staging.spritz.finance",graphEndpoint:"https://api-staging.spritz.finance/graphql"},production:{baseEndpoint:"https://api.spritz.finance",graphEndpoint:"https://api.spritz.finance/graphql"}},zr=(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 Hr 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 Yr(n,t,i,a):n===401?new Kr(n,t,i,a):n===403?new Xr(n,t,i,a):n===404?new Wr(n,t,i,a):n===409?new Zr(n,t,i,a):n===422?new eo(n,t,i,a):n===429?new no(n,t,i,a):n>=500?new to(n,t,i,a):new j(n,t,i,a):new ut({cause:wi(t)})}}class ut 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 Jr extends ut{constructor(){super({message:"Request timed out."})}}class Yr extends j{name="BadRequestError";status=400}class Kr extends j{name="AuthenticationError";status=401}class Xr extends j{name="PermissionDeniedError";status=403}class Wr extends j{name="NotFoundError";status=404}class Zr extends j{name="ConflictError";status=409}class eo extends j{name="UnprocessableEntityError";status=422}class no extends j{name="RateLimitError";status=429}class to extends j{name="InternalServerError"}const io=e=>{try{return JSON.parse(e)}catch{return}};async function Di(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 ao{baseGraphURL;baseRestURL;timeout;apiKey;integrationKey;constructor({environment:n,timeout:t=3e5,apiKey:i,integrationKey:a}){this.apiKey=i,this.integrationKey=a,this.baseGraphURL=Ii[n].graphEndpoint,this.baseRestURL=Ii[n].baseEndpoint,this.timeout=zr("timeout",t)}async query({query:n,variables:t}){return this.sendQuery({query:n,variables:t}).then(i=>Di(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 Hr(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=>Di(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(wi);if(r instanceof Error)throw r.name==="AbortError"?new Jr:new ut({cause:r});const u=this.getResponseHeaders(r.headers);if(!r.ok){const o=await r.text().catch(()=>"Unknown error"),s=io(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 Ea(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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isRepeatable:{type:new w(z),resolve:function(t){return t.isRepeatable}},locations:{type:new w(new x(new w(vi))),resolve:function(t){return t.locations}},args:{type:new w(new x(new w(pn))),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})}}}}}),vi=new dn({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(hi),resolve:function(t){if(xe(t))return $.SCALAR;if(Z(t))return $.OBJECT;if(Q(t))return $.INTERFACE;if(ie(t))return $.UNION;if(ae(t))return $.ENUM;if(ce(t))return $.INPUT_OBJECT;if($e(t))return $.LIST;if(pe(t))return $.NON_NULL;qe(0,'Unexpected type: "'.concat(R(t),'".'))}},name:{type:V,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:V,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:V,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new x(new w(mi)),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 x(new w(X)),resolve:function(t){if(Z(t)||Q(t))return t.getInterfaces()}},possibleTypes:{type:new x(new w(X)),resolve:function(t,i,a,r){var u=r.schema;if(ur(t))return u.getPossibleTypes(t)}},enumValues:{type:new x(new w(pi)),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 x(new w(pn)),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}}}}}),mi=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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},args:{type:new w(new x(new w(pn))),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:V,resolve:function(t){return t.deprecationReason}}}}}),pn=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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},type:{type:new w(X),resolve:function(t){return t.type}},defaultValue:{type:V,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,a=t.defaultValue,r=Qe(a,i);return r?te(r):null}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),pi=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(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isDeprecated:{type:new w(z),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),$=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),hi=new dn({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:$.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:$.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:$.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:$.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:$.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:$.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:$.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:$.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),yi={name:"__schema",type:new w(st),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},ki={name:"__type",type:X,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new w(V),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},gi={name:"__typename",type:new w(V),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},Si=Object.freeze([st,fi,vi,X,mi,pn,pi,hi]);function bi(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 _r(e,n,t){return n&&bi(e.prototype,n),t&&bi(e,t),e}function Lr(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=Ce(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:ri(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},_r(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();J(ge);var Pr=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."}}}),Br=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."}}}),Ur="No longer supported",Vr=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:V,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:Ur}}}),qr=new ge({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[L.SCALAR],args:{url:{type:new w(V),description:"The URL that specifies the behaviour of this scalar."}}}),Cr=Object.freeze([Pr,Br,Vr,qr]);function Ni(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&&Ni(e.prototype,n),t&&Ni(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:Cr;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(Lr(k))for(var E=0,y=k.args;E<y.length;E++){var f=y[E];W(f.type,a)}}W(st,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,I=hr(a);N<I.length;N++){var A=I[N];if(A!=null){var F=A.name;if(F||O(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[F]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(F,'".'));if(this._typeMap[F]=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,v=A.getInterfaces();S<v.length;S++){var T=v[S];if(Q(T)){var D=this._implementationsMap[T.name];D===void 0&&(D=this._implementationsMap[T.name]={objects:[],interfaces:[]}),D.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,E=c.objects;k<E.length;k++){var y=E[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 Yt(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}},xr(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function W(e,n){var t=Me(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 E=k[c];W(E.type,n);for(var y=0,f=E.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 F=A[I];W(F.type,n)}}return n}function hn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=hn(e,n.type),t&&new x(t);if(n.kind===h.NON_NULL_TYPE)return t=hn(e,n.type),t&&new w(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);qe(0,"Unexpected type node: "+R(n))}var $r=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??Mr,a&&(he(a)&&this._inputTypeStack.push(a),it(a)&&this._parentTypeStack.push(a),cn(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=Me(this.getType());this._parentTypeStack.push(it(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(cn(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,E=k?hn(a,k):Me(this.getType());this._typeStack.push(cn(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=hn(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=Yt(A.args,function(T){return T.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 F=dr(this.getInputType()),P=$e(F)?F.ofType:F;this._defaultValueStack.push(void 0),this._inputTypeStack.push(he(P)?P:void 0);break}case h.OBJECT_FIELD:{var _=Me(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=Me(this.getInputType()),v;ae(S)&&(v=S.getValue(i.value)),this._enumValue=v;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 Mr(e,n,t){var i=t.name.value;if(i===yi.name&&e.getQueryType()===n)return yi;if(i===ki.name&&e.getQueryType()===n)return ki;if(i===gi.name&&it(n))return gi;if(Z(n)||Q(n))return n.getFields()[i]}function jr(e,n){return{enter:function(i){e.enter(i);var a=Zn(n,i.kind,!1);if(a){var r=a.apply(n,arguments);return r!==void 0&&(e.leave(i),Wn(r)&&e.enter(r)),r}},leave:function(i){var a=Zn(n,i.kind,!0),r;return a&&(r=a.apply(n,arguments)),e.leave(i),r}}}[].concat(li,Si).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 Ti(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Ei=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],E=k.name.value;if(r[E]!==!0){r[E]=!0;var y=this.getFragment(E);y&&(a.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,a)}return a},e}();(function(e){Ti(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})(Ei),function(e){Ti(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 $r(this._schema);Jt(a,jr(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}(Ei),Kt(li.concat(Si),function(e){return e.name});const wi=e=>e instanceof Error?e:new Error(e),Gr=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",Ii={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"}},Qr=(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 zr 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 Jr(n,t,i,a):n===401?new Yr(n,t,i,a):n===403?new Kr(n,t,i,a):n===404?new Xr(n,t,i,a):n===409?new Wr(n,t,i,a):n===422?new Zr(n,t,i,a):n===429?new eo(n,t,i,a):n>=500?new no(n,t,i,a):new j(n,t,i,a):new ut({cause:wi(t)})}}class ut 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 Hr extends ut{constructor(){super({message:"Request timed out."})}}class Jr extends j{name="BadRequestError";status=400}class Yr extends j{name="AuthenticationError";status=401}class Kr extends j{name="PermissionDeniedError";status=403}class Xr extends j{name="NotFoundError";status=404}class Wr extends j{name="ConflictError";status=409}class Zr extends j{name="UnprocessableEntityError";status=422}class eo extends j{name="RateLimitError";status=429}class no extends j{name="InternalServerError"}const to=e=>{try{return JSON.parse(e)}catch{return}};async function Di(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 io{baseGraphURL;baseRestURL;timeout;apiKey;integrationKey;constructor({environment:n,timeout:t=3e5,apiKey:i,integrationKey:a}){this.apiKey=i,this.integrationKey=a,this.baseGraphURL=Ii[n].graphEndpoint,this.baseRestURL=Ii[n].baseEndpoint,this.timeout=Qr("timeout",t)}async query({query:n,variables:t}){return this.sendQuery({query:n,variables:t}).then(i=>Di(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 zr(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=>Di(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(wi);if(r instanceof Error)throw r.name==="AbortError"?new Hr:new ut({cause:r});const u=this.getResponseHeaders(r.headers);if(!r.ok){const o=await r.text().catch(()=>"Unknown error"),s=to(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 Ta(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
|
|
@@ -106,21 +106,21 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
106
106
|
logo
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 ct={};(function(){be.definitions.forEach(function(n){if(n.name){var t=new Set;yn(n,t),ct[n.name.value]=t}})})();function Fi(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
|
|
109
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 ct={};(function(){be.definitions.forEach(function(n){if(n.name){var t=new Set;yn(n,t),ct[n.name.value]=t}})})();function Fi(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:[Fi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=ct[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=ct[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Fi(e,o);s&&t.definitions.push(s)}),t}ao(be,"PayableAccountFragment");var Ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createAccountInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BankAccountInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createBankAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createAccountInput"},value:{kind:"Variable",name:{kind:"Name",value:"createAccountInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:229}};Ne.loc.source={body:`#import "../queries/payableAccountFragment.graphql"
|
|
110
110
|
|
|
111
111
|
mutation CreateBankAccount($createAccountInput: BankAccountInput!) {
|
|
112
112
|
createBankAccount(createAccountInput: $createAccountInput) {
|
|
113
113
|
...PayableAccountFragment
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ai={};function
|
|
116
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ai={};function ro(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Ai[t]?!1:(Ai[t]=!0,!0)})}Ne.definitions=Ne.definitions.concat(ro(be.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 lt={};(function(){Ne.definitions.forEach(function(n){if(n.name){var t=new Set;kn(n,t),lt[n.name.value]=t}})})();function Oi(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 oo(e,n){var t={kind:e.kind,definitions:[Oi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=lt[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=lt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Oi(e,o);s&&t.definitions.push(s)}),t}oo(Ne,"CreateBankAccount");var de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeletePayableAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};de.loc.source={body:`#import "../queries/payableAccountFragment.graphql"
|
|
117
117
|
|
|
118
118
|
mutation DeletePayableAccount($accountId: String!) {
|
|
119
119
|
deletePayableAccount(accountId: $accountId) {
|
|
120
120
|
...PayableAccountFragment
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
123
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ri={};function so(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Ri[t]?!1:(Ri[t]=!0,!0)})}de.definitions=de.definitions.concat(so(be.definitions));function gn(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){gn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){gn(i,n)}),e.definitions&&e.definitions.forEach(function(i){gn(i,n)})}var dt={};(function(){de.definitions.forEach(function(n){if(n.name){var t=new Set;gn(n,t),dt[n.name.value]=t}})})();function _i(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 uo(e,n){var t={kind:e.kind,definitions:[_i(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=dt[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=dt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=_i(e,o);s&&t.definitions.push(s)}),t}uo(de,"DeletePayableAccount");var ze={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}};ze.loc.source={body:`fragment BankAccountFragment on BankAccount {
|
|
124
124
|
id
|
|
125
125
|
name
|
|
126
126
|
userId
|
|
@@ -140,6 +140,7 @@ mutation DeletePayableAccount($accountId: String!) {
|
|
|
140
140
|
routingNumber
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
deliveryMethods
|
|
143
144
|
}
|
|
144
145
|
institution {
|
|
145
146
|
id
|
|
@@ -149,21 +150,21 @@ mutation DeletePayableAccount($accountId: String!) {
|
|
|
149
150
|
currency
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sn(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){Sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Sn(i,n)})}var ft={};(function(){ze.definitions.forEach(function(n){if(n.name){var t=new Set;Sn(n,t),ft[n.name.value]=t}})})();function Li(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
|
|
153
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sn(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){Sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Sn(i,n)})}var ft={};(function(){ze.definitions.forEach(function(n){if(n.name){var t=new Set;Sn(n,t),ft[n.name.value]=t}})})();function Li(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 co(e,n){var t={kind:e.kind,definitions:[Li(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=Li(e,o);s&&t.definitions.push(s)}),t}co(ze,"BankAccountFragment");var Te={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}};Te.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
|
|
153
154
|
|
|
154
155
|
mutation RenameBankAccount($accountId: String!, $name: String!) {
|
|
155
156
|
renamePayableAccount(accountId: $accountId, name: $name) {
|
|
156
157
|
...BankAccountFragment
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Pi={};function
|
|
160
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Pi={};function lo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Pi[t]?!1:(Pi[t]=!0,!0)})}Te.definitions=Te.definitions.concat(lo(ze.definitions));function bn(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){bn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){bn(i,n)}),e.definitions&&e.definitions.forEach(function(i){bn(i,n)})}var vt={};(function(){Te.definitions.forEach(function(n){if(n.name){var t=new Set;bn(n,t),vt[n.name.value]=t}})})();function Bi(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 fo(e,n){var t={kind:e.kind,definitions:[Bi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=vt[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=vt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Bi(e,o);s&&t.definitions.push(s)}),t}fo(Te,"RenameBankAccount");var Ee={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}};Ee.loc.source={body:`#import "./bankAccountFragment.graphql"
|
|
160
161
|
|
|
161
162
|
query UserBankAccounts {
|
|
162
163
|
bankAccounts {
|
|
163
164
|
...BankAccountFragment
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ui={};function
|
|
167
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ui={};function vo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Ui[t]?!1:(Ui[t]=!0,!0)})}Ee.definitions=Ee.definitions.concat(vo(ze.definitions));function Nn(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){Nn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Nn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Nn(i,n)})}var mt={};(function(){Ee.definitions.forEach(function(n){if(n.name){var t=new Set;Nn(n,t),mt[n.name.value]=t}})})();function Vi(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 mo(e,n){var t={kind:e.kind,definitions:[Vi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=mt[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=mt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=Vi(e,o);s&&t.definitions.push(s)}),t}mo(Ee,"UserBankAccounts");function po(e){throw new Error(e)}var ho=(e=>(e.CHECKBOOK="CHECKBOOK",e.METHOD_FI="METHOD_FI",e))(ho||{}),yo=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(yo||{}),qi=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(qi||{}),Tn=(e=>(e.CABankAccount="CABankAccount",e.USBankAccount="USBankAccount",e))(Tn||{}),Ci=(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))(Ci||{}),xi=(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))(xi||{}),ko=(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))(ko||{}),go=(e=>(e.Provider="Provider",e.User="User",e))(go||{}),$i=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.VirtualCard="VirtualCard",e))($i||{}),So=(e=>(e.INSTANT="INSTANT",e.STANDARD="STANDARD",e))(So||{}),Mi=(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))(Mi||{}),pt=(e=>(e.USVirtualDebitCard="USVirtualDebitCard",e))(pt||{});const bo=ve.z.object({transitNumber:ve.z.string().length(5,{message:"Transit number must be exactly 5 characters long"}).regex(/^[0-9]{5}$/,"Transit number should contain only digits."),institutionNumber:ve.z.string().length(3,{message:"Institution number must be exactly 3 characters long"}).regex(/^[0-9]{3}$/,"Institution number should contain only digits.")}),No=ve.z.object({routingNumber:ve.z.string().length(9,{message:"Routing number must be exactly 9 characters long"}).regex(/^[0-9]{9}$/,"Routing number should contain only digits.")}),To={[Tn.CABankAccount]:bo,[Tn.USBankAccount]:No};class Eo{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Ee}))?.bankAccounts??[]}async rename(n,t){return(await this.client.query({query:Te,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=To[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 ve.z.ZodError?new Error(a?.issues?.[0]?.message??"Input validation failure"):a}}}var He={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}};He.loc.source={body:`fragment BillFragment on Bill {
|
|
167
168
|
id
|
|
168
169
|
name
|
|
169
170
|
userId
|
|
@@ -195,49 +196,49 @@ query UserBankAccounts {
|
|
|
195
196
|
logo
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 ht={};(function(){He.definitions.forEach(function(n){if(n.name){var t=new Set;En(n,t),ht[n.name.value]=t}})})();function
|
|
199
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 ht={};(function(){He.definitions.forEach(function(n){if(n.name){var t=new Set;En(n,t),ht[n.name.value]=t}})})();function ji(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 wo(e,n){var t={kind:e.kind,definitions:[ji(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=ht[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=ht[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=ji(e,o);s&&t.definitions.push(s)}),t}wo(He,"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"
|
|
199
200
|
|
|
200
201
|
mutation CreateUSBill($institutionId: String!, $accountNumber: String!, $type: BillType) {
|
|
201
202
|
addUSBill(institutionId: $institutionId, accountNumber: $accountNumber, type: $type) {
|
|
202
203
|
...BillFragment
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
206
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Gi={};function Io(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Gi[t]?!1:(Gi[t]=!0,!0)})}we.definitions=we.definitions.concat(Io(He.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 yt={};(function(){we.definitions.forEach(function(n){if(n.name){var t=new Set;wn(n,t),yt[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 Do(e,n){var t={kind:e.kind,definitions:[Qi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=yt[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=yt[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}Do(we,"CreateUSBill");var Ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RenamePayableAccount"},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:"PayableAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:227}};Ie.loc.source={body:`#import "../queries/payableAccountFragment.graphql"
|
|
206
207
|
|
|
207
208
|
mutation RenamePayableAccount($accountId: String!, $name: String!) {
|
|
208
209
|
renamePayableAccount(accountId: $accountId, name: $name) {
|
|
209
210
|
...PayableAccountFragment
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
213
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var zi={};function Fo(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)})}Ie.definitions=Ie.definitions.concat(Fo(be.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 kt={};(function(){Ie.definitions.forEach(function(n){if(n.name){var t=new Set;In(n,t),kt[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 Ao(e,n){var t={kind:e.kind,definitions:[Hi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=kt[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=kt[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}Ao(Ie,"RenamePayableAccount");var De={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}};De.loc.source={body:`#import "./billFragment.graphql"
|
|
213
214
|
|
|
214
215
|
query UserBills {
|
|
215
216
|
bills {
|
|
216
217
|
...BillFragment
|
|
217
218
|
}
|
|
218
219
|
}
|
|
219
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
220
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ji={};function Oo(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(Oo(He.definitions));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 gt={};(function(){De.definitions.forEach(function(n){if(n.name){var t=new Set;Dn(n,t),gt[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 Ro(e,n){var t={kind:e.kind,definitions:[Yi(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=Yi(e,o);s&&t.definitions.push(s)}),t}Ro(De,"UserBills");class _o{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:De}))?.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 Je={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}};Je.loc.source={body:`fragment PayableAccountInstitutionFragment on PayableAccountInstitution {
|
|
220
221
|
id
|
|
221
222
|
country
|
|
222
223
|
currency
|
|
223
224
|
name
|
|
224
225
|
logo
|
|
225
226
|
}
|
|
226
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Fn(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){Fn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Fn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Fn(i,n)})}var St={};(function(){Je.definitions.forEach(function(n){if(n.name){var t=new Set;Fn(n,t),St[n.name.value]=t}})})();function
|
|
227
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Fn(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){Fn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Fn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Fn(i,n)})}var St={};(function(){Je.definitions.forEach(function(n){if(n.name){var t=new Set;Fn(n,t),St[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=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=Ki(e,o);s&&t.definitions.push(s)}),t}Lo(Je,"PayableAccountInstitutionFragment");var Fe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PopularBillInstitutions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"billType"}},type:{kind:"NamedType",name:{kind:"Name",value:"BillType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"popularUSBillInstitutions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"billType"},value:{kind:"Variable",name:{kind:"Name",value:"billType"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},directives:[]}]}}]}}],loc:{start:0,end:214}};Fe.loc.source={body:`#import "./payableAccountInstitutionFragment.graphql"
|
|
227
228
|
|
|
228
229
|
query PopularBillInstitutions($billType: BillType) {
|
|
229
230
|
popularUSBillInstitutions(billType: $billType) {
|
|
230
231
|
...PayableAccountInstitutionFragment
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
234
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Xi={};function Po(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Xi[t]?!1:(Xi[t]=!0,!0)})}Fe.definitions=Fe.definitions.concat(Po(Je.definitions));function An(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){An(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){An(i,n)}),e.definitions&&e.definitions.forEach(function(i){An(i,n)})}var bt={};(function(){Fe.definitions.forEach(function(n){if(n.name){var t=new Set;An(n,t),bt[n.name.value]=t}})})();function Wi(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 Bo(e,n){var t={kind:e.kind,definitions:[Wi(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=Wi(e,o);s&&t.definitions.push(s)}),t}Bo(Fe,"PopularBillInstitutions");var Ae={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchUSBillInstitutions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"billType"}},type:{kind:"NamedType",name:{kind:"Name",value:"BillType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchUSBillInstitutions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"searchTerm"},value:{kind:"Variable",name:{kind:"Name",value:"searchTerm"}}},{kind:"Argument",name:{kind:"Name",value:"billType"},value:{kind:"Variable",name:{kind:"Name",value:"billType"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountInstitutionFragment"},directives:[]}]}}]}}],loc:{start:0,end:261}};Ae.loc.source={body:`#import "./payableAccountInstitutionFragment.graphql"
|
|
234
235
|
|
|
235
236
|
query SearchUSBillInstitutions($searchTerm: String!, $billType: BillType) {
|
|
236
237
|
searchUSBillInstitutions(searchTerm: $searchTerm, billType: $billType) {
|
|
237
238
|
...PayableAccountInstitutionFragment
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
241
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Zi={};function Uo(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)})}Ae.definitions=Ae.definitions.concat(Uo(Je.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 Nt={};(function(){Ae.definitions.forEach(function(n){if(n.name){var t=new Set;On(n,t),Nt[n.name.value]=t}})})();function ea(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 Vo(e,n){var t={kind:e.kind,definitions:[ea(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=ea(e,o);s&&t.definitions.push(s)}),t}Vo(Ae,"SearchUSBillInstitutions");class qo{client;constructor(n){this.client=n}async popularUSBillInstitutions(n){return(await this.client.query({query:Fe,variables:{billType:n??null}}))?.popularUSBillInstitutions??[]}async searchUSBillInstitutions(n,t){return(await this.client.query({query:Ae,variables:{searchTerm:n,billType:t??null}}))?.searchUSBillInstitutions??[]}}var Ye={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]}]}}],loc:{start:0,end:162}};Ye.loc.source={body:`fragment PaymentFragment on Payment {
|
|
241
242
|
id
|
|
242
243
|
userId
|
|
243
244
|
status
|
|
@@ -245,22 +246,24 @@ query SearchUSBillInstitutions($searchTerm: String!, $billType: BillType) {
|
|
|
245
246
|
amount
|
|
246
247
|
feeAmount
|
|
247
248
|
createdAt
|
|
249
|
+
deliveryMethod
|
|
250
|
+
paymentRequestId
|
|
248
251
|
}
|
|
249
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
252
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 Tt={};(function(){Ye.definitions.forEach(function(n){if(n.name){var t=new Set;Rn(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 Co(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}Co(Ye,"PaymentFragment");var Oe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaymentRequestPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentForPaymentRequest"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentRequestId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};Oe.loc.source={body:`#import "./paymentFragment.graphql"
|
|
250
253
|
|
|
251
254
|
query PaymentRequestPayment($paymentRequestId: String!) {
|
|
252
255
|
paymentForPaymentRequest(paymentRequestId: $paymentRequestId) {
|
|
253
256
|
...PaymentFragment
|
|
254
257
|
}
|
|
255
258
|
}
|
|
256
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
259
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ta={};function xo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ta[t]?!1:(ta[t]=!0,!0)})}Oe.definitions=Oe.definitions.concat(xo(Ye.definitions));function _n(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){_n(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){_n(i,n)}),e.definitions&&e.definitions.forEach(function(i){_n(i,n)})}var Et={};(function(){Oe.definitions.forEach(function(n){if(n.name){var t=new Set;_n(n,t),Et[n.name.value]=t}})})();function ia(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 $o(e,n){var t={kind:e.kind,definitions:[ia(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Et[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=Et[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=ia(e,o);s&&t.definitions.push(s)}),t}$o(Oe,"PaymentRequestPayment");var Re={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AccountPayments"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentsForAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:165}};Re.loc.source={body:`#import "./paymentFragment.graphql"
|
|
257
260
|
|
|
258
261
|
query AccountPayments($accountId: String!) {
|
|
259
262
|
paymentsForAccount(accountId: $accountId) {
|
|
260
263
|
...PaymentFragment
|
|
261
264
|
}
|
|
262
265
|
}
|
|
263
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
266
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var aa={};function Mo(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)})}Re.definitions=Re.definitions.concat(Mo(Ye.definitions));function Ln(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){Ln(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Ln(i,n)}),e.definitions&&e.definitions.forEach(function(i){Ln(i,n)})}var wt={};(function(){Re.definitions.forEach(function(n){if(n.name){var t=new Set;Ln(n,t),wt[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 jo(e,n){var t={kind:e.kind,definitions:[ra(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=wt[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=wt[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}jo(Re,"AccountPayments");class Go{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:Re,variables:{accountId:n}}))?.paymentsForAccount??[]}async getForPaymentRequest(n){return(await this.client.query({query:Oe,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var Pn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]}]}}],loc:{start:0,end:180}};Pn.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
|
|
264
267
|
id
|
|
265
268
|
userId
|
|
266
269
|
accountId
|
|
@@ -270,15 +273,16 @@ query AccountPayments($accountId: String!) {
|
|
|
270
273
|
amountDue
|
|
271
274
|
network
|
|
272
275
|
createdAt
|
|
276
|
+
deliveryMethod
|
|
273
277
|
}
|
|
274
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Bn(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){Bn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Bn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Bn(i,n)})}var It={};(function(){Pn.definitions.forEach(function(n){if(n.name){var t=new Set;Bn(n,t),It[n.name.value]=t}})})();function
|
|
278
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Bn(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){Bn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Bn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Bn(i,n)})}var It={};(function(){Pn.definitions.forEach(function(n){if(n.name){var t=new Set;Bn(n,t),It[n.name.value]=t}})})();function oa(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:[oa(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=oa(e,o);s&&t.definitions.push(s)}),t}Qo(Pn,"PaymentRequestFragment");var fe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePaymentRequest"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateDirectPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDirectPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createDirectPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentRequestFragment"},directives:[]}]}}]}}],loc:{start:0,end:260}};fe.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
|
|
275
279
|
|
|
276
280
|
mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInput!) {
|
|
277
281
|
createDirectPayment(createDirectPaymentInput: $createDirectPaymentInput) {
|
|
278
282
|
...PaymentRequestFragment
|
|
279
283
|
}
|
|
280
284
|
}
|
|
281
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
285
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var sa={};function zo(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return sa[t]?!1:(sa[t]=!0,!0)})}fe.definitions=fe.definitions.concat(zo(Pn.definitions));function Un(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){Un(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Un(i,n)}),e.definitions&&e.definitions.forEach(function(i){Un(i,n)})}var Dt={};(function(){fe.definitions.forEach(function(n){if(n.name){var t=new Set;Un(n,t),Dt[n.name.value]=t}})})();function ua(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 Ho(e,n){var t={kind:e.kind,definitions:[ua(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Dt[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=Dt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=ua(e,o);s&&t.definitions.push(s)}),t}Ho(fe,"CreatePaymentRequest");var Vn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"suggestedGasLimit"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:399}};Vn.loc.source={body:`query GetSpritzPayParams(
|
|
282
286
|
$tokenAddress: String!
|
|
283
287
|
$amount: Float!
|
|
284
288
|
$reference: String!
|
|
@@ -298,11 +302,11 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
|
|
|
298
302
|
suggestedGasLimit
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function qn(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){qn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){qn(i,n)}),e.definitions&&e.definitions.forEach(function(i){qn(i,n)})}var Ft={};(function(){Vn.definitions.forEach(function(n){if(n.name){var t=new Set;qn(n,t),Ft[n.name.value]=t}})})();function
|
|
305
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function qn(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){qn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){qn(i,n)}),e.definitions&&e.definitions.forEach(function(i){qn(i,n)})}var Ft={};(function(){Vn.definitions.forEach(function(n){if(n.name){var t=new Set;qn(n,t),Ft[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 Jo(e,n){var t={kind:e.kind,definitions:[ca(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=ca(e,o);s&&t.definitions.push(s)}),t}Jo(Vn,"GetSpritzPayParams");var la=ee({"node_modules/@noble/hashes/_assert.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.output=e.exists=e.hash=e.bytes=e.bool=e.number=void 0;function n(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}e.number=n;function t(s){if(typeof s!="boolean")throw new Error(`Expected boolean, not ${s}`)}e.bool=t;function i(s,...c){if(!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(c.length>0&&!c.includes(s.length))throw new TypeError(`Expected Uint8Array of length ${c}, not of length=${s.length}`)}e.bytes=i;function a(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");n(s.outputLen),n(s.blockLen)}e.hash=a;function r(s,c=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(c&&s.finished)throw new Error("Hash#digest() has already been called")}e.exists=r;function u(s,c){i(s);const k=c.outputLen;if(s.length<k)throw new Error(`digestInto() expects output buffer of length at least ${k}`)}e.output=u;var o={number:n,bool:t,bytes:i,hash:a,exists:r,output:u};e.default=o}}),Yo=ee({"node_modules/@noble/hashes/crypto.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0}}),At=ee({"node_modules/@noble/hashes/utils.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;var n=Yo(),t=d=>new Uint8Array(d.buffer,d.byteOffset,d.byteLength);e.u8=t;var i=d=>new Uint32Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/4));e.u32=i;var a=d=>new DataView(d.buffer,d.byteOffset,d.byteLength);e.createView=a;var r=(d,l)=>d<<32-l|d>>>l;if(e.rotr=r,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");var u=Array.from({length:256},(d,l)=>l.toString(16).padStart(2,"0"));function o(d){if(!(d instanceof Uint8Array))throw new Error("Uint8Array expected");let l="";for(let S=0;S<d.length;S++)l+=u[d[S]];return l}e.bytesToHex=o;function s(d){if(typeof d!="string")throw new TypeError("hexToBytes: expected string, got "+typeof d);if(d.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const l=new Uint8Array(d.length/2);for(let S=0;S<l.length;S++){const v=S*2,T=d.slice(v,v+2),D=Number.parseInt(T,16);if(Number.isNaN(D)||D<0)throw new Error("Invalid byte sequence");l[S]=D}return l}e.hexToBytes=s;var c=async()=>{};e.nextTick=c;async function k(d,l,S){let v=Date.now();for(let T=0;T<d;T++){S(T);const D=Date.now()-v;D>=0&&D<l||(await(0,e.nextTick)(),v+=D)}}e.asyncLoop=k;function E(d){if(typeof d!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof d}`);return new TextEncoder().encode(d)}e.utf8ToBytes=E;function y(d){if(typeof d=="string"&&(d=E(d)),!(d instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof d})`);return d}e.toBytes=y;function f(...d){if(!d.every(v=>v instanceof Uint8Array))throw new Error("Uint8Array list expected");if(d.length===1)return d[0];const l=d.reduce((v,T)=>v+T.length,0),S=new Uint8Array(l);for(let v=0,T=0;v<d.length;v++){const D=d[v];S.set(D,T),T+=D.length}return S}e.concatBytes=f;var N=class{clone(){return this._cloneInto()}};e.Hash=N;var I=d=>Object.prototype.toString.call(d)==="[object Object]"&&d.constructor===Object;function A(d,l){if(l!==void 0&&(typeof l!="object"||!I(l)))throw new TypeError("Options should be object or undefined");return Object.assign(d,l)}e.checkOpts=A;function F(d){const l=v=>d().update(y(v)).digest(),S=d();return l.outputLen=S.outputLen,l.blockLen=S.blockLen,l.create=()=>d(),l}e.wrapConstructor=F;function P(d){const l=(v,T)=>d(T).update(y(v)).digest(),S=d({});return l.outputLen=S.outputLen,l.blockLen=S.blockLen,l.create=v=>d(v),l}e.wrapConstructorWithOpts=P;function _(d=32){if(n.crypto&&typeof n.crypto.getRandomValues=="function")return n.crypto.getRandomValues(new Uint8Array(d));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=_}}),da=ee({"node_modules/ethereum-cryptography/utils.js"(e,n){var t=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=e.wrapHash=e.equalsBytes=e.hexToBytes=e.bytesToUtf8=e.utf8ToBytes=e.createView=e.concatBytes=e.toHex=e.bytesToHex=e.assertBytes=e.assertBool=void 0;var i=t(la()),a=At(),r=i.default.bool;e.assertBool=r;var u=i.default.bytes;e.assertBytes=u;var o=At();Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(e,"createView",{enumerable:!0,get:function(){return o.createView}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});function s(y){if(!(y instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof y}`);return new TextDecoder().decode(y)}e.bytesToUtf8=s;function c(y){const f=y.startsWith("0x")?y.substring(2):y;return(0,a.hexToBytes)(f)}e.hexToBytes=c;function k(y,f){if(y.length!==f.length)return!1;for(let N=0;N<y.length;N++)if(y[N]!==f[N])return!1;return!0}e.equalsBytes=k;function E(y){return f=>(i.default.bytes(f),y(f))}e.wrapHash=E,e.crypto=(()=>{const y=typeof self=="object"&&"crypto"in self?self.crypto:void 0,f=typeof n<"u"&&typeof n.require=="function"&&n.require.bind(n);return{node:f&&!y?f("crypto"):void 0,web:y}})()}});/*! Bundled license information:
|
|
302
306
|
|
|
303
307
|
@noble/hashes/utils.js:
|
|
304
308
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
305
|
-
*/var
|
|
309
|
+
*/var Ko=ee({"node_modules/@noble/hashes/_u64.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;var n=BigInt(2**32-1),t=BigInt(32);function i(p,m=!1){return m?{h:Number(p&n),l:Number(p>>t&n)}:{h:Number(p>>t&n)|0,l:Number(p&n)|0}}e.fromBig=i;function a(p,m=!1){let b=new Uint32Array(p.length),q=new Uint32Array(p.length);for(let C=0;C<p.length;C++){const{h:H,l:Hn}=i(p[C],m);[b[C],q[C]]=[H,Hn]}return[b,q]}e.split=a;var r=(p,m)=>BigInt(p>>>0)<<t|BigInt(m>>>0);e.toBig=r;var u=(p,m,b)=>p>>>b,o=(p,m,b)=>p<<32-b|m>>>b,s=(p,m,b)=>p>>>b|m<<32-b,c=(p,m,b)=>p<<32-b|m>>>b,k=(p,m,b)=>p<<64-b|m>>>b-32,E=(p,m,b)=>p>>>b-32|m<<64-b,y=(p,m)=>m,f=(p,m)=>p,N=(p,m,b)=>p<<b|m>>>32-b,I=(p,m,b)=>m<<b|p>>>32-b,A=(p,m,b)=>m<<b-32|p>>>64-b,F=(p,m,b)=>p<<b-32|m>>>64-b;function P(p,m,b,q){const C=(m>>>0)+(q>>>0);return{h:p+b+(C/2**32|0)|0,l:C|0}}e.add=P;var _=(p,m,b)=>(p>>>0)+(m>>>0)+(b>>>0),d=(p,m,b,q)=>m+b+q+(p/2**32|0)|0,l=(p,m,b,q)=>(p>>>0)+(m>>>0)+(b>>>0)+(q>>>0),S=(p,m,b,q,C)=>m+b+q+C+(p/2**32|0)|0,v=(p,m,b,q,C)=>(p>>>0)+(m>>>0)+(b>>>0)+(q>>>0)+(C>>>0),T=(p,m,b,q,C,H)=>m+b+q+C+H+(p/2**32|0)|0,D={fromBig:i,split:a,toBig:e.toBig,shrSH:u,shrSL:o,rotrSH:s,rotrSL:c,rotrBH:k,rotrBL:E,rotr32H:y,rotr32L:f,rotlSH:N,rotlSL:I,rotlBH:A,rotlBL:F,add:P,add3L:_,add3H:d,add4L:l,add4H:S,add5H:T,add5L:v};e.default=D}}),Xo=ee({"node_modules/@noble/hashes/sha3.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=e.keccakP=void 0;var n=la(),t=Ko(),i=At(),[a,r,u]=[[],[],[]],o=BigInt(0),s=BigInt(1),c=BigInt(2),k=BigInt(7),E=BigInt(256),y=BigInt(113);for(let l=0,S=s,v=1,T=0;l<24;l++){[v,T]=[T,(2*v+3*T)%5],a.push(2*(5*T+v)),r.push((l+1)*(l+2)/2%64);let D=o;for(let p=0;p<7;p++)S=(S<<s^(S>>k)*y)%E,S&c&&(D^=s<<(s<<BigInt(p))-s);u.push(D)}var[f,N]=t.default.split(u,!0),I=(l,S,v)=>v>32?t.default.rotlBH(l,S,v):t.default.rotlSH(l,S,v),A=(l,S,v)=>v>32?t.default.rotlBL(l,S,v):t.default.rotlSL(l,S,v);function F(l,S=24){const v=new Uint32Array(10);for(let T=24-S;T<24;T++){for(let m=0;m<10;m++)v[m]=l[m]^l[m+10]^l[m+20]^l[m+30]^l[m+40];for(let m=0;m<10;m+=2){const b=(m+8)%10,q=(m+2)%10,C=v[q],H=v[q+1],Hn=I(C,H,1)^v[b],Na=A(C,H,1)^v[b+1];for(let Xe=0;Xe<50;Xe+=10)l[m+Xe]^=Hn,l[m+Xe+1]^=Na}let D=l[2],p=l[3];for(let m=0;m<24;m++){const b=r[m],q=I(D,p,b),C=A(D,p,b),H=a[m];D=l[H],p=l[H+1],l[H]=q,l[H+1]=C}for(let m=0;m<50;m+=10){for(let b=0;b<10;b++)v[b]=l[m+b];for(let b=0;b<10;b++)l[m+b]^=~v[(b+2)%10]&v[(b+4)%10]}l[0]^=f[T],l[1]^=N[T]}v.fill(0)}e.keccakP=F;var P=class extends i.Hash{constructor(l,S,v,T=!1,D=24){if(super(),this.blockLen=l,this.suffix=S,this.outputLen=v,this.enableXOF=T,this.rounds=D,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(v),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){F(this.state32,this.rounds),this.posOut=0,this.pos=0}update(l){n.default.exists(this);const{blockLen:S,state:v}=this;l=(0,i.toBytes)(l);const T=l.length;for(let D=0;D<T;){const p=Math.min(S-this.pos,T-D);for(let m=0;m<p;m++)v[this.pos++]^=l[D++];this.pos===S&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:l,suffix:S,pos:v,blockLen:T}=this;l[v]^=S,S&128&&v===T-1&&this.keccak(),l[T-1]^=128,this.keccak()}writeInto(l){n.default.exists(this,!1),n.default.bytes(l),this.finish();const S=this.state,{blockLen:v}=this;for(let T=0,D=l.length;T<D;){this.posOut>=v&&this.keccak();const p=Math.min(v-this.posOut,D-T);l.set(S.subarray(this.posOut,this.posOut+p),T),this.posOut+=p,T+=p}return l}xofInto(l){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(l)}xof(l){return n.default.number(l),this.xofInto(new Uint8Array(l))}digestInto(l){if(n.default.output(l,this),this.finished)throw new Error("digest() was already called");return this.writeInto(l),this.destroy(),l}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(l){const{blockLen:S,suffix:v,outputLen:T,rounds:D,enableXOF:p}=this;return l||(l=new P(S,v,T,p,D)),l.state32.set(this.state32),l.pos=this.pos,l.posOut=this.posOut,l.finished=this.finished,l.rounds=D,l.suffix=v,l.outputLen=T,l.enableXOF=p,l.destroyed=this.destroyed,l}};e.Keccak=P;var _=(l,S,v)=>(0,i.wrapConstructor)(()=>new P(S,l,v));e.sha3_224=_(6,144,224/8),e.sha3_256=_(6,136,256/8),e.sha3_384=_(6,104,384/8),e.sha3_512=_(6,72,512/8),e.keccak_224=_(1,144,224/8),e.keccak_256=_(1,136,256/8),e.keccak_384=_(1,104,384/8),e.keccak_512=_(1,72,512/8);var d=(l,S,v)=>(0,i.wrapConstructorWithOpts)((T={})=>new P(S,l,T.dkLen===void 0?v:T.dkLen,!0));e.shake128=d(31,168,128/8),e.shake256=d(31,136,256/8)}}),Wo=ee({"node_modules/ethereum-cryptography/keccak.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keccak512=e.keccak384=e.keccak256=e.keccak224=void 0;var n=Xo(),t=da();e.keccak224=(0,t.wrapHash)(n.keccak_224),e.keccak256=(()=>{const i=(0,t.wrapHash)(n.keccak_256);return i.create=n.keccak_256.create,i})(),e.keccak384=(0,t.wrapHash)(n.keccak_384),e.keccak512=(0,t.wrapHash)(n.keccak_512)}}),Zo=ee({"optimize-deps:ethereum-cryptography/keccak"(e,n){n.exports=Wo()}}),es=Zo(),ns=ee({"optimize-deps:ethereum-cryptography/utils"(e,n){n.exports=da()}}),ts=ns();function is(e){let n="0x";for(const t of e){const i=t.toString(16);n+=i.length===1?`0${i}`:i}return n}const as=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const n=e.slice(2),t=ts.utf8ToBytes(n.toLowerCase()),i=is(es.keccak256(t)).slice(2);for(let a=0;a<40;a+=1)if(parseInt(i[a],16)>7&&n[a].toUpperCase()!==n[a]||parseInt(i[a],16)<=7&&n[a].toLowerCase()!==n[a])return!1;return!0};function rs(e){return/^0x[0-9a-f]{40}$/i.test(e)?/^0x[0-9a-f]{40}$/.test(e)||/^(0x|0X)[0-9A-F]{40}$/.test(e)?!0:as(e):!1}const Ot=e=>Math.round((e+Number.EPSILON)*100)/100;class os{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:fe,variables:{createDirectPaymentInput:{...n,amount:Ot(n.amount)}}}))?.createDirectPayment}async transactionPrice(n){return(await this.client.query({query:fe,variables:{amount:Ot(n)}}))?.transactionPrice??0}async getWeb3PaymentParams(n){if(!rs(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Vn,variables:{amount:Ot(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}}var Cn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"picture"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:135}};Cn.loc.source={body:`fragment UserFragment on User {
|
|
306
310
|
id
|
|
307
311
|
sub
|
|
308
312
|
email
|
|
@@ -313,14 +317,14 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
|
|
|
313
317
|
createdAt
|
|
314
318
|
timezone
|
|
315
319
|
}
|
|
316
|
-
`,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
|
|
320
|
+
`,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 Rt={};(function(){Cn.definitions.forEach(function(n){if(n.name){var t=new Set;xn(n,t),Rt[n.name.value]=t}})})();function fa(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 ss(e,n){var t={kind:e.kind,definitions:[fa(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Rt[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=Rt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=fa(e,o);s&&t.definitions.push(s)}),t}ss(Cn,"UserFragment");var _e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUser"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"UserFragment"},directives:[]}]}}]}}],loc:{start:0,end:95}};_e.loc.source={body:`#import "./userFragment.graphql"
|
|
317
321
|
|
|
318
322
|
query CurrentUser {
|
|
319
323
|
me {
|
|
320
324
|
...UserFragment
|
|
321
325
|
}
|
|
322
326
|
}
|
|
323
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
327
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var va={};function us(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return va[t]?!1:(va[t]=!0,!0)})}_e.definitions=_e.definitions.concat(us(Cn.definitions));function $n(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){$n(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){$n(i,n)}),e.definitions&&e.definitions.forEach(function(i){$n(i,n)})}var _t={};(function(){_e.definitions.forEach(function(n){if(n.name){var t=new Set;$n(n,t),_t[n.name.value]=t}})})();function ma(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 cs(e,n){var t={kind:e.kind,definitions:[ma(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=_t[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=_t[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=ma(e,o);s&&t.definitions.push(s)}),t}cs(_e,"CurrentUser");var Mn={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}};Mn.loc.source={body:`query UserVerification {
|
|
324
328
|
verification {
|
|
325
329
|
userId
|
|
326
330
|
identity {
|
|
@@ -336,7 +340,7 @@ query CurrentUser {
|
|
|
336
340
|
}
|
|
337
341
|
}
|
|
338
342
|
}
|
|
339
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function jn(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){jn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){jn(i,n)}),e.definitions&&e.definitions.forEach(function(i){jn(i,n)})}var Lt={};(function(){Mn.definitions.forEach(function(n){if(n.name){var t=new Set;jn(n,t),Lt[n.name.value]=t}})})();function
|
|
343
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function jn(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){jn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){jn(i,n)}),e.definitions&&e.definitions.forEach(function(i){jn(i,n)})}var Lt={};(function(){Mn.definitions.forEach(function(n){if(n.name){var t=new Set;jn(n,t),Lt[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 ls(e,n){var t={kind:e.kind,definitions:[pa(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Lt[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=Lt[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}ls(Mn,"UserVerification");class ds{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/integration/user/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/integration/user/validate-otp",body:n})}async getCurrentUser(){return(await this.client.query({query:_e}))?.me??null}async getUserVerification(){return(await this.client.query({query:Mn}))?.verification??null}}var Ke={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}};Ke.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
|
|
340
344
|
id
|
|
341
345
|
name
|
|
342
346
|
userId
|
|
@@ -362,24 +366,24 @@ query CurrentUser {
|
|
|
362
366
|
}
|
|
363
367
|
}
|
|
364
368
|
}
|
|
365
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Gn(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){Gn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Gn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Gn(i,n)})}var Pt={};(function(){Ke.definitions.forEach(function(n){if(n.name){var t=new Set;Gn(n,t),Pt[n.name.value]=t}})})();function
|
|
369
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Gn(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){Gn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Gn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Gn(i,n)})}var Pt={};(function(){Ke.definitions.forEach(function(n){if(n.name){var t=new Set;Gn(n,t),Pt[n.name.value]=t}})})();function ha(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 fs(e,n){var t={kind:e.kind,definitions:[ha(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Pt[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=Pt[o]||new Set;s.forEach(function(c){r.add(c)})}})}return a.forEach(function(o){var s=ha(e,o);s&&t.definitions.push(s)}),t}fs(Ke,"VirtualDebitCardFragment");var Le={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}};Le.loc.source={body:`#import "../queries/virtualDebitCardFragment.graphql"
|
|
366
370
|
|
|
367
371
|
mutation CreateUSVirtualDebitCard {
|
|
368
372
|
createUSVirtualDebitCard {
|
|
369
373
|
...VirtualDebitCardFragment
|
|
370
374
|
}
|
|
371
375
|
}
|
|
372
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
376
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ya={};function vs(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ya[t]?!1:(ya[t]=!0,!0)})}Le.definitions=Le.definitions.concat(vs(Ke.definitions));function Qn(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){Qn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Qn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Qn(i,n)})}var Bt={};(function(){Le.definitions.forEach(function(n){if(n.name){var t=new Set;Qn(n,t),Bt[n.name.value]=t}})})();function ka(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 ms(e,n){var t={kind:e.kind,definitions:[ka(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=ka(e,o);s&&t.definitions.push(s)}),t}ms(Le,"CreateUSVirtualDebitCard");var Pe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:142}};Pe.loc.source={body:`#import "./virtualDebitCardFragment.graphql"
|
|
373
377
|
|
|
374
378
|
query UserVirtualDebitCard {
|
|
375
379
|
virtualDebitCard {
|
|
376
380
|
...VirtualDebitCardFragment
|
|
377
381
|
}
|
|
378
382
|
}
|
|
379
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
383
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ga={};function ps(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ga[t]?!1:(ga[t]=!0,!0)})}Pe.definitions=Pe.definitions.concat(ps(Ke.definitions));function zn(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){zn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){zn(i,n)}),e.definitions&&e.definitions.forEach(function(i){zn(i,n)})}var Ut={};(function(){Pe.definitions.forEach(function(n){if(n.name){var t=new Set;zn(n,t),Ut[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 hs(e,n){var t={kind:e.kind,definitions:[Sa(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Ut[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=Ut[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}hs(Pe,"UserVirtualDebitCard");const ys={[pt.USVirtualDebitCard]:e=>({query:Le,variables:void 0,response:"createUSVirtualDebitCard"})},ks=(e,n)=>ys[e]?.(n)??null;class gs{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:Pe}))?.virtualDebitCard??null}async create(n,t){const i=ks(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 Ss{client;constructor(n){this.client=n}async create(n){return this.client.request({method:"post",path:"/users/integrators/webhooks",body:n})}}class Vt{environment;apiKey;integrationKey;client;user;bankAccount;paymentRequest;payment;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&&Gr())throw new Error(`It seems you're operating within a browser environment.
|
|
380
384
|
|
|
381
385
|
By default, this is deactivated due to the potential risk of exposing your confidential integrator credentials.
|
|
382
386
|
If you're aware of these risks and have taken necessary security measures, you can enable the \`dangerouslyAllowBrowser\` option, e.g.,
|
|
383
387
|
|
|
384
388
|
SpritzApiClient.initialize({ apiKey, dangerouslyAllowBrowser: true });
|
|
385
|
-
`)}static initialize({environment:n=Jn.Staging,apiKey:t=void 0,integrationKey:i=void 0,dangerouslyAllowBrowser:a=!1}){const r=new Vt(n,t,i,a);return r.init(),r}init(){this.client=new
|
|
389
|
+
`)}static initialize({environment:n=Jn.Staging,apiKey:t=void 0,integrationKey:i=void 0,dangerouslyAllowBrowser:a=!1}){const r=new Vt(n,t,i,a);return r.init(),r}init(){this.client=new io({environment:this.environment,apiKey:this.apiKey,integrationKey:this.integrationKey}),this.user=new ds(this.client),this.bankAccount=new Eo(this.client),this.paymentRequest=new os(this.client),this.payment=new Go(this.client),this.virtualCard=new gs(this.client),this.bill=new _o(this.client),this.institution=new qo(this.client),this.webhook=new Ss(this.client)}setApiKey(n){return this.apiKey=n,this.init(),this}}var ba=(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))(ba||{});exports.BankAccountSubType=qi,exports.BankAccountType=Tn,exports.BillType=Ci,exports.Environment=Jn,exports.PayableAccountType=$i,exports.PaymentNetwork=ba,exports.PaymentRequestStatus=xi,exports.PaymentStatus=Mi,exports.SpritzApiClient=Vt,exports.VirtualCardType=pt;
|