Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blips

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blips - npm Package Compare versions

Comparing version 1.0.0-rc.1-1 to 1.0.0-rc.1-2

2

dist/blips.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("graphql"),require("apollo-fetch")):"function"==typeof define&&define.amd?define(["exports","graphql","apollo-fetch"],t):t(e.blips={},e.GraphQL,e.ApolloFetch)}(this,function(e,t,r){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t){return t={exports:{}},e(t,t.exports),t.exports}function i(){}function u(){u.init.call(this)}function c(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function a(e,t,r,n){var o,u,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((u=e._events)?(u.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),u=e._events),a=u[t]):(u=e._events=new i,e._eventsCount=0),a){if("function"==typeof a?a=u[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(o=c(e))&&o>0&&a.length>o){a.warned=!0;var s=Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(s)}}else a=u[t]=r,++e._eventsCount;return e}function s(e,t,r){function n(){e.removeListener(t,n),o||(o=!0,r.apply(e,arguments))}var o=!1;return n.listener=r,n}function f(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function l(e,t){for(var r=Array(t);t--;)r[t]=e[t];return r}function p(e){return!!y(e)}function h(e){var t=null!=e&&e.length;return"number"==typeof t&&t>=0&&t%1==0}function v(e){var t=y(e);if(t)return t.call(e)}function y(e){if(null!=e){var t=X&&e[X]||e["@@iterator"];if("function"==typeof t)return t}}function d(e){if(null!=e){var t=v(e);if(t)return t;if(h(e))return new b(e)}}function b(e){this._o=e,this._i=0}function m(e){var t=g(e);if(t)return t.call(e)}function g(e){if(null!=e){var t=ue&&e[ue]||e["@@asyncIterator"];if("function"==typeof t)return t}}function w(e){if(null!=e){var t=m(e);if(t)return t;var r=d(e);if(r)return new O(r)}}function O(e){this._i=e}function _(e,t,r,n){function o(e,t){return j(e,t,r.slice(),n.slice())}var i=Ie(e),u=Ie(t);return!Ce(function(e,t){return!Ce(o,t,e)},u,i)}function j(e,t,r,n){if(qe(e,t))return!0;var o=Qe(e);if(o!==Qe(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===Fe(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!qe(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!qe(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=r.length-1;i>=0;){if(r[i]===e)return n[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&_(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&_(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var u=Ge(e);if(u.length!==Ge(t).length)return!1;var c=r.concat([e]),a=n.concat([t]);for(i=u.length-1;i>=0;){var s=u[i];if(!xe(s,t)||!j(t[s],e[s],c,a))return!1;i-=1}return!0}function E(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function x(e,t,r,n){return e["@@transducer/result"](r[n](Xe(e["@@transducer/step"],e),t))}function k(e){return function(e,t){var r=this[e];return mt(r,e),dt(r)?je(t)?r:function(e,t){if(!bt(t))return[];var r=Object.entries(t)[0],n=r[0],o=r[1];return e.filter(function(e){return e[n]===o})}(r,t):je(t)?r:function(e,t){if(bt(t)){var r=Object.entries(t)[0]||{},n=r[0],o=r[1];return Object.entries(e).filter(function(e){return e[1][n]===o}).reduce(function(e,t){var r;return wt({},e,(r={},r[t[0]]=t[1],r))},{})}return e[t]}(r,t)}}function S(e){return function(e,t,r){var n=this[e];return mt(n,e),dt(n)?function(e,t){return this[e]=[].concat(this[e]||[],[t]),t}.call(this,e,t):function(e,t,r){var n;return Ee(!je(t),"You forgot to specify the payload"),Ee(!je(r),"You are trying to post to a collection object but haven't specified an identifier. Try again with \"clerk.post('"+e+"', payload, identifier)\""),this[e]=_t({},this[e]||{},(n={},n[r]=t,n)),t}.call(this,e,t,r)}}function A(e){return function(e,t,r){var n=this[e];return mt(n,e),dt(n)?function(e,t,r){if(je(r))return this[e]=[].concat(this[e],[t]),t;Ee(bt(r),"When updating a resource inside a list you have to specify an identifier object containing the key/value pair you want to match.");var n=Object.entries(r)[0],o=n[0],i=n[1],u=this[e].findIndex(function(e){return e[o]===i});return this[e]=[].concat(this[e].slice(0,u),[t],this[e].slice(u+1)),t}.call(this,e,t,r):function(e,t,r){var n;return Ee(!je(r),"You are trying to update a resource but haven't specified the identifier. Try again with \"clerk.put('"+e+"', payload, identifier)\""),this[e]=Et({},this[e]||{},(n={},n[r]=t,n)),t}.call(this,e,t,r)}}function P(e){return function(e,t,r){var n=this[e];return mt(n,e),Ee(!je(r),"You are trying to patch a resource but haven't specified the identifier. Try again with \"clerk.patch('"+e+"', payload, key)\""),dt(n)?function(e,t,r){Ee(bt(r),"When patching a resource inside a list you have to specify an identifier object containing the key/value pair you want to match.");var n=Object.entries(r)[0],o=n[0],i=n[1],u=this[e].findIndex(function(e){return e[o]===i});if(u>=0){var c=St(this[e][u],gt(t));return this[e]=[].concat(this[e].slice(0,u),[c],this[e].slice(u+1)),c}}.call(this,e,t,r):function(e,t,r){var n;if(Ee(!je(r),"You are trying to update a resource but haven't specified the identifier. Try again with \"clerk.put('"+e+"', payload, identifier)\""),!je(this[e][r])){var o=St(this[e][r],gt(t));return this[e]=At({},this[e]||{},(n={},n[r]=o,n)),o}}.call(this,e,t,r)}}function T(e){return function(e,t){if(!je(t)){var r=this[e];return mt(r,e),dt(r)?function(e,t){if(bt(t)){var r=Object.entries(t)[0],n=r[0],o=r[1],i=this[e].findIndex(function(e){return e[n]===o});if(i>=0){var u=this[e][i];return this[e]=[].concat(this[e].slice(0,i),this[e].slice(i+1)),u}}}.call(this,e,t):function(e,t){var r=this[e][t];if(!je(r))return this[e]=Tt([t],this[e]),r}.call(this,e,t)}}}function L(e,t,r){var n=!!e;return"function"==typeof e&&(n=!!e(r)),n?"function"==typeof t?t(r):t:r}function I(e,t){return null===t?"null"===e.toLowerCase():void 0===t?"undefined"===e.toLowerCase():e.toLowerCase()===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(t).toLowerCase()}function C(e){return"string"==typeof e?!e:I("object",e)?!Object.values(e).length:I("array",e)?!e.length:I("Map",e)?!e.size:!!I("Set",e)&&!e.size}function F(e){var t=this;return new Nt(function(r){return qt(regeneratorRuntime.mark(function n(){var o,i,u,c,a,s,f;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,o=!0,i=!1,u=void 0,t.prev=4,c=Ft(e);case 6:return t.next=8,c.next();case 8:return a=t.sent,o=a.done,t.next=12,a.value;case 12:if(s=t.sent,o){t.next=19;break}r.next(f=s);case 16:o=!0,t.next=6;break;case 19:t.next=25;break;case 21:t.prev=21,t.t0=t.catch(4),i=!0,u=t.t0;case 25:if(t.prev=25,t.prev=26,o||!c.return){t.next=30;break}return t.next=30,c.return();case 30:if(t.prev=30,!i){t.next=33;break}throw u;case 33:return t.finish(30);case 34:return t.finish(25);case 35:t.next=41;break;case 37:t.prev=37,t.t1=t.catch(0),e.return(),r.error(t.t1);case 41:case"end":return t.stop()}},n,t,[[0,37],[4,21,25,35],[26,,30,34]])}))(),function(){r.complete(),e.return()}})}function q(e,t){if(!t||"object"!==(void 0===t?"undefined":Ct(t))||t.hasOwnProperty("length")||t.hasOwnProperty("size"))return e;var r=t.store,n=Rt(t,["store"]);r&&console.warn(Dt);var o=Object.keys(n),i=Array.isArray(o),u=0;for(o=i?o:o[Symbol.iterator]();;){var c;if(i){if(u>=o.length)break;c=o[u++]}else{if((u=o.next()).done)break;c=u.value}var a=c;e.hasOwnProperty(a)&&console.warn(Gt(a))}return Mt({},e,n)}function M(e){return null==e}function R(e){for(var t=[],r=[],n=Array.isArray(i=e),o=0,i=n?i:i[Symbol.iterator]();;){var u;if(n){if(o>=i.length)break;u=i[o++]}else{if((o=i.next()).done)break;u=o.value}var c=u||{},a=c.data,s=c.errors;s&&(t=[].concat(t,s)),a&&(r=[].concat(r,[a]))}var f=function(e){return L(C,function(){},e.reduce(function(e,t){return I("object",t)&&!M(t)?Mt({},e,t):e},{}))}(r),l=function(e){return L(C,function(){},e.reduce(function(e,t){var r;if(M(t)||C(t))return e;var n=t.path?t.path[0]:I("object",t)?t.constructor.name:"Errors";return Mt({},e,(r={},r[n]=[].concat(e[n]||[],[t]),r))},{}))}(t);return Mt({},f?{data:f}:{},l?{errors:l}:{})}function N(e){return!(e.kind!==t.Kind.OPERATION_DEFINITION)}function D(e){if("subscription"===e.operation&&1!==e.selectionSet.selections.length)return new t.GraphQLError(function(e){return(e?'Subscription "'+e+'" ':"Anonymous Subscription ")+"must select only one top level field."}(e.name&&e.name.value),e.selectionSet.selections.slice(1))}function G(e,r){if(!e.name&&r>1)return new t.GraphQLError("This anonymous operation must be the only defined operation.",[e])}function Q(e,r){if(function(e){return!(e.kind!==t.Kind.FRAGMENT_DEFINITION)}(e)){var n=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).name.value}(e);if(r[n])return new t.GraphQLError(function(e){return'There can be only one fragment named "'+e+'".'}(n),[r[n],e.name]);r[n]=e.name}}function U(e){for(var t=function(e){return e.definitions.filter(N)}(e).length,r=Object.create(null),n=[],o=Array.isArray(u=e.definitions),i=0,u=o?u:u[Symbol.iterator]();;){var c;if(o){if(i>=u.length)break;c=u[i++]}else{if((i=u.next()).done)break;c=i.value}var a=c,s=G(a,t)||Q(a,r)||D(a);s&&n.push(s)}return n}function Y(){function e(e){var r=e;try{r=function(e){return"string"==typeof e?t.parse(e):e}(e)}catch(e){return{document:r,errors:[e]}}var n=w?t.validate(w,r):U(r);return Mt({document:r},!C(n)&&{errors:n})}function n(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.variables,o=void 0===n?{}:n,i=r.context,u=arguments[2],c=arguments[3];return e(w,t,{},q(j,void 0===i?{}:i),Mt({},E,o),u,c)}}function o(e,t){if(e)if(I("function",e))x.use(e);else{if(!I("array",e))throw new TypeError(Bt(t));for(var r=Array.isArray(o=e),n=0,o=r?o:o[Symbol.iterator]();;){var i;if(r){if(n>=o.length)break;i=o[n++]}else{if((n=o.next()).done)break;i=n.value}x.use(i)}}}function i(t){return function(r,n,o,i){var u=e(r),c=u.document,a=u.errors;if(a)return Promise.resolve({errors:a});if(o)return k(c,n,o,i);if(1===c.definitions.length&&function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).operation}(c.definitions[0])===t)return k(c,n,o,i);return function(e){return new Promise(function(t){for(var r=[],n=function(){if(o){if(i>=u.length)return"break";c=u[i++]}else{if((i=u.next()).done)return"break";c=i.value}var e=c;r.push(new Promise(function(t){e.then(function(e){return t(e)},function(e){return t({errors:[e]})})}))},o=Array.isArray(u=e),i=0,u=o?u:u[Symbol.iterator]();;){var c;if("break"===n())break}Promise.all(r).then(function(e){t(R(e))})})}(c.definitions.filter(function(e){return e.operation===t}).map(function(e){return k(e,n,e.name.value,i)}))}}var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=u.typeDefs,a=u.resolvers,s=this,f=arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},p=l.variables,h=void 0===p?{}:p,v=l.context,y=void 0===v?{}:v,d=l.fetch,b=void 0===d?{}:d,m=new ge,g=void 0,w=void 0,O=void 0,_=void 0,j=void 0,E=void 0,x=void 0,k=n(t.execute),S=n(t.subscribe);return g=Mt({},f)||{},_=new It(g),O=L("function"==typeof a,a({pubsub:m,withFilter:we}),a),c&&(w=K({typeDefs:c,resolvers:O})),E=h,j=q({store:Mt({},_)},y),b.uri&&(x=r.createApolloFetch({uri:b.uri}),o(b.middleware,"middleware"),o(b.afterware,"afterware")),{get state(){return g},get schema(){return w},query:i("query"),mutate:i("mutation"),subscribe:function(){var r=qt(regeneratorRuntime.mark(function r(n,o,i,u){var c,a,f,l,p;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(c=e(n),a=c.document,!(f=c.errors)){r.next=3;break}return r.abrupt("return",Promise.resolve({errors:f}));case 3:if((l=a.definitions.filter(function(e){return"subscription"===e.operation})).length>=1){r.next=8;break}return r.abrupt("return",Promise.resolve({errors:[new t.GraphQLError(zt)]}));case 8:if(l.length<=1){r.next=10;break}return r.abrupt("return",Promise.resolve({errors:[new t.GraphQLError(Wt)]}));case 10:return r.next=12,S(a,o,i,u);case 12:return p=r.sent,p.toObservable=function(){return F(p)},r.abrupt("return",p);case 15:case"end":return r.stop()}},r,s)}));return function(e,t,n,o){return r.apply(this,arguments)}}(),fetch:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).variables,r=void 0===t?{}:t,n=arguments[2];if(!x||!I("function",x))throw Error($t);return x({query:e,variables:r,operationName:n})},graphql:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).variables,r=void 0===t?{}:t,n=arguments[2];if(Qt[Ut]||(console.warn(Ut),Qt[Ut]=!0),!x||!I("function",x))throw Error($t);return x({query:e,variables:r,operationName:n})}}}var $="default"in t?t.default:t,z="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=o(function(e,t){function r(e,t,r,n,o){var i={};return function(){var u=((Error().stack||"").match(/(?:\s+at\s.+){2}\s+at\s(.+)/)||[void 0,""])[1];if(!((u=/\)$/.test(u)?u.match(/[^(]+(?=\)$)/)[0]:u.trim())in i)){i[u]=!0;var c;switch(e){case"class":c="Class";break;case"property":c="Property";break;case"method":c="Method";break;case"function":c="Function"}c+=" `"+t+"` has been deprecated",n&&(c+=" since version "+n),r&&(c+=", use `"+r+"` instead"),c+=".",u&&(c+="\n at "+u),o&&(c+="\nCheck out "+o+" for more information."),console.warn(c)}}}function n(e,n,o,i,u,c){var a=(t.options.getWarner||r)(e,n,i,u,c),s={enumerable:(o=o||{writable:!0,enumerable:!1,configurable:!0}).enumerable,configurable:o.configurable};if(o.get||o.set)o.get&&(s.get=function(){return a(),o.get.call(this)}),o.set&&(s.set=function(e){return a(),o.set.call(this,e)});else{var f=o.value;s.get=function(){return a(),f},o.writable&&(s.set=function(e){a(),f=e})}return s}function o(e,n,o,i,u){for(var c=(t.options.getWarner||r)(e,n.name,o,i,u),a=function(){return c(),n.apply(this,arguments)},s=0,f=Object.getOwnPropertyNames(n);f.length>s;s++){var l=f[s],p=Object.getOwnPropertyDescriptor(n,l);p.writable?a[l]=n[l]:p.configurable&&Object.defineProperty(a,l,p)}return a}function i(){for(var e=[],t=0;arguments.length>t;t++)e[t-0]=arguments[t];var r=e[e.length-1];r="function"==typeof r?e.pop():void 0;var i,u,c,a=e[0];return"string"==typeof a?(i=a,u=e[1],c=e[2]):a&&(i=a.alternative,u=a.version,c=a.url),r?o("function",r,i,u,c):function(e,t,r){if("string"==typeof t){return n(r&&"function"==typeof r.value?"method":"property",t,r,i,u,c)}if("function"==typeof e){for(var a=o("class",e,i,u,c),s=e.name,f=0,l=Object.getOwnPropertyNames(a);l.length>f;f++){var p=l[f],h=Object.getOwnPropertyDescriptor(a,p);(h=n("class",s,h,i,u,c)).writable?a[p]=e[p]:h.configurable&&Object.defineProperty(a,p,h)}return a}}}t.options={getWarner:void 0},t.deprecated=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i});n(W);var B=o(function(e,t){function r(e){return void 0!==e.kind}function n(e,t){void 0===t&&(t=[]);var o=[];return e.forEach(function(e){if(r(e)&&(e=$.print(e)),"function"==typeof e)-1===t.indexOf(e)&&(t.push(e),o=o.concat(n(e(),t)));else{if("string"!=typeof e){throw new m("typeDef array must contain only strings and functions, got "+typeof e)}o.push(e.trim())}}),function(e){return e.reduce(function(e,t){return-1===e.indexOf(t)?e.concat([t]):e},[])}(o.map(function(e){return e.trim()})).join("\n")}function o(e){var t,o=e;if(r(e))t=e;else if("string"!=typeof o){if(!Array.isArray(o)){throw new m("typeDefs must be a string, array or schema AST, got "+typeof o)}o=n(o)}"string"==typeof o&&(t=$.parse(o));var u=d.buildASTSchema(t),c=i(t);return c.definitions.length>0&&(u=d.extendSchema(u,c)),u}function i(e){var t=e.definitions.filter(function(e){return e.kind===$.Kind.TYPE_EXTENSION_DEFINITION});return Object.assign({},e,{definitions:t})}function u(e,t){var r=e.getTypeMap();Object.keys(r).forEach(function(e){var n=r[e];if(!b.getNamedType(n).name.startsWith("__")&&n instanceof b.GraphQLObjectType){var o=n.getFields();Object.keys(o).forEach(function(r){t(o[r],e,r)})}})}function c(e,t){[e.getQueryType(),e.getMutationType(),e.getSubscriptionType()].filter(function(e){return!!e}).forEach(function(r){var n=function(e){var t,r=Math.random();return function(n,o,i,u){return u.operation.__runAtMostOnce||(u.operation.__runAtMostOnce={}),u.operation.__runAtMostOnce[r]||(u.operation.__runAtMostOnce[r]=!0,t=e(n,o,i,u)),t}}(t),o=r.getFields();Object.keys(o).forEach(function(i){o[i].resolve=r===e.getSubscriptionType()?h(o[i].resolve,t):h(o[i].resolve,n)})})}function a(e,t){Object.keys(t).forEach(function(r){var n=e.getType(r);if(!n&&"__schema"!==r)throw new m('"'+r+'" defined in resolvers, but not in schema');Object.keys(t[r]).forEach(function(e){if(e.startsWith("__"))n[e.substring(2)]=t[r][e];else if(n instanceof b.GraphQLScalarType)n[e]=t[r][e];else{var o=function(e){return e instanceof b.GraphQLObjectType||e instanceof b.GraphQLInterfaceType?e.getFields():void 0}(n);if(!o)throw new m(r+" was defined in resolvers, but it's not an object");if(!o[e])throw new m(r+"."+e+" defined in resolvers, but not in schema");var i=o[e],u=t[r][e];if("function"==typeof u)s(i,{resolve:u});else{if("object"!=typeof u)throw new m("Resolver "+r+"."+e+" must be object or function");s(i,u)}}})})}function s(e,t){Object.keys(t).forEach(function(r){e[r]=t[r]})}function f(e,t){void 0===t&&(t={});var r=t.requireResolversForArgs,n=void 0!==r&&r,o=t.requireResolversForNonScalar,i=void 0!==o&&o,c=t.requireResolversForAllFields,a=void 0!==c&&c;if(a&&(n||i))throw new TypeError("requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.");u(e,function(e,t,r){a&&l(e,t,r),n&&e.args.length>0&&l(e,t,r),!i||b.getNamedType(e.type)instanceof b.GraphQLScalarType||l(e,t,r)})}function l(e,t,r){if(e.resolve){if("function"!=typeof e.resolve)throw new m('Resolver "'+t+"."+r+'" must be a function')}else console.warn('Resolve function missing for "'+t+"."+r+'". To disable this warning check https://github.com/apollostack/graphql-tools/issues/131')}function p(e,t){if(!t)throw Error("Must provide a logger");if("function"!=typeof t.log)throw Error("Logger.log must be a function");u(e,function(e,r,n){e.resolve=function(e,t,r){void 0===e&&(e=$.defaultFieldResolver);var n=function(e){var n=Error();n.stack=e.stack,r&&(n.originalMessage=e.message,n.message="Error in resolver "+r+"\n"+e.message),t.log(n)};return function(t,r,o,i){try{var u=e(t,r,o,i);return u&&"function"==typeof u.then&&"function"==typeof u.catch&&u.catch(function(e){var t=e instanceof Error?e:Error(e);return n(t),e}),u}catch(e){throw n(e),e}}}(e.resolve,t,r+"."+n)})}function h(e,t){return function(r,n,o,i){return Promise.resolve(t(r,n,o,i)).then(function(t){return e?e(t,n,o,i):$.defaultFieldResolver(t,n,o,i)})}}function v(e){u(e,function(e,t,r){e.resolve=function(e,t){void 0===e&&(e=$.defaultFieldResolver);return function(r,n,o,i){var u=e(r,n,o,i);if(void 0===u)throw Error('Resolve function for "'+t+'" returned undefined');return u}}(e.resolve,t+"."+r)})}var y=z&&z.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var d=$,b=$,m=function(e){function t(t){var r=e.call(this,t)||this;return r.message=t,Error.captureStackTrace(r,r.constructor),r}return y(t,e),t}(Error);t.SchemaError=m,t.makeExecutableSchema=function(e){var t=e.resolvers,r=void 0===t?{}:t,n=e.connectors,i=e.allowUndefinedInResolve,u=e.resolverValidationOptions,s=function(e,t,r,n,i){if("object"!=typeof i)throw new m("Expected `resolverValidationOptions` to be an object");if(!e)throw new m("Must provide typeDefs");if(!t)throw new m("Must provide resolvers");var u=o(e);return a(u,t),f(u,i),n||v(u),r&&p(u,r),u}(e.typeDefs,r,e.logger,void 0===i||i,void 0===u?{}:u);return"function"==typeof r.__schema&&c(s,r.__schema),n&&g(s,n),s},t.concatenateTypeDefs=n,t.buildSchemaFromTypeDefinitions=o,t.extractExtensionDefinitions=i,t.forEachField=u;var g=W.deprecated({version:"0.7.0",url:"https://github.com/apollostack/graphql-tools/issues/140"},function(e,t){if(!(e&&e instanceof b.GraphQLSchema))throw Error("schema must be an instance of GraphQLSchema. This error could be caused by installing more than one version of GraphQL-JS");if("object"!=typeof t){throw Error("Expected connectors to be of type object, got "+typeof t)}if(0===Object.keys(t).length)throw Error("Expected connectors to not be an empty object");if(Array.isArray(t))throw Error("Expected connectors to be of type object, got Array");if(e._apolloConnectorsAttached)throw Error("Connectors already attached to context, cannot attach more than once");e._apolloConnectorsAttached=!0;c(e,function(e,r,n){if("object"!=typeof n)throw Error("Cannot attach connector because context is not an object: "+typeof n);return void 0===n.connectors&&(n.connectors={}),Object.keys(t).forEach(function(e){var r=t[e];if(!r.prototype)throw Error("Connector must be a function or an class");n.connectors[e]=new r(n)}),e})});t.attachConnectorsToContext=g,t.addSchemaLevelResolveFunction=c,t.addResolveFunctionsToSchema=a,t.assertResolveFunctionsPresent=f,t.addErrorLoggingToSchema=p,t.chainResolvers=function(e){return function(t,r,n,o){return e.reduce(function(e,t){return t?t(e,r,n,o):$.defaultFieldResolver(e,r,n,o)},t)}},t.addCatchUndefinedToSchema=v});n(B);var K=B.makeExecutableSchema;i.prototype=Object.create(null),u.EventEmitter=u,u.usingDomains=!1,u.prototype.domain=void 0,u.prototype._events=void 0,u.prototype._maxListeners=void 0,u.defaultMaxListeners=10,u.init=function(){this.domain=null,u.usingDomains&&(!(void 0).active||this instanceof(void 0).Domain||(this.domain=(void 0).active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new i,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return c(this)},u.prototype.emit=function(e){var t,r,n,o,i,u,c,a="error"===e;if(u=this._events)a=a&&null==u.error;else if(!a)return!1;if(c=this.domain,a){if(t=arguments[1],!c){if(t instanceof Error)throw t;var s=Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}return t||(t=Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=c,t.domainThrown=!1,c.emit("error",t),!1}if(!(r=u[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,o=l(e,n),i=0;n>i;++i)o[i].call(r)}(r,f,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var o=e.length,i=l(e,o),u=0;o>u;++u)i[u].call(r,n)}(r,f,this,arguments[1]);break;case 3:!function(e,t,r,n,o){if(t)e.call(r,n,o);else for(var i=e.length,u=l(e,i),c=0;i>c;++c)u[c].call(r,n,o)}(r,f,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,o,i){if(t)e.call(r,n,o,i);else for(var u=e.length,c=l(e,u),a=0;u>a;++a)c[a].call(r,n,o,i)}(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=Array(n-1),i=1;n>i;i++)o[i-1]=arguments[i];!function(e,t,r,n){if(t)e.apply(r,n);else for(var o=e.length,i=l(e,o),u=0;o>u;++u)i[u].apply(r,n)}(r,f,this,o)}return!0},u.prototype.on=u.prototype.addListener=function(e,t){return a(this,e,t,!1)},u.prototype.prependListener=function(e,t){return a(this,e,t,!0)},u.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,s(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,s(this,e,t)),this},u.prototype.removeListener=function(e,t){var r,n,o,u,c;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new i:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,u=r.length;u-- >0;)if(r[u]===t||r[u].listener&&r[u].listener===t){c=r[u].listener,o=u;break}if(0>o)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new i,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,o=e.length;o>n;r+=1,n+=1)e[r]=e[n];e.pop()}(r,o);n.removeListener&&this.emit("removeListener",e,c||t)}return this},u.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new i,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new i:delete r[e]),this;if(0===arguments.length){for(var n,o=Object.keys(r),u=0;o.length>u;++u)"removeListener"!==(n=o[u])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new i,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},u.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=Array(e.length),r=0;t.length>r;++r)t[r]=e[r].listener||e[r];return t}(t):[]},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var V=Object.freeze({default:u,EventEmitter:u}),X="function"==typeof Symbol&&Symbol.iterator,J=X||"@@iterator",H=J,Z=p,ee=h,te=function(e){return Object(e)===e&&(h(e)||p(e))},re=v,ne=y,oe=d;b.prototype[J]=function(){return this},b.prototype.next=function(){return void 0!==this._o&&this._o.length>this._i?{value:this._o[this._i++],done:!1}:(this._o=void 0,{value:void 0,done:!0})};var ie=function(e,t,r){if(null!=e){if("function"==typeof e.forEach)return e.forEach(t,r);var n=0,o=v(e);if(o){for(var i;!(i=o.next()).done;)if(t.call(r,i.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(h(e))for(;e.length>n;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}},ue="function"==typeof Symbol&&Symbol.asyncIterator,ce=ue||"@@asyncIterator",ae=ce,se=function(e){return!!g(e)},fe=m,le=g,pe=w;O.prototype[ce]=function(){return this},O.prototype.next=function(){var e=this._i.next();return Promise.resolve(e.value).then(function(t){return{value:t,done:e.done}})};var he={$$iterator:H,isIterable:Z,isArrayLike:ee,isCollection:te,getIterator:re,getIteratorMethod:ne,createIterator:oe,forEach:ie,$$asyncIterator:ae,isAsyncIterable:se,getAsyncIterator:fe,getAsyncIteratorMethod:le,createAsyncIterator:pe,forAwaitEach:function(e,t,r){var n=w(e);if(n){var o=0;return new Promise(function(i,u){function c(){return n.next().then(function(n){n.done?i():Promise.resolve(t.call(r,n.value,o++,e)).then(c).catch(u)}).catch(u)}c()})}}},ve=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.eventEmitterAsyncIterator=function(e,t){var r=[],n=[],o="string"==typeof t?[t]:t,i=!0,u=function(e){0!==r.length?r.shift()({value:e,done:!1}):n.push(e)},c=function(){i&&(i=!1,a(),r.forEach(function(e){return e({value:void 0,done:!0})}),r.length=0,n.length=0)},a=function(){for(var t=0,r=o;r.length>t;t++)e.removeListener(r[t],u)};return function(){for(var t=0,r=o;r.length>t;t++)e.addListener(r[t],u)}(),s={next:function(){return i?new Promise(function(e){0!==n.length?e({value:n.shift(),done:!1}):r.push(e)}):this.return()},return:function(){return c(),Promise.resolve({value:void 0,done:!0})},throw:function(e){return c(),Promise.reject(e)}},s[he.$$asyncIterator]=function(){return this},s;var s}});n(ve);var ye=V&&u||V,de=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.ee=new ye.EventEmitter,this.subscriptions={},this.subIdCounter=0}return e.prototype.publish=function(e,t){return this.ee.emit(e,t),!0},e.prototype.subscribe=function(e,t){return this.ee.addListener(e,t),this.subIdCounter=this.subIdCounter+1,this.subscriptions[this.subIdCounter]=[e,t],Promise.resolve(this.subIdCounter)},e.prototype.unsubscribe=function(e){var t=this.subscriptions[e],r=t[0],n=t[1];delete this.subscriptions[e],this.ee.removeListener(r,n)},e.prototype.asyncIterator=function(e){return ve.eventEmitterAsyncIterator(this.ee,e)},e}();t.PubSub=r});n(de);var be=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.withFilter=function(e,t){return function(r,n,o,i){var u=e(r,n,o,i),c=function(){return u.next().then(function(e){return Promise.all([e,Promise.resolve(t(e.value,n,o,i)).catch(function(){return!1})])}).then(function(e){var t=e[0];return!0===e[1]||!0===t.done?t:c()})};return a={next:function(){return c()},return:function(){return u.return()},throw:function(e){return u.throw(e)}},a[he.$$asyncIterator]=function(){return this},a;var a}}});n(be);var me=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PubSub=de.PubSub,t.withFilter=be.withFilter});n(me);var ge=me.PubSub,we=me.withFilter,Oe=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},_e=function(e){return function t(r){return 0===arguments.length||Oe(r)?t:e.apply(this,arguments)}},je=_e(function(e){return null==e}),Ee=function(e,t,r,n,o,i,u,c){if(!e){var a;if(void 0===t)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,u,c],f=0;(a=Error(t.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw a.framesToPop=1,a}},xe=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},ke=Object.prototype.toString,Se=function(){return"[object Arguments]"===ke.call(arguments)?function(e){return"[object Arguments]"===ke.call(e)}:function(e){return xe("callee",e)}},Ae=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},Pe=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Te=function(e){return"[object String]"===Object.prototype.toString.call(e)},Le=function(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return Oe(r)?t:_e(function(t){return e(r,t)});default:return Oe(r)&&Oe(n)?t:Oe(r)?_e(function(t){return e(t,n)}):Oe(n)?_e(function(t){return e(r,t)}):e(r,n)}}},Ie=function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r},Ce=function(e,t,r){for(var n=0,o=r.length;o>n;){if(e(t,r[n]))return!0;n+=1}return!1},Fe=function(e){var t=(e+"").match(/^function (\w*)/);return null==t?"":t[1]},qe=Le(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),Me=!{toString:null}.propertyIsEnumerable("toString"),Re=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Ne=function(){return arguments.propertyIsEnumerable("length")}(),De=function(e,t){for(var r=0;e.length>r;){if(e[r]===t)return!0;r+=1}return!1},Ge=_e("function"!=typeof Object.keys||Ne?function(e){if(Object(e)!==e)return[];var t,r,n=[],o=Ne&&Se(e);for(t in e)!xe(t,e)||o&&"length"===t||(n[n.length]=t);if(Me)for(r=Re.length-1;r>=0;)xe(t=Re[r],e)&&!De(n,t)&&(n[n.length]=t),r-=1;return n}:function(e){return Object(e)!==e?[]:Object.keys(e)}),Qe=_e(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),Ue=j,Ye=Le(function(e,t){return Ue(e,t,[],[])}),$e=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,o){return t.apply(this,arguments)};case 5:return function(e,r,n,o,i){return t.apply(this,arguments)};case 6:return function(e,r,n,o,i,u){return t.apply(this,arguments)};case 7:return function(e,r,n,o,i,u,c){return t.apply(this,arguments)};case 8:return function(e,r,n,o,i,u,c,a){return t.apply(this,arguments)};case 9:return function(e,r,n,o,i,u,c,a,s){return t.apply(this,arguments)};case 10:return function(e,r,n,o,i,u,c,a,s,f){return t.apply(this,arguments)};default:throw Error("First argument to _arity must be a non-negative integer no greater than ten")}},ze=function(e,t){return function(){return t.call(this,e.apply(this,arguments))}},We=function(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return Oe(r)?t:Le(function(t,n){return e(r,t,n)});case 2:return Oe(r)&&Oe(n)?t:Oe(r)?Le(function(t,r){return e(t,n,r)}):Oe(n)?Le(function(t,n){return e(r,t,n)}):_e(function(t){return e(r,n,t)});default:return Oe(r)&&Oe(n)&&Oe(o)?t:Oe(r)&&Oe(n)?Le(function(t,r){return e(t,r,o)}):Oe(r)&&Oe(o)?Le(function(t,r){return e(t,n,r)}):Oe(n)&&Oe(o)?Le(function(t,n){return e(r,t,n)}):Oe(r)?_e(function(t){return e(t,n,o)}):Oe(n)?_e(function(t){return e(r,t,o)}):Oe(o)?_e(function(t){return e(r,n,t)}):e(r,n,o)}}},Be=_e(function(e){return!!Ae(e)||!!e&&("object"==typeof e&&(!Te(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))}),Ke=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Ve=function(e){return new Ke(e)},Xe=Le(function(e,t){return $e(e.length,function(){return e.apply(t,arguments)})}),Je="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",He=function(e,t,r){if("function"==typeof e&&(e=Ve(e)),Be(r))return function(e,t,r){for(var n=0,o=r.length;o>n;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}(e,t,r);if("function"==typeof r["fantasy-land/reduce"])return x(e,t,r,"fantasy-land/reduce");if(null!=r[Je])return E(e,t,r[Je]());if("function"==typeof r.next)return E(e,t,r);if("function"==typeof r.reduce)return x(e,t,r,"reduce");throw new TypeError("reduce: list must be array or iterable")},Ze=We(He),et=function(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return Ae(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}},tt=_e(et("tail",We(et("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)}))(1,1/0))),rt=function(){if(0===arguments.length)throw Error("pipe requires at least one argument");return $e(arguments[0].length,Ze(ze,arguments[0],tt(arguments)))},nt=_e(function(e){return Te(e)?e.split("").reverse().join(""):Array.prototype.slice.call(e,0).reverse()}),ot=function(){if(0===arguments.length)throw Error("compose requires at least one argument");return rt.apply(this,nt(arguments))},it=function(e){return function(){return!e.apply(this,arguments)}},ut=function(e){return"function"==typeof e["@@transducer/step"]},ct=function(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),o=n.pop();if(!Ae(o)){for(var i=0;e.length>i;){if("function"==typeof o[e[i]])return o[e[i]].apply(o,n);i+=1}if(ut(o))return t.apply(null,n)(o)}return r.apply(this,arguments)}},at=function(e,t){for(var r=0,n=t.length,o=[];n>r;)e(t[r])&&(o[o.length]=t[r]),r+=1;return o},st=function(){return this.xf["@@transducer/init"]()},ft=function(e){return this.xf["@@transducer/result"](e)},lt=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=st,e.prototype["@@transducer/result"]=ft,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}(),pt=Le(ct(["filter"],Le(function(e,t){return new lt(e,t)}),function(e,t){return Pe(t)?He(function(r,n){return e(t[n])&&(r[n]=t[n]),r},{},Ge(t)):at(e,t)})),ht=Le(function(e,t){return pt(it(e),t)}),vt="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},yt=function(e){return ot(Ye(e),Qe)},dt=yt("Array"),bt=yt("Object"),mt=function(e,t){Ee(!je(e),'The "'+t+"\" collection does not exist. You can create one using your clerk instance by running(clerk.addCollection('"+t+"'))"),Ee("object"===(void 0===e?"undefined":vt(e)),'"'+t+'" is not a collection. You can access it like any other property on the state object')},gt=ht(yt("Undefined")),wt=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ot=function(e){return k()},_t=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jt=function(e){return S()},Et=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xt=function(e){return A()},kt="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,n=arguments.length;n>r;){var o=arguments[r];if(null!=o)for(var i in o)xe(i,o)&&(t[i]=o[i]);r+=1}return t},St=Le(function(e,t){return kt({},e,t)}),At=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pt=function(e){return P()},Tt=Le(function(e,t){for(var r={},n={},o=0,i=e.length;i>o;)n[e[o]]=1,o+=1;for(var u in t)n.hasOwnProperty(u)||(r[u]=t[u]);return r}),Lt=function(e){return T()},It=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.state=t,this.get=Ot(t).bind(t),this.post=jt(t).bind(t),this.put=xt(t).bind(t),this.patch=Pt(t).bind(t),this.delete=Lt(t).bind(t)}return e.prototype.getCollection=function(e){return this.state[e]},e.prototype.addCollection=function(e){return this.state[e]=new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object),this.state[e]},e.prototype.removeCollection=function(e){var t=this.state[e];return null!=t&&delete this.state[e],t},e}(),Ct="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},Ft=function(e){if("function"==typeof Symbol){if(Symbol.asyncIterator){var t=e[Symbol.asyncIterator];if(null!=t)return t.call(e)}if(Symbol.iterator)return e[Symbol.iterator]()}throw new TypeError("Object is not async iterable")},qt=(function(){function e(e){this.value=e}function t(t){function r(o,i){try{var u=t[o](i),c=u.value;c instanceof e?Promise.resolve(c.value).then(function(e){r("next",e)},function(e){r("throw",e)}):n(u.done?"return":"normal",u.value)}catch(e){n("throw",e)}}function n(e,t){switch(e){case"return":o.resolve({value:t,done:!0});break;case"throw":o.reject(t);break;default:o.resolve({value:t,done:!1})}(o=o.next)?r(o.key,o.arg):i=null}var o,i;this._invoke=function(e,t){return new Promise(function(n,u){var c={key:e,arg:t,resolve:n,reject:u,next:null};i?i=i.next=c:(o=i=c,r(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,i){try{var u=t[o](i),c=u.value}catch(e){return void r(e)}if(!u.done)return Promise.resolve(c).then(function(e){n("next",e)},function(e){n("throw",e)});e(c)}return n("next")})}}),Mt=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rt=function(e,t){var r={};for(var n in e)0>t.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},Nt=o(function(e,t){!function(e,t){function r(e){return"function"==typeof Symbol&&!!Symbol[e]}function n(e){return r(e)?Symbol[e]:"@@"+e}function o(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function i(e){var t=e.constructor;return void 0!==t&&null===(t=t[n("species")])&&(t=void 0),void 0!==t?t:l}function u(e,t){Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);n.enumerable=!1,Object.defineProperty(e,r,n)})}function c(e){var t=e._cleanup;t&&(e._cleanup=void 0,t())}function a(e){return void 0===e._observer}function s(e,t){if(Object(e)!==e)throw new TypeError("Observer must be an object");this._cleanup=void 0,this._observer=e;var r=o(e,"start");if(r&&r.call(e,this),!a(this)){e=new f(this);try{var n=t.call(void 0,e);if(null!=n){if("function"==typeof n.unsubscribe)n=function(e){return function(){e.unsubscribe()}}(n);else if("function"!=typeof n)throw new TypeError(n+" is not a function");this._cleanup=n}}catch(t){return void e.error(t)}a(this)&&c(this)}}function f(e){this._subscription=e}function l(e){if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}"function"!=typeof Symbol||Symbol.observable||(Symbol.observable=Symbol("observable"));u(s.prototype={},{get closed(){return a(this)},unsubscribe:function(){!function(e){if(a(e))return;e._observer=void 0,c(e)}(this)}});u(f.prototype={},{get closed(){return a(this._subscription)},next:function(e){var t=this._subscription;if(!a(t)){var r=t._observer,n=o(r,"next");if(n)return n.call(r,e)}},error:function(e){var t=this._subscription;if(a(t))throw e;var r=t._observer;t._observer=void 0;try{var n=o(r,"error");if(!n)throw e;e=n.call(r,e)}catch(e){try{c(t)}finally{throw e}}return c(t),e},complete:function(e){var t=this._subscription;if(!a(t)){var r=t._observer;t._observer=void 0;try{var n=o(r,"complete");e=n?n.call(r,e):void 0}catch(e){try{c(t)}finally{throw e}}return c(t),e}}});u(l.prototype,{subscribe:function(e){for(var t=[],r=1;arguments.length>r;++r)t.push(arguments[r]);return"function"==typeof e&&(e={next:e,error:t[0],complete:t[1]}),new s(e,this._subscriber)},forEach:function(e){var t=this;return new Promise(function(r,n){if("function"!=typeof e)return Promise.reject(new TypeError(e+" is not a function"));t.subscribe({_subscription:null,start:function(e){if(Object(e)!==e)throw new TypeError(e+" is not an object");this._subscription=e},next:function(t){var r=this._subscription;if(!r.closed)try{return e(t)}catch(e){n(e),r.unsubscribe()}},error:n,complete:r})})},map:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this);return new r(function(r){return t.subscribe({next:function(t){if(!r.closed){try{t=e(t)}catch(e){return r.error(e)}return r.next(t)}},error:function(e){return r.error(e)},complete:function(e){return r.complete(e)}})})},filter:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this);return new r(function(r){return t.subscribe({next:function(t){if(!r.closed){try{if(!e(t))return}catch(e){return r.error(e)}return r.next(t)}},error:function(e){return r.error(e)},complete:function(){return r.complete()}})})},reduce:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this),n=arguments.length>1,o=!1,u=arguments[1],c=u;return new r(function(r){return t.subscribe({next:function(t){if(!r.closed){var i=!o;if(o=!0,!i||n)try{c=e(c,t)}catch(e){return r.error(e)}else c=t}},error:function(e){r.error(e)},complete:function(){o||n?(r.next(c),r.complete()):r.error(new TypeError("Cannot reduce an empty sequence"))}})})},flatMap:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this);return new r(function(r){function n(){o&&0===i.length&&r.complete()}var o=!1,i=[],u=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return void r.error(e)}l.from(t).subscribe({_subscription:null,start:function(e){i.push(this._subscription=e)},next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(this._subscription);0>e||i.splice(e,1),n()}})},error:function(e){return r.error(e)},complete:function(){o=!0,n()}});return function(){i.forEach(function(e){return e.unsubscribe()}),u.unsubscribe()}})}}),Object.defineProperty(l.prototype,n("observable"),{value:function(){return this},writable:!0,configurable:!0}),u(l,{from:function(e){var t="function"==typeof this?this:l;if(null==e)throw new TypeError(e+" is not an object");var i=o(e,n("observable"));if(i){var u=i.call(e);if(Object(u)!==u)throw new TypeError(u+" is not an object");return u.constructor===t?u:new t(function(e){return u.subscribe(e)})}if(r("iterator")&&(i=o(e,n("iterator"))))return new t(function(t){for(var r,n=i.call(e)[Symbol.iterator]();!(r=n.next()).done;){var o=r.value;if(t.next(o),t.closed)return}t.complete()});if(Array.isArray(e))return new t(function(t){for(var r=0;e.length>r;++r)if(t.next(e[r]),t.closed)return;t.complete()});throw new TypeError(e+" is not observable")},of:function(){for(var e=[],t=0;arguments.length>t;++t)e.push(arguments[t]);var r="function"==typeof this?this:l;return new r(function(t){for(var r=0;e.length>r;++r)if(t.next(e[r]),t.closed)return;t.complete()})}}),Object.defineProperty(l,n("species"),{get:function(){return this},configurable:!0}),e.Observable=l}(t)}).Observable,Dt='You cannot extend the context with an object containing a "store" prop. It will be omitted and the other props will be added',Gt=function(e){return'The "'+e+"\" property already exists in the context object. Make sure you haven't replaced anything important"},Qt={},Ut=' The "graphql" method is deprecated and will be removed in the 1.0 release. Use the "fetch" method instead.',Yt='The "createStore" method is deprecated and will be removed in the 1.0 release. Use "new BlipsClient(...)" instead',$t='You are trying to use "BlipsClient.fetch" without it being configured.',zt="No subscription operation defined in query",Wt="Only one subscription operation is allowed per query",Bt=function(){return"The fetch "+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"middleware/afterware")+" must be a function or an array of functions"};e.BlipsClient=Y,e.createStore=function(){Qt[Yt]||(console.warn(Yt),Qt[Yt]=!0);for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return new(Function.prototype.bind.apply(Y,[null].concat(t)))},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("graphql"),require("apollo-fetch")):"function"==typeof define&&define.amd?define(["exports","graphql","apollo-fetch"],t):t(e.blips={},e.GraphQL,e.ApolloFetch)}(this,function(e,t,r){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t){return t={exports:{}},e(t,t.exports),t.exports}function i(){}function u(){u.init.call(this)}function c(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function a(e,t,r,n){var o,u,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((u=e._events)?(u.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),u=e._events),a=u[t]):(u=e._events=new i,e._eventsCount=0),a){if("function"==typeof a?a=u[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(o=c(e))&&o>0&&a.length>o){a.warned=!0;var s=Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(s)}}else a=u[t]=r,++e._eventsCount;return e}function s(e,t,r){function n(){e.removeListener(t,n),o||(o=!0,r.apply(e,arguments))}var o=!1;return n.listener=r,n}function f(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function l(e,t){for(var r=Array(t);t--;)r[t]=e[t];return r}function p(e){return!!y(e)}function h(e){var t=null!=e&&e.length;return"number"==typeof t&&t>=0&&t%1==0}function v(e){var t=y(e);if(t)return t.call(e)}function y(e){if(null!=e){var t=X&&e[X]||e["@@iterator"];if("function"==typeof t)return t}}function d(e){if(null!=e){var t=v(e);if(t)return t;if(h(e))return new b(e)}}function b(e){this._o=e,this._i=0}function m(e){var t=g(e);if(t)return t.call(e)}function g(e){if(null!=e){var t=ue&&e[ue]||e["@@asyncIterator"];if("function"==typeof t)return t}}function w(e){if(null!=e){var t=m(e);if(t)return t;var r=d(e);if(r)return new O(r)}}function O(e){this._i=e}function _(e,t,r,n){function o(e,t){return j(e,t,r.slice(),n.slice())}var i=Ie(e),u=Ie(t);return!Ce(function(e,t){return!Ce(o,t,e)},u,i)}function j(e,t,r,n){if(qe(e,t))return!0;var o=Qe(e);if(o!==Qe(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===Fe(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!qe(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!qe(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=r.length-1;i>=0;){if(r[i]===e)return n[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&_(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&_(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var u=Ge(e);if(u.length!==Ge(t).length)return!1;var c=r.concat([e]),a=n.concat([t]);for(i=u.length-1;i>=0;){var s=u[i];if(!xe(s,t)||!j(t[s],e[s],c,a))return!1;i-=1}return!0}function E(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function x(e,t,r,n){return e["@@transducer/result"](r[n](Xe(e["@@transducer/step"],e),t))}function k(e){return function(e,t){var r=this[e];return mt(r,e),dt(r)?je(t)?r:function(e,t){if(!bt(t))return[];var r=Object.entries(t)[0],n=r[0],o=r[1];return e.filter(function(e){return e[n]===o})}(r,t):je(t)?r:function(e,t){if(bt(t)){var r=Object.entries(t)[0]||{},n=r[0],o=r[1];return Object.entries(e).filter(function(e){return e[1][n]===o}).reduce(function(e,t){var r;return wt({},e,(r={},r[t[0]]=t[1],r))},{})}return e[t]}(r,t)}}function S(e){return function(e,t,r){var n=this[e];return mt(n,e),dt(n)?function(e,t){return this[e]=[].concat(this[e]||[],[t]),t}.call(this,e,t):function(e,t,r){var n;return Ee(!je(t),"You forgot to specify the payload"),Ee(!je(r),"You are trying to post to a collection object but haven't specified an identifier. Try again with \"clerk.post('"+e+"', payload, identifier)\""),this[e]=_t({},this[e]||{},(n={},n[r]=t,n)),t}.call(this,e,t,r)}}function A(e){return function(e,t,r){var n=this[e];return mt(n,e),dt(n)?function(e,t,r){if(je(r))return this[e]=[].concat(this[e],[t]),t;Ee(bt(r),"When updating a resource inside a list you have to specify an identifier object containing the key/value pair you want to match.");var n=Object.entries(r)[0],o=n[0],i=n[1],u=this[e].findIndex(function(e){return e[o]===i});return this[e]=[].concat(this[e].slice(0,u),[t],this[e].slice(u+1)),t}.call(this,e,t,r):function(e,t,r){var n;return Ee(!je(r),"You are trying to update a resource but haven't specified the identifier. Try again with \"clerk.put('"+e+"', payload, identifier)\""),this[e]=Et({},this[e]||{},(n={},n[r]=t,n)),t}.call(this,e,t,r)}}function P(e){return function(e,t,r){var n=this[e];return mt(n,e),Ee(!je(r),"You are trying to patch a resource but haven't specified the identifier. Try again with \"clerk.patch('"+e+"', payload, key)\""),dt(n)?function(e,t,r){Ee(bt(r),"When patching a resource inside a list you have to specify an identifier object containing the key/value pair you want to match.");var n=Object.entries(r)[0],o=n[0],i=n[1],u=this[e].findIndex(function(e){return e[o]===i});if(u>=0){var c=St(this[e][u],gt(t));return this[e]=[].concat(this[e].slice(0,u),[c],this[e].slice(u+1)),c}}.call(this,e,t,r):function(e,t,r){var n;if(Ee(!je(r),"You are trying to update a resource but haven't specified the identifier. Try again with \"clerk.put('"+e+"', payload, identifier)\""),!je(this[e][r])){var o=St(this[e][r],gt(t));return this[e]=At({},this[e]||{},(n={},n[r]=o,n)),o}}.call(this,e,t,r)}}function T(e){return function(e,t){if(!je(t)){var r=this[e];return mt(r,e),dt(r)?function(e,t){if(bt(t)){var r=Object.entries(t)[0],n=r[0],o=r[1],i=this[e].findIndex(function(e){return e[n]===o});if(i>=0){var u=this[e][i];return this[e]=[].concat(this[e].slice(0,i),this[e].slice(i+1)),u}}}.call(this,e,t):function(e,t){var r=this[e][t];if(!je(r))return this[e]=Tt([t],this[e]),r}.call(this,e,t)}}}function L(e,t,r){var n=!!e;return"function"==typeof e&&(n=!!e(r)),n?"function"==typeof t?t(r):t:r}function I(e,t){return null===t?"null"===e.toLowerCase():void 0===t?"undefined"===e.toLowerCase():e.toLowerCase()===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(t).toLowerCase()}function C(e){return"string"==typeof e?!e:I("object",e)?!Object.values(e).length:I("array",e)?!e.length:I("Map",e)?!e.size:!!I("Set",e)&&!e.size}function F(e){var t=this;return new Nt(function(r){return qt(regeneratorRuntime.mark(function n(){var o,i,u,c,a,s,f;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,o=!0,i=!1,u=void 0,t.prev=4,c=Ft(e);case 6:return t.next=8,c.next();case 8:return a=t.sent,o=a.done,t.next=12,a.value;case 12:if(s=t.sent,o){t.next=19;break}r.next(f=s);case 16:o=!0,t.next=6;break;case 19:t.next=25;break;case 21:t.prev=21,t.t0=t.catch(4),i=!0,u=t.t0;case 25:if(t.prev=25,t.prev=26,o||!c.return){t.next=30;break}return t.next=30,c.return();case 30:if(t.prev=30,!i){t.next=33;break}throw u;case 33:return t.finish(30);case 34:return t.finish(25);case 35:t.next=41;break;case 37:t.prev=37,t.t1=t.catch(0),e.return(),r.error(t.t1);case 41:case"end":return t.stop()}},n,t,[[0,37],[4,21,25,35],[26,,30,34]])}))(),function(){r.complete(),e.return()}})}function q(e,t){if(!t||"object"!==(void 0===t?"undefined":Ct(t))||t.hasOwnProperty("length")||t.hasOwnProperty("size"))return e;var r=t.store,n=Rt(t,["store"]);r&&console.warn(Dt);var o=Object.keys(n),i=Array.isArray(o),u=0;for(o=i?o:o[Symbol.iterator]();;){var c;if(i){if(u>=o.length)break;c=o[u++]}else{if((u=o.next()).done)break;c=u.value}var a=c;e.hasOwnProperty(a)&&console.warn(Gt(a))}return Mt({},e,n)}function M(e){return null==e}function R(e){for(var t=[],r=[],n=Array.isArray(i=e),o=0,i=n?i:i[Symbol.iterator]();;){var u;if(n){if(o>=i.length)break;u=i[o++]}else{if((o=i.next()).done)break;u=o.value}var c=u||{},a=c.data,s=c.errors;s&&(t=[].concat(t,s)),a&&(r=[].concat(r,[a]))}var f=function(e){return L(C,function(){},e.reduce(function(e,t){return I("object",t)&&!M(t)?Mt({},e,t):e},{}))}(r),l=function(e){return L(C,function(){},e.reduce(function(e,t){var r;if(M(t)||C(t))return e;var n=t.path?t.path[0]:I("object",t)?t.constructor.name:"Errors";return Mt({},e,(r={},r[n]=[].concat(e[n]||[],[t]),r))},{}))}(t);return Mt({},f?{data:f}:{},l?{errors:l}:{})}function N(e){return!(e.kind!==t.Kind.OPERATION_DEFINITION)}function D(e){if("subscription"===e.operation&&1!==e.selectionSet.selections.length)return new t.GraphQLError(function(e){return(e?'Subscription "'+e+'" ':"Anonymous Subscription ")+"must select only one top level field."}(e.name&&e.name.value),e.selectionSet.selections.slice(1))}function G(e,r){if(!e.name&&r>1)return new t.GraphQLError("This anonymous operation must be the only defined operation.",[e])}function Q(e,r){if(function(e){return!(e.kind!==t.Kind.FRAGMENT_DEFINITION)}(e)){var n=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).name.value}(e);if(r[n])return new t.GraphQLError(function(e){return'There can be only one fragment named "'+e+'".'}(n),[r[n],e.name]);r[n]=e.name}}function U(e){for(var t=function(e){return e.definitions.filter(N)}(e).length,r=Object.create(null),n=[],o=Array.isArray(u=e.definitions),i=0,u=o?u:u[Symbol.iterator]();;){var c;if(o){if(i>=u.length)break;c=u[i++]}else{if((i=u.next()).done)break;c=i.value}var a=c,s=G(a,t)||Q(a,r)||D(a);s&&n.push(s)}return n}function Y(){function e(e){var r=e;try{r=function(e){return"string"==typeof e?t.parse(e):e}(e)}catch(e){return{document:r,errors:[e]}}var n=w?t.validate(w,r):U(r);return Mt({document:r},!C(n)&&{errors:n})}function n(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.variables,o=void 0===n?{}:n,i=r.context,u=arguments[2],c=arguments[3];return e(w,t,{},q(j,void 0===i?{}:i),Mt({},E,o),u,c)}}function o(e,t){if(e)if(I("function",e))x.use(e);else{if(!I("array",e))throw new TypeError(Bt(t));for(var r=Array.isArray(o=e),n=0,o=r?o:o[Symbol.iterator]();;){var i;if(r){if(n>=o.length)break;i=o[n++]}else{if((n=o.next()).done)break;i=n.value}x.use(i)}}}function i(t){return function(r,n,o,i){var u=e(r),c=u.document,a=u.errors;if(a)return Promise.resolve({errors:a});if(o)return k(c,n,o,i);var s=c.definitions.filter(function(e){return e.operation===t});return 1===s.length?k(c,n,o,i):function(e){return new Promise(function(t){for(var r=[],n=function(){if(o){if(i>=u.length)return"break";c=u[i++]}else{if((i=u.next()).done)return"break";c=i.value}var e=c;r.push(new Promise(function(t){e.then(function(e){return t(e)},function(e){return t({errors:[e]})})}))},o=Array.isArray(u=e),i=0,u=o?u:u[Symbol.iterator]();;){var c;if("break"===n())break}Promise.all(r).then(function(e){t(R(e))})})}(s.map(function(e){return k(c,n,e.name.value,i)}))}}var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=u.typeDefs,a=u.resolvers,s=this,f=arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},p=l.variables,h=void 0===p?{}:p,v=l.context,y=void 0===v?{}:v,d=l.fetch,b=void 0===d?{}:d,m=new ge,g=void 0,w=void 0,O=void 0,_=void 0,j=void 0,E=void 0,x=void 0,k=n(t.execute),S=n(t.subscribe);return g=Mt({},f)||{},_=new It(g),O=L("function"==typeof a,a({pubsub:m,withFilter:we}),a),c&&(w=K({typeDefs:c,resolvers:O})),E=h,j=q({store:Mt({},_)},y),b.uri&&(x=r.createApolloFetch({uri:b.uri}),o(b.middleware,"middleware"),o(b.afterware,"afterware")),{get state(){return g},get schema(){return w},query:i("query"),mutate:i("mutation"),subscribe:function(){var r=qt(regeneratorRuntime.mark(function r(n,o,i,u){var c,a,f,l,p;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(c=e(n),a=c.document,!(f=c.errors)){r.next=3;break}return r.abrupt("return",Promise.resolve({errors:f}));case 3:if((l=a.definitions.filter(function(e){return"subscription"===e.operation})).length>=1){r.next=8;break}return r.abrupt("return",Promise.resolve({errors:[new t.GraphQLError(zt)]}));case 8:if(l.length<=1){r.next=10;break}return r.abrupt("return",Promise.resolve({errors:[new t.GraphQLError(Wt)]}));case 10:return r.next=12,S(a,o,i,u);case 12:return p=r.sent,p.toObservable=function(){return F(p)},r.abrupt("return",p);case 15:case"end":return r.stop()}},r,s)}));return function(e,t,n,o){return r.apply(this,arguments)}}(),fetch:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).variables,r=void 0===t?{}:t,n=arguments[2];if(!x||!I("function",x))throw Error($t);return x({query:e,variables:r,operationName:n})},graphql:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).variables,r=void 0===t?{}:t,n=arguments[2];if(Qt[Ut]||(console.warn(Ut),Qt[Ut]=!0),!x||!I("function",x))throw Error($t);return x({query:e,variables:r,operationName:n})}}}var $="default"in t?t.default:t,z="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=o(function(e,t){function r(e,t,r,n,o){var i={};return function(){var u=((Error().stack||"").match(/(?:\s+at\s.+){2}\s+at\s(.+)/)||[void 0,""])[1];if(!((u=/\)$/.test(u)?u.match(/[^(]+(?=\)$)/)[0]:u.trim())in i)){i[u]=!0;var c;switch(e){case"class":c="Class";break;case"property":c="Property";break;case"method":c="Method";break;case"function":c="Function"}c+=" `"+t+"` has been deprecated",n&&(c+=" since version "+n),r&&(c+=", use `"+r+"` instead"),c+=".",u&&(c+="\n at "+u),o&&(c+="\nCheck out "+o+" for more information."),console.warn(c)}}}function n(e,n,o,i,u,c){var a=(t.options.getWarner||r)(e,n,i,u,c),s={enumerable:(o=o||{writable:!0,enumerable:!1,configurable:!0}).enumerable,configurable:o.configurable};if(o.get||o.set)o.get&&(s.get=function(){return a(),o.get.call(this)}),o.set&&(s.set=function(e){return a(),o.set.call(this,e)});else{var f=o.value;s.get=function(){return a(),f},o.writable&&(s.set=function(e){a(),f=e})}return s}function o(e,n,o,i,u){for(var c=(t.options.getWarner||r)(e,n.name,o,i,u),a=function(){return c(),n.apply(this,arguments)},s=0,f=Object.getOwnPropertyNames(n);f.length>s;s++){var l=f[s],p=Object.getOwnPropertyDescriptor(n,l);p.writable?a[l]=n[l]:p.configurable&&Object.defineProperty(a,l,p)}return a}function i(){for(var e=[],t=0;arguments.length>t;t++)e[t-0]=arguments[t];var r=e[e.length-1];r="function"==typeof r?e.pop():void 0;var i,u,c,a=e[0];return"string"==typeof a?(i=a,u=e[1],c=e[2]):a&&(i=a.alternative,u=a.version,c=a.url),r?o("function",r,i,u,c):function(e,t,r){if("string"==typeof t){return n(r&&"function"==typeof r.value?"method":"property",t,r,i,u,c)}if("function"==typeof e){for(var a=o("class",e,i,u,c),s=e.name,f=0,l=Object.getOwnPropertyNames(a);l.length>f;f++){var p=l[f],h=Object.getOwnPropertyDescriptor(a,p);(h=n("class",s,h,i,u,c)).writable?a[p]=e[p]:h.configurable&&Object.defineProperty(a,p,h)}return a}}}t.options={getWarner:void 0},t.deprecated=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i});n(W);var B=o(function(e,t){function r(e){return void 0!==e.kind}function n(e,t){void 0===t&&(t=[]);var o=[];return e.forEach(function(e){if(r(e)&&(e=$.print(e)),"function"==typeof e)-1===t.indexOf(e)&&(t.push(e),o=o.concat(n(e(),t)));else{if("string"!=typeof e){throw new m("typeDef array must contain only strings and functions, got "+typeof e)}o.push(e.trim())}}),function(e){return e.reduce(function(e,t){return-1===e.indexOf(t)?e.concat([t]):e},[])}(o.map(function(e){return e.trim()})).join("\n")}function o(e){var t,o=e;if(r(e))t=e;else if("string"!=typeof o){if(!Array.isArray(o)){throw new m("typeDefs must be a string, array or schema AST, got "+typeof o)}o=n(o)}"string"==typeof o&&(t=$.parse(o));var u=d.buildASTSchema(t),c=i(t);return c.definitions.length>0&&(u=d.extendSchema(u,c)),u}function i(e){var t=e.definitions.filter(function(e){return e.kind===$.Kind.TYPE_EXTENSION_DEFINITION});return Object.assign({},e,{definitions:t})}function u(e,t){var r=e.getTypeMap();Object.keys(r).forEach(function(e){var n=r[e];if(!b.getNamedType(n).name.startsWith("__")&&n instanceof b.GraphQLObjectType){var o=n.getFields();Object.keys(o).forEach(function(r){t(o[r],e,r)})}})}function c(e,t){[e.getQueryType(),e.getMutationType(),e.getSubscriptionType()].filter(function(e){return!!e}).forEach(function(r){var n=function(e){var t,r=Math.random();return function(n,o,i,u){return u.operation.__runAtMostOnce||(u.operation.__runAtMostOnce={}),u.operation.__runAtMostOnce[r]||(u.operation.__runAtMostOnce[r]=!0,t=e(n,o,i,u)),t}}(t),o=r.getFields();Object.keys(o).forEach(function(i){o[i].resolve=r===e.getSubscriptionType()?h(o[i].resolve,t):h(o[i].resolve,n)})})}function a(e,t){Object.keys(t).forEach(function(r){var n=e.getType(r);if(!n&&"__schema"!==r)throw new m('"'+r+'" defined in resolvers, but not in schema');Object.keys(t[r]).forEach(function(e){if(e.startsWith("__"))n[e.substring(2)]=t[r][e];else if(n instanceof b.GraphQLScalarType)n[e]=t[r][e];else{var o=function(e){return e instanceof b.GraphQLObjectType||e instanceof b.GraphQLInterfaceType?e.getFields():void 0}(n);if(!o)throw new m(r+" was defined in resolvers, but it's not an object");if(!o[e])throw new m(r+"."+e+" defined in resolvers, but not in schema");var i=o[e],u=t[r][e];if("function"==typeof u)s(i,{resolve:u});else{if("object"!=typeof u)throw new m("Resolver "+r+"."+e+" must be object or function");s(i,u)}}})})}function s(e,t){Object.keys(t).forEach(function(r){e[r]=t[r]})}function f(e,t){void 0===t&&(t={});var r=t.requireResolversForArgs,n=void 0!==r&&r,o=t.requireResolversForNonScalar,i=void 0!==o&&o,c=t.requireResolversForAllFields,a=void 0!==c&&c;if(a&&(n||i))throw new TypeError("requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.");u(e,function(e,t,r){a&&l(e,t,r),n&&e.args.length>0&&l(e,t,r),!i||b.getNamedType(e.type)instanceof b.GraphQLScalarType||l(e,t,r)})}function l(e,t,r){if(e.resolve){if("function"!=typeof e.resolve)throw new m('Resolver "'+t+"."+r+'" must be a function')}else console.warn('Resolve function missing for "'+t+"."+r+'". To disable this warning check https://github.com/apollostack/graphql-tools/issues/131')}function p(e,t){if(!t)throw Error("Must provide a logger");if("function"!=typeof t.log)throw Error("Logger.log must be a function");u(e,function(e,r,n){e.resolve=function(e,t,r){void 0===e&&(e=$.defaultFieldResolver);var n=function(e){var n=Error();n.stack=e.stack,r&&(n.originalMessage=e.message,n.message="Error in resolver "+r+"\n"+e.message),t.log(n)};return function(t,r,o,i){try{var u=e(t,r,o,i);return u&&"function"==typeof u.then&&"function"==typeof u.catch&&u.catch(function(e){var t=e instanceof Error?e:Error(e);return n(t),e}),u}catch(e){throw n(e),e}}}(e.resolve,t,r+"."+n)})}function h(e,t){return function(r,n,o,i){return Promise.resolve(t(r,n,o,i)).then(function(t){return e?e(t,n,o,i):$.defaultFieldResolver(t,n,o,i)})}}function v(e){u(e,function(e,t,r){e.resolve=function(e,t){void 0===e&&(e=$.defaultFieldResolver);return function(r,n,o,i){var u=e(r,n,o,i);if(void 0===u)throw Error('Resolve function for "'+t+'" returned undefined');return u}}(e.resolve,t+"."+r)})}var y=z&&z.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var d=$,b=$,m=function(e){function t(t){var r=e.call(this,t)||this;return r.message=t,Error.captureStackTrace(r,r.constructor),r}return y(t,e),t}(Error);t.SchemaError=m,t.makeExecutableSchema=function(e){var t=e.resolvers,r=void 0===t?{}:t,n=e.connectors,i=e.allowUndefinedInResolve,u=e.resolverValidationOptions,s=function(e,t,r,n,i){if("object"!=typeof i)throw new m("Expected `resolverValidationOptions` to be an object");if(!e)throw new m("Must provide typeDefs");if(!t)throw new m("Must provide resolvers");var u=o(e);return a(u,t),f(u,i),n||v(u),r&&p(u,r),u}(e.typeDefs,r,e.logger,void 0===i||i,void 0===u?{}:u);return"function"==typeof r.__schema&&c(s,r.__schema),n&&g(s,n),s},t.concatenateTypeDefs=n,t.buildSchemaFromTypeDefinitions=o,t.extractExtensionDefinitions=i,t.forEachField=u;var g=W.deprecated({version:"0.7.0",url:"https://github.com/apollostack/graphql-tools/issues/140"},function(e,t){if(!(e&&e instanceof b.GraphQLSchema))throw Error("schema must be an instance of GraphQLSchema. This error could be caused by installing more than one version of GraphQL-JS");if("object"!=typeof t){throw Error("Expected connectors to be of type object, got "+typeof t)}if(0===Object.keys(t).length)throw Error("Expected connectors to not be an empty object");if(Array.isArray(t))throw Error("Expected connectors to be of type object, got Array");if(e._apolloConnectorsAttached)throw Error("Connectors already attached to context, cannot attach more than once");e._apolloConnectorsAttached=!0;c(e,function(e,r,n){if("object"!=typeof n)throw Error("Cannot attach connector because context is not an object: "+typeof n);return void 0===n.connectors&&(n.connectors={}),Object.keys(t).forEach(function(e){var r=t[e];if(!r.prototype)throw Error("Connector must be a function or an class");n.connectors[e]=new r(n)}),e})});t.attachConnectorsToContext=g,t.addSchemaLevelResolveFunction=c,t.addResolveFunctionsToSchema=a,t.assertResolveFunctionsPresent=f,t.addErrorLoggingToSchema=p,t.chainResolvers=function(e){return function(t,r,n,o){return e.reduce(function(e,t){return t?t(e,r,n,o):$.defaultFieldResolver(e,r,n,o)},t)}},t.addCatchUndefinedToSchema=v});n(B);var K=B.makeExecutableSchema;i.prototype=Object.create(null),u.EventEmitter=u,u.usingDomains=!1,u.prototype.domain=void 0,u.prototype._events=void 0,u.prototype._maxListeners=void 0,u.defaultMaxListeners=10,u.init=function(){this.domain=null,u.usingDomains&&(!(void 0).active||this instanceof(void 0).Domain||(this.domain=(void 0).active)),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new i,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return c(this)},u.prototype.emit=function(e){var t,r,n,o,i,u,c,a="error"===e;if(u=this._events)a=a&&null==u.error;else if(!a)return!1;if(c=this.domain,a){if(t=arguments[1],!c){if(t instanceof Error)throw t;var s=Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}return t||(t=Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=c,t.domainThrown=!1,c.emit("error",t),!1}if(!(r=u[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,o=l(e,n),i=0;n>i;++i)o[i].call(r)}(r,f,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var o=e.length,i=l(e,o),u=0;o>u;++u)i[u].call(r,n)}(r,f,this,arguments[1]);break;case 3:!function(e,t,r,n,o){if(t)e.call(r,n,o);else for(var i=e.length,u=l(e,i),c=0;i>c;++c)u[c].call(r,n,o)}(r,f,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,o,i){if(t)e.call(r,n,o,i);else for(var u=e.length,c=l(e,u),a=0;u>a;++a)c[a].call(r,n,o,i)}(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=Array(n-1),i=1;n>i;i++)o[i-1]=arguments[i];!function(e,t,r,n){if(t)e.apply(r,n);else for(var o=e.length,i=l(e,o),u=0;o>u;++u)i[u].apply(r,n)}(r,f,this,o)}return!0},u.prototype.on=u.prototype.addListener=function(e,t){return a(this,e,t,!1)},u.prototype.prependListener=function(e,t){return a(this,e,t,!0)},u.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,s(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,s(this,e,t)),this},u.prototype.removeListener=function(e,t){var r,n,o,u,c;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new i:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,u=r.length;u-- >0;)if(r[u]===t||r[u].listener&&r[u].listener===t){c=r[u].listener,o=u;break}if(0>o)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new i,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,o=e.length;o>n;r+=1,n+=1)e[r]=e[n];e.pop()}(r,o);n.removeListener&&this.emit("removeListener",e,c||t)}return this},u.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new i,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new i:delete r[e]),this;if(0===arguments.length){for(var n,o=Object.keys(r),u=0;o.length>u;++u)"removeListener"!==(n=o[u])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new i,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},u.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=Array(e.length),r=0;t.length>r;++r)t[r]=e[r].listener||e[r];return t}(t):[]},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var V=Object.freeze({default:u,EventEmitter:u}),X="function"==typeof Symbol&&Symbol.iterator,J=X||"@@iterator",H=J,Z=p,ee=h,te=function(e){return Object(e)===e&&(h(e)||p(e))},re=v,ne=y,oe=d;b.prototype[J]=function(){return this},b.prototype.next=function(){return void 0!==this._o&&this._o.length>this._i?{value:this._o[this._i++],done:!1}:(this._o=void 0,{value:void 0,done:!0})};var ie=function(e,t,r){if(null!=e){if("function"==typeof e.forEach)return e.forEach(t,r);var n=0,o=v(e);if(o){for(var i;!(i=o.next()).done;)if(t.call(r,i.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(h(e))for(;e.length>n;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}},ue="function"==typeof Symbol&&Symbol.asyncIterator,ce=ue||"@@asyncIterator",ae=ce,se=function(e){return!!g(e)},fe=m,le=g,pe=w;O.prototype[ce]=function(){return this},O.prototype.next=function(){var e=this._i.next();return Promise.resolve(e.value).then(function(t){return{value:t,done:e.done}})};var he={$$iterator:H,isIterable:Z,isArrayLike:ee,isCollection:te,getIterator:re,getIteratorMethod:ne,createIterator:oe,forEach:ie,$$asyncIterator:ae,isAsyncIterable:se,getAsyncIterator:fe,getAsyncIteratorMethod:le,createAsyncIterator:pe,forAwaitEach:function(e,t,r){var n=w(e);if(n){var o=0;return new Promise(function(i,u){function c(){return n.next().then(function(n){n.done?i():Promise.resolve(t.call(r,n.value,o++,e)).then(c).catch(u)}).catch(u)}c()})}}},ve=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.eventEmitterAsyncIterator=function(e,t){var r=[],n=[],o="string"==typeof t?[t]:t,i=!0,u=function(e){0!==r.length?r.shift()({value:e,done:!1}):n.push(e)},c=function(){i&&(i=!1,a(),r.forEach(function(e){return e({value:void 0,done:!0})}),r.length=0,n.length=0)},a=function(){for(var t=0,r=o;r.length>t;t++)e.removeListener(r[t],u)};return function(){for(var t=0,r=o;r.length>t;t++)e.addListener(r[t],u)}(),s={next:function(){return i?new Promise(function(e){0!==n.length?e({value:n.shift(),done:!1}):r.push(e)}):this.return()},return:function(){return c(),Promise.resolve({value:void 0,done:!0})},throw:function(e){return c(),Promise.reject(e)}},s[he.$$asyncIterator]=function(){return this},s;var s}});n(ve);var ye=V&&u||V,de=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.ee=new ye.EventEmitter,this.subscriptions={},this.subIdCounter=0}return e.prototype.publish=function(e,t){return this.ee.emit(e,t),!0},e.prototype.subscribe=function(e,t){return this.ee.addListener(e,t),this.subIdCounter=this.subIdCounter+1,this.subscriptions[this.subIdCounter]=[e,t],Promise.resolve(this.subIdCounter)},e.prototype.unsubscribe=function(e){var t=this.subscriptions[e],r=t[0],n=t[1];delete this.subscriptions[e],this.ee.removeListener(r,n)},e.prototype.asyncIterator=function(e){return ve.eventEmitterAsyncIterator(this.ee,e)},e}();t.PubSub=r});n(de);var be=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.withFilter=function(e,t){return function(r,n,o,i){var u=e(r,n,o,i),c=function(){return u.next().then(function(e){return Promise.all([e,Promise.resolve(t(e.value,n,o,i)).catch(function(){return!1})])}).then(function(e){var t=e[0];return!0===e[1]||!0===t.done?t:c()})};return a={next:function(){return c()},return:function(){return u.return()},throw:function(e){return u.throw(e)}},a[he.$$asyncIterator]=function(){return this},a;var a}}});n(be);var me=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PubSub=de.PubSub,t.withFilter=be.withFilter});n(me);var ge=me.PubSub,we=me.withFilter,Oe=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},_e=function(e){return function t(r){return 0===arguments.length||Oe(r)?t:e.apply(this,arguments)}},je=_e(function(e){return null==e}),Ee=function(e,t,r,n,o,i,u,c){if(!e){var a;if(void 0===t)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,u,c],f=0;(a=Error(t.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw a.framesToPop=1,a}},xe=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},ke=Object.prototype.toString,Se=function(){return"[object Arguments]"===ke.call(arguments)?function(e){return"[object Arguments]"===ke.call(e)}:function(e){return xe("callee",e)}},Ae=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},Pe=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Te=function(e){return"[object String]"===Object.prototype.toString.call(e)},Le=function(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return Oe(r)?t:_e(function(t){return e(r,t)});default:return Oe(r)&&Oe(n)?t:Oe(r)?_e(function(t){return e(t,n)}):Oe(n)?_e(function(t){return e(r,t)}):e(r,n)}}},Ie=function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r},Ce=function(e,t,r){for(var n=0,o=r.length;o>n;){if(e(t,r[n]))return!0;n+=1}return!1},Fe=function(e){var t=(e+"").match(/^function (\w*)/);return null==t?"":t[1]},qe=Le(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),Me=!{toString:null}.propertyIsEnumerable("toString"),Re=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Ne=function(){return arguments.propertyIsEnumerable("length")}(),De=function(e,t){for(var r=0;e.length>r;){if(e[r]===t)return!0;r+=1}return!1},Ge=_e("function"!=typeof Object.keys||Ne?function(e){if(Object(e)!==e)return[];var t,r,n=[],o=Ne&&Se(e);for(t in e)!xe(t,e)||o&&"length"===t||(n[n.length]=t);if(Me)for(r=Re.length-1;r>=0;)xe(t=Re[r],e)&&!De(n,t)&&(n[n.length]=t),r-=1;return n}:function(e){return Object(e)!==e?[]:Object.keys(e)}),Qe=_e(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),Ue=j,Ye=Le(function(e,t){return Ue(e,t,[],[])}),$e=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,o){return t.apply(this,arguments)};case 5:return function(e,r,n,o,i){return t.apply(this,arguments)};case 6:return function(e,r,n,o,i,u){return t.apply(this,arguments)};case 7:return function(e,r,n,o,i,u,c){return t.apply(this,arguments)};case 8:return function(e,r,n,o,i,u,c,a){return t.apply(this,arguments)};case 9:return function(e,r,n,o,i,u,c,a,s){return t.apply(this,arguments)};case 10:return function(e,r,n,o,i,u,c,a,s,f){return t.apply(this,arguments)};default:throw Error("First argument to _arity must be a non-negative integer no greater than ten")}},ze=function(e,t){return function(){return t.call(this,e.apply(this,arguments))}},We=function(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return Oe(r)?t:Le(function(t,n){return e(r,t,n)});case 2:return Oe(r)&&Oe(n)?t:Oe(r)?Le(function(t,r){return e(t,n,r)}):Oe(n)?Le(function(t,n){return e(r,t,n)}):_e(function(t){return e(r,n,t)});default:return Oe(r)&&Oe(n)&&Oe(o)?t:Oe(r)&&Oe(n)?Le(function(t,r){return e(t,r,o)}):Oe(r)&&Oe(o)?Le(function(t,r){return e(t,n,r)}):Oe(n)&&Oe(o)?Le(function(t,n){return e(r,t,n)}):Oe(r)?_e(function(t){return e(t,n,o)}):Oe(n)?_e(function(t){return e(r,t,o)}):Oe(o)?_e(function(t){return e(r,n,t)}):e(r,n,o)}}},Be=_e(function(e){return!!Ae(e)||!!e&&("object"==typeof e&&(!Te(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))}),Ke=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Ve=function(e){return new Ke(e)},Xe=Le(function(e,t){return $e(e.length,function(){return e.apply(t,arguments)})}),Je="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",He=function(e,t,r){if("function"==typeof e&&(e=Ve(e)),Be(r))return function(e,t,r){for(var n=0,o=r.length;o>n;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}(e,t,r);if("function"==typeof r["fantasy-land/reduce"])return x(e,t,r,"fantasy-land/reduce");if(null!=r[Je])return E(e,t,r[Je]());if("function"==typeof r.next)return E(e,t,r);if("function"==typeof r.reduce)return x(e,t,r,"reduce");throw new TypeError("reduce: list must be array or iterable")},Ze=We(He),et=function(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return Ae(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}},tt=_e(et("tail",We(et("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)}))(1,1/0))),rt=function(){if(0===arguments.length)throw Error("pipe requires at least one argument");return $e(arguments[0].length,Ze(ze,arguments[0],tt(arguments)))},nt=_e(function(e){return Te(e)?e.split("").reverse().join(""):Array.prototype.slice.call(e,0).reverse()}),ot=function(){if(0===arguments.length)throw Error("compose requires at least one argument");return rt.apply(this,nt(arguments))},it=function(e){return function(){return!e.apply(this,arguments)}},ut=function(e){return"function"==typeof e["@@transducer/step"]},ct=function(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),o=n.pop();if(!Ae(o)){for(var i=0;e.length>i;){if("function"==typeof o[e[i]])return o[e[i]].apply(o,n);i+=1}if(ut(o))return t.apply(null,n)(o)}return r.apply(this,arguments)}},at=function(e,t){for(var r=0,n=t.length,o=[];n>r;)e(t[r])&&(o[o.length]=t[r]),r+=1;return o},st=function(){return this.xf["@@transducer/init"]()},ft=function(e){return this.xf["@@transducer/result"](e)},lt=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=st,e.prototype["@@transducer/result"]=ft,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}(),pt=Le(ct(["filter"],Le(function(e,t){return new lt(e,t)}),function(e,t){return Pe(t)?He(function(r,n){return e(t[n])&&(r[n]=t[n]),r},{},Ge(t)):at(e,t)})),ht=Le(function(e,t){return pt(it(e),t)}),vt="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},yt=function(e){return ot(Ye(e),Qe)},dt=yt("Array"),bt=yt("Object"),mt=function(e,t){Ee(!je(e),'The "'+t+"\" collection does not exist. You can create one using your clerk instance by running(clerk.addCollection('"+t+"'))"),Ee("object"===(void 0===e?"undefined":vt(e)),'"'+t+'" is not a collection. You can access it like any other property on the state object')},gt=ht(yt("Undefined")),wt=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ot=function(e){return k()},_t=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jt=function(e){return S()},Et=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xt=function(e){return A()},kt="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,n=arguments.length;n>r;){var o=arguments[r];if(null!=o)for(var i in o)xe(i,o)&&(t[i]=o[i]);r+=1}return t},St=Le(function(e,t){return kt({},e,t)}),At=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pt=function(e){return P()},Tt=Le(function(e,t){for(var r={},n={},o=0,i=e.length;i>o;)n[e[o]]=1,o+=1;for(var u in t)n.hasOwnProperty(u)||(r[u]=t[u]);return r}),Lt=function(e){return T()},It=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.state=t,this.get=Ot(t).bind(t),this.post=jt(t).bind(t),this.put=xt(t).bind(t),this.patch=Pt(t).bind(t),this.delete=Lt(t).bind(t)}return e.prototype.getCollection=function(e){return this.state[e]},e.prototype.addCollection=function(e){return this.state[e]=new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object),this.state[e]},e.prototype.removeCollection=function(e){var t=this.state[e];return null!=t&&delete this.state[e],t},e}(),Ct="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},Ft=function(e){if("function"==typeof Symbol){if(Symbol.asyncIterator){var t=e[Symbol.asyncIterator];if(null!=t)return t.call(e)}if(Symbol.iterator)return e[Symbol.iterator]()}throw new TypeError("Object is not async iterable")},qt=(function(){function e(e){this.value=e}function t(t){function r(o,i){try{var u=t[o](i),c=u.value;c instanceof e?Promise.resolve(c.value).then(function(e){r("next",e)},function(e){r("throw",e)}):n(u.done?"return":"normal",u.value)}catch(e){n("throw",e)}}function n(e,t){switch(e){case"return":o.resolve({value:t,done:!0});break;case"throw":o.reject(t);break;default:o.resolve({value:t,done:!1})}(o=o.next)?r(o.key,o.arg):i=null}var o,i;this._invoke=function(e,t){return new Promise(function(n,u){var c={key:e,arg:t,resolve:n,reject:u,next:null};i?i=i.next=c:(o=i=c,r(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,i){try{var u=t[o](i),c=u.value}catch(e){return void r(e)}if(!u.done)return Promise.resolve(c).then(function(e){n("next",e)},function(e){n("throw",e)});e(c)}return n("next")})}}),Mt=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rt=function(e,t){var r={};for(var n in e)0>t.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},Nt=o(function(e,t){!function(e,t){function r(e){return"function"==typeof Symbol&&!!Symbol[e]}function n(e){return r(e)?Symbol[e]:"@@"+e}function o(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function i(e){var t=e.constructor;return void 0!==t&&null===(t=t[n("species")])&&(t=void 0),void 0!==t?t:l}function u(e,t){Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);n.enumerable=!1,Object.defineProperty(e,r,n)})}function c(e){var t=e._cleanup;t&&(e._cleanup=void 0,t())}function a(e){return void 0===e._observer}function s(e,t){if(Object(e)!==e)throw new TypeError("Observer must be an object");this._cleanup=void 0,this._observer=e;var r=o(e,"start");if(r&&r.call(e,this),!a(this)){e=new f(this);try{var n=t.call(void 0,e);if(null!=n){if("function"==typeof n.unsubscribe)n=function(e){return function(){e.unsubscribe()}}(n);else if("function"!=typeof n)throw new TypeError(n+" is not a function");this._cleanup=n}}catch(t){return void e.error(t)}a(this)&&c(this)}}function f(e){this._subscription=e}function l(e){if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}"function"!=typeof Symbol||Symbol.observable||(Symbol.observable=Symbol("observable"));u(s.prototype={},{get closed(){return a(this)},unsubscribe:function(){!function(e){if(a(e))return;e._observer=void 0,c(e)}(this)}});u(f.prototype={},{get closed(){return a(this._subscription)},next:function(e){var t=this._subscription;if(!a(t)){var r=t._observer,n=o(r,"next");if(n)return n.call(r,e)}},error:function(e){var t=this._subscription;if(a(t))throw e;var r=t._observer;t._observer=void 0;try{var n=o(r,"error");if(!n)throw e;e=n.call(r,e)}catch(e){try{c(t)}finally{throw e}}return c(t),e},complete:function(e){var t=this._subscription;if(!a(t)){var r=t._observer;t._observer=void 0;try{var n=o(r,"complete");e=n?n.call(r,e):void 0}catch(e){try{c(t)}finally{throw e}}return c(t),e}}});u(l.prototype,{subscribe:function(e){for(var t=[],r=1;arguments.length>r;++r)t.push(arguments[r]);return"function"==typeof e&&(e={next:e,error:t[0],complete:t[1]}),new s(e,this._subscriber)},forEach:function(e){var t=this;return new Promise(function(r,n){if("function"!=typeof e)return Promise.reject(new TypeError(e+" is not a function"));t.subscribe({_subscription:null,start:function(e){if(Object(e)!==e)throw new TypeError(e+" is not an object");this._subscription=e},next:function(t){var r=this._subscription;if(!r.closed)try{return e(t)}catch(e){n(e),r.unsubscribe()}},error:n,complete:r})})},map:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this);return new r(function(r){return t.subscribe({next:function(t){if(!r.closed){try{t=e(t)}catch(e){return r.error(e)}return r.next(t)}},error:function(e){return r.error(e)},complete:function(e){return r.complete(e)}})})},filter:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this);return new r(function(r){return t.subscribe({next:function(t){if(!r.closed){try{if(!e(t))return}catch(e){return r.error(e)}return r.next(t)}},error:function(e){return r.error(e)},complete:function(){return r.complete()}})})},reduce:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this),n=arguments.length>1,o=!1,u=arguments[1],c=u;return new r(function(r){return t.subscribe({next:function(t){if(!r.closed){var i=!o;if(o=!0,!i||n)try{c=e(c,t)}catch(e){return r.error(e)}else c=t}},error:function(e){r.error(e)},complete:function(){o||n?(r.next(c),r.complete()):r.error(new TypeError("Cannot reduce an empty sequence"))}})})},flatMap:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=i(this);return new r(function(r){function n(){o&&0===i.length&&r.complete()}var o=!1,i=[],u=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return void r.error(e)}l.from(t).subscribe({_subscription:null,start:function(e){i.push(this._subscription=e)},next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(this._subscription);0>e||i.splice(e,1),n()}})},error:function(e){return r.error(e)},complete:function(){o=!0,n()}});return function(){i.forEach(function(e){return e.unsubscribe()}),u.unsubscribe()}})}}),Object.defineProperty(l.prototype,n("observable"),{value:function(){return this},writable:!0,configurable:!0}),u(l,{from:function(e){var t="function"==typeof this?this:l;if(null==e)throw new TypeError(e+" is not an object");var i=o(e,n("observable"));if(i){var u=i.call(e);if(Object(u)!==u)throw new TypeError(u+" is not an object");return u.constructor===t?u:new t(function(e){return u.subscribe(e)})}if(r("iterator")&&(i=o(e,n("iterator"))))return new t(function(t){for(var r,n=i.call(e)[Symbol.iterator]();!(r=n.next()).done;){var o=r.value;if(t.next(o),t.closed)return}t.complete()});if(Array.isArray(e))return new t(function(t){for(var r=0;e.length>r;++r)if(t.next(e[r]),t.closed)return;t.complete()});throw new TypeError(e+" is not observable")},of:function(){for(var e=[],t=0;arguments.length>t;++t)e.push(arguments[t]);var r="function"==typeof this?this:l;return new r(function(t){for(var r=0;e.length>r;++r)if(t.next(e[r]),t.closed)return;t.complete()})}}),Object.defineProperty(l,n("species"),{get:function(){return this},configurable:!0}),e.Observable=l}(t)}).Observable,Dt='You cannot extend the context with an object containing a "store" prop. It will be omitted and the other props will be added',Gt=function(e){return'The "'+e+"\" property already exists in the context object. Make sure you haven't replaced anything important"},Qt={},Ut=' The "graphql" method is deprecated and will be removed in the 1.0 release. Use the "fetch" method instead.',Yt='The "createStore" method is deprecated and will be removed in the 1.0 release. Use "new BlipsClient(...)" instead',$t='You are trying to use "BlipsClient.fetch" without it being configured.',zt="No subscription operation defined in query",Wt="Only one subscription operation is allowed per query",Bt=function(){return"The fetch "+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"middleware/afterware")+" must be a function or an array of functions"};e.BlipsClient=Y,e.createStore=function(){Qt[Yt]||(console.warn(Yt),Qt[Yt]=!0);for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return new(Function.prototype.bind.apply(Y,[null].concat(t)))},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=blips.min.js.map

@@ -11,3 +11,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

import { isEmpty, when, isType, toObservable, extendContext, getDocument, promiseBatch, getOperationType, validateWithoutSchema } from './utils';
import { isEmpty, when, isType, toObservable, extendContext, getDocument, promiseBatch, validateWithoutSchema } from './utils';

@@ -123,4 +123,8 @@ var loggedWarnings = {};

var executableOperations = document.definitions.filter(function (definition) {
return definition.operation === operationType;
});
// If there's just one operation definition of the correct type execute it
if (document.definitions.length === 1 && getOperationType(document.definitions[0]) === operationType) {
if (executableOperations.length === 1) {
return _executor(document, options, operationName, resolveFn);

@@ -130,8 +134,4 @@ }

// otherwise:
var executableOperations = document.definitions.filter(function (definition) {
return definition.operation === operationType;
});
return promiseBatch(executableOperations.map(function (operation) {
return _executor(operation, options, operation.name.value, resolveFn);
return _executor(document, options, operation.name.value, resolveFn);
}));

@@ -138,0 +138,0 @@ };

@@ -138,4 +138,8 @@ 'use strict';

var executableOperations = document.definitions.filter(function (definition) {
return definition.operation === operationType;
});
// If there's just one operation definition of the correct type execute it
if (document.definitions.length === 1 && (0, _utils.getOperationType)(document.definitions[0]) === operationType) {
if (executableOperations.length === 1) {
return _executor(document, options, operationName, resolveFn);

@@ -145,8 +149,4 @@ }

// otherwise:
var executableOperations = document.definitions.filter(function (definition) {
return definition.operation === operationType;
});
return (0, _utils.promiseBatch)(executableOperations.map(function (operation) {
return _executor(operation, options, operation.name.value, resolveFn);
return _executor(document, options, operation.name.value, resolveFn);
}));

@@ -153,0 +153,0 @@ };

{
"name": "blips",
"version": "1.0.0-rc.1-1",
"version": "1.0.0-rc.1-2",
"description": "State management for the GraphQL heads",

@@ -5,0 +5,0 @@ "repository": {

@@ -15,3 +15,2 @@ import { GraphQLError, execute, subscribe, validate, } from 'graphql'

promiseBatch,
getOperationType,
validateWithoutSchema,

@@ -106,7 +105,8 @@ } from './utils'

const executableOperations = document.definitions.filter(
definition => definition.operation === operationType
)
// If there's just one operation definition of the correct type execute it
if (
document.definitions.length === 1 &&
getOperationType(document.definitions[0]) === operationType
) {
if (executableOperations.length === 1) {
return _executor(document, options, operationName, resolveFn)

@@ -116,10 +116,6 @@ }

// otherwise:
const executableOperations = document.definitions.filter(
definition => definition.operation === operationType
)
return promiseBatch(
executableOperations.map(operation =>
_executor(operation, options, operation.name.value, resolveFn)
)
executableOperations.map(operation => {
return _executor(document, options, operation.name.value, resolveFn)
})
)

@@ -126,0 +122,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc