text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.vuexOrmGraphql={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u(e,t){return e(t={exports:{}},t.exports),t.exports}var c=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e)throw new Error(t)}});s(c);var l=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0;var n,r=(n=c)&&n.__esModule?n:{default:n};t.Source=function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.body=t,this.name=n||"GraphQL request",this.locationOffset=o||{line:1,column:1},this.locationOffset.line>0||(0,r.default)(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||(0,r.default)(0,"column in locationOffset is 1-indexed and must be positive")}});s(l);l.Source;var f=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){var n=/\r\n|[\n\r]/g,r=1,o=t+1,i=void 0;for(;(i=n.exec(e.body))&&i.index<t;)r+=1,o=t+1-(i.index+i[0].length);return{line:r,column:o}}});s(f);f.getLocation;var d=u(function(e,t){function n(e,t){var n=t.line,i=e.locationOffset.line-1,a=function(e,t){return 1===t.line?e.locationOffset.column-1:0}(e,t),s=n+i,u=t.column+a,c=(s-1).toString(),l=s.toString(),f=(s+1).toString(),d=f.length,p=e.body.split(/\r\n|[\n\r]/g);return p[0]=r(e.locationOffset.column-1)+p[0],[e.name+" ("+s+":"+u+")",n>=2&&o(d,c)+": "+p[n-2],o(d,l)+": "+p[n-1],r(2+d+u-1)+"^",n<p.length&&o(d,f)+": "+p[n]].filter(Boolean).join("\n")}function r(e){return Array(e+1).join(" ")}function o(e,t){return r(e-t.length)+t}Object.defineProperty(t,"__esModule",{value:!0}),t.printError=function(e){var t=[];if(e.nodes)e.nodes.forEach(function(e){e.loc&&t.push(n(e.loc.source,(0,f.getLocation)(e.loc.source,e.loc.start)))});else if(e.source&&e.locations){var r=e.source;e.locations.forEach(function(e){t.push(n(r,e))})}return 0===t.length?e.message:[e.message].concat(t).join("\n\n")+"\n"}});s(d);d.printError;var p=u(function(e,t){function n(e,t,r,o,i,a,s){var u=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,c=r;if(!c&&u){var l=u[0];c=l&&l.loc&&l.loc.source}var d=o;!d&&u&&(d=u.reduce(function(e,t){return t.loc&&e.push(t.loc.start),e},[])),d&&0===d.length&&(d=void 0);var p=void 0;if(o&&r){var h=r;p=o.map(function(e){return(0,f.getLocation)(h,e)})}else u&&(p=u.reduce(function(e,t){return t.loc&&e.push((0,f.getLocation)(t.loc.source,t.loc.start)),e},[]));Object.defineProperties(this,{message:{value:e,enumerable:!0,writable:!0},locations:{value:p||void 0,enumerable:!0},path:{value:i||void 0,enumerable:!0},nodes:{value:u||void 0},source:{value:c||void 0},positions:{value:d||void 0},originalError:{value:a},extensions:{value:s||a&&a.extensions}}),a&&a.stack?Object.defineProperty(this,"stack",{value:a.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=n,n.prototype=Object.create(Error.prototype,{constructor:{value:n},name:{value:"GraphQLError"},toString:{value:function(){return(0,d.printError)(this)}}})});s(p);p.GraphQLError;var h=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new p.GraphQLError("Syntax Error: "+n,void 0,e,[t])}});s(h);h.syntaxError;var y=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.locatedError=function(e,t,n){if(e&&Array.isArray(e.path))return e;return new p.GraphQLError(e&&e.message,e&&e.nodes||t,e&&e.source,e&&e.positions,n,e)}});s(y);y.locatedError;var v=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.formatError=function(e){return e||(0,o.default)(0,"Received null or undefined error."),n({},e.extensions,{message:e.message||"An unknown error occurred.",locations:e.locations,path:e.path})};var r,o=(r=c)&&r.__esModule?r:{default:r}});s(v);v.formatError;var m=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"GraphQLError",{enumerable:!0,get:function(){return p.GraphQLError}}),Object.defineProperty(t,"syntaxError",{enumerable:!0,get:function(){return h.syntaxError}}),Object.defineProperty(t,"locatedError",{enumerable:!0,get:function(){return y.locatedError}}),Object.defineProperty(t,"printError",{enumerable:!0,get:function(){return d.printError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return v.formatError}})});s(m);var g=u(function(e,t){function n(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function r(e){return n(e)===e.length}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=e.split(/\r\n|[\n\r]/g),o=null,i=1;i<t.length;i++){var a=t[i],s=n(a);if(s<a.length&&(null===o||s<o)&&0===(o=s))break}if(o)for(var u=1;u<t.length;u++)t[u]=t[u].slice(o);for(;t.length>0&&r(t[0]);)t.shift();for(;t.length>0&&r(t[t.length-1]);)t.pop();return t.join("\n")}});s(g);var b=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.createLexer=function(e,t){var n=new A(a,0,0,0,0,null);return{source:e,options:t,lastToken:n,token:n,line:1,lineStart:0,advance:o,lookahead:i}},t.getTokenDesc=function(e){var t=e.value;return t?e.kind+' "'+t+'"':e.kind};var n,r=(n=g)&&n.__esModule?n:{default:n};function o(){return this.lastToken=this.token,this.token=this.lookahead()}function i(){var e=this.token;if(e.kind!==s)do{e=e.next||(e.next=D(this,e))}while(e.kind===S);return e}var a="<SOF>",s="<EOF>",u="!",c="$",l="(",f=")",d="...",p=":",h="=",y="@",v="[",b="]",E="{",w="|",O="}",_="Name",k="Int",T="Float",I="String",N="BlockString",S="Comment";t.TokenKind={SOF:a,EOF:s,BANG:u,DOLLAR:c,PAREN_L:l,PAREN_R:f,SPREAD:d,COLON:p,EQUALS:h,AT:y,BRACKET_L:v,BRACKET_R:b,BRACE_L:E,PIPE:w,BRACE_R:O,NAME:_,INT:k,FLOAT:T,STRING:I,BLOCK_STRING:N,COMMENT:S};var M=String.prototype.charCodeAt,P=String.prototype.slice;function A(e,t,n,r,o,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=o,this.value=a,this.prev=i,this.next=null}function R(e){return isNaN(e)?s:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function D(e,t){var n=e.source,o=n.body,i=o.length,a=function(e,t,n){var r=e.length,o=t;for(;o<r;){var i=M.call(e,o);if(9===i||32===i||44===i||65279===i)++o;else if(10===i)++o,++n.line,n.lineStart=o;else{if(13!==i)break;10===M.call(e,o+1)?o+=2:++o,++n.line,n.lineStart=o}}return o}(o,t.end,e),g=e.line,D=1+a-e.lineStart;if(a>=i)return new A(s,i,i,g,D,t);var Q=M.call(o,a);if(Q<32&&9!==Q&&10!==Q&&13!==Q)throw(0,m.syntaxError)(n,a,"Cannot contain the invalid character "+R(Q)+".");switch(Q){case 33:return new A(u,a,a+1,g,D,t);case 35:return function(e,t,n,r,o){var i=e.body,a=void 0,s=t;do{a=M.call(i,++s)}while(null!==a&&(a>31||9===a));return new A(S,t,s,n,r,o,P.call(i,t+1,s))}(n,a,g,D,t);case 36:return new A(c,a,a+1,g,D,t);case 40:return new A(l,a,a+1,g,D,t);case 41:return new A(f,a,a+1,g,D,t);case 46:if(46===M.call(o,a+1)&&46===M.call(o,a+2))return new A(d,a,a+3,g,D,t);break;case 58:return new A(p,a,a+1,g,D,t);case 61:return new A(h,a,a+1,g,D,t);case 64:return new A(y,a,a+1,g,D,t);case 91:return new A(v,a,a+1,g,D,t);case 93:return new A(b,a,a+1,g,D,t);case 123:return new A(E,a,a+1,g,D,t);case 124:return new A(w,a,a+1,g,D,t);case 125:return new A(O,a,a+1,g,D,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,t,n,r,o){var i=e.body,a=i.length,s=t+1,u=0;for(;s!==a&&null!==(u=M.call(i,s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new A(_,t,s,n,r,o,P.call(i,t,s))}(n,a,g,D,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,o,i){var a=e.body,s=n,u=t,c=!1;45===s&&(s=M.call(a,++u));if(48===s){if((s=M.call(a,++u))>=48&&s<=57)throw(0,m.syntaxError)(e,u,"Invalid number, unexpected digit after 0: "+R(s)+".")}else u=F(e,u,s),s=M.call(a,u);46===s&&(c=!0,s=M.call(a,++u),u=F(e,u,s),s=M.call(a,u));69!==s&&101!==s||(c=!0,43!==(s=M.call(a,++u))&&45!==s||(s=M.call(a,++u)),u=F(e,u,s));return new A(c?T:k,t,u,r,o,i,P.call(a,t,u))}(n,a,Q,g,D,t);case 34:return 34===M.call(o,a+1)&&34===M.call(o,a+2)?function(e,t,n,o,i){var a=e.body,s=t+3,u=s,c=0,l="";for(;s<a.length&&null!==(c=M.call(a,s));){if(34===c&&34===M.call(a,s+1)&&34===M.call(a,s+2))return l+=P.call(a,u,s),new A(N,t,s+3,n,o,i,(0,r.default)(l));if(c<32&&9!==c&&10!==c&&13!==c)throw(0,m.syntaxError)(e,s,"Invalid character within String: "+R(c)+".");92===c&&34===M.call(a,s+1)&&34===M.call(a,s+2)&&34===M.call(a,s+3)?(l+=P.call(a,u,s)+'"""',u=s+=4):++s}throw(0,m.syntaxError)(e,s,"Unterminated string.")}(n,a,g,D,t):function(e,t,n,r,o){var i=e.body,a=t+1,s=a,u=0,c="";for(;a<i.length&&null!==(u=M.call(i,a))&&10!==u&&13!==u;){if(34===u)return c+=P.call(i,s,a),new A(I,t,a+1,n,r,o,c);if(u<32&&9!==u)throw(0,m.syntaxError)(e,a,"Invalid character within String: "+R(u)+".");if(++a,92===u){switch(c+=P.call(i,s,a-1),u=M.call(i,a)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=(f=M.call(i,a+1),d=M.call(i,a+2),p=M.call(i,a+3),h=M.call(i,a+4),j(f)<<12|j(d)<<8|j(p)<<4|j(h));if(l<0)throw(0,m.syntaxError)(e,a,"Invalid character escape sequence: \\u"+i.slice(a+1,a+5)+".");c+=String.fromCharCode(l),a+=4;break;default:throw(0,m.syntaxError)(e,a,"Invalid character escape sequence: \\"+String.fromCharCode(u)+".")}s=++a}}var f,d,p,h;throw(0,m.syntaxError)(e,a,"Unterminated string.")}(n,a,g,D,t)}throw(0,m.syntaxError)(n,a,function(e){if(39===e)return"Unexpected single quote character ('), did you mean to use a double quote (\")?";return"Cannot parse the unexpected character "+R(e)+"."}(Q))}function F(e,t,n){var r=e.body,o=t,i=n;if(i>=48&&i<=57){do{i=M.call(r,++o)}while(i>=48&&i<=57);return o}throw(0,m.syntaxError)(e,o,"Invalid number, expected digit but got: "+R(i)+".")}function j(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}A.prototype.toJSON=A.prototype.inspect=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}});s(b);b.TokenKind,b.createLexer,b.getTokenDesc;var E=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.VARIABLE="Variable",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",t.DIRECTIVE_DEFINITION="DirectiveDefinition"});s(E);E.NAME,E.DOCUMENT,E.OPERATION_DEFINITION,E.VARIABLE_DEFINITION,E.VARIABLE,E.SELECTION_SET,E.FIELD,E.ARGUMENT,E.FRAGMENT_SPREAD,E.INLINE_FRAGMENT,E.FRAGMENT_DEFINITION,E.INT,E.FLOAT,E.STRING,E.BOOLEAN,E.NULL,E.ENUM,E.LIST,E.OBJECT,E.OBJECT_FIELD,E.DIRECTIVE,E.NAMED_TYPE,E.LIST_TYPE,E.NON_NULL_TYPE,E.SCHEMA_DEFINITION,E.OPERATION_TYPE_DEFINITION,E.SCALAR_TYPE_DEFINITION,E.OBJECT_TYPE_DEFINITION,E.FIELD_DEFINITION,E.INPUT_VALUE_DEFINITION,E.INTERFACE_TYPE_DEFINITION,E.UNION_TYPE_DEFINITION,E.ENUM_TYPE_DEFINITION,E.ENUM_VALUE_DEFINITION,E.INPUT_OBJECT_TYPE_DEFINITION,E.SCALAR_TYPE_EXTENSION,E.OBJECT_TYPE_EXTENSION,E.INTERFACE_TYPE_EXTENSION,E.UNION_TYPE_EXTENSION,E.ENUM_TYPE_EXTENSION,E.INPUT_OBJECT_TYPE_EXTENSION,E.DIRECTIVE_DEFINITION;var w=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.DirectiveLocation={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",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"}});s(w);w.DirectiveLocation;var O=u(function(e,t){function n(e){var t=z(e,b.TokenKind.NAME);return{kind:E.NAME,value:t.value,loc:U(e,t)}}function r(e){if(G(e,b.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":case"fragment":return o(e);case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"extend":case"directive":return P(e)}else{if(G(e,b.TokenKind.BRACE_L))return o(e);if(A(e))return P(e)}throw W(e)}function o(e){if(G(e,b.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return i(e);case"fragment":return function(e){var t=e.token;if(J(e,"fragment"),e.options.experimentalFragmentVariables)return{kind:E.FRAGMENT_DEFINITION,name:v(e),variableDefinitions:s(e),typeCondition:(J(e,"on"),M(e)),directives:I(e,!1),selectionSet:f(e),loc:U(e,t)};return{kind:E.FRAGMENT_DEFINITION,name:v(e),typeCondition:(J(e,"on"),M(e)),directives:I(e,!1),selectionSet:f(e),loc:U(e,t)}}(e)}else if(G(e,b.TokenKind.BRACE_L))return i(e);throw W(e)}function i(e){var t=e.token;if(G(e,b.TokenKind.BRACE_L))return{kind:E.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:f(e),loc:U(e,t)};var r=a(e),o=void 0;return G(e,b.TokenKind.NAME)&&(o=n(e)),{kind:E.OPERATION_DEFINITION,operation:r,name:o,variableDefinitions:s(e),directives:I(e,!1),selectionSet:f(e),loc:U(e,t)}}function a(e){var t=z(e,b.TokenKind.NAME);switch(t.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw W(e,t)}function s(e){return G(e,b.TokenKind.PAREN_L)?H(e,b.TokenKind.PAREN_L,u,b.TokenKind.PAREN_R):[]}function u(e){var t=e.token;return{kind:E.VARIABLE_DEFINITION,variable:c(e),type:(z(e,b.TokenKind.COLON),S(e)),defaultValue:Y(e,b.TokenKind.EQUALS)?g(e,!0):void 0,loc:U(e,t)}}function c(e){var t=e.token;return z(e,b.TokenKind.DOLLAR),{kind:E.VARIABLE,name:n(e),loc:U(e,t)}}function f(e){var t=e.token;return{kind:E.SELECTION_SET,selections:H(e,b.TokenKind.BRACE_L,d,b.TokenKind.BRACE_R),loc:U(e,t)}}function d(e){return G(e,b.TokenKind.SPREAD)?function(e){var t=e.token;if(z(e,b.TokenKind.SPREAD),G(e,b.TokenKind.NAME)&&"on"!==e.token.value)return{kind:E.FRAGMENT_SPREAD,name:v(e),directives:I(e,!1),loc:U(e,t)};var n=void 0;"on"===e.token.value&&(e.advance(),n=M(e));return{kind:E.INLINE_FRAGMENT,typeCondition:n,directives:I(e,!1),selectionSet:f(e),loc:U(e,t)}}(e):function(e){var t=e.token,r=n(e),o=void 0,i=void 0;Y(e,b.TokenKind.COLON)?(o=r,i=n(e)):i=r;return{kind:E.FIELD,alias:o,name:i,arguments:p(e,!1),directives:I(e,!1),selectionSet:G(e,b.TokenKind.BRACE_L)?f(e):void 0,loc:U(e,t)}}(e)}function p(e,t){var n=t?y:h;return G(e,b.TokenKind.PAREN_L)?H(e,b.TokenKind.PAREN_L,n,b.TokenKind.PAREN_R):[]}function h(e){var t=e.token;return{kind:E.ARGUMENT,name:n(e),value:(z(e,b.TokenKind.COLON),g(e,!1)),loc:U(e,t)}}function y(e){var t=e.token;return{kind:E.ARGUMENT,name:n(e),value:(z(e,b.TokenKind.COLON),_(e)),loc:U(e,t)}}function v(e){if("on"===e.token.value)throw W(e);return n(e)}function g(e,t){var n=e.token;switch(n.kind){case b.TokenKind.BRACKET_L:return function(e,t){var n=e.token,r=t?_:k;return{kind:E.LIST,values:function(e,t,n,r){z(e,t);var o=[];for(;!Y(e,r);)o.push(n(e));return o}(e,b.TokenKind.BRACKET_L,r,b.TokenKind.BRACKET_R),loc:U(e,n)}}(e,t);case b.TokenKind.BRACE_L:return function(e,t){var n=e.token;z(e,b.TokenKind.BRACE_L);var r=[];for(;!Y(e,b.TokenKind.BRACE_R);)r.push(T(e,t));return{kind:E.OBJECT,fields:r,loc:U(e,n)}}(e,t);case b.TokenKind.INT:return e.advance(),{kind:E.INT,value:n.value,loc:U(e,n)};case b.TokenKind.FLOAT:return e.advance(),{kind:E.FLOAT,value:n.value,loc:U(e,n)};case b.TokenKind.STRING:case b.TokenKind.BLOCK_STRING:return O(e);case b.TokenKind.NAME:return"true"===n.value||"false"===n.value?(e.advance(),{kind:E.BOOLEAN,value:"true"===n.value,loc:U(e,n)}):"null"===n.value?(e.advance(),{kind:E.NULL,loc:U(e,n)}):(e.advance(),{kind:E.ENUM,value:n.value,loc:U(e,n)});case b.TokenKind.DOLLAR:if(!t)return c(e)}throw W(e)}function O(e){var t=e.token;return e.advance(),{kind:E.STRING,value:t.value,block:t.kind===b.TokenKind.BLOCK_STRING,loc:U(e,t)}}function _(e){return g(e,!0)}function k(e){return g(e,!1)}function T(e,t){var r=e.token;return{kind:E.OBJECT_FIELD,name:n(e),value:(z(e,b.TokenKind.COLON),g(e,t)),loc:U(e,r)}}function I(e,t){for(var n=[];G(e,b.TokenKind.AT);)n.push(N(e,t));return n}function N(e,t){var r=e.token;return z(e,b.TokenKind.AT),{kind:E.DIRECTIVE,name:n(e),arguments:p(e,t),loc:U(e,r)}}function S(e){var t=e.token,n=void 0;return Y(e,b.TokenKind.BRACKET_L)?(n=S(e),z(e,b.TokenKind.BRACKET_R),n={kind:E.LIST_TYPE,type:n,loc:U(e,t)}):n=M(e),Y(e,b.TokenKind.BANG)?{kind:E.NON_NULL_TYPE,type:n,loc:U(e,t)}:n}function M(e){var t=e.token;return{kind:E.NAMED_TYPE,name:n(e),loc:U(e,t)}}function P(e){var t=A(e)?e.lookahead():e.token;if(t.kind===b.TokenKind.NAME)switch(t.value){case"schema":return function(e){var t=e.token;J(e,"schema");var n=I(e,!0),r=H(e,b.TokenKind.BRACE_L,D,b.TokenKind.BRACE_R);return{kind:E.SCHEMA_DEFINITION,directives:n,operationTypes:r,loc:U(e,t)}}(e);case"scalar":return function(e){var t=e.token,r=R(e);J(e,"scalar");var o=n(e),i=I(e,!0);return{kind:E.SCALAR_TYPE_DEFINITION,description:r,name:o,directives:i,loc:U(e,t)}}(e);case"type":return function(e){var t=e.token,r=R(e);J(e,"type");var o=n(e),i=F(e),a=I(e,!0),s=j(e);return{kind:E.OBJECT_TYPE_DEFINITION,description:r,name:o,interfaces:i,directives:a,fields:s,loc:U(e,t)}}(e);case"interface":return function(e){var t=e.token,r=R(e);J(e,"interface");var o=n(e),i=I(e,!0),a=j(e);return{kind:E.INTERFACE_TYPE_DEFINITION,description:r,name:o,directives:i,fields:a,loc:U(e,t)}}(e);case"union":return function(e){var t=e.token,r=R(e);J(e,"union");var o=n(e),i=I(e,!0),a=C(e);return{kind:E.UNION_TYPE_DEFINITION,description:r,name:o,directives:i,types:a,loc:U(e,t)}}(e);case"enum":return function(e){var t=e.token,r=R(e);J(e,"enum");var o=n(e),i=I(e,!0),a=L(e);return{kind:E.ENUM_TYPE_DEFINITION,description:r,name:o,directives:i,values:a,loc:U(e,t)}}(e);case"input":return function(e){var t=e.token,r=R(e);J(e,"input");var o=n(e),i=I(e,!0),a=$(e);return{kind:E.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:o,directives:i,fields:a,loc:U(e,t)}}(e);case"extend":return function(e){var t=e.lookahead();if(t.kind===b.TokenKind.NAME)switch(t.value){case"scalar":return function(e){var t=e.token;J(e,"extend"),J(e,"scalar");var r=n(e),o=I(e,!0);if(0===o.length)throw W(e);return{kind:E.SCALAR_TYPE_EXTENSION,name:r,directives:o,loc:U(e,t)}}(e);case"type":return function(e){var t=e.token;J(e,"extend"),J(e,"type");var r=n(e),o=F(e),i=I(e,!0),a=j(e);if(0===o.length&&0===i.length&&0===a.length)throw W(e);return{kind:E.OBJECT_TYPE_EXTENSION,name:r,interfaces:o,directives:i,fields:a,loc:U(e,t)}}(e);case"interface":return function(e){var t=e.token;J(e,"extend"),J(e,"interface");var r=n(e),o=I(e,!0),i=j(e);if(0===o.length&&0===i.length)throw W(e);return{kind:E.INTERFACE_TYPE_EXTENSION,name:r,directives:o,fields:i,loc:U(e,t)}}(e);case"union":return function(e){var t=e.token;J(e,"extend"),J(e,"union");var r=n(e),o=I(e,!0),i=C(e);if(0===o.length&&0===i.length)throw W(e);return{kind:E.UNION_TYPE_EXTENSION,name:r,directives:o,types:i,loc:U(e,t)}}(e);case"enum":return function(e){var t=e.token;J(e,"extend"),J(e,"enum");var r=n(e),o=I(e,!0),i=L(e);if(0===o.length&&0===i.length)throw W(e);return{kind:E.ENUM_TYPE_EXTENSION,name:r,directives:o,values:i,loc:U(e,t)}}(e);case"input":return function(e){var t=e.token;J(e,"extend"),J(e,"input");var r=n(e),o=I(e,!0),i=$(e);if(0===o.length&&0===i.length)throw W(e);return{kind:E.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:o,fields:i,loc:U(e,t)}}(e)}throw W(e,t)}(e);case"directive":return function(e){var t=e.token,r=R(e);J(e,"directive"),z(e,b.TokenKind.AT);var o=n(e),i=q(e);J(e,"on");var a=function(e){Y(e,b.TokenKind.PIPE);var t=[];do{t.push(B(e))}while(Y(e,b.TokenKind.PIPE));return t}(e);return{kind:E.DIRECTIVE_DEFINITION,description:r,name:o,arguments:i,locations:a,loc:U(e,t)}}(e)}throw W(e,t)}function A(e){return G(e,b.TokenKind.STRING)||G(e,b.TokenKind.BLOCK_STRING)}function R(e){if(A(e))return O(e)}function D(e){var t=e.token,n=a(e);z(e,b.TokenKind.COLON);var r=M(e);return{kind:E.OPERATION_TYPE_DEFINITION,operation:n,type:r,loc:U(e,t)}}function F(e){var t=[];if("implements"===e.token.value){e.advance();do{t.push(M(e))}while(G(e,b.TokenKind.NAME))}return t}function j(e){return G(e,b.TokenKind.BRACE_L)?H(e,b.TokenKind.BRACE_L,Q,b.TokenKind.BRACE_R):[]}function Q(e){var t=e.token,r=R(e),o=n(e),i=q(e);z(e,b.TokenKind.COLON);var a=S(e),s=I(e,!0);return{kind:E.FIELD_DEFINITION,description:r,name:o,arguments:i,type:a,directives:s,loc:U(e,t)}}function q(e){return G(e,b.TokenKind.PAREN_L)?H(e,b.TokenKind.PAREN_L,x,b.TokenKind.PAREN_R):[]}function x(e){var t=e.token,r=R(e),o=n(e);z(e,b.TokenKind.COLON);var i=S(e),a=void 0;Y(e,b.TokenKind.EQUALS)&&(a=_(e));var s=I(e,!0);return{kind:E.INPUT_VALUE_DEFINITION,description:r,name:o,type:i,defaultValue:a,directives:s,loc:U(e,t)}}function C(e){var t=[];if(Y(e,b.TokenKind.EQUALS)){Y(e,b.TokenKind.PIPE);do{t.push(M(e))}while(Y(e,b.TokenKind.PIPE))}return t}function L(e){return G(e,b.TokenKind.BRACE_L)?H(e,b.TokenKind.BRACE_L,V,b.TokenKind.BRACE_R):[]}function V(e){var t=e.token,r=R(e),o=n(e),i=I(e,!0);return{kind:E.ENUM_VALUE_DEFINITION,description:r,name:o,directives:i,loc:U(e,t)}}function $(e){return G(e,b.TokenKind.BRACE_L)?H(e,b.TokenKind.BRACE_L,x,b.TokenKind.BRACE_R):[]}function B(e){var t=e.token,r=n(e);if(w.DirectiveLocation.hasOwnProperty(r.value))return r;throw W(e,t)}function U(e,t){if(!e.options.noLocation)return new K(t,e.lastToken,e.source)}function K(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function G(e,t){return e.token.kind===t}function Y(e,t){var n=e.token.kind===t;return n&&e.advance(),n}function z(e,t){var n=e.token;if(n.kind===t)return e.advance(),n;throw(0,m.syntaxError)(e.source,n.start,"Expected "+t+", found "+(0,b.getTokenDesc)(n))}function J(e,t){var n=e.token;if(n.kind===b.TokenKind.NAME&&n.value===t)return e.advance(),n;throw(0,m.syntaxError)(e.source,n.start,'Expected "'+t+'", found '+(0,b.getTokenDesc)(n))}function W(e,t){var n=t||e.token;return(0,m.syntaxError)(e.source,n.start,"Unexpected "+(0,b.getTokenDesc)(n))}function H(e,t,n,r){z(e,t);for(var o=[n(e)];!Y(e,r);)o.push(n(e));return o}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e,t){var n="string"==typeof e?new l.Source(e):e;if(!(n instanceof l.Source))throw new TypeError("Must provide Source. Received: "+String(n));return function(e){var t=e.token;z(e,b.TokenKind.SOF);var n=[];do{n.push(r(e))}while(!Y(e,b.TokenKind.EOF));return{kind:E.DOCUMENT,definitions:n,loc:U(e,t)}}((0,b.createLexer)(n,t||{}))},t.parseValue=function(e,t){var n="string"==typeof e?new l.Source(e):e,r=(0,b.createLexer)(n,t||{});z(r,b.TokenKind.SOF);var o=g(r,!1);return z(r,b.TokenKind.EOF),o},t.parseType=function(e,t){var n="string"==typeof e?new l.Source(e):e,r=(0,b.createLexer)(n,t||{});z(r,b.TokenKind.SOF);var o=S(r);return z(r,b.TokenKind.EOF),o},t.parseConstValue=_,t.parseTypeReference=S,t.parseNamedType=M,K.prototype.toJSON=K.prototype.inspect=function(){return{start:this.start,end:this.end}}});s(O);var _=O.parse,k=(O.parseValue,O.parseType,O.parseConstValue,O.parseTypeReference,O.parseNamedType,u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n,s=void 0,u=Array.isArray(e),c=[e],l=-1,f=[],d=void 0,p=void 0,h=void 0,y=[],v=[],m=e;do{var g=++l===c.length,b=g&&0!==f.length;if(g){if(p=0===v.length?void 0:y[y.length-1],d=h,h=v.pop(),b){if(u)d=d.slice();else{var E={};for(var w in d)d.hasOwnProperty(w)&&(E[w]=d[w]);d=E}for(var O=0,_=0;_<f.length;_++){var k=f[_][0],T=f[_][1];u&&(k-=O),u&&null===T?(d.splice(k,1),O++):d[k]=T}}l=s.index,c=s.keys,f=s.edits,u=s.inArray,s=s.prev}else{if(p=h?u?l:c[l]:void 0,null===(d=h?h[p]:m)||void 0===d)continue;h&&y.push(p)}var I=void 0;if(!Array.isArray(d)){if(!o(d))throw new Error("Invalid AST Node: "+JSON.stringify(d));var N=i(t,d.kind,g);if(N){if((I=N.call(t,d,p,h,y,v))===r)break;if(!1===I){if(!g){y.pop();continue}}else if(void 0!==I&&(f.push([p,I]),!g)){if(!o(I)){y.pop();continue}d=I}}}void 0===I&&b&&f.push([p,d]),g?y.pop():(s={inArray:u,index:l,keys:c,edits:f,prev:s},u=Array.isArray(d),c=u?d:a[d.kind]||[],l=-1,f=[],h&&v.push(h),h=d)}while(void 0!==s);0!==f.length&&(m=f[f.length-1][1]);return m},t.visitInParallel=function(e){var t=new Array(e.length);return{enter:function(n){for(var o=0;o<e.length;o++)if(!t[o]){var a=i(e[o],n.kind,!1);if(a){var s=a.apply(e[o],arguments);if(!1===s)t[o]=n;else if(s===r)t[o]=r;else if(void 0!==s)return s}}},leave:function(n){for(var o=0;o<e.length;o++)if(t[o])t[o]===n&&(t[o]=null);else{var a=i(e[o],n.kind,!0);if(a){var s=a.apply(e[o],arguments);if(s===r)t[o]=r;else if(void 0!==s&&!1!==s)return s}}}}},t.visitWithTypeInfo=function(e,t){return{enter:function(n){e.enter(n);var r=i(t,n.kind,!1);if(r){var a=r.apply(t,arguments);return void 0!==a&&(e.leave(n),o(a)&&e.enter(a)),a}},leave:function(n){var r=i(t,n.kind,!0),o=void 0;return r&&(o=r.apply(t,arguments)),e.leave(n),o}}},t.getVisitFn=i;var n=t.QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue"],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:["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","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"]},r=t.BREAK={};function o(e){return Boolean(e&&"string"==typeof e.kind)}function i(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var o=n?r.leave:r.enter;if("function"==typeof o)return o}else{var i=n?e.leave:e.enter;if(i){if("function"==typeof i)return i;var a=i[t];if("function"==typeof a)return a}}}}));s(k);var T=k.visit,I=(k.visitInParallel,k.visitWithTypeInfo,k.getVisitFn,k.QueryDocumentKeys,k.BREAK,u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,k.visit)(e,{leave:n})};var n={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return r(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,o=i("(",r(e.variableDefinitions,", "),")"),a=r(e.directives," "),s=e.selectionSet;return n||a||o||"query"!==t?r([t,r([n,o]),a,s]," "):s},VariableDefinition:function(e){return e.variable+": "+e.type+i(" = ",e.defaultValue)},SelectionSet:function(e){return o(e.selections)},Field:function(e){var t=e.alias,n=e.name,o=e.arguments,a=e.directives,s=e.selectionSet;return r([i("",t,": ")+n+i("(",r(o,", "),")"),r(a," "),s]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+i(" ",r(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,o=e.selectionSet;return r(["...",i("on ",t),r(n," "),o]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,o=e.variableDefinitions,a=e.directives,s=e.selectionSet;return"fragment "+t+i("(",r(o,", "),")")+" on "+n+" "+i("",r(a," ")," ")+s},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?function(e,t){return" "!==e[0]&&"\t"!==e[0]||-1!==e.indexOf("\n")?t?'"""\n'+e.replace(/"""/g,'\\"""')+'\n"""':a('"""\n'+e.replace(/"""/g,'\\"""'))+'\n"""':'"""'+e.replace(/"""/g,'\\"""')+'"""'}(n,"description"===t):JSON.stringify(n)},BooleanValue:function(e){var t=e.value;return JSON.stringify(t)},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+r(e.values,", ")+"]"},ObjectValue:function(e){return"{"+r(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+i("(",r(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var t=e.directives,n=e.operationTypes;return r(["schema",r(t," "),o(n)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:function(e){return r([e.description,r(["scalar",e.name,r(e.directives," ")]," ")],"\n")},ObjectTypeDefinition:function(e){var t=e.description,n=e.name,a=e.interfaces,s=e.directives,u=e.fields;return r([t,r(["type",n,i("implements ",r(a,", ")),r(s," "),o(u)]," ")],"\n")},FieldDefinition:function(e){var t=e.description,n=e.name,o=e.arguments,a=e.type,s=e.directives;return r([t,n+i("(",r(o,", "),")")+": "+a+i(" ",r(s," "))],"\n")},InputValueDefinition:function(e){var t=e.description,n=e.name,o=e.type,a=e.defaultValue,s=e.directives;return r([t,r([n+": "+o,i("= ",a),r(s," ")]," ")],"\n")},InterfaceTypeDefinition:function(e){var t=e.description,n=e.name,i=e.directives,a=e.fields;return r([t,r(["interface",n,r(i," "),o(a)]," ")],"\n")},UnionTypeDefinition:function(e){var t=e.description,n=e.name,o=e.directives,i=e.types;return r([t,r(["union",n,r(o," "),i&&0!==i.length?"= "+r(i," | "):""]," ")],"\n")},EnumTypeDefinition:function(e){var t=e.description,n=e.name,i=e.directives,a=e.values;return r([t,r(["enum",n,r(i," "),o(a)]," ")],"\n")},EnumValueDefinition:function(e){return r([e.description,r([e.name,r(e.directives," ")]," ")],"\n")},InputObjectTypeDefinition:function(e){var t=e.description,n=e.name,i=e.directives,a=e.fields;return r([t,r(["input",n,r(i," "),o(a)]," ")],"\n")},ScalarTypeExtension:function(e){return r(["extend scalar",e.name,r(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,a=e.directives,s=e.fields;return r(["extend type",t,i("implements ",r(n,", ")),r(a," "),o(s)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.directives,i=e.fields;return r(["extend interface",t,r(n," "),o(i)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,o=e.types;return r(["extend union",t,r(n," "),o&&0!==o.length?"= "+r(o," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,i=e.values;return r(["extend enum",t,r(n," "),o(i)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,i=e.fields;return r(["extend input",t,r(n," "),o(i)]," ")},DirectiveDefinition:function(e){var t=e.description,n=e.name,o=e.arguments,a=e.locations;return r([t,"directive @"+n+i("(",r(o,", "),")")+" on "+r(a," | ")],"\n")}};function r(e,t){return e?e.filter(function(e){return e}).join(t||""):""}function o(e){return e&&0!==e.length?a("{\n"+r(e,"\n"))+"\n}":""}function i(e,t,n){return t?e+t+(n||""):""}function a(e){return e&&e.replace(/\n/g,"\n  ")}}));s(I);var N=I.print,S=u(function(e,t){var n=200,r="__lodash_hash_undefined__",o=1,i=2,s=9007199254740991,u="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",f="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",y="[object GeneratorFunction]",v="[object Map]",m="[object Number]",g="[object Null]",b="[object Object]",E="[object Proxy]",w="[object RegExp]",O="[object Set]",_="[object String]",k="[object Symbol]",T="[object Undefined]",I="[object ArrayBuffer]",N="[object DataView]",S=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,P={};P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P[u]=P[c]=P[I]=P[f]=P[N]=P[d]=P[p]=P[h]=P[v]=P[m]=P[b]=P[w]=P[O]=P[_]=P["[object WeakMap]"]=!1;var A="object"==typeof a&&a&&a.Object===Object&&a,R="object"==typeof self&&self&&self.Object===Object&&self,D=A||R||Function("return this")(),F=t&&!t.nodeType&&t,j=F&&e&&!e.nodeType&&e,Q=j&&j.exports===F,q=Q&&A.process,x=function(){try{return q&&q.binding&&q.binding("util")}catch(e){}}(),C=x&&x.isTypedArray;function L(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function V(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function $(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var B,U,K,G=Array.prototype,Y=Function.prototype,z=Object.prototype,J=D["__core-js_shared__"],W=Y.toString,H=z.hasOwnProperty,X=(B=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",Z=z.toString,ee=RegExp("^"+W.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=Q?D.Buffer:void 0,ne=D.Symbol,re=D.Uint8Array,oe=z.propertyIsEnumerable,ie=G.splice,ae=ne?ne.toStringTag:void 0,se=Object.getOwnPropertySymbols,ue=te?te.isBuffer:void 0,ce=(U=Object.keys,K=Object,function(e){return U(K(e))}),le=xe(D,"DataView"),fe=xe(D,"Map"),de=xe(D,"Promise"),pe=xe(D,"Set"),he=xe(D,"WeakMap"),ye=xe(Object,"create"),ve=$e(le),me=$e(fe),ge=$e(de),be=$e(pe),Ee=$e(he),we=ne?ne.prototype:void 0,Oe=we?we.valueOf:void 0;function _e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ke(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ie(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Te;++t<n;)this.add(e[t])}function Ne(e){var t=this.__data__=new ke(e);this.size=t.size}function Se(e,t){var n=Ke(e),r=!n&&Ue(e),o=!n&&!r&&Ge(e),i=!n&&!r&&!o&&He(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=s.length;for(var c in e)!t&&!H.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ve(c,u))||s.push(c);return s}function Me(e,t){for(var n=e.length;n--;)if(Be(e[n][0],t))return n;return-1}function Pe(e){return null==e?void 0===e?T:g:ae&&ae in Object(e)?function(e){var t=H.call(e,ae),n=e[ae];try{e[ae]=void 0}catch(e){}var r=Z.call(e);t?e[ae]=n:delete e[ae];return r}(e):function(e){return Z.call(e)}(e)}function Ae(e){return We(e)&&Pe(e)==u}function Re(e,t,n,r,a){return e===t||(null==e||null==t||!We(e)&&!We(t)?e!=e&&t!=t:function(e,t,n,r,a,s){var l=Ke(e),h=Ke(t),y=l?c:Le(e),g=h?c:Le(t),E=(y=y==u?b:y)==b,T=(g=g==u?b:g)==b,S=y==g;if(S&&Ge(e)){if(!Ge(t))return!1;l=!0,E=!1}if(S&&!E)return s||(s=new Ne),l||He(e)?je(e,t,n,r,a,s):function(e,t,n,r,a,s,u){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case I:return!(e.byteLength!=t.byteLength||!s(new re(e),new re(t)));case f:case d:case m:return Be(+e,+t);case p:return e.name==t.name&&e.message==t.message;case w:case _:return e==t+"";case v:var c=V;case O:var l=r&o;if(c||(c=$),e.size!=t.size&&!l)return!1;var h=u.get(e);if(h)return h==t;r|=i,u.set(e,t);var y=je(c(e),c(t),r,a,s,u);return u.delete(e),y;case k:if(Oe)return Oe.call(e)==Oe.call(t)}return!1}(e,t,y,n,r,a,s);if(!(n&o)){var M=E&&H.call(e,"__wrapped__"),P=T&&H.call(t,"__wrapped__");if(M||P){var A=M?e.value():e,R=P?t.value():t;return s||(s=new Ne),a(A,R,n,r,s)}}if(!S)return!1;return s||(s=new Ne),function(e,t,n,r,i,a){var s=n&o,u=Qe(e),c=u.length,l=Qe(t).length;if(c!=l&&!s)return!1;for(var f=c;f--;){var d=u[f];if(!(s?d in t:H.call(t,d)))return!1}var p=a.get(e);if(p&&a.get(t))return p==t;var h=!0;a.set(e,t),a.set(t,e);for(var y=s;++f<c;){d=u[f];var v=e[d],m=t[d];if(r)var g=s?r(m,v,d,t,e,a):r(v,m,d,e,t,a);if(!(void 0===g?v===m||i(v,m,n,r,a):g)){h=!1;break}y||(y="constructor"==d)}if(h&&!y){var b=e.constructor,E=t.constructor;b!=E&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof E&&E instanceof E)&&(h=!1)}return a.delete(e),a.delete(t),h}(e,t,n,r,a,s)}(e,t,n,r,Re,a))}function De(e){return!(!Je(e)||X&&X in e)&&(Ye(e)?ee:S).test($e(e))}function Fe(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||z,t!==r)return ce(e);var t,n,r,o=[];for(var i in Object(e))H.call(e,i)&&"constructor"!=i&&o.push(i);return o}function je(e,t,n,r,a,s){var u=n&o,c=e.length,l=t.length;if(c!=l&&!(u&&l>c))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var d=-1,p=!0,h=n&i?new Ie:void 0;for(s.set(e,t),s.set(t,e);++d<c;){var y=e[d],v=t[d];if(r)var m=u?r(v,y,d,t,e,s):r(y,v,d,e,t,s);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!L(t,function(e,t){if(o=t,!h.has(o)&&(y===e||a(y,e,n,r,s)))return h.push(t);var o})){p=!1;break}}else if(y!==v&&!a(y,v,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function Qe(e){return function(e,t,n){var r=t(e);return Ke(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Xe,Ce)}function qe(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function xe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return De(n)?n:void 0}_e.prototype.clear=function(){this.__data__=ye?ye(null):{},this.size=0},_e.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},_e.prototype.get=function(e){var t=this.__data__;if(ye){var n=t[e];return n===r?void 0:n}return H.call(t,e)?t[e]:void 0},_e.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:H.call(t,e)},_e.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ye&&void 0===t?r:t,this},ke.prototype.clear=function(){this.__data__=[],this.size=0},ke.prototype.delete=function(e){var t=this.__data__,n=Me(t,e);return!(n<0||(n==t.length-1?t.pop():ie.call(t,n,1),--this.size,0))},ke.prototype.get=function(e){var t=this.__data__,n=Me(t,e);return n<0?void 0:t[n][1]},ke.prototype.has=function(e){return Me(this.__data__,e)>-1},ke.prototype.set=function(e,t){var n=this.__data__,r=Me(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Te.prototype.clear=function(){this.size=0,this.__data__={hash:new _e,map:new(fe||ke),string:new _e}},Te.prototype.delete=function(e){var t=qe(this,e).delete(e);return this.size-=t?1:0,t},Te.prototype.get=function(e){return qe(this,e).get(e)},Te.prototype.has=function(e){return qe(this,e).has(e)},Te.prototype.set=function(e,t){var n=qe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Ie.prototype.add=Ie.prototype.push=function(e){return this.__data__.set(e,r),this},Ie.prototype.has=function(e){return this.__data__.has(e)},Ne.prototype.clear=function(){this.__data__=new ke,this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ne.prototype.get=function(e){return this.__data__.get(e)},Ne.prototype.has=function(e){return this.__data__.has(e)},Ne.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ke){var o=r.__data__;if(!fe||o.length<n-1)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new Te(o)}return r.set(e,t),this.size=r.size,this};var Ce=se?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(se(e),function(t){return oe.call(e,t)}))}:function(){return[]},Le=Pe;function Ve(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||M.test(e))&&e>-1&&e%1==0&&e<t}function $e(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Be(e,t){return e===t||e!=e&&t!=t}(le&&Le(new le(new ArrayBuffer(1)))!=N||fe&&Le(new fe)!=v||de&&"[object Promise]"!=Le(de.resolve())||pe&&Le(new pe)!=O||he&&"[object WeakMap]"!=Le(new he))&&(Le=function(e){var t=Pe(e),n=t==b?e.constructor:void 0,r=n?$e(n):"";if(r)switch(r){case ve:return N;case me:return v;case ge:return"[object Promise]";case be:return O;case Ee:return"[object WeakMap]"}return t});var Ue=Ae(function(){return arguments}())?Ae:function(e){return We(e)&&H.call(e,"callee")&&!oe.call(e,"callee")},Ke=Array.isArray;var Ge=ue||function(){return!1};function Ye(e){if(!Je(e))return!1;var t=Pe(e);return t==h||t==y||t==l||t==E}function ze(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Je(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function We(e){return null!=e&&"object"==typeof e}var He=C?function(e){return function(t){return e(t)}}(C):function(e){return We(e)&&ze(e.length)&&!!P[Pe(e)]};function Xe(e){return null!=(t=e)&&ze(t.length)&&!Ye(t)?Se(e):Fe(e);var t}e.exports=function(e,t){return Re(e,t)}}),M=u(function(e,t){var n=200,r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Boolean]",u="[object Date]",c="[object Function]",l="[object GeneratorFunction]",f="[object Map]",d="[object Number]",p="[object Object]",h="[object RegExp]",y="[object Set]",v="[object String]",m="[object Symbol]",g="[object ArrayBuffer]",b="[object DataView]",E="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",_="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",I="[object Uint8ClampedArray]",N="[object Uint16Array]",S="[object Uint32Array]",M=/\w*$/,P=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,R={};R[i]=R["[object Array]"]=R[g]=R[b]=R[s]=R[u]=R[E]=R[w]=R[O]=R[_]=R[k]=R[f]=R[d]=R[p]=R[h]=R[y]=R[v]=R[m]=R[T]=R[I]=R[N]=R[S]=!0,R["[object Error]"]=R[c]=R["[object WeakMap]"]=!1;var D="object"==typeof a&&a&&a.Object===Object&&a,F="object"==typeof self&&self&&self.Object===Object&&self,j=D||F||Function("return this")(),Q=t&&!t.nodeType&&t,q=Q&&e&&!e.nodeType&&e,x=q&&q.exports===Q;function C(e,t){return e.set(t[0],t[1]),e}function L(e,t){return e.add(t),e}function V(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function $(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function B(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function U(e,t){return function(n){return e(t(n))}}function K(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var G,Y=Array.prototype,z=Function.prototype,J=Object.prototype,W=j["__core-js_shared__"],H=(G=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",X=z.toString,Z=J.hasOwnProperty,ee=J.toString,te=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=x?j.Buffer:void 0,re=j.Symbol,oe=j.Uint8Array,ie=U(Object.getPrototypeOf,Object),ae=Object.create,se=J.propertyIsEnumerable,ue=Y.splice,ce=Object.getOwnPropertySymbols,le=ne?ne.isBuffer:void 0,fe=U(Object.keys,Object),de=qe(j,"DataView"),pe=qe(j,"Map"),he=qe(j,"Promise"),ye=qe(j,"Set"),ve=qe(j,"WeakMap"),me=qe(Object,"create"),ge=$e(de),be=$e(pe),Ee=$e(he),we=$e(ye),Oe=$e(ve),_e=re?re.prototype:void 0,ke=_e?_e.valueOf:void 0;function Te(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Se(e){this.__data__=new Ie(e)}function Me(e,t){var n=Ue(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&Z.call(e,"callee")&&(!se.call(e,"callee")||ee.call(e)==i)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,o=!!r;for(var a in e)!t&&!Z.call(e,a)||o&&("length"==a||Le(a,r))||n.push(a);return n}function Pe(e,t,n){var r=e[t];Z.call(e,t)&&Be(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if(Be(e[n][0],t))return n;return-1}function Re(e,t,n,r,o,a,P){var A;if(r&&(A=a?r(e,o,a,P):r(e)),void 0!==A)return A;if(!ze(e))return e;var D=Ue(e);if(D){if(A=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&Z.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,A)}else{var F=Ce(e),j=F==c||F==l;if(Ge(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(F==p||F==i||j&&!a){if($(e))return a?e:{};if(A=function(e){return"function"!=typeof e.constructor||Ve(e)?{}:(t=ie(e),ze(t)?ae(t):{});var t}(j?{}:e),!t)return function(e,t){return je(e,xe(e),t)}(e,function(e,t){return e&&je(t,Je(t),e)}(A,e))}else{if(!R[F])return a?e:{};A=function(e,t,n,r){var o=e.constructor;switch(t){case g:return Fe(e);case s:case u:return new o(+e);case b:return function(e,t){var n=t?Fe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case E:case w:case O:case _:case k:case T:case I:case N:case S:return function(e,t){var n=t?Fe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case f:return function(e,t,n){return V(t?n(B(e),!0):B(e),C,new e.constructor)}(e,r,n);case d:case v:return new o(e);case h:return(c=new(a=e).constructor(a.source,M.exec(a))).lastIndex=a.lastIndex,c;case y:return function(e,t,n){return V(t?n(K(e),!0):K(e),L,new e.constructor)}(e,r,n);case m:return i=e,ke?Object(ke.call(i)):{}}var i;var a,c}(e,F,Re,t)}}P||(P=new Se);var Q=P.get(e);if(Q)return Q;if(P.set(e,A),!D)var q=n?function(e){return function(e,t,n){var r=t(e);return Ue(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Je,xe)}(e):Je(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(q||e,function(o,i){q&&(o=e[i=o]),Pe(A,i,Re(o,t,n,r,i,e,P))}),A}function De(e){return!(!ze(e)||H&&H in e)&&(Ye(e)||$(e)?te:P).test($e(e))}function Fe(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function je(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],s=r?r(n[a],e[a],a,n,e):void 0;Pe(n,a,void 0===s?e[a]:s)}return n}function Qe(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function qe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return De(n)?n:void 0}Te.prototype.clear=function(){this.__data__=me?me(null):{}},Te.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Te.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===r?void 0:n}return Z.call(t,e)?t[e]:void 0},Te.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:Z.call(t,e)},Te.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?r:t,this},Ie.prototype.clear=function(){this.__data__=[]},Ie.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0||(n==t.length-1?t.pop():ue.call(t,n,1),0))},Ie.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},Ie.prototype.has=function(e){return Ae(this.__data__,e)>-1},Ie.prototype.set=function(e,t){var n=this.__data__,r=Ae(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ne.prototype.clear=function(){this.__data__={hash:new Te,map:new(pe||Ie),string:new Te}},Ne.prototype.delete=function(e){return Qe(this,e).delete(e)},Ne.prototype.get=function(e){return Qe(this,e).get(e)},Ne.prototype.has=function(e){return Qe(this,e).has(e)},Ne.prototype.set=function(e,t){return Qe(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new Ie},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ie){var o=r.__data__;if(!pe||o.length<n-1)return o.push([e,t]),this;r=this.__data__=new Ne(o)}return r.set(e,t),this};var xe=ce?U(ce,Object):function(){return[]},Ce=function(e){return ee.call(e)};function Le(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||A.test(e))&&e>-1&&e%1==0&&e<t}function Ve(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)}function $e(e){if(null!=e){try{return X.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Be(e,t){return e===t||e!=e&&t!=t}(de&&Ce(new de(new ArrayBuffer(1)))!=b||pe&&Ce(new pe)!=f||he&&"[object Promise]"!=Ce(he.resolve())||ye&&Ce(new ye)!=y||ve&&"[object WeakMap]"!=Ce(new ve))&&(Ce=function(e){var t=ee.call(e),n=t==p?e.constructor:void 0,r=n?$e(n):void 0;if(r)switch(r){case ge:return b;case be:return f;case Ee:return"[object Promise]";case we:return y;case Oe:return"[object WeakMap]"}return t});var Ue=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Ye(e)}var Ge=le||function(){return!1};function Ye(e){var t=ze(e)?ee.call(e):"";return t==c||t==l}function ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Je(e){return Ke(e)?Me(e):function(e){if(!Ve(e))return fe(e);var t=[];for(var n in Object(e))Z.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Re(e,!1,!0)}}),P=u(function(e,t){var n;n=function(){var e=[],t=[],n={},r={},o={};function i(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t){return e.replace(t[0],function(n,r){var o,i,s=(o=t[1],i=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return i[t]||""}));return a(""===n?e[r-1]:n,s)})}function u(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var o=r.length;o--;){var i=r[o];if(i[0].test(t))return s(t,i)}return t}function c(e,t,n){return function(r){var o=r.toLowerCase();return t.hasOwnProperty(o)?a(r,o):e.hasOwnProperty(o)?a(r,e[o]):u(o,r,n)}}function l(e,t,n,r){return function(r){var o=r.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&u(o,o,n)===o}}function f(e,t,n){var r=1===t?f.singular(e):f.plural(e);return(n?t+" ":"")+r}return f.plural=c(o,r,e),f.isPlural=l(o,r,e),f.singular=c(r,o,t),f.isSingular=l(r,o,t),f.addPluralRule=function(t,n){e.push([i(t),n])},f.addSingularRule=function(e,n){t.push([i(e),n])},f.addUncountableRule=function(e){"string"!=typeof e?(f.addPluralRule(e,"$0"),f.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},f.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),o[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["whiskey","whiskies"]].forEach(function(e){return f.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|tlas|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/(m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return f.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/(m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i,"$1"],[/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return f.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","alcohol","ammo","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","flounder","fun","gallows","garbage","graffiti","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","manga","news","pike","plankton","pliers","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","species","staff","swine","tennis","traffic","transporation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(f.addUncountableRule),f},e.exports=n()}),A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R=P.plural,D=P.singular;function F(e){return e.charAt(0).toUpperCase()+e.slice(1)}function j(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Q(e){return N(q(e))}function q(e){return"string"==typeof e?_(e):e}function x(e){return e.loc.source.body}function C(e){return null!==e&&!(e instanceof Array)&&"object"===(void 0===e?"undefined":A(e))}function L(e,t){if(!e)return{};for(var n=-1,r=t.length,o={};++n<r;){var i=t[n];o[i]=e[i]}return o}function V(e,t){return S(e,t)}function $(e){return M(e)}var B=function(){function e(e){this.PREFIX=["%c Vuex-ORM: GraphQL Plugin %c","background: #35495e; padding: 1px 0; border-radius: 3px; color: #eee;","background: transparent;"],this.enabled=e,this.log("Logging is enabled.")}return e.prototype.group=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(console.groupCollapsed?console.groupCollapsed.apply(console,this.PREFIX.concat(e)):console.log.apply(console,this.PREFIX.concat(e)))},e.prototype.groupEnd=function(){this.enabled&&console.groupEnd&&console.groupEnd()},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&console.log.apply(console,this.PREFIX.concat(e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&console.warn.apply(console,this.PREFIX.concat(e))},e.prototype.logQuery=function(e,t,n){if(this.enabled)try{var r="";r=C(e)&&e.loc?Q(e.loc.source.body):Q(e),this.group("Sending query:",r.split("\n")[1].replace("{","").trim()),console.log(r),t&&console.log("VARIABLES:",t),n&&console.log("FETCH POLICY:",n),this.groupEnd()}catch(t){console.error("[Vuex-ORM-Apollo] There is a syntax error in the query!",t,e)}},e}(),U=function(){function e(e){var t=this;this.fields=new Map,this.mocks={},this.baseModel=e,this.singularName=D(this.baseModel.entity),this.pluralName=R(this.baseModel.entity);var n=this.baseModel.fields();Object.keys(n).forEach(function(e){t.fields.set(e,n[e])})}return e.isFieldNumber=function(e){return!!e&&e instanceof xn.getInstance().components.Number},e.isFieldAttribute=function(e){var t=xn.getInstance();return e instanceof t.components.Attr||e instanceof t.components.String||e instanceof t.components.Number||e instanceof t.components.Boolean},e.isConnection=function(e){var t=xn.getInstance();return!(e instanceof t.components.BelongsTo||e instanceof t.components.HasOne||e instanceof t.components.MorphTo||e instanceof t.components.MorphOne)},e.augment=function(e){var t=e.baseModel.fields.bind(e.baseModel);e.baseModel.fields=function(){var n=t();return n.$isPersisted=e.baseModel.boolean(!1),n}},e.getRelatedModel=function(e){if(void 0===e)return null;var t=xn.getInstance();if(e instanceof t.components.BelongsToMany||e instanceof t.components.HasMany||e instanceof t.components.HasManyThrough||e instanceof t.components.MorphedByMany||e instanceof t.components.MorphMany||e instanceof t.components.MorphOne||e instanceof t.components.MorphToMany||e instanceof t.components.HasOne)return t.getModel(e.related.entity,!0);if(e instanceof t.components.BelongsTo||e instanceof t.components.HasManyBy)return t.getModel(e.parent.entity,!0);if(e instanceof t.components.MorphTo)return t.getModel(e.type,!0);throw console.warn("Failed relation",void 0===e?"undefined":A(e),e),new Error("Can't find related model for relation of type "+(void 0===e?"undefined":A(e))+"!")},e.prototype.getQueryFields=function(){var t=this,n=[];return this.fields.forEach(function(r,o){e.isFieldAttribute(r)&&!t.skipField(o)&&n.push(o)}),n},e.prototype.skipField=function(e){if(e.startsWith("$"))return!0;if(this.baseModel.skipFields&&this.baseModel.skipFields.indexOf(e)>=0)return!0;var t=xn.getInstance(),n=!1;return this.getRelations().forEach(function(r){return!(r instanceof t.components.BelongsTo||r instanceof t.components.HasOne)||r.foreignKey!==e||(n=!0,!1)}),n},e.prototype.getRelations=function(){var t=new Map;return this.fields.forEach(function(n,r){e.isFieldAttribute(n)||t.set(r,n)}),t},e.prototype.isTypeFieldOfPolymorphicRelation=function(e){var t=this,n=xn.getInstance(),r=!1;return n.models.forEach(function(o){return!r&&(o.getRelations().forEach(function(o){if(o instanceof n.components.MorphMany||o instanceof n.components.MorphedByMany||o instanceof n.components.MorphOne||o instanceof n.components.MorphTo||o instanceof n.components.MorphToMany){var i=o.related;if(o.type===e&&i&&i.entity===t.baseModel.entity)return r=!0,!1}return!0}),!0)}),r},e.prototype.getRecordWithId=function(e){return this.baseModel.query().withAllRecursive().where("id",e).first()},e.prototype.shouldEagerLoadRelation=function(e,t,n){var r=xn.getInstance();if(t instanceof r.components.HasOne||t instanceof r.components.BelongsTo||t instanceof r.components.MorphOne)return!0;var o=this.baseModel.eagerLoad||[];return Array.prototype.push.apply(o,this.baseModel.eagerSync||[]),void 0!==o.find(function(t){return t===n.singularName||t===n.pluralName||t===e})},e.prototype.shouldEagerSaveRelation=function(e,t,n){if(t instanceof xn.getInstance().components.BelongsTo)return!0;var r=this.baseModel.eagerSave||[];return Array.prototype.push.apply(r,this.baseModel.eagerSync||[]),void 0!==r.find(function(t){return t===n.singularName||t===n.pluralName||t===e})},e.prototype.$addMock=function(e){return!this.$findMock(e.action,e.options)&&(this.mocks[e.action]||(this.mocks[e.action]=[]),this.mocks[e.action].push(e),!0)},e.prototype.$findMock=function(e,t){return this.mocks[e]&&this.mocks[e].find(function(e){return!e.options||!t||V(L(t,Object.keys(e.options)),e.options||{})})||null},e.prototype.$mockHook=function(e,t){var n,r=null,o=this.$findMock(e,t);return o&&(r=o.returnValue instanceof Function?o.returnValue():o.returnValue||null),r?(r instanceof Array?r.forEach(function(e){return e.$isPersisted=!0}):r.$isPersisted=!0,(n={})[this.pluralName]=r,n):null},e}(),K=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,r="boolean"==typeof t.cycles&&t.cycles,o=t.cmp&&(n=t.cmp,function(e){return function(t,r){var o={key:t,value:e[t]},i={key:r,value:e[r]};return n(o,i)}}),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n<t.length;n++)n&&(a+=","),a+=e(t[n])||"null";return a+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=i.push(t)-1,u=Object.keys(t).sort(o&&o(t));for(a="",n=0;n<u.length;n++){var c=u[n],l=e(t[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return i.splice(s,1),"{"+a+"}"}}(e)};function G(e){return e.definitions.filter(function(e){return e.selectionSet&&e.selectionSet.selections}).map(function(e){return function e(t){return t.selectionSet&&t.selectionSet.selections.length>0?[t].concat(t.selectionSet.selections.map(function(t){return[t].concat(e(t))}).reduce(function(e,t){return e.concat(t)},[])):[t]}(e)}).reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return e.directives&&e.directives.length>0}).map(function(e){return e.directives}).reduce(function(e,t){return e.concat(t)},[]).map(function(e){return e.name.value})}function Y(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach(function(t){void 0!==t&&null!==t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function z(e){if("Document"!==e.kind)throw new Error('Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql');var t=e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new Error('Schema type definitions not allowed in queries. Found: "'+e.kind+'"');return e});if(t.length>1)throw new Error("Ambiguous GraphQL document: contains "+t.length+" operations")}function J(e){return z(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function W(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null}function H(e){var t=J(e);if(!t||"query"!==t.operation)throw new Error("Must contain a query definition.");return t}function X(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,n=e.defaultValue,r={};return function e(t,n,r,o){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))t[n.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))t[n.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map(function(t){return e(i,t.name,t.value,o)}),t[n.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var a=(o||{})[r.name.value];t[n.value]=a}else if(function(e){return"ListValue"===e.kind}(r))t[n.value]=r.values.map(function(t){var r={};return e(r,n,t,o),r[n.value]});else if(function(e){return"EnumValue"===e.kind}(r))t[n.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new Error('The inline argument "'+n.value+'" of kind "'+r.kind+'"is not supported. Use variables instead of inline arguments to overcome this limitation.');t[n.value]=null}}(r,t.name,n),r});return Y.apply(void 0,[{}].concat(t))}return{}}var Z=Object.prototype.toString;function ee(e){return function e(t,n){switch(Z.call(t)){case"[object Array]":if(n.has(t))return n.get(t);var r=t.slice(0);return n.set(t,r),r.forEach(function(t,o){r[o]=e(t,n)}),r;case"[object Object]":if(n.has(t))return n.get(t);var o=Object.create(Object.getPrototypeOf(t));return n.set(t,o),Object.keys(t).forEach(function(r){o[r]=e(t[r],n)}),o;default:return t}}(e,new Map)}function te(e,t){var n=ee(t);return n.definitions.forEach(function(t){!function e(t,n){if(!n.selections)return n;var r=t.some(function(e){return e.remove});return n.selections=n.selections.map(function(e){if("Field"!==e.kind||!e||!e.directives)return e;var n,o=function(e){return function(t){return e.some(function(e){return!(!e.name||e.name!==t.name.value)||!(!e.test||!e.test(t))})}}(t);return e.directives=e.directives.filter(function(e){var t=!o(e);return n||t||!r||(n=!0),t}),n?null:e}).filter(function(e){return!!e}),n.selections.forEach(function(n){"Field"!==n.kind&&"InlineFragment"!==n.kind||!n.selectionSet||e(t,n.selectionSet)}),n}(e,t.selectionSet)}),function e(t,n){return t.selectionSet.selections.filter(function(t){return!(t&&"FragmentSpread"===t.kind&&!e(n[t.name.value],n))}).length>0}(function(e){var t=J(e);if(!t)throw new Error("GraphQL document is missing an operation");return t}(n),function(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}(function(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}(n)))?n:null}var ne,re={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some(function(e){return"key"===e.name.value})||console.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function oe(e){return("undefined"!=typeof process&&process.env.NODE_ENV?process.env.NODE_ENV:"development")===e}function ie(){return!0===oe("production")}function ae(e){try{return e()}catch(e){console.error&&console.error(e)}}function se(e){return e.errors&&e.errors.length}function ue(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(null!=e&&"object"==typeof e&&null!=t&&"object"==typeof t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!ue(e[n],t[n]))return!1}for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!Object.prototype.hasOwnProperty.call(e,n))return!1;return!0}return!1}function ce(e){return e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(ne||(ne={}));var le=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){return"function"==typeof Symbol},i=function(e){return o()&&Boolean(Symbol[e])},a=function(e){return i(e)?Symbol[e]:"@@"+e};o()&&!i("observable")&&(Symbol.observable=Symbol("observable"));var s=a("iterator"),u=a("observable"),c=a("species");function l(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function f(e){var t=e.constructor;return void 0!==t&&null===(t=t[c])&&(t=void 0),void 0!==t?t:w}function d(e){return e instanceof w}function p(e){p.log?p.log(e):setTimeout(function(){throw e})}function h(e){Promise.resolve().then(function(){try{e()}catch(e){p(e)}})}function y(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=l(t,"unsubscribe");n&&n.call(t)}}catch(e){p(e)}}function v(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function m(e,t,n){e._state="running";var r=e._observer;try{var o=l(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(v(e),!o)throw n;o.call(r,n);break;case"complete":v(e),o&&o.call(r)}}catch(e){p(e)}"closed"===e._state?y(e):"running"===e._state&&(e._state="ready")}function g(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void h(function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(m(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)})):void m(e,t,n);e._queue.push({type:t,value:n})}}var b=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var o=new E(this);try{this._cleanup=n.call(void 0,o)}catch(e){o.error(e)}"initializing"===this._state&&(this._state="ready")}return n(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(v(this),y(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),E=function(){function e(t){r(this,e),this._subscription=t}return n(e,[{key:"next",value:function(e){g(this._subscription,"next",e)}},{key:"error",value:function(e){g(this._subscription,"error",e)}},{key:"complete",value:function(){g(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),w=t.Observable=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return n(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new b(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise(function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}})}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))(function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))(function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this),r=arguments.length>1,o=!1,i=arguments[1];return new n(function(n){return t.subscribe({next:function(t){var a=!o;if(o=!0,!a||r)try{i=e(i,t)}catch(e){return n.error(e)}else i=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(i),n.complete()}})})}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=f(this);return new o(function(t){var r=void 0,i=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){i===n.length?(r=void 0,t.complete()):e(o.from(n[i++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}})}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this);return new n(function(r){var o=[],i=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var i=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(i);e>=0&&o.splice(e,1),a()}});o.push(i)},error:function(e){r.error(e)},complete:function(){a()}});function a(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach(function(e){return e.unsubscribe()}),i.unsubscribe()}})}},{key:u,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=l(t,u);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return d(o)&&o.constructor===n?o:new n(function(e){return o.subscribe(e)})}if(i("iterator")&&(r=l(t,s)))return new n(function(e){h(function(){if(!e.closed){var n=!0,o=!1,i=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){o=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}e.complete()}})});if(Array.isArray(t))return new n(function(e){h(function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}})});throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)(function(e){h(function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}})})}},{key:c,get:function(){return this}}]),e}();o()&&Object.defineProperty(w,Symbol("extensions"),{value:{symbol:u,hostReportError:p},configurable:!0})});s(le);le.Observable;var fe=le.Observable;var de=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pe=function(){return(pe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var he=function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}return de(t,e),t}(Error);function ye(e){return e.request.length<=1}function ve(e){return new fe(function(t){t.error(e)})}function me(e,t){var n=pe({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=pe({},n,"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return pe({},n)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){return N(e.query)+"|"+JSON.stringify(e.variables)+"|"+e.operationName}(t)}}),t}var ge=function(e,t){return t?t(e):fe.of()},be=function(e){return"function"==typeof e?new ke(e):e},Ee=function(){return new ke(function(e,t){return fe.of()})},we=function(e){return 0===e.length?Ee():e.map(be).reduce(function(e,t){return e.concat(t)})},Oe=function(e,t,n){void 0===n&&(n=new ke(ge));var r=be(t),o=be(n);return ye(r)&&ye(o)?new ke(function(t){return e(t)?r.request(t)||fe.of():o.request(t)||fe.of()}):new ke(function(t,n){return e(t)?r.request(t,n)||fe.of():o.request(t,n)||fe.of()})},_e=function(e,t){var n=be(e);if(ye(n))return console.warn(new he("You are calling concat on a terminating link, which will have no effect",n)),n;var r=be(t);return ye(r)?new ke(function(e){return n.request(e,function(e){return r.request(e)||fe.of()})||fe.of()}):new ke(function(e,t){return n.request(e,function(e){return r.request(e,t)||fe.of()})||fe.of()})},ke=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,n,r){return void 0===r&&(r=new e(ge)),this.concat(Oe(t,n,r))},e.prototype.concat=function(e){return _e(this,e)},e.prototype.request=function(e,t){throw new Error("request is not implemented")},e.empty=Ee,e.from=we,e.split=Oe,e.execute=Te,e}();function Te(e,t){return e.request(me(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?t.query.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(t.indexOf(o)<0)throw new Error("illegal argument: "+o)}return e}(t))))||fe.of()}var Ie=function(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),Ne=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ne(t,e),t.prototype[Ie]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(fe),Me=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var Pe,Ae=function(e){var t="";return Array.isArray(e.graphQLErrors)&&0!==e.graphQLErrors.length&&e.graphQLErrors.forEach(function(e){var n=e?e.message:"Error message not found.";t+="GraphQL error: "+n+"\n"}),e.networkError&&(t+="Network error: "+e.networkError.message+"\n"),t=t.replace(/\n$/,"")},Re=function(e){function t(n){var r=n.graphQLErrors,o=n.networkError,i=n.errorMessage,a=n.extraInfo,s=e.call(this,i)||this;return s.graphQLErrors=r||[],s.networkError=o||null,s.message=i||Ae(s),s.extraInfo=a,s.__proto__=t.prototype,s}return Me(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(Pe||(Pe={}));var De=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fe=function(){return(Fe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},je=function(e){function t(t){var n=t.scheduler,r=t.options,o=t.shouldSubscribe,i=void 0===o||o,a=e.call(this,function(e){return a.onSubscribe(e)})||this;return a.isCurrentlyPolling=!1,a.isTornDown=!1,a.options=r,a.variables=r.variables||{},a.queryId=n.queryManager.generateQueryId(),a.shouldSubscribe=i,a.scheduler=n,a.queryManager=n.queryManager,a.observers=[],a.subscriptionHandles=[],a}return De(t,e),t.prototype.result=function(){var e=this;return new Promise(function(t,n){var r,o={next:function(n){t(n),e.observers.some(function(e){return e!==o})||e.queryManager.removeQuery(e.queryId),setTimeout(function(){r.unsubscribe()},0)},error:function(e){n(e)}};r=e.subscribe(o)})},t.prototype.currentResult=function(){if(this.isTornDown)return{data:this.lastError?{}:this.lastResult?this.lastResult.data:{},error:this.lastError,loading:!1,networkStatus:ne.error};var e,t,n=this.queryManager.queryStore.get(this.queryId);if(e=n,void 0===(t=this.options.errorPolicy)&&(t="none"),e&&(e.graphQLErrors&&e.graphQLErrors.length>0&&"none"===t||e.networkError))return{data:{},loading:!1,networkStatus:n.networkStatus,error:new Re({graphQLErrors:n.graphQLErrors,networkError:n.networkError})};var r,o=this.queryManager.getCurrentQueryResult(this),i=o.data,a=o.partial,s=!n||n.networkStatus===ne.loading,u="network-only"===this.options.fetchPolicy&&s||a&&"cache-only"!==this.options.fetchPolicy,c={data:i,loading:ce(r=n?n.networkStatus:u?ne.loading:ne.ready),networkStatus:r};return n&&n.graphQLErrors&&"all"===this.options.errorPolicy&&(c.errors=n.graphQLErrors),a||(this.lastResult=Fe({},c,{stale:!1}),this.lastResultSnapshot=ee(this.lastResult)),Fe({},c,{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&ue(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;if("cache-only"===t)return Promise.reject(new Error("cache-only fetchPolicy option should not be used together with query refetch."));ue(this.variables,e)||(this.variables=Object.assign({},this.variables,e)),ue(this.options.variables,this.variables)||(this.options.variables=Object.assign({},this.options.variables,this.variables));var n="network-only"===t||"no-cache"===t,r=Fe({},this.options,{fetchPolicy:n?t:"network-only"});return this.queryManager.fetchQuery(this.queryId,r,Pe.refetch).then(function(e){return e})},t.prototype.fetchMore=function(e){var t,n=this;if(!e.updateQuery)throw new Error("updateQuery option is required. This function defines how to update the query data with the new results.");return Promise.resolve().then(function(){var r=n.queryManager.generateQueryId();return(t=e.query?e:Fe({},n.options,e,{variables:Object.assign({},n.variables,e.variables)})).fetchPolicy="network-only",n.queryManager.fetchQuery(r,t,Pe.normal,n.queryId)}).then(function(r){return n.updateQuery(function(n){return e.updateQuery(n,{fetchMoreResult:r.data,variables:t.variables})}),r})},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(n){e.updateQuery&&t.updateQuery(function(t,r){var o=r.variables;return e.updateQuery(t,{subscriptionData:n,variables:o})})},error:function(t){e.onError?e.onError(t):console.error("Unhandled GraphQL subscription error",t)}});return this.subscriptionHandles.push(n),function(){var e=t.subscriptionHandles.indexOf(n);e>=0&&(t.subscriptionHandles.splice(e,1),n.unsubscribe())}},t.prototype.setOptions=function(e){var t=this.options;this.options=Object.assign({},this.options,e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var n="network-only"!==t.fetchPolicy&&"network-only"===e.fetchPolicy||"cache-only"===t.fetchPolicy&&"cache-only"!==e.fetchPolicy||"standby"===t.fetchPolicy&&"standby"!==e.fetchPolicy||!1;return this.setVariables(this.options.variables,n,e.fetchResults)},t.prototype.setVariables=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),this.isTornDown=!1;var r=e||this.variables;return ue(r,this.variables)&&!t?0!==this.observers.length&&n?this.result():new Promise(function(e){return e()}):(this.variables=r,this.options.variables=r,0===this.observers.length?new Promise(function(e){return e()}):this.queryManager.fetchQuery(this.queryId,Fe({},this.options,{variables:this.variables})).then(function(e){return e}))},t.prototype.updateQuery=function(e){var t=this.queryManager.getQueryWithPreviousResult(this.queryId),n=t.previousResult,r=t.variables,o=t.document,i=ae(function(){return e(n,{variables:r})});i&&(this.queryManager.dataStore.markUpdateQueryResult(o,r,i),this.queryManager.broadcastQueries())},t.prototype.stopPolling=function(){this.isCurrentlyPolling&&(this.scheduler.stopPollingQuery(this.queryId),this.options.pollInterval=void 0,this.isCurrentlyPolling=!1)},t.prototype.startPolling=function(e){if("cache-first"===this.options.fetchPolicy||"cache-only"===this.options.fetchPolicy)throw new Error("Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.");this.isCurrentlyPolling&&(this.scheduler.stopPollingQuery(this.queryId),this.isCurrentlyPolling=!1),this.options.pollInterval=e,this.isCurrentlyPolling=!0,this.scheduler.startPollingQuery(this.options,this.queryId)},t.prototype.onSubscribe=function(e){var t=this;return e._subscription&&e._subscription._observer&&!e._subscription._observer.error&&(e._subscription._observer.error=function(e){console.error("Unhandled error",e.message,e.stack)}),this.observers.push(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),1===this.observers.length&&this.setUpQuery(),function(){t.observers=t.observers.filter(function(t){return t!==e}),0===t.observers.length&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this;if(this.shouldSubscribe&&this.queryManager.addObservableQuery(this.queryId,this),this.options.pollInterval){if("cache-first"===this.options.fetchPolicy||"cache-only"===this.options.fetchPolicy)throw new Error("Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.");this.isCurrentlyPolling=!0,this.scheduler.startPollingQuery(this.options,this.queryId)}var t={next:function(t){e.lastResult=t,e.lastResultSnapshot=ee(t),e.observers.forEach(function(e){return e.next&&e.next(t)})},error:function(t){e.lastError=t,e.observers.forEach(function(e){return e.error&&e.error(t)})}};this.queryManager.startQuery(this.queryId,this.options,this.queryManager.queryListenerForObserver(this.queryId,this.options,t))},t.prototype.tearDownQuery=function(){this.isTornDown=!0,this.isCurrentlyPolling&&(this.scheduler.stopPollingQuery(this.queryId),this.isCurrentlyPolling=!1),this.subscriptionHandles.forEach(function(e){return e.unsubscribe()}),this.subscriptionHandles=[],this.queryManager.removeObservableQuery(this.queryId),this.queryManager.stopQuery(this.queryId),this.observers=[]},t}(Se),Qe=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.inFlightRequestObservables=new Map,t.subscribers=new Map,t}return Qe(t,e),t.prototype.request=function(e,t){var n=this;if(e.getContext().forceFetch)return t(e);var r=e.toKey(),o=function(e){return n.inFlightRequestObservables.delete(e),n.subscribers.get(e)};if(!this.inFlightRequestObservables.get(r)){var i,a=t(e),s=new fe(function(e){var t=n.subscribers.get(r);return t||(t={next:[],error:[],complete:[]}),n.subscribers.set(r,{next:t.next.concat([e.next.bind(e)]),error:t.error.concat([e.error.bind(e)]),complete:t.complete.concat([e.complete.bind(e)])}),i||(i=a.subscribe({next:function(e){var t=o(r);n.subscribers.delete(r),t&&(t.next.forEach(function(t){return t(e)}),t.complete.forEach(function(e){return e()}))},error:function(e){var t=o(r);n.subscribers.delete(r),t&&t.error.forEach(function(t){return t(e)})}})),function(){i&&i.unsubscribe(),n.inFlightRequestObservables.delete(r)}});this.inFlightRequestObservables.set(r,s)}return this.inFlightRequestObservables.get(r)},t}(ke),xe=function(){return(xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ce=function(){function e(e){var t=e.queryManager,n=e.ssrMode;this.inFlightQueries={},this.registeredQueries={},this.intervalQueries={},this.pollingTimers={},this.ssrMode=!1,this.queryManager=t,this.ssrMode=n||!1}return e.prototype.checkInFlight=function(e){var t=this.queryManager.queryStore.get(e);return t&&t.networkStatus!==ne.ready&&t.networkStatus!==ne.error},e.prototype.fetchQuery=function(e,t,n){var r=this;return new Promise(function(o,i){r.queryManager.fetchQuery(e,t,n).then(function(e){o(e)}).catch(function(e){i(e)})})},e.prototype.startPollingQuery=function(e,t,n){if(!e.pollInterval)throw new Error("Attempted to start a polling query without a polling interval.");return this.ssrMode?t:(this.registeredQueries[t]=e,n&&this.queryManager.addQueryListener(t,n),this.addQueryOnInterval(t,e),t)},e.prototype.stopPollingQuery=function(e){delete this.registeredQueries[e]},e.prototype.fetchQueriesOnInterval=function(e){var t=this;this.intervalQueries[e]=this.intervalQueries[e].filter(function(n){if(!t.registeredQueries.hasOwnProperty(n)||t.registeredQueries[n].pollInterval!==e)return!1;if(t.checkInFlight(n))return!0;var r=t.registeredQueries[n],o=xe({},r);return o.fetchPolicy="network-only",t.fetchQuery(n,o,Pe.poll).catch(function(){}),!0}),0===this.intervalQueries[e].length&&(clearInterval(this.pollingTimers[e]),delete this.intervalQueries[e])},e.prototype.addQueryOnInterval=function(e,t){var n=this,r=t.pollInterval;if(!r)throw new Error("A poll interval is required to start polling query with id '"+e+"'.");this.intervalQueries.hasOwnProperty(r.toString())&&this.intervalQueries[r].length>0?this.intervalQueries[r].push(e):(this.intervalQueries[r]=[e],this.pollingTimers[r]=setInterval(function(){n.fetchQueriesOnInterval(r)},r))},e.prototype.registerPollingQuery=function(e){if(!e.pollInterval)throw new Error("Attempted to register a non-polling query with the scheduler.");return new je({scheduler:this,options:e})},e}(),Le=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,n){this.store[e]={mutationString:t,variables:n||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var n=this.store[e];n&&(n.loading=!1,n.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Ve=function(){return(Ve=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},$e=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];if(t&&t.document!==e.document&&N(t.document)!==N(e.document))throw new Error("Internal Error: may not update existing query string in store");var n,r=!1,o=null;e.storePreviousVariables&&t&&t.networkStatus!==ne.loading&&(ue(t.variables,e.variables)||(r=!0,o=t.variables)),n=r?ne.setVariables:e.isPoll?ne.poll:e.isRefetch?ne.refetch:ne.loading;var i=[];t&&t.graphQLErrors&&(i=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:o,networkError:null,graphQLErrors:i,networkStatus:n,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=ne.fetchMore)},e.prototype.markQueryResult=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=t.errors&&t.errors.length?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=ne.ready,"string"==typeof n&&this.store[n]&&(this.store[n].networkStatus=ne.ready))},e.prototype.markQueryError=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=ne.error,"string"==typeof n&&this.markQueryResultClient(n,!0))},e.prototype.markQueryResultClient=function(e,t){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].previousVariables=null,this.store[e].networkStatus=t?ne.ready:ne.loading)},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;this.store=Object.keys(this.store).filter(function(t){return e.indexOf(t)>-1}).reduce(function(e,n){return e[n]=Ve({},t.store[n],{networkStatus:ne.loading}),e},{})},e}(),Be=function(){return(Be=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ue=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},Ke=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ge=function(){function e(e){var t=e.link,n=e.queryDeduplication,r=void 0!==n&&n,o=e.store,i=e.onBroadcast,a=void 0===i?function(){}:i,s=e.ssrMode,u=void 0!==s&&s;this.mutationStore=new Le,this.queryStore=new $e,this.idCounter=1,this.queries=new Map,this.fetchQueryPromises=new Map,this.queryIdsByName={},this.link=t,this.deduplicator=ke.from([new qe,t]),this.queryDeduplication=r,this.dataStore=o,this.onBroadcast=a,this.scheduler=new Ce({queryManager:this,ssrMode:u})}return e.prototype.mutate=function(e){var t=this,n=e.mutation,r=e.variables,o=e.optimisticResponse,i=e.updateQueries,a=e.refetchQueries,s=void 0===a?[]:a,u=e.awaitRefetchQueries,c=void 0!==u&&u,l=e.update,f=e.errorPolicy,d=void 0===f?"none":f,p=e.fetchPolicy,h=e.context,y=void 0===h?{}:h;if(!n)throw new Error("mutation option is required. You must specify your GraphQL document in the mutation option.");if(p&&"no-cache"!==p)throw new Error("fetchPolicy for mutations currently only supports the 'no-cache' policy");var v=this.generateQueryId(),m=this.dataStore.getCache();n=m.transformDocument(n),r=Y({},X(function(e){z(e);var t=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})[0];if(!t)throw new Error("Must contain a mutation definition.");return t}(n)),r);var g=N(n);this.setQuery(v,function(){return{document:n}});var b=function(){var e={};return i&&Object.keys(i).forEach(function(n){return(t.queryIdsByName[n]||[]).forEach(function(r){e[r]={updater:i[n],query:t.queryStore.get(r)}})}),e};return this.mutationStore.initMutation(v,g,r),this.dataStore.markMutationInit({mutationId:v,document:n,variables:r||{},updateQueries:b(),update:l,optimisticResponse:o}),this.broadcastQueries(),new Promise(function(e,i){var a,u,f=t.buildOperationForLink(n,r,Be({},y,{optimisticResponse:o}));Te(t.link,f).subscribe({next:function(e){se(e)&&"none"===d?u=new Re({graphQLErrors:e.errors}):(t.mutationStore.markMutationResult(v),"no-cache"!==p&&t.dataStore.markMutationResult({mutationId:v,result:e,document:n,variables:r||{},updateQueries:b(),update:l}),a=e)},error:function(e){t.mutationStore.markMutationError(v,e),t.dataStore.markMutationComplete({mutationId:v,optimisticResponse:o}),t.broadcastQueries(),t.setQuery(v,function(){return{document:void 0}}),i(new Re({networkError:e}))},complete:function(){return Ue(t,void 0,void 0,function(){var e,t,n,r,i,l;return Ke(this,function(f){switch(f.label){case 0:if(u&&this.mutationStore.markMutationError(v,u),this.dataStore.markMutationComplete({mutationId:v,optimisticResponse:o}),this.broadcastQueries(),u)throw u;for("function"==typeof s&&(s=s(a)),e=[],t=0,n=s;t<n.length;t++)"string"!=typeof(r=n[t])?(l={query:r.query,variables:r.variables,fetchPolicy:"network-only"},r.context&&(l.context=r.context),e.push(this.query(l))):(i=this.refetchQueryByName(r))&&e.push(i);return c?[4,Promise.all(e)]:[3,2];case 1:f.sent(),f.label=2;case 2:return this.setQuery(v,function(){return{document:void 0}}),"ignore"===d&&a&&se(a)&&delete a.errors,[2,a]}})}).then(e,i)}})})},e.prototype.fetchQuery=function(e,t,n,r){var o,i=this,a=t.variables,s=void 0===a?{}:a,u=t.metadata,c=void 0===u?null:u,l=t.fetchPolicy,f=void 0===l?"cache-first":l,d=this.dataStore.getCache().transformDocument(t.query),p="network-only"===f||"no-cache"===f;if(n!==Pe.refetch&&"network-only"!==f&&"no-cache"!==f){var h=this.dataStore.getCache().diff({query:d,variables:s,returnPartialData:!0,optimistic:!1}),y=h.complete,v=h.result;p=!y||"cache-and-network"===f,o=v}var m,g=p&&"cache-only"!==f&&"standby"!==f;m=["live"],G(d).some(function(e){return m.indexOf(e)>-1})&&(g=!0);var b=this.generateRequestId(),E=this.updateQueryWatch(e,d,t);if(this.setQuery(e,function(){return{document:d,lastRequestId:b,invalidated:!0,cancel:E}}),this.invalidate(!0,r),this.queryStore.initQuery({queryId:e,document:d,storePreviousVariables:g,variables:s,isPoll:n===Pe.poll,isRefetch:n===Pe.refetch,metadata:c,fetchMoreForQueryId:r}),this.broadcastQueries(),(!g||"cache-and-network"===f)&&(this.queryStore.markQueryResultClient(e,!g),this.invalidate(!0,e,r),this.broadcastQueries()),g){var w=this.fetchRequest({requestId:b,queryId:e,document:d,options:t,fetchMoreForQueryId:r}).catch(function(t){if(t.hasOwnProperty("graphQLErrors"))throw t;var n=i.getQuery(e).lastRequestId;throw b>=(n||1)&&(i.queryStore.markQueryError(e,t,r),i.invalidate(!0,e,r),i.broadcastQueries()),i.removeFetchQueryPromise(b),new Re({networkError:t})});if("cache-and-network"!==f)return w;w.catch(function(){})}return Promise.resolve({data:o})},e.prototype.queryListenerForObserver=function(e,t,n){var r=this,o=!1;return function(i,a){if(r.invalidate(!1,e),i){var s=r.getQuery(e).observableQuery,u=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==u){var c=s?s.options.errorPolicy:t.errorPolicy,l=s?s.getLastResult():null,f=s?s.getLastError():null,d=!a&&null!=i.previousVariables||"cache-only"===u||"cache-and-network"===u,p=Boolean(l&&i.networkStatus!==l.networkStatus),h=c&&(f&&f.graphQLErrors)!==i.graphQLErrors&&"none"!==c;if(!ce(i.networkStatus)||p&&t.notifyOnNetworkStatusChange||d){if((!c||"none"===c)&&i.graphQLErrors&&i.graphQLErrors.length>0||i.networkError){var y=new Re({graphQLErrors:i.graphQLErrors,networkError:i.networkError});if(o=!0,n.error)try{n.error(y)}catch(e){setTimeout(function(){throw e},0)}else setTimeout(function(){throw y},0),ie()||console.info("An unhandled error was thrown because no error handler is registered for the query "+N(i.document));return}try{var v=void 0,m=void 0;if(a)"no-cache"!==u&&r.setQuery(e,function(){return{newData:null}}),v=a.result,m=!a.complete||!1;else if(l&&l.data&&!h)v=l.data,m=!1;else{var g=r.getQuery(e).document,b=r.dataStore.getCache().diff({query:g,variables:i.previousVariables||i.variables,optimistic:!0});v=b.result,m=!b.complete}var E=void 0;if(E=m&&"cache-only"!==u?{data:l&&l.data,loading:ce(i.networkStatus),networkStatus:i.networkStatus,stale:!0}:{data:v,loading:ce(i.networkStatus),networkStatus:i.networkStatus,stale:!1},"all"===c&&i.graphQLErrors&&i.graphQLErrors.length>0&&(E.errors=i.graphQLErrors),n.next&&(o||!s||s.isDifferentFromLastResult(E)))try{n.next(E)}catch(e){setTimeout(function(){throw e},0)}o=!1}catch(e){return o=!0,void(n.error&&n.error(new Re({networkError:e})))}}}}}},e.prototype.watchQuery=function(e,t){if(void 0===t&&(t=!0),"standby"===e.fetchPolicy)throw new Error('client.watchQuery cannot be called with fetchPolicy set to "standby"');var n=H(e.query);if(n.variableDefinitions&&n.variableDefinitions.length){var r=X(n);e.variables=Y({},r,e.variables)}void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var o=Be({},e);return new je({scheduler:this.scheduler,options:o,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;if(!e.query)throw new Error("query option is required. You must specify your GraphQL document in the query option.");if("Document"!==e.query.kind)throw new Error('You must wrap the query string in a "gql" tag.');if(e.returnPartialData)throw new Error("returnPartialData option only supported on watchQuery.");if(e.pollInterval)throw new Error("pollInterval option only supported on watchQuery.");var n=this.idCounter;return new Promise(function(r,o){return t.addFetchQueryPromise(n,r,o),t.watchQuery(e,!1).result().then(function(e){t.removeFetchQueryPromise(n),r(e)}).catch(function(e){t.removeFetchQueryPromise(n),o(e)})})},e.prototype.generateQueryId=function(){var e=this.idCounter.toString();return this.idCounter++,e},e.prototype.stopQueryInStore=function(e){this.queryStore.stopQuery(e),this.invalidate(!0,e),this.broadcastQueries()},e.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){var n=e.listeners;return{listeners:(void 0===n?[]:n).concat([t]),invalidate:!1}})},e.prototype.updateQueryWatch=function(e,t,n){var r=this,o=this.getQuery(e).cancel;o&&o();return this.dataStore.getCache().watch({query:t,variables:n.variables,optimistic:!0,previousResult:function(){var t=null,n=r.getQuery(e).observableQuery;if(n){var o=n.getLastResult();o&&(t=o.data)}return t},callback:function(t){r.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},e.prototype.addFetchQueryPromise=function(e,t,n){this.fetchQueryPromises.set(e.toString(),{resolve:t,reject:n})},e.prototype.removeFetchQueryPromise=function(e){this.fetchQueryPromises.delete(e.toString())},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}});var n=H(t.options.query);if(n.name&&n.name.value){var r=n.name.value;this.queryIdsByName[r]=this.queryIdsByName[r]||[],this.queryIdsByName[r].push(t.queryId)}},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e),n=t.observableQuery,r=t.cancel;if(r&&r(),n){var o=H(n.options.query),i=o.name?o.name.value:null;this.setQuery(e,function(){return{observableQuery:null}}),i&&(this.queryIdsByName[i]=this.queryIdsByName[i].filter(function(e){return!(n.queryId===e)}))}},e.prototype.clearStore=function(){this.fetchQueryPromises.forEach(function(e){(0,e.reject)(new Error("Store reset while query was in flight(not completed in link chain)"))});var e=[];return this.queries.forEach(function(t,n){t.observableQuery&&e.push(n)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},e.prototype.reFetchObservableQueries=function(e){var t=this.getObservableQueryPromises(e);return this.broadcastQueries(),Promise.all(t)},e.prototype.startQuery=function(e,t,n){return this.addQueryListener(e,n),this.fetchQuery(e,t).catch(function(){}),e},e.prototype.startGraphQLSubscription=function(e){var t,n=this,r=e.query,o=!(e.fetchPolicy&&"no-cache"===e.fetchPolicy),i=this.dataStore.getCache().transformDocument(r),a=Y({},X(J(r)),e.variables),s=[];return new Se(function(e){if(s.push(e),1===s.length){var r={next:function(e){o&&(n.dataStore.markSubscriptionResult(e,i,a),n.broadcastQueries()),s.forEach(function(t){se(e)&&t.error?t.error(new Re({graphQLErrors:e.errors})):t.next&&t.next(e)})},error:function(e){s.forEach(function(t){t.error&&t.error(e)})}},u=n.buildOperationForLink(i,a);t=Te(n.link,u).subscribe(r)}return function(){0===(s=s.filter(function(t){return t!==e})).length&&t&&t.unsubscribe()}})},e.prototype.stopQuery=function(e){this.stopQueryInStore(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var n=e.options,r=n.variables,o=n.query,i=e.getLastResult(),a=this.getQuery(e.queryId).newData;if(a&&a.complete)return{data:a.result,partial:!1};try{return{data:this.dataStore.getCache().read({query:o,variables:r,previousResult:i?i.data:void 0,optimistic:t}),partial:!1}}catch(e){return{data:{},partial:!0}}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var n=this.getQuery(e).observableQuery;if(!n)throw new Error("ObservableQuery with this id doesn't exist: "+e);t=n}else t=e;var r=t.options,o=r.variables,i=r.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:o,document:i}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,n){t.invalidated&&t.listeners&&t.listeners.filter(function(e){return!!e}).forEach(function(r){r(e.queryStore.get(n),t.newData)})})},e.prototype.getObservableQueryPromises=function(e){var t=this,n=[];return this.queries.forEach(function(r,o){var i=r.observableQuery;if(i){var a=i.options.fetchPolicy;i.resetLastResults(),"cache-only"===a||!e&&"standby"===a||n.push(i.refetch()),t.setQuery(o,function(){return{newData:null}}),t.invalidate(!0,o)}}),n},e.prototype.fetchRequest=function(e){var t,n,r=this,o=e.requestId,i=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.context,f=s.errorPolicy,d=void 0===f?"none":f,p=s.fetchPolicy,h=this.buildOperationForLink(a,c,Be({},l,{forceFetch:!this.queryDeduplication}));return new Promise(function(e,s){r.addFetchQueryPromise(o,e,s);var l=Te(r.deduplicator,h).subscribe({next:function(e){var l=r.getQuery(i).lastRequestId;if(o>=(l||1)){if("no-cache"!==p)try{r.dataStore.markQueryResult(e,a,c,u,"ignore"===d||"all"===d)}catch(e){return void s(e)}else r.setQuery(i,function(){return{newData:{result:e.data,complete:!0}}});r.queryStore.markQueryResult(i,e,u),r.invalidate(!0,i,u),r.broadcastQueries()}if(e.errors&&"none"===d)s(new Re({graphQLErrors:e.errors}));else if("all"===d&&(n=e.errors),u||"no-cache"===p)t=e.data;else try{t=r.dataStore.getCache().read({variables:c,query:a,optimistic:!1})}catch(e){}},error:function(e){r.removeFetchQueryPromise(o),r.setQuery(i,function(e){return{subscriptions:e.subscriptions.filter(function(e){return e!==l})}}),s(e)},complete:function(){r.removeFetchQueryPromise(o),r.setQuery(i,function(e){return{subscriptions:e.subscriptions.filter(function(e){return e!==l})}}),e({data:t,errors:n,loading:!1,networkStatus:ne.ready,stale:!1})}});r.setQuery(i,function(e){return{subscriptions:e.subscriptions.concat([l])}})})},e.prototype.refetchQueryByName=function(e){var t=this,n=this.queryIdsByName[e];if(void 0!==n)return Promise.all(n.map(function(e){return t.getQuery(e).observableQuery}).filter(function(e){return!!e}).map(function(e){return e.refetch()}))},e.prototype.generateRequestId=function(){var e=this.idCounter;return this.idCounter++,e},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:[],invalidated:!1,document:null,newData:null,lastRequestId:null,observableQuery:null,subscriptions:[]}},e.prototype.setQuery=function(e,t){var n=this.getQuery(e),r=Be({},n,t(n));this.queries.set(e,r)},e.prototype.invalidate=function(e,t,n){t&&this.setQuery(t,function(){return{invalidated:e}}),n&&this.setQuery(n,function(){return{invalidated:e}})},e.prototype.buildOperationForLink=function(e,t,n){var r=this.dataStore.getCache();return{query:r.transformForLink?r.transformForLink(e):e,variables:t,operationName:W(e)||void 0,context:Be({},n,{cache:r,getCacheKey:function(e){if(r.config)return r.config.dataIdFromObject(e);throw new Error("To use context.getCacheKey, you need to use a cache that has a configurable dataIdFromObject, like apollo-cache-inmemory.")}})}},e}(),Ye=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,n,r,o){void 0===o&&(o=!1);var i=!se(e);o&&se(e)&&e.data&&(i=!0),!r&&i&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:n})},e.prototype.markSubscriptionResult=function(e,t,n){se(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:n})},e.prototype.markMutationInit=function(e){var t=this;if(e.optimisticResponse){var n;n="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse;this.cache.recordOptimisticTransaction(function(r){var o=t.cache;t.cache=r;try{t.markMutationResult({mutationId:e.mutationId,result:{data:n},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{t.cache=o}},e.mutationId)}},e.prototype.markMutationResult=function(e){var t=this;if(!se(e.result)){var n=[];n.push({result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),e.updateQueries&&Object.keys(e.updateQueries).filter(function(t){return e.updateQueries[t]}).forEach(function(r){var o=e.updateQueries[r],i=o.query,a=o.updater,s=t.cache.diff({query:i.document,variables:i.variables,returnPartialData:!0,optimistic:!1}),u=s.result;if(s.complete){var c=ae(function(){return a(u,{mutationResult:e.result,queryName:W(i.document)||void 0,queryVariables:i.variables})});c&&n.push({result:c,dataId:"ROOT_QUERY",query:i.document,variables:i.variables})}}),this.cache.performTransaction(function(e){n.forEach(function(t){return e.write(t)})});var r=e.update;r&&this.cache.performTransaction(function(t){ae(function(){return r(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,n){this.cache.write({result:n,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),ze="2.4.6",Je=function(){return(Je=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},We=!1,He=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[];var n=e.link,r=e.cache,o=e.ssrMode,i=void 0!==o&&o,a=e.ssrForceFetchDelay,s=void 0===a?0:a,u=e.connectToDevTools,c=e.queryDeduplication,l=void 0===c||c,f=e.defaultOptions;if(!n||!r)throw new Error("\n        In order to initialize Apollo Client, you must specify link & cache properties on the config object.\n        This is part of the required upgrade when migrating from Apollo Client 1.0 to Apollo Client 2.0.\n        For more information, please visit:\n          https://www.apollographql.com/docs/react/basics/setup.html\n        to help you get started.\n      ");var d=new Map,p=new ke(function(e,t){var n,r=d.get(e.query);return r||(z(n=e.query),r=te([re],n),d.set(e.query,r),d.set(r,r)),e.query=r,t(e)});this.link=p.concat(n),this.cache=r,this.store=new Ye(r),this.disableNetworkFetches=i||s>0,this.queryDeduplication=l,this.ssrMode=i,this.defaultOptions=f||{},s&&setTimeout(function(){return t.disableNetworkFetches=!1},s),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);var h=!ie()&&"undefined"!=typeof window&&!window.__APOLLO_CLIENT__;(void 0===u?h:u&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),We||ie()||(We=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&void 0===window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("Chrome")>-1&&console.debug("Download the Apollo DevTools for a better development experience: https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm")),this.version=ze}return e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Je({},this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Je({},e,{fetchPolicy:"cache-first"})),this.initQueryManager().watchQuery(e)},e.prototype.query=function(e){if(this.defaultOptions.query&&(e=Je({},this.defaultOptions.query,e)),"cache-and-network"===e.fetchPolicy)throw new Error("cache-and-network fetchPolicy can only be used with watchQuery");return this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Je({},e,{fetchPolicy:"cache-first"})),this.initQueryManager().query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Je({},this.defaultOptions.mutate,e)),this.initQueryManager().mutate(e)},e.prototype.subscribe=function(e){return this.initQueryManager().startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.initProxy().readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.initProxy().readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.initProxy().writeQuery(e);return this.initQueryManager().broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.initProxy().writeFragment(e);return this.initQueryManager().broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.initProxy().writeData(e);return this.initQueryManager().broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Te(this.link,e)},e.prototype.initQueryManager=function(){var e=this;return this.queryManager||(this.queryManager=new Ge({link:this.link,store:this.store,queryDeduplication:this.queryDeduplication,ssrMode:this.ssrMode,onBroadcast:function(){e.devToolsHookCb&&e.devToolsHookCb({action:{},state:{queries:e.queryManager?e.queryManager.queryStore.getStore():{},mutations:e.queryManager?e.queryManager.mutationStore.getStore():{}},dataWithOptimisticResults:e.cache.extract(!0)})}})),this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager?e.queryManager.clearStore():Promise.resolve(null)}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.queryManager&&e.queryManager.reFetchObservableQueries?e.queryManager.reFetchObservableQueries():Promise.resolve(null)})},e.prototype.clearStore=function(){var e=this.queryManager;return Promise.resolve().then(function(){return e?e.clearStore():Promise.resolve(null)})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager?this.queryManager.reFetchObservableQueries(e):Promise.resolve(null)},e.prototype.extract=function(e){return this.initProxy().extract(e)},e.prototype.restore=function(e){return this.initProxy().restore(e)},e.prototype.initProxy=function(){return this.proxy||(this.initQueryManager(),this.proxy=this.cache),this.proxy},e}(),Xe="Invariant Violation",Ze=Object.setPrototypeOf,et=void 0===Ze?function(e,t){return e.__proto__=t,e}:Ze,tt=function(e){function t(n){void 0===n&&(n=Xe);var r=e.call(this,n)||this;return r.framesToPop=1,r.name=Xe,et(r,t.prototype),r}return n(t,e),t}(Error);function nt(e,t){if(!e)throw new tt(t)}function rt(e,t,n,r){if(function(e){return"IntValue"===e.kind}(n)||function(e){return"FloatValue"===e.kind}(n))e[t.value]=Number(n.value);else if(function(e){return"BooleanValue"===e.kind}(n)||function(e){return"StringValue"===e.kind}(n))e[t.value]=n.value;else if(function(e){return"ObjectValue"===e.kind}(n)){var o={};n.fields.map(function(e){return rt(o,e.name,e.value,r)}),e[t.value]=o}else if(function(e){return"Variable"===e.kind}(n)){var i=(r||{})[n.name.value];e[t.value]=i}else if(function(e){return"ListValue"===e.kind}(n))e[t.value]=n.values.map(function(e){var n={};return rt(n,t,e,r),n[t.value]});else if(function(e){return"EnumValue"===e.kind}(n))e[t.value]=n.value;else{if(!function(e){return"NullValue"===e.kind}(n))throw"production"===process.env.NODE_ENV?new tt:new tt('The inline argument "'+t.value+'" of kind "'+n.kind+'"is not supported. Use variables instead of inline arguments to overcome this limitation.');e[t.value]=null}}!function(e){e.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.warn.apply(console,e)},e.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return console.error.apply(console,e)}}(nt||(nt={}));var ot=["connection","include","skip","client","rest","export"];function it(e,t,n){if(n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var o=t,i={};return r.forEach(function(e){i[e]=o[e]}),n.connection.key+"("+JSON.stringify(i)+")"}return n.connection.key}var a=e;if(t){var s=K(t);a+="("+s+")"}return n&&Object.keys(n).forEach(function(e){-1===ot.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@"+e+"("+JSON.stringify(n[e])+")":a+="@"+e)}),a}function at(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach(function(e){var r=e.name,o=e.value;return rt(n,r,o,t)}),n}return null}function st(e){return e.alias?e.alias.value:e.name.value}function ut(e){return"Field"===e.kind}function ct(e){return"InlineFragment"===e.kind}function lt(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function ft(e,t){return void 0===t&&(t=!1),r({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function dt(e,t){if(void 0===t&&(t={}),!e.directives)return!0;var n=!0;return e.directives.forEach(function(e){if("skip"===e.name.value||"include"===e.name.value){var r=e.arguments||[],o=e.name.value;"production"===process.env.NODE_ENV?nt(1===r.length):nt(1===r.length,"Incorrect number of arguments for the @"+o+" directive.");var i=r[0];"production"===process.env.NODE_ENV?nt(i.name&&"if"===i.name.value):nt(i.name&&"if"===i.name.value,"Invalid argument for the @"+o+" directive.");var a=r[0].value,s=!1;a&&"BooleanValue"===a.kind?s=a.value:("production"===process.env.NODE_ENV?nt("Variable"===a.kind):nt("Variable"===a.kind,"Argument for the @"+o+" directive must be a variable or a boolean value."),s=t[a.name.value],"production"===process.env.NODE_ENV?nt(void 0!==s):nt(void 0!==s,"Invalid variable referenced in @"+o+" directive.")),"skip"===o&&(s=!s),s||(n=!1)}}),n}function pt(e,t){var n=t,o=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw"production"===process.env.NODE_ENV?new tt:new tt("Found a "+e.operation+" operation"+(e.name?" named '"+e.name.value+"'":"")+". No operations are allowed when using a fragment as a query. Only fragments are allowed.");"FragmentDefinition"===e.kind&&o.push(e)}),void 0===n&&("production"===process.env.NODE_ENV?nt(1===o.length):nt(1===o.length,"Found "+o.length+" fragments. `fragmentName` must be provided when there is not exactly 1 fragment."),n=o[0].name.value),r({},e,{definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}].concat(e.definitions)})}function ht(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach(function(t){void 0!==t&&null!==t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function yt(e){"production"===process.env.NODE_ENV?nt(e&&"Document"===e.kind):nt(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql');var t=e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw"production"===process.env.NODE_ENV?new tt:new tt('Schema type definitions not allowed in queries. Found: "'+e.kind+'"');return e});return"production"===process.env.NODE_ENV?nt(t.length<=1):nt(t.length<=1,"Ambiguous GraphQL document: contains "+t.length+" operations"),e}function vt(e){return yt(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function mt(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function gt(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function bt(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,n=e.defaultValue,r={};return rt(r,t.name,n),r});return ht.apply(void 0,[{}].concat(t))}return{}}var Et={kind:"Field",name:{kind:"Name",value:"__typename"}};function wt(e){return("undefined"!=typeof process&&process.env.NODE_ENV?process.env.NODE_ENV:"development")===e}function Ot(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(null!=e&&"object"==typeof e&&null!=t&&"object"==typeof t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!Ot(e[n],t[n]))return!1}for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!Object.prototype.hasOwnProperty.call(e,n))return!1;return!0}return!1}var _t=Object.prototype.hasOwnProperty;function kt(e){return null!==e&&"object"==typeof e}function Tt(e,t,n){return kt(t)&&kt(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=It(e,n)),Object.keys(t).forEach(function(r){var o=t[r];if(_t.call(e,r)){var i=e[r];o!==i&&(e[r]=Tt(It(i,n),o,n))}else e[r]=o}),e):t}function It(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):r({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}function Nt(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||void 0===e||null===e)return null;if(Array.isArray(e))return Nt(e[0]);var t=[];return Object.keys(e).forEach(function(n){var r={kind:"Field",name:{kind:"Name",value:n},selectionSet:Nt(e[n])||void 0};t.push(r)}),{kind:"SelectionSet",selections:t}}var St={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},Mt=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:pt(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:pt(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,n,r=e.id,o=e.data;if(void 0!==r){var i=null;try{i=this.read({rootId:r,optimistic:!1,query:St})}catch(e){}var a=i&&i.__typename||"__ClientData",s=Object.assign({__typename:a},o);this.writeFragment({id:r,fragment:(t=s,n=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:n||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:Nt(t)}]}),data:s})}else this.writeQuery({query:function(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:Nt(e)}]}}(o),data:o})},e}();function Pt(e){this.map=new Map,this.newest=null,this.oldest=null,this.max=e&&e.max,this.dispose=e&&e.dispose}var At=Pt,Rt=Pt.prototype;function Dt(e,t){var n=e.map.get(t);if(n&&n!==e.newest){var r=n.older,o=n.newer;o&&(o.older=r),r&&(r.newer=o),n.older=e.newest,n.older.newer=n,n.newer=null,e.newest=n,n===e.oldest&&(e.oldest=o)}return n}Rt.has=function(e){return this.map.has(e)},Rt.get=function(e){var t=Dt(this,e);return t&&t.value},Rt.set=function(e,t){var n=Dt(this,e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},Rt.clean=function(){if("number"==typeof this.max)for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},Rt.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),"function"==typeof this.dispose&&this.dispose(e,t.value),!0)};var Ft={Cache:At},jt=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"function"==typeof Symbol.for,r=n?Symbol.for("immutable-tuple"):"@@__IMMUTABLE_TUPLE__@@",o=n?Symbol.for("immutable-tuple-root"):"@@__IMMUTABLE_TUPLE_ROOT__@@";function i(e,t,n,r){return Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!1,configurable:!1}),n}var a=Object.freeze||function(e){return e};function s(e){switch(typeof e){case"object":if(null===e)return!1;case"function":return!0;default:return!1}}var u=function(){this._weakMap=null,this._strongMap=null,this.data=null};u.prototype.get=function(e){var t=this._getMap(e,!1);if(t)return t.get(e)},u.prototype.set=function(e,t){return this._getMap(e,!0).set(e,t),t},u.prototype._getMap=function(e,t){return t?s(e)?this._weakMap||(this._weakMap=new WeakMap):this._strongMap||(this._strongMap=new Map):s(e)?this._weakMap:this._strongMap};var c=Array[o]||i(Array,o,new u,!1);function l(){return f(arguments)}function f(e){for(var t=c,n=e.length,r=0;r<n;++r){var o=e[r];t=t.get(o)||t.set(o,new u)}return t.data||(t.data=Object.create(null))}function d(){var e=arguments,t=l.apply(null,arguments);if(t.tuple)return t.tuple;for(var n=Object.create(d.prototype),r=arguments.length,o=0;o<r;++o)n[o]=e[o];return i(n,"length",r,!1),a(t.tuple=n)}function p(e){return!(!e||!0!==e[r])}function h(e){for(var t=[],n=e.length;n--;)t[n]=e[n];return t}i(d.prototype,r,!0,!1),d.isTuple=p,function(e){function t(t,n){var r=Object.getOwnPropertyDescriptor(Array.prototype,t);e(t,r,!!n)}t("every"),t("filter"),t("find"),t("findIndex"),t("forEach"),t("includes"),t("indexOf"),t("join"),t("lastIndexOf"),t("map"),t("reduce"),t("reduceRight"),t("slice"),t("some"),t("toLocaleString"),t("toString"),t("reverse",!0),t("sort",!0),t(n&&Symbol.iterator||"@@iterator")}(function(e,t,n){var r=t&&t.value;"function"==typeof r&&(t.value=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var o=r.apply(n?h(this):this,e);return Array.isArray(o)?d.apply(void 0,o):o},Object.defineProperty(d.prototype,e,t))});var y=Array.prototype.concat;d.prototype.concat=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return d.apply(void 0,y.apply(h(this),e.map(function(e){return p(e)?h(e):e})))},t.default=d,t.tuple=d,t.lookup=l,t.lookupArray=f});s(jt);jt.tuple,jt.lookup,jt.lookupArray;var Qt=u(function(e,t){var n=new function(){};function r(){return n}try{var o=e["eriuqer".split("").reverse().join("")]("fibers");r=function(){return o.current||n}}catch(e){}t.get=function(){var e=r();return e._optimism_local||(e._optimism_local=Object.create(null))}}),qt=(Qt.get,u(function(e,t){var n=Qt.get,r=Object.create(null),o=[],i=[];function a(e,t){if(!e)throw new Error(t||"assertion failure")}function s(e,t,n){this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,u(this,e,t,n),++s.count}function u(e,t,n,o){e.fn=t,e.key=n,e.args=o,e.value=r,e.dirty=!0,e.subscribe=null,e.unsubscribe=null,e.recomputing=!1,e.reportOrphan=null}t.POOL_TARGET_SIZE=100,s.count=0,s.acquire=function(e,t,n){var r=i.pop();return r?(u(r,e,t,n),r):new s(e,t,n)},t.Entry=s;var c=s.prototype;function l(e){var t=e.reportOrphan;return"function"==typeof t&&0===e.parents.size&&!0===t(e)}function f(e){e.parents.forEach(function(t){h(t,e)})}function d(e){e.parents.forEach(function(t){y(t,e)})}function p(e){return e.dirty||e.dirtyChildren&&e.dirtyChildren.size}function h(e,t){if(a(e.childValues.has(t)),a(p(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=o.pop()||new Set;e.dirtyChildren.add(t),f(e)}function y(e,t){var n=e.childValues;a(n.has(t)),a(!p(t));var o=n.get(t);o===r?n.set(t,t.value):o!==t.value&&e.setDirty(),v(e,t),p(e)||d(e)}function v(e,n){var r=e.dirtyChildren;r&&(r.delete(n),0===r.size&&(o.length<t.POOL_TARGET_SIZE&&o.push(r),e.dirtyChildren=null))}function m(e){a(!e.recomputing,"already recomputing"),e.recomputing=!0;var t=b(e),r=n(),o=r.currentParentEntry;r.currentParentEntry=e;var i=!0;try{e.value=e.fn.apply(null,e.args),i=!1}finally{e.recomputing=!1,a(r.currentParentEntry===e),r.currentParentEntry=o,i||!function(e){if("function"==typeof e.subscribe)try{w(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)?e.setDirty():function(e){e.dirty=!1,p(e)||d(e)}(e)}return t.forEach(l),e.value}c.recompute=function(){if(function(e){var t=n().currentParentEntry;if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,r),p(e)?h(t,e):y(t,e),t}(this)||!l(this))return function e(t){if(t.dirty)return m(t);if(p(t)&&(t.dirtyChildren.forEach(function(n){a(t.childValues.has(n));try{e(n)}catch(e){t.setDirty()}}),t.dirty))return m(t);a(t.value!==r);return t.value}(this)},c.setDirty=function(){this.dirty||(this.dirty=!0,this.value=r,f(this),w(this))},c.dispose=function(){var e=this;b(e).forEach(l),w(e),e.parents.forEach(function(t){t.setDirty(),E(t,e)}),function(e){a(0===e.parents.size),a(0===e.childValues.size),a(null===e.dirtyChildren),i.length<t.POOL_TARGET_SIZE&&i.push(e)}(e)};var g=[];function b(e){var t=g;return e.childValues.size>0&&(t=[],e.childValues.forEach(function(n,r){E(e,r),t.push(r)})),a(null===e.dirtyChildren),t}function E(e,t){t.parents.delete(e),e.childValues.delete(t),v(e,t)}function w(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=null,t())}})),xt=(qt.POOL_TARGET_SIZE,qt.Entry,Ft.Cache),Ct=jt.tuple,Lt=qt.Entry,Vt=Qt.get;var $t=function(e,t){var n=!!(t=function(e){return"function"!=typeof(e=e||Object.create(null)).makeCacheKey&&(e.makeCacheKey=Ct),"number"!=typeof e.max&&(e.max=Math.pow(2,16)),e}(t)).disposable,r=new xt({max:t.max,dispose:function(e,t){t.dispose()}});function o(e){if(n)return r.delete(e.key),!0}function i(){if(!n||Vt().currentParentEntry){var i=t.makeCacheKey.apply(null,arguments);if(!i)return e.apply(null,arguments);for(var a=[],s=arguments.length;s--;)a[s]=arguments[s];var u=r.get(i);u?u.args=a:(r.set(i,u=Lt.acquire(e,i,a)),u.subscribe=t.subscribe,n&&(u.reportOrphan=o));var c=u.recompute();return r.set(i,u),0===u.parents.size&&r.clean(),n?void 0:c}}return i.dirty=function(){var e=t.makeCacheKey.apply(null,arguments);e&&r.has(e)&&r.get(e).setDirty()},i},Bt=new Map;if(Bt.set(1,2)!==Bt){var Ut=Bt.set;Map.prototype.set=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ut.apply(this,e),this}}var Kt=new Set;if(Kt.add(3)!==Kt){var Gt=Kt.add;Set.prototype.add=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Gt.apply(this,e),this}}var Yt={};"function"==typeof Object.freeze&&Object.freeze(Yt);try{Bt.set(Yt,Yt).delete(Yt)}catch(Ze){var zt=function(e){return e&&function(t){try{Bt.set(t,t).delete(t)}finally{return e.call(Object,t)}}};Object.freeze=zt(Object.freeze),Object.seal=zt(Object.seal),Object.preventExtensions=zt(Object.preventExtensions)}var Jt=!1;function Wt(){var e=!Jt;return!0!==wt("test")&&(Jt=!0),e}var Ht=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,n){var r=n.store.get(e.id);return!r&&"ROOT_QUERY"===e.id||!!r&&(r.__typename?r.__typename===t||(Wt()&&("production"===process.env.NODE_ENV||nt.error("You are using the simple (heuristic) fragment matcher, but your queries contain union or interface types. Apollo Client will not be able to accurately map fragments. To make this error go away, use the `IntrospectionFragmentMatcher` as described in the docs: https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher")),"heuristic"):(Wt()&&("production"===process.env.NODE_ENV||nt.warn("You're using fragments in your queries, but either don't have the addTypename:\n  true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n   Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n   can accurately match fragments."),"production"===process.env.NODE_ENV||nt.warn("Could not find __typename on Fragment ",t,r),"production"===process.env.NODE_ENV||nt.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.")),"heuristic"))},e}(),Xt=function(){function e(){this.children=null,this.key=null}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach(function(e){t=t.getOrCreate(e)}),t.key||(t.key=Object.create(null))},e.prototype.getOrCreate=function(t){var n=this.children||(this.children=new Map),r=n.get(t);return r||n.set(t,r=new e),r},e}(),Zt=Object.prototype.hasOwnProperty,en=function(){function e(e){void 0===e&&(e=Object.create(null));var t=this;this.data=e,this.depend=$t(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Zt.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(n){t.set(n,e[n])}),Object.keys(this.data).forEach(function(n){Zt.call(e,n)||t.delete(n)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function tn(e){return new en(e)}var nn=function(){function e(e){void 0===e&&(e=new Xt);var t=this;this.cacheKeyRoot=e;var n=this,r=n.executeStoreQuery,o=n.executeSelectionSet;this.executeStoreQuery=$t(function(e){return r.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,o=e.contextValue,i=e.variableValues,a=e.fragmentMatcher;if(o.store instanceof en)return n.cacheKeyRoot.lookup(t,o.store,a,JSON.stringify(i),r.id)}}),this.executeSelectionSet=$t(function(e){return o.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,o=e.execContext;if(o.contextValue.store instanceof en)return n.cacheKeyRoot.lookup(t,o.contextValue.store,o.fragmentMatcher,JSON.stringify(o.variableValues),r.id)}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(r({},e,{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,n=e.store,r=e.query,o=e.variables,i=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,f=e.config;o=ht({},bt((t=vt(r),"production"===process.env.NODE_ENV?nt(t&&"query"===t.operation):nt(t&&"query"===t.operation,"Must contain a query definition."),t)),o);var d={store:n,dataIdFromObject:f&&f.dataIdFromObject||null,cacheRedirects:f&&f.cacheRedirects||{}},p=this.executeStoreQuery({query:r,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:d,variableValues:o,fragmentMatcher:l}),h=p.missing&&p.missing.length>0;return h&&!s&&p.missing.forEach(function(e){if(!e.tolerable)throw"production"===process.env.NODE_ENV?new tt:new tt("Can't find field "+e.fieldName+" on object "+JSON.stringify(e.object,null,2)+".")}),i&&Ot(i,p.result)&&(p.result=i),{result:p.result,complete:!h}},e.prototype.executeStoreQuery=function(e){var t=e.query,n=e.rootValue,r=e.contextValue,o=e.variableValues,i=e.fragmentMatcher,a=void 0===i?on:i,s=function(e){var t;yt(e);for(var n=0,r=e.definitions;n<r.length;n++){var o=r[n];if("OperationDefinition"===o.kind){var i=o.operation;if("query"===i||"mutation"===i||"subscription"===i)return o}"FragmentDefinition"!==o.kind||t||(t=o)}if(t)return t;throw"production"===process.env.NODE_ENV?new tt:new tt("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.")}(t),u={query:t,fragmentMap:gt(mt(t)),contextValue:r,variableValues:o,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:n,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,n=e.selectionSet,o=e.rootValue,i=e.execContext,a=i.fragmentMap,s=i.contextValue,u=i.variableValues,c={result:null},l=[],f=s.store.get(o.id),d=f&&f.__typename||"ROOT_QUERY"===o.id&&"Query"||void 0;function p(e){var t;return e.missing&&(c.missing=c.missing||[],(t=c.missing).push.apply(t,e.missing)),e.result}return n.selections.forEach(function(e){var n;if(dt(e,u))if(ut(e)){var c=p(t.executeField(f,d,e,i));void 0!==c&&l.push(((n={})[st(e)]=c,n))}else{var h=void 0;if(ct(e))h=e;else if(!(h=a[e.name.value]))throw"production"===process.env.NODE_ENV?new tt:new tt("No fragment named "+e.name.value);var y=h.typeCondition.name.value,v=i.fragmentMatcher(o,y,s);if(v){var m=t.executeSelectionSet({selectionSet:h.selectionSet,rootValue:o,execContext:i});"heuristic"===v&&m.missing&&(m=r({},m,{missing:m.missing.map(function(e){return r({},e,{tolerable:!0})})})),l.push(p(m))}}}),c.result=function(e){var t=e[0]||{},n=e.length;if(n>1){var r=[];t=It(t,r);for(var o=1;o<n;++o)t=Tt(t,e[o],r)}return t}(l),c},e.prototype.executeField=function(e,t,n,r){var o=r.variableValues,i=r.contextValue,a=function(e,t,n,r,o,i){i.resultKey;var a=i.directives,s=n;(r||a)&&(s=it(s,r,a));var u=void 0;if(e&&void 0===(u=e[s])&&o.cacheRedirects&&"string"==typeof t){var c=o.cacheRedirects[t];if(c){var l=c[n];l&&(u=l(e,r,{getCacheKey:function(e){return ft({id:o.dataIdFromObject(e),typename:e.__typename})}}))}}if(void 0===u)return{result:u,missing:[{object:e,fieldName:s,tolerable:!1}]};f=u,null!=f&&"object"==typeof f&&"json"===f.type&&(u=u.json);var f;return{result:u}}(e,t,n.name.value,at(n,o),i,{resultKey:st(n),directives:function(e,t){if(e.directives&&e.directives.length){var n={};return e.directives.forEach(function(e){n[e.name.value]=at(e,t)}),n}return null}(n,o)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray(n,a.result,r)):n.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:n.selectionSet,rootValue:a.result,execContext:r})):(rn(n,a.result),a)},e.prototype.combineExecResults=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=null;return e.forEach(function(e){e.missing&&(n=n||[]).push.apply(n,e.missing)}),{result:e.pop().result,missing:n}},e.prototype.executeSubSelectedArray=function(e,t,n){var r=this,o=null;function i(e){return e.missing&&(o=o||[]).push.apply(o,e.missing),e.result}return{result:t=t.map(function(t){return null===t?null:Array.isArray(t)?i(r.executeSubSelectedArray(e,t,n)):e.selectionSet?i(r.executeSelectionSet({selectionSet:e.selectionSet,rootValue:t,execContext:n})):(rn(e,t),t)}),missing:o}},e}();function rn(e,t){if(!e.selectionSet&&lt(t))throw"production"===process.env.NODE_ENV?new tt:new tt("Missing selection set for object of type "+t.typename+" returned for query field "+e.name.value)}function on(){return!0}var an=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),sn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return n(t,e),t}(Error);var un=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,n=e.result,r=e.store,o=void 0===r?tn():r,i=e.variables,a=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:n,document:t,store:o,variables:i,dataIdFromObject:a,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,n=e.result,r=e.document,o=e.store,i=void 0===o?tn():o,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=vt(r);try{return this.writeSelectionSetToStore({result:n,dataId:t,selectionSet:c.selectionSet,context:{store:i,processedData:{},variables:ht({},bt(c),a),dataIdFromObject:s,fragmentMap:gt(mt(r)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var n=new sn("Error writing result to store for query:\n "+JSON.stringify(t));return n.message+="\n"+e.message,n.stack=e.stack,n}(e,r)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,n=e.result,r=e.dataId,o=e.selectionSet,i=e.context,a=i.variables,s=i.store,u=i.fragmentMap;return o.selections.forEach(function(e){if(dt(e,a))if(ut(e)){var o=st(e),s=n[o];if(void 0!==s)t.writeFieldToStore({dataId:r,value:s,field:e,context:i});else{var c=!1,l=!1;e.directives&&e.directives.length&&(c=e.directives.some(function(e){return e.name&&"defer"===e.name.value}),l=e.directives.some(function(e){return e.name&&"client"===e.name.value})),c||l||!i.fragmentMatcherFunction||"production"===process.env.NODE_ENV||nt.warn("Missing field "+o+" in "+JSON.stringify(n,null,2).substring(0,100))}}else{var f=void 0;ct(e)?f=e:(f=(u||{})[e.name.value],"production"===process.env.NODE_ENV?nt(f):nt(f,"No fragment named "+e.name.value+"."));var d=!0;if(i.fragmentMatcherFunction&&f.typeCondition){var p=ft({id:"self",typename:void 0}),h={store:new an({self:n}),cacheRedirects:{}},y=i.fragmentMatcherFunction(p,f.typeCondition.name.value,h);!0!==wt("production")&&"heuristic"===y&&("production"===process.env.NODE_ENV||nt.error("WARNING: heuristic fragment matching going on!")),d=!!y}d&&t.writeSelectionSetToStore({result:n,selectionSet:f.selectionSet,dataId:r,context:i})}}),s},e.prototype.writeFieldToStore=function(e){var t,n,o,i=e.field,a=e.value,s=e.dataId,u=e.context,c=u.variables,l=u.dataIdFromObject,f=u.store,d=function(e,t){var n=null;e.directives&&(n={},e.directives.forEach(function(e){n[e.name.value]={},e.arguments&&e.arguments.forEach(function(r){var o=r.name,i=r.value;return rt(n[e.name.value],o,i,t)})}));var r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(function(e){var n=e.name,o=e.value;return rt(r,n,o,t)})),it(e.name.value,r,n)}(i,c);if(i.selectionSet&&null!==a)if(Array.isArray(a)){var p=s+"."+d;n=this.processArrayValue(a,p,i.selectionSet,u)}else{var h=s+"."+d,y=!0;if(cn(h)||(h="$"+h),l){var v=l(a);"production"===process.env.NODE_ENV?nt(!v||!cn(v)):nt(!v||!cn(v),'IDs returned by dataIdFromObject cannot begin with the "$" character.'),(v||"number"==typeof v&&0===v)&&(h=v,y=!1)}ln(h,i,u.processedData)||this.writeSelectionSetToStore({dataId:h,result:a,selectionSet:i.selectionSet,context:u});var m=a.__typename;n=ft({id:h,typename:m},y);var g=(o=f.get(s))&&o[d];if(g!==n&&lt(g)){var b=void 0!==g.typename,E=void 0!==m,w=b&&E&&g.typename!==m;"production"===process.env.NODE_ENV?nt(!y||g.generated||w):nt(!y||g.generated||w,"Store error: the application attempted to write an object with no provided id but the store already contains an id of "+g.id+" for this object. The selectionSet that was trying to be written is:\n"+JSON.stringify(i)),"production"===process.env.NODE_ENV?nt(!b||E):nt(!b||E,"Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of "+g.typename+" for the object of id "+g.id+". The selectionSet that was trying to be written is:\n"+JSON.stringify(i)),g.generated&&(w?y||f.delete(g.id):function e(t,n,o){if(t===n)return!1;var i=o.get(t);var a=o.get(n);var s=!1;Object.keys(i).forEach(function(t){var n=i[t],r=a[t];lt(n)&&cn(n.id)&&lt(r)&&!Ot(n,r)&&e(n.id,r.id,o)&&(s=!0)});o.delete(t);var u=r({},i,a);if(Ot(u,a))return s;o.set(n,u);return!0}(g.id,n.id,f))}}else n=null!=a&&"object"==typeof a?{type:"json",json:a}:a;(o=f.get(s))&&Ot(n,o[d])||f.set(s,r({},o,((t={})[d]=n,t)))},e.prototype.processArrayValue=function(e,t,n,r){var o=this;return e.map(function(e,i){if(null===e)return null;var a=t+"."+i;if(Array.isArray(e))return o.processArrayValue(e,a,n,r);var s=!0;if(r.dataIdFromObject){var u=r.dataIdFromObject(e);u&&(a=u,s=!1)}return ln(a,n,r.processedData)||o.writeSelectionSetToStore({dataId:a,result:e,selectionSet:n,context:r}),ft({id:a,typename:e.__typename},s)})},e}();function cn(e){return"$"===e[0]}function ln(e,t,n){if(!n)return!1;if(n[e]){if(n[e].indexOf(t)>=0)return!0;n[e].push(t)}else n[e]=[t];return!1}var fn={fragmentMatcher:new Ht,dataIdFromObject:function(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null},addTypename:!0,resultCaching:!0};var dn=Object.prototype.hasOwnProperty,pn=function(e){function t(t,n,r){var o=e.call(this,Object.create(null))||this;return o.optimisticId=t,o.parent=n,o.transaction=r,o}return n(t,e),t.prototype.toObject=function(){return r({},this.parent.toObject(),this.data)},t.prototype.get=function(e){return dn.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(an),hn=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new Xt,n.silenceBroadcast=!1,n.config=r({},fn,t),n.config.customResolvers&&("production"===process.env.NODE_ENV||nt.warn("customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version."),n.config.cacheRedirects=n.config.customResolvers),n.config.cacheResolvers&&("production"===process.env.NODE_ENV||nt.warn("cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version."),n.config.cacheRedirects=n.config.cacheResolvers),n.addTypename=n.config.addTypename,n.data=n.config.resultCaching?new en:new an,n.optimisticData=n.data,n.storeReader=new nn(n.cacheKeyRoot),n.storeWriter=new un;var o=n,i=o.maybeBroadcastWatch;return n.maybeBroadcastWatch=$t(function(e){return i.call(n,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return o.data instanceof en?o.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),n}return n(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){return"string"==typeof e.rootId&&void 0===this.data.get(e.rootId)?null:this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:this.config.fragmentMatcher.match,previousResult:e.previousResult,config:this.config})},t.prototype.write=function(e){this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:this.config.fragmentMatcher.match}),this.broadcastWatches()},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:this.config.fragmentMatcher.match,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw"production"===process.env.NODE_ENV?new tt:new tt("eviction is not implemented on InMemory Cache")},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],n=0,r=this.optimisticData;r instanceof pn;)r.optimisticId===e?++n:t.push(r),r=r.parent;if(n>0){for(this.optimisticData=r;t.length>0;){var o=t.pop();this.performTransaction(o.transaction,o.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var n=this.data,r=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new pn(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=r,this.data=n}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=T(yt(e),{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var o=e.selections;if(o&&!o.some(function(e){return"Field"===e.kind&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))return r({},e,{selections:o.concat([Et])})}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach(function(t){return e.maybeBroadcastWatch(t)})},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(Mt),yn=function(){return(yn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},vn={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},mn=function(e,t,n){var r=new Error(n);throw r.response=e,r.statusCode=e.status,r.result=t,r},gn=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=new Error("Network request failed. "+t+" is not serializable: "+e.message);throw r.parseError=e,r}return n},bn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),En=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},wn=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,o=e.includeExtensions,i=e.useGETForQueries,a=En(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch){var t="unfetch";throw"undefined"==typeof window&&(t="node-fetch"),new Error("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/"+t+".\n\nFor example:\nimport fetch from '"+t+"';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });")}}(r),r||(r=fetch);var s={http:{includeExtensions:o},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new ke(function(e){var t,o=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),a=e.getContext(),u={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:a.headers},c=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=yn({},t.options,{headers:t.headers,credentials:t.credentials}),i=t.http;n.forEach(function(e){o=yn({},o,e.options,{headers:yn({},o.headers,e.headers)}),e.credentials&&(o.credentials=e.credentials),i=yn({},i,e.http)});var a=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:a,variables:u};return i.includeExtensions&&(l.extensions=s),i.includeQuery&&(l.query=N(c)),{options:o,body:l}}(e,vn,s,u),l=c.options,f=c.body;if(!l.signal){var d=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),p=d.controller,h=d.signal;(t=p)&&(l.signal=h)}if(i&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(l.method="GET"),"GET"===l.method){var y=function(e,t){var n=[],r=function(e,t){n.push(e+"="+encodeURIComponent(t))};"query"in t&&r("query",t.query);t.operationName&&r("operationName",t.operationName);if(t.variables){var o=void 0;try{o=gn(t.variables,"Variables map")}catch(e){return{parseError:e}}r("variables",o)}if(t.extensions){var i=void 0;try{i=gn(t.extensions,"Extensions map")}catch(e){return{parseError:e}}r("extensions",i)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+n.join("&")+a}}(o,f),v=y.newURI,m=y.parseError;if(m)return ve(m);o=v}else try{l.body=gn(f,"Payload")}catch(m){return ve(m)}return new fe(function(n){var i;return r(o,l).then(function(t){return e.setContext({response:t}),t}).then((i=e,function(e){return e.text().then(function(t){try{return JSON.parse(t)}catch(r){var n=r;return n.response=e,n.statusCode=e.status,n.bodyText=t,Promise.reject(n)}}).then(function(t){return e.status>=300&&mn(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||mn(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map(function(e){return e.operationName}):i.operationName)+"'."),t})})).then(function(e){return n.next(e),n.complete(),e}).catch(function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))}),function(){t&&t.abort()}})})};var On,_n,kn=function(e){function t(t){return e.call(this,wn(t).request)||this}return bn(t,e),t}(ke);(On=e.ConnectionMode||(e.ConnectionMode={}))[On.AUTO=0]="AUTO",On[On.PLAIN=1]="PLAIN",On[On.NODES=2]="NODES",On[On.EDGES=3]="EDGES",(_n=e.ArgumentMode||(e.ArgumentMode={}))[_n.TYPE=0]="TYPE",_n[_n.LIST=1]="LIST";var Tn=function(){function t(){}return t.transformOutgoingData=function(e,t,n,r,o,i,a){var s=this,u=xn.getInstance(),c=e.getRelations(),l={},f=r?r.inputFields:void 0;return void 0===i&&(i=new Map),void 0===a&&(a=!1),Object.keys(t).forEach(function(r){var d=t[r],p=e.getRelations().has(r);if(!(d instanceof Array?p&&s.isRecursion(i,d[0]):p&&s.isRecursion(i,d))&&s.shouldIncludeOutgoingField(a&&n,r,d,e,o,f)){var h=U.getRelatedModel(c.get(r));if(d instanceof Array){var y=u.getModel(D(r),!0);y?(s.addRecordForRecursionDetection(i,d[0]),l[r]=d.map(function(t){return s.transformOutgoingData(y||e,t,n,void 0,void 0,i,!0)})):l[r]=d}else"object"===(void 0===d?"undefined":A(d))&&void 0!==d.$id?(h||(h=u.getModel(d.$self().entity)),s.addRecordForRecursionDetection(i,d),l[r]=s.transformOutgoingData(h,d,n,void 0,void 0,i,!0)):l[r]=d}}),l},t.transformIncomingData=function(t,n,r,o){var i=this;void 0===r&&(r=!1),void 0===o&&(o=!1);var a={},s=xn.getInstance();return o||(s.logger.group("Transforming incoming data"),s.logger.log("Raw data:",t)),Array.isArray(t)?a=t.map(function(e){return i.transformIncomingData(e,n,r,!0)}):Object.keys(t).forEach(function(u){if(void 0!==t[u]&&null!==t[u]&&u in t)if(C(t[u])){var c=s.getModel(u,!0)||n;if(t[u].nodes&&s.connectionMode===e.ConnectionMode.NODES)a[R(u)]=i.transformIncomingData(t[u].nodes,c,r,!0);else if(t[u].edges&&s.connectionMode===e.ConnectionMode.EDGES)a[R(u)]=i.transformIncomingData(t[u].edges,c,r,!0);else if(t.node&&s.connectionMode===e.ConnectionMode.EDGES)a=i.transformIncomingData(t.node,c,r,!0);else{var l=u;r&&!o&&(l=j(l=t[u].nodes?c.pluralName:c.singularName)),a[l]=i.transformIncomingData(t[u],c,r,!0)}}else if(U.isFieldNumber(n.fields.get(u)))a[u]=parseFloat(t[u]);else if(u.endsWith("Type")&&n.isTypeFieldOfPolymorphicRelation(u))a[u]=R(j(t[u]));else if(Array.isArray(t[u])&&o){var f=n.getRelations().get(u);if(f){var d=U.getRelatedModel(f);a[u]=i.transformIncomingData(t[u],d,r,!0)}}else a[u]=t[u]}),o?a.$isPersisted=!0:(s.logger.log("Transformed data:",a),s.logger.groupEnd()),$(a)},t.shouldIncludeOutgoingField=function(e,t,n,r,o,i){if(o&&o.includes(t))return!0;if(t.startsWith("$"))return!1;if(null===n||void 0===n)return!1;if(i&&!i.find(function(e){return e.name===t}))return!1;if(r.getRelations().has(t)){if(e)return!1;var a=r.getRelations().get(t),s=U.getRelatedModel(a);return!(!s||!r.shouldEagerSaveRelation(t,a,s))}return!0},t.addRecordForRecursionDetection=function(e,t){var n=xn.getInstance();if(t)if(t.$self){var r=n.getModel(t.$self().entity),o=e.get(r.singularName)||[];o.push(t.$id),e.set(r.singularName,o)}else n.logger.warn("Seems like you're using non-model classes with plugin graphql. You shouldn't do that.");else n.logger.warn("Trying to add invalid record",t,"to recursion detection")},t.isRecursion=function(e,t){if(!t)return!1;if(!t.$self)return xn.getInstance().logger.warn("Seems like you're using non-model classes with plugin graphql. You shouldn't do that."),!1;var n=xn.getInstance().getModel(t.$self().entity);return(e.get(n.singularName)||[]).includes(t.$id)},t}(),In=O.parse;function Nn(e){return e.replace(/[\s,]+/g," ").trim()}var Sn={},Mn={};var Pn=!0;var An=!1;function Rn(e){var t=Nn(e);if(Sn[t])return Sn[t];var n=In(e,{experimentalFragmentVariables:An});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");return n=function e(t,n){var r=Object.prototype.toString.call(t);if("[object Array]"===r)return t.map(function(t){return e(t,n)});if("[object Object]"!==r)throw new Error("Unexpected input.");n&&t.loc&&delete t.loc,t.loc&&(delete t.loc.startToken,delete t.loc.endToken);var o,i,a,s=Object.keys(t);for(o in s)s.hasOwnProperty(o)&&(i=t[s[o]],"[object Object]"!==(a=Object.prototype.toString.call(i))&&"[object Array]"!==a||(t[s[o]]=e(i,!0)));return t}(n=function(e){for(var t,n={},r=[],o=0;o<e.definitions.length;o++){var i=e.definitions[o];if("FragmentDefinition"===i.kind){var a=i.name.value,s=Nn((t=i.loc).source.body.substring(t.start,t.end));Mn.hasOwnProperty(a)&&!Mn[a][s]?(Pn&&console.warn("Warning: fragment with name "+a+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"),Mn[a][s]=!0):Mn.hasOwnProperty(a)||(Mn[a]={},Mn[a][s]=!0),n[s]||(n[s]=!0,r.push(i))}else r.push(i)}return e.definitions=r,e}(n),!1),Sn[t]=n,n}function Dn(){for(var e=Array.prototype.slice.call(arguments),t=e[0],n="string"==typeof t?t:t[0],r=1;r<e.length;r++)e[r]&&e[r].kind&&"Document"===e[r].kind?n+=e[r].loc.source.body:n+=e[r],n+=t[r];return Rn(n)}Dn.default=Dn,Dn.resetCaches=function(){Sn={},Mn={}},Dn.disableFragmentWarnings=function(){Pn=!1},Dn.enableExperimentalFragmentVariables=function(){An=!0},Dn.disableExperimentalFragmentVariables=function(){An=!1};var Fn=Dn,jn=function(){function e(){var e=xn.getInstance();!e.options.apolloClient&&e.options.link?this.httpLink=e.options.link:this.httpLink=new kn({uri:e.options.url?e.options.url:"/graphql",credentials:e.options.credentials?e.options.credentials:"same-origin",useGETForQueries:Boolean(e.options.useGETForQueries)}),e.options.apolloClient?this.apolloClient=function(e){return e.options.apolloClient}(e):this.apolloClient=new He({link:this.httpLink,cache:new hn,connectToDevTools:e.debugMode})}return e.prototype.request=function(t,n,r,a,s){return void 0===a&&(a=!1),void 0===s&&(s=!1),o(this,void 0,void 0,function(){var o,u,c;return i(this,function(i){switch(i.label){case 0:return o=s?"network-only":"cache-first",xn.getInstance().logger.logQuery(n,r,o),u={headers:e.getHeaders()},a?[4,this.apolloClient.mutate({mutation:n,variables:r,context:u})]:[3,2];case 1:return c=i.sent(),[3,4];case 2:return[4,this.apolloClient.query({query:n,variables:r,fetchPolicy:o,context:u})];case 3:c=i.sent(),i.label=4;case 4:return[2,Tn.transformIncomingData(c.data,t,a)]}})})},e.prototype.simpleQuery=function(t,n,r,a){return void 0===r&&(r=!1),o(this,void 0,void 0,function(){var o;return i(this,function(i){return o=r?"network-only":"cache-first",[2,this.apolloClient.query({query:Fn(t),variables:n,fetchPolicy:o,context:{headers:e.getHeaders()}})]})})},e.prototype.simpleMutation=function(t,n,r){return o(this,void 0,void 0,function(){return i(this,function(r){return[2,this.apolloClient.mutate({mutation:Fn(t),variables:n,context:{headers:e.getHeaders()}})]})})},e.getHeaders=function(){var e=xn.getInstance(),t=e.options.headers?e.options.headers:{};return"function"==typeof t&&(t=t(e)),t},e}(),Qn=function(){function t(e){var t=this,n=xn.getInstance();this.schema=e,this.types=new Map,this.mutations=new Map,this.queries=new Map,this.schema.types.forEach(function(e){return t.types.set(e.name,e)}),this.getType(n.adapter.getRootQueryName()).fields.forEach(function(e){return t.queries.set(e.name,e)}),this.getType(n.adapter.getRootMutationName()).fields.forEach(function(e){return t.mutations.set(e.name,e)})}return t.prototype.determineQueryMode=function(){var n=this,r=null;if(this.queries.forEach(function(e){var o=t.getTypeNameOfField(e);return!o.endsWith("TypeConnection")||(r=n.getType(o),!1)}),!r)throw new Error("Can't determine the connection mode due to the fact that here are no connection types in the schema. Please set the connectionMode via Vuex-ORM-GraphQL options!");return r.fields.find(function(e){return"nodes"===e.name})?e.ConnectionMode.NODES:r.fields.find(function(e){return"edges"===e.name})?e.ConnectionMode.EDGES:e.ConnectionMode.PLAIN},t.prototype.getType=function(e,t){void 0===t&&(t=!1),e=xn.getInstance().adapter.prepareSchemaTypeName(e);var n=this.types.get(e);if(!t&&!n)throw new Error("Couldn't find Type of name "+e+" in the GraphQL Schema.");return n||null},t.prototype.getMutation=function(e,t){void 0===t&&(t=!1);var n=this.mutations.get(e);if(!t&&!n)throw new Error("Couldn't find Mutation of name "+e+" in the GraphQL Schema.");return n||null},t.prototype.getQuery=function(e,t){void 0===t&&(t=!1);var n=this.queries.get(e);if(!t&&!n)throw new Error("Couldn't find Query of name "+e+" in the GraphQL Schema.");return n||null},t.returnsConnection=function(e){return t.getTypeNameOfField(e).endsWith("TypeConnection")},t.getRealType=function(e){return"NON_NULL"===e.kind?this.getRealType(e.ofType):e},t.getTypeNameOfField=function(e){var t=this.getRealType(e.type);if("LIST"===t.kind){for(;!t.name;)t=t.ofType;return"["+t.name+"]"}for(;!t.name;)t=t.ofType;if(!t.name)throw new Error("Can't find type name for field "+e.name);return t.name},t}(),qn=function(){function t(){}return t.prototype.getRootMutationName=function(){return"Mutation"},t.prototype.getRootQueryName=function(){return"Query"},t.prototype.getConnectionMode=function(){return e.ConnectionMode.NODES},t.prototype.getArgumentMode=function(){return e.ArgumentMode.TYPE},t.prototype.getFilterTypeName=function(e){return F(e.singularName)+"Filter"},t.prototype.getInputTypeName=function(e,t){return F(e.singularName)+"Input"},t.prototype.getNameForDestroy=function(e){return"delete"+F(e.singularName)},t.prototype.getNameForFetch=function(e,t){return t?e.pluralName:e.singularName},t.prototype.getNameForPersist=function(e){return"create"+F(e.singularName)},t.prototype.getNameForPush=function(e){return"update"+F(e.singularName)},t.prototype.prepareSchemaTypeName=function(e){return F(e)},t}(),xn=function(){function t(t,n){if(this.models=new Map,this.debugMode=!1,this.connectionMode=e.ConnectionMode.AUTO,this.globalMocks={},this.components=t,this.options=n,this.database=n.database,this.debugMode=Boolean(n.debug),this.logger=new B(this.debugMode),this.adapter=n.adapter||new qn,!n.database)throw new Error("database param is required to initialize vuex-orm-graphql!")}return t.getInstance=function(){return this.instance},t.setup=function(e,n){return this.instance=new t(e,n),this.instance.apollo=new jn,this.instance.collectModels(),this.instance.logger.group("Context setup"),this.instance.logger.log("components",this.instance.components),this.instance.logger.log("options",this.instance.options),this.instance.logger.log("database",this.instance.database),this.instance.logger.log("models",this.instance.models),this.instance.logger.groupEnd(),this.instance},t.prototype.loadSchema=function(){return o(this,void 0,void 0,function(){var e=this;return i(this,function(t){return this.schemaWillBeLoaded||(this.schemaWillBeLoaded=new Promise(function(t,n){return o(e,void 0,void 0,function(){var e,n;return i(this,function(r){switch(r.label){case 0:return this.logger.log("Fetching GraphQL Schema initially ..."),this.connectionMode=this.adapter.getConnectionMode(),e={headers:{"X-GraphQL-Introspection-Query":"true"}},[4,this.apollo.simpleQuery("\nquery Introspection {\n  __schema {\n    types {\n      name\n      description\n      fields(includeDeprecated: true) {\n        name\n        description\n        args {\n          name\n          description\n          type {\n            name\n            kind\n\n            ofType {\n              kind\n\n              name\n              ofType {\n                kind\n                name\n\n                ofType {\n                  kind\n                  name\n                }\n              }\n            }\n          }\n        }\n\n        type {\n          name\n          kind\n\n          ofType {\n            kind\n\n            name\n            ofType {\n              kind\n              name\n\n              ofType {\n                kind\n                name\n              }\n            }\n          }\n        }\n      }\n\n      inputFields {\n        name\n        description\n        type {\n          name\n          kind\n\n          ofType {\n            kind\n\n            name\n            ofType {\n              kind\n              name\n\n              ofType {\n                kind\n                name\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n",{},!0,e)];case 1:return n=r.sent(),this.schema=new Qn(n.data.__schema),this.logger.log("GraphQL Schema successful fetched",n),this.logger.log("Starting to process the schema ..."),this.processSchema(),this.logger.log("Schema procession done!"),t(this.schema),[2]}})})})),[2,this.schemaWillBeLoaded]})})},t.prototype.processSchema=function(){var t=this;this.models.forEach(function(e){var n;try{n=t.schema.getType(e.singularName)}catch(n){return void t.logger.warn("Ignoring entity "+e.singularName+" because it's not in the schema.")}e.fields.forEach(function(r,o){n.fields.find(function(e){return e.name===o})||(t.logger.warn("Ignoring field "+e.singularName+"."+o+" because it's not in the schema."),e.baseModel.skipFields=e.baseModel.skipFields?e.baseModel.skipFields:[],e.baseModel.skipFields.includes(o)||e.baseModel.skipFields.push(o))})}),this.connectionMode===e.ConnectionMode.AUTO?(this.connectionMode=this.schema.determineQueryMode(),this.logger.log("Connection Query Mode is "+this.connectionMode+" by automatic detection")):this.logger.log("Connection Query Mode is "+this.connectionMode+" by config")},t.prototype.getModel=function(e,t){if(void 0===t&&(t=!1),"string"==typeof e){var n=D(j(e));if(e=this.models.get(n),!t&&!e)throw new Error("No such model "+n+"!")}return e},t.prototype.addGlobalMock=function(e){return!this.findGlobalMock(e.action,e.options)&&(this.globalMocks[e.action]||(this.globalMocks[e.action]=[]),this.globalMocks[e.action].push(e),!0)},t.prototype.findGlobalMock=function(e,t){return this.globalMocks[e]&&this.globalMocks[e].find(function(e){return!e.options||!t||V(L(t,Object.keys(e.options)),e.options||{})})||null},t.prototype.globalMockHook=function(e,t){var n=null,r=this.findGlobalMock(e,t);return r&&(n=r.returnValue instanceof Function?r.returnValue():r.returnValue||null),n},t.prototype.collectModels=function(){var e=this;this.database.entities.forEach(function(t){var n=new U(t.model);e.models.set(n.singularName,n),U.augment(n)})},t}(),Cn=function(){function t(){}return t.buildField=function(t,n,r,o,i,a,s){void 0===n&&(n=!0),void 0===o&&(o=[]),void 0===a&&(a=!1),void 0===s&&(s=!1);var u=xn.getInstance();t=u.getModel(t),i=i||t.pluralName;var c=u.schema.getMutation(i,!0)||u.schema.getQuery(i,!0),l=this.buildArguments(t,r,!1,a,s,c);o=0===o.length?[t.singularName]:o;var f="\n      "+t.getQueryFields().join(" ")+"\n      "+this.buildRelationsQuery(t,o)+"\n    ";if(n){var d=""+i+l;return u.connectionMode===e.ConnectionMode.NODES?"\n          "+d+" {\n            nodes {\n              "+f+"\n            }\n          }\n        ":u.connectionMode===e.ConnectionMode.EDGES?"\n          "+d+" {\n            edges {\n              node {\n                "+f+"\n              }\n            }\n          }\n        ":"\n          "+d+" {\n            "+f+"\n          }\n        "}return"\n        "+(i||t.singularName)+l+" {\n          "+f+"\n        }\n      "},t.buildQuery=function(e,t,n,r,o,i){var a=xn.getInstance();t=a.getModel(t),r=this.prepareArguments(r),o=void 0===o?!r.id:o,n||(n=o?t.pluralName:t.singularName);var s=a.schema.getMutation(n,!0)||a.schema.getQuery(n,!0),u=e+" "+F(n)+this.buildArguments(t,r,!0,i,!0,s)+" {\n  "+this.buildField(t,o,r,[],n,i,!0)+"\n}";return Fn(u)},t.buildArguments=function(n,r,o,i,a,s){var u=this;void 0===o&&(o=!1),void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===s&&(s=null);var c=xn.getInstance();if(void 0===r)return"";var l="",f=!0;return r&&(Object.keys(r).forEach(function(e){var d=r[e],p=n.skipField(e),h=("id"===e||p)&&!a,y=u.findSchemaFieldForArgument(e,s,n,i),v=y&&Qn.getTypeNameOfField(y).endsWith("TypeConnection");if(d&&!h&&!v){var m="";if(o)if(C(d)&&d.__type)m=c.adapter.getInputTypeName(c.getModel(d.__type))+"!";else if(d instanceof Array&&s){var g=t.findSchemaFieldForArgument(e,s,n,i);if(!g)throw new Error("The argument "+e+" is of type array but it's not possible to determine the type, because it's not in the field "+s.name);m=Qn.getTypeNameOfField(g)+"!"}else y&&Qn.getTypeNameOfField(y)?m=Qn.getTypeNameOfField(y)+"!":"id"===e||p?m="ID!":(m=u.determineAttributeType(n,e,d,s||void 0),m+="!");else m="$"+e;l=l+(f?"":", ")+(o?"$":"")+e+": "+m,f=!1}}),f||(!o&&i&&xn.getInstance().adapter.getArgumentMode()===e.ArgumentMode.TYPE&&(l="filter: { "+l+" }"),l="("+l+")")),l},t.determineAttributeType=function(e,t,n,r){var o,i=xn.getInstance(),a=e.fields.get(t);r?(o=r.args.find(function(e){return e.name===t}))||r.args.find(function(e){return"filter"===e.name})&&(o=this.findSchemaFieldForArgument(t,null,e,!0)):o=i.schema.getType(e.singularName).fields.find(function(e){return e.name===t});if(o&&Qn.getTypeNameOfField(o))return Qn.getTypeNameOfField(o);if(a instanceof i.components.String)return"String";if(a&&a instanceof i.components.Number)return"Int";if(a&&a instanceof i.components.Boolean)return"Boolean";if("number"==typeof n)return"Int";if("string"==typeof n)return"String";if("boolean"==typeof n)return"Boolean";throw new Error("Can't find suitable graphql type for field '"+e.singularName+"."+t+"'.")},t.findSchemaFieldForArgument=function(e,t,n,r){var o,i=xn.getInstance(),a=i.schema;if(t&&(o=t.args.find(function(t){return t.name===e})))return o;var s=a.getType(r?i.adapter.getFilterTypeName(n):n.singularName,!0);return(o=s?(r?s.inputFields:s.fields).find(function(t){return t.name===e}):void 0)||xn.getInstance().logger.warn("Couldn't find the argument with name "+e+" for the mutation/query "+(t?t.name:"(?)")),o},t.buildRelationsQuery=function(e,t){var n=this;if(void 0===t&&(t=[]),null===e)return"";xn.getInstance();var r=[];return e.getRelations().forEach(function(o,i){var a=U.getRelatedModel(o),s=function(e,t){for(var n=-1;++n<e.length&&t(e[n],n,e););return e.slice(0,n)}(t.slice(0).reverse(),function(e){return e===a.singularName}).length,u=s?s>5:t.includes(a.singularName);if(e.shouldEagerLoadRelation(i,o,a)&&!u){var c=t.slice(0);c.push(a.singularName),r.push(n.buildField(a,U.isConnection(o),void 0,c,i,!1))}}),r.join("\n")},t.prepareArguments=function(t){return t=t?$(t):{},Object.keys(t).forEach(function(n){var r=t[n];r&&C(r)&&(xn.getInstance().adapter.getArgumentMode()===e.ArgumentMode.LIST?(Object.keys(r).forEach(function(e){t[e]=r[e]}),delete t[n]):t[n]={__type:F(n)})}),t},t}(),Ln=function(){function e(){}return e.insertData=function(e,t){return o(this,void 0,void 0,function(){var n,r=this;return i(this,function(a){switch(a.label){case 0:return n={},[4,Promise.all(Object.keys(e).map(function(a){return o(r,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return r=e[a],xn.getInstance().logger.log("Inserting records",r),[4,t("insertOrUpdate",{data:r})];case 1:return o=i.sent(),Object.keys(o).forEach(function(e){n[e]||(n[e]=[]),n[e]=n[e].concat(o[e])}),[2]}})})}))];case 1:return a.sent(),[2,n]}})})},e}(),Vn=function(){function e(){}return e.mutation=function(e,t,n,r){return o(this,void 0,void 0,function(){var o,a,s,u,c,l,f,d,p;return i(this,function(i){switch(i.label){case 0:return t?[4,(a=xn.getInstance()).loadSchema()]:[3,5];case 1:return s=i.sent(),u=Qn.returnsConnection(s.getMutation(e)),c=Cn.buildQuery("mutation",r,e,t,u),[4,a.apollo.request(r,c,t,!0)];case 2:return l=i.sent(),e===a.adapter.getNameForDestroy(r)?[3,4]:((l=l[Object.keys(l)[0]]).id=parseInt(l.id,10),[4,Ln.insertData((o={},o[r.singularName]=l,o),n)]);case 3:return f=i.sent(),d=f[r.singularName],(p=d[d.length-1])?[2,p]:(xn.getInstance().logger.log("Couldn't find the record of type '",r.singularName,"' within",f,". Falling back to find()"),[2,r.baseModel.query().last()]);case 4:return[2,!0];case 5:return[2]}})})},e.getModelFromState=function(e){return xn.getInstance().getModel(e.$name)},e.prepareArgs=function(e,t){return e=e||{},t&&(e.id=t),e},e.addRecordToArgs=function(e,t,n){return e[t.singularName]=Tn.transformOutgoingData(t,n,!1,this.getInputType(t)),e},e.transformArgs=function(e){var t=this,n=xn.getInstance();return Object.keys(e).forEach(function(r){var o=e[r];if(o instanceof n.components.Model){var i=n.getModel(D(o.$self().entity)),a=Tn.transformOutgoingData(i,o,!1,t.getInputType(i));n.logger.log("A",r,"model was found within the variables and will be transformed from",o,"to",a),e[r]=a}}),e},e.getInputType=function(e){var t=xn.getInstance(),n=t.adapter.getInputTypeName(e);return t.schema.getType(n)},e}(),$n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.id,s=t.args;return o(this,void 0,void 0,function(){var e,t,o;return i(this,function(i){switch(i.label){case 0:return a?(e=this.getModelFromState(n),t=xn.getInstance().adapter.getNameForDestroy(e),(o=e.$mockHook("destroy",{id:a}))?[4,Ln.insertData(o,r)]:[3,2]):[3,4];case 1:return i.sent(),[2,!0];case 2:return s=this.prepareArgs(s,a),[4,Vn.mutation(t,s,r,e)];case 3:return i.sent(),[2,!0];case 4:throw new Error("The destroy action requires the 'id' to be set")}})})},t}(Vn),Bn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){var n=e.state,r=e.dispatch;return o(this,void 0,void 0,function(){var e,o,a,s,u,c,l,f,d;return i(this,function(i){switch(i.label){case 0:return e=xn.getInstance(),o=this.getModelFromState(n),(a=o.$mockHook("fetch",{filter:t&&t.filter||{}}))?[2,Ln.insertData(a,r)]:[4,e.loadSchema()];case 1:return i.sent(),s={},t&&t.filter&&(s=Tn.transformOutgoingData(o,t.filter,!0,void 0,Object.keys(t.filter))),u=t&&t.bypassCache,c=!s.id,l=e.adapter.getNameForFetch(o,c),f=Cn.buildQuery("query",o,l,s,c,c),[4,e.apollo.request(o,f,s,!1,u)];case 2:return d=i.sent(),[2,Ln.insertData(d,r)]}})})},t}(Vn),Un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.args,s=t.name;return o(this,void 0,void 0,function(){var e,t,o;return i(this,function(i){switch(i.label){case 0:return s?(e=xn.getInstance(),t=this.getModelFromState(n),(o=t.$mockHook("mutate",{name:s,args:a||{}}))?[2,Ln.insertData(o,r)]:[4,e.loadSchema()]):[3,2];case 1:return i.sent(),a=this.prepareArgs(a),this.transformArgs(a),[2,Vn.mutation(s,a,r,t)];case 2:throw new Error("The mutate action requires the mutation name ('mutation') to be set")}})})},t}(Vn),Kn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.id,s=t.args;return o(this,void 0,void 0,function(){var e,t,o,u,c,l;return i(this,function(i){switch(i.label){case 0:return a?(e=this.getModelFromState(n),t=xn.getInstance().adapter.getNameForPersist(e),o=e.baseModel.query().withAllRecursive().where("$id",a).first(),(u=e.$mockHook("persist",{id:a,args:s||{}}))?[4,Ln.insertData(u,r)]:[3,3]):[3,6];case 1:return c=i.sent(),[4,this.deleteObsoleteRecord(e,c,o)];case 2:return i.sent(),[2,c];case 3:return s=this.prepareArgs(s),this.addRecordToArgs(s,e,o),[4,Vn.mutation(t,s,r,e)];case 4:return l=i.sent(),[4,this.deleteObsoleteRecord(e,l,o)];case 5:return i.sent(),[2,l];case 6:throw new Error("The persist action requires the 'id' to be set")}})})},t.deleteObsoleteRecord=function(e,t,n){return o(this,void 0,void 0,function(){return i(this,function(e){return t&&n&&t.id!==n.id?(xn.getInstance().logger.log("Dropping deprecated record",n),[2,n.$delete()]):[2,null]})})},t}(Vn),Gn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.data,s=t.args;return o(this,void 0,void 0,function(){var e,t,o;return i(this,function(i){if(a)return e=this.getModelFromState(n),t=xn.getInstance().adapter.getNameForPush(e),(o=e.$mockHook("push",{data:a,args:s||{}}))?[2,Ln.insertData(o,r)]:(s=this.prepareArgs(s,a.id),this.addRecordToArgs(s,e,a),[2,Vn.mutation(t,s,r,e)]);throw new Error("The persist action requires the 'data' to be set")})})},t}(Vn),Yn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){var n=e.state,r=e.dispatch,a=t.name,s=t.filter,u=t.bypassCache;return o(this,void 0,void 0,function(){var e,t,o,c,l,f,d;return i(this,function(i){switch(i.label){case 0:return a?(e=xn.getInstance(),t=this.getModelFromState(n),(o=t.$mockHook("query",{name:a,filter:s||{}}))?[2,Ln.insertData(o,r)]:[4,e.loadSchema()]):[3,3];case 1:return c=i.sent(),s=s?Tn.transformOutgoingData(t,s,!0):{},l=Qn.returnsConnection(c.getQuery(a)),f=Cn.buildQuery("query",t,a,s,l,!1),[4,e.apollo.request(t,f,s,!1,u)];case 2:return d=i.sent(),[2,Ln.insertData(d,r)];case 3:throw new Error("The customQuery action requires the query name ('name') to be set")}})})},t}(Vn),zn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){e.dispatch;var n=t.query,r=t.bypassCache,a=t.variables;return o(this,void 0,void 0,function(){var e,t,o,s;return i(this,function(i){switch(i.label){case 0:return e=xn.getInstance(),n?(t=q(n),(o=e.globalMockHook("simpleQuery",{name:t.definitions[0].name.value,variables:a}))?[2,o]:(a=this.prepareArgs(a),[4,e.apollo.simpleQuery(x(t),a,r)])):[3,2];case 1:return s=i.sent(),[2,(u=$(s.data),JSON.parse(JSON.stringify(u)))];case 2:throw new Error("The simpleQuery action requires the 'query' to be set")}var u})})},t}(Vn),Jn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.call=function(e,t){e.dispatch;var n=t.query,r=t.variables;return o(this,void 0,void 0,function(){var e,t,o;return i(this,function(i){switch(i.label){case 0:return e=xn.getInstance(),n?(t=q(n),(o=e.globalMockHook("simpleMutation",{name:t.definitions[0].name.value,variables:r}))?[2,o]:(r=this.prepareArgs(r),[4,e.apollo.simpleMutation(x(t),r)])):[3,2];case 1:return[2,$(i.sent().data)];case 2:throw new Error("The simpleMutation action requires the 'query' to be set")}})})},t}(Vn),Wn=function(){function e(t,n){xn.setup(t,n),e.setupActions(),e.setupModelMethods()}return e.prototype.getContext=function(){return xn.getInstance()},e.setupActions=function(){var e=xn.getInstance();e.components.RootActions.simpleQuery=zn.call.bind(zn),e.components.RootActions.simpleMutation=Jn.call.bind(Jn),e.components.Actions.fetch=Bn.call.bind(Bn),e.components.Actions.persist=Kn.call.bind(Kn),e.components.Actions.push=Gn.call.bind(Gn),e.components.Actions.destroy=$n.call.bind($n),e.components.Actions.mutate=Un.call.bind(Un),e.components.Actions.query=Yn.call.bind(Yn)},e.setupModelMethods=function(){var e=xn.getInstance();e.components.Model.fetch=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,function(){var n;return i(this,function(r){return C(n=e)||(n={id:e}),[2,this.dispatch("fetch",{filter:n,bypassCache:t})]})})},e.components.Model.mutate=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.dispatch("mutate",e)]})})},e.components.Model.customQuery=function(e){var t=e.name,n=e.filter,r=e.multiple,a=e.bypassCache;return o(this,void 0,void 0,function(){return i(this,function(e){return[2,this.dispatch("query",{name:t,filter:n,multiple:r,bypassCache:a})]})})};var t=e.components.Model.prototype;t.$mutate=function(e){var t=e.name,n=e.args,r=e.multiple;return o(this,void 0,void 0,function(){return i(this,function(e){return(n=n||{}).id||(n.id=this.$id),[2,this.$dispatch("mutate",{name:t,args:n,multiple:r})]})})},t.$customQuery=function(e){var t=e.name,n=e.filter,r=e.multiple,a=e.bypassCache;return o(this,void 0,void 0,function(){return i(this,function(e){return(n=n||{}).id||(n.id=this.$id),[2,this.$dispatch("query",{name:t,filter:n,multiple:r,bypassCache:a})]})})},t.$persist=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.$dispatch("persist",{id:this.$id,args:e})]})})},t.$push=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.$dispatch("push",{data:this,args:e})]})})},t.$destroy=function(){return o(this,void 0,void 0,function(){return i(this,function(e){return[2,this.$dispatch("destroy",{id:this.$id})]})})},t.$deleteAndDestroy=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.$delete()];case 1:return e.sent(),[2,this.$destroy()]}})})}},e}(),Hn=function(){function e(){}return e.install=function(t,n){return e.instance=new Wn(t,n),e.instance},e}(),Xn=null;var Zn=function(){function e(e,t){this.action=e,this.options=t}return e.prototype.for=function(e){return this.modelClass=e,this},e.prototype.andReturn=function(e){return this.returnValue=e,this.installMock(),this},e.prototype.installMock=function(){"simpleQuery"===this.action||"simpleMutation"===this.action?Xn.addGlobalMock(this):Xn.getModel(this.modelClass.entity).$addMock(this)},e}();e.default=Hn,e.DefaultAdapter=qn,e.setupTestUtils=function(e){if(!e.instance)throw new Error("Please call this function after setting up the store!");Xn=e.instance.getContext()},e.mock=function(e,t){if(!Xn)throw new Error("Please call setupTestUtils() before!");return new Zn(e,t)},e.clearORMStore=function(){return o(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:if(!Xn)throw new Error("Please call setupTestUtils() before!");return[4,Xn.database.store.dispatch("entities/deleteAll")];case 1:return e.sent(),[2]}})})},e.Mock=Zn,Object.defineProperty(e,"__esModule",{value:!0})});
  //# sourceMappingURL=vuex-orm-graphql.umd.js.map
  