react-transporter
Advanced tools
Comparing version 0.5.18 to 0.5.19
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("redux"),require("react"),require("react-redux"),require("graphql/utilities/valueFromASTUntyped")):"function"==typeof define&&define.amd?define(["exports","redux","react","react-redux","graphql/utilities/valueFromASTUntyped"],e):e((t=t||self)["react-transporter"]={},t.Redux,t.React,t.ReactRedux,t.valueFromASTUntyped)}(this,function(t,e,n,r,i){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(){return(l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){c(t,e,n[e])})}return t}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(t,e,n){return(y=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&h(i,n.prototype),i}).apply(null,arguments)}function v(t){var e="function"==typeof Map?new Map:void 0;return(v=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return y(t,arguments,p(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,t)})(t)}function m(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function g(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function b(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?g(t):e}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function S(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function w(t,e){return f({type:"TRANSPORTER_QUERY",query:t},e)}function R(){return(new Date).getTime()}n=n&&n.hasOwnProperty("default")?n.default:n;function T(t){return"string"==typeof t||t instanceof String}var O=function t(e){var n=Object.keys(e);n.sort();var r=n.map(function(n){var r=null!==e[n]&&"object"===o(e[n])?t(e[n]):JSON.stringify(e[n]);return'"'.concat(n,'":').concat(r)});return"{".concat(r.join(","),"}")};function k(t){return T(t)?t:"".concat(t[0],"(").concat(O(t[1]),")")}function _(t){return!!t&&(Object.prototype.hasOwnProperty.call(t,"link")&&"function"!=typeof t.link)}function P(t){return!(null===t||T(t[0]))}var j=function(){function t(e,n){a(this,t),e?_(e)?(this.meta=e.meta,this.link=e.link):this.link=[e,n]:this.link=null}return u(t,[{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}();function C(t,e){return t[0]===e[0]&&t[1]===e[1]}function A(t,e){return _(t)?P(t.link)?t.link:[t.link]:T(t)?T(e)?[[t,e]]:e.map(function(e){return[t,e]}):t}function D(t,e){return t.filter(function(t){return!e.some(function(e){return C(t,e)})})}var x=function(){function t(e,n){a(this,t),e?(_(e)&&(this.meta=e.meta),this.link=A(e,n)):this.link=[]}return u(t,[{key:"prepend",value:function(t,e){var n=A(t,e);return this.link=[].concat(S(n),S(this.link)),this}},{key:"append",value:function(t,e){var n=A(t,e);return this.link=[].concat(S(this.link),S(n)),this}},{key:"syncPrepend",value:function(t,e){var n=A(t,e),r=D(this.link,n);return this.link=[].concat(S(n),S(r)),this}},{key:"syncAppend",value:function(t,e){var n=A(t,e),r=D(this.link,n);return this.link=[].concat(S(r),S(n)),this}},{key:"detach",value:function(t,e){var n=A(t,e);return this.link=null===n?[]:D(this.link,n),this}},{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}(),M=function(t){function e(t,n){var r;return a(this,e),(r=T(n)?b(this,p(e).call(this,"".concat(t," [").concat(n,"]"))):b(this,n?p(e).call(this,"".concat(t," [").concat(n[0],", ").concat(n[1],"]")):p(e).call(this,t))).name="StoreError",console.error("StoreError: ".concat(r.message)),b(r)}return d(e,v(Error)),e}();function N(t,e,n,r){var i=function(t,e,n,r){return void 0!==e[t]?e[t]:r&&"UPDATE"===r.type&&void 0!==r.data[t]?r.data[t].originalValue:n[t]}(t,e,n,r);return _(i)?P(i.link)?new x(i):new j(i):i}function L(t,e,n){var r,i="function"==typeof n?n(e):n;return _(i)?i.toSource():(r=i,"[object Date]"===Object.prototype.toString.call(r)?i.toISOString():i)}function U(t,e,n,r){if(void 0!==e){if(_(e)&&!_(n)){var i='Cannot set field "'.concat(t,'", because it needs a scalar value, not a connection.');throw new M(i,r)}if(!_(e)&&_(n)){var o='Cannot set field "'.concat(t,'", because it needs a connection, not a scalar value.');throw new M(o,r)}if(_(e)&&_(n)){if(P(e.link)&&!P(n.link)){var a='Cannot set field "'.concat(t,'", because it is of type ManyLink, not Link.');throw new M(a,r)}if(!P(e.link)&&P(n.link)){var s='Cannot set field "'.concat(t,'", because it is of type Link, not ManyLink.');throw new M(s,r)}}}}var F=function(){function t(e,n,r,i){a(this,t),this.type=e,this.id=n,this.originalData=r||{},this.data={},this.optimistic=i}return u(t,[{key:"get",value:function(t){if(void 0===this.data[t]&&void 0===this.originalData[t]){var e='Cannot get field "'.concat(t,'", because it does not exist.');throw new M(e,[this.type,this.id])}return N(t,this.data[t],this.originalData[t],this.optimistic)}},{key:"setDistinct",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.set(t,e)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=k(t),r=N(n,this.data,this.originalData,this.optimistic),i=L(0,r,e);U(n,r,i,[this.type,this.id]),this.data[n]=i}},{key:"fill",value:function(t){var e=this;Object.keys(t).forEach(function(n){e.set(n,t[n])})}}]),t}(),q=function(){function t(e){a(this,t),this.obj=e||{}}return u(t,[{key:"forEach",value:function(t){var e=this;Object.keys(this.obj).forEach(function(n){Object.keys(e.obj[n]).forEach(function(r){t([e.obj[n][r],n,r])})})}},{key:"get",value:function(t,e){if(this.obj[t]&&this.obj[t][e])return this.obj[t][e]}},{key:"set",value:function(t,e,n){this.obj[t]||(this.obj[t]={}),this.obj[t][e]=n}},{key:"delete",value:function(t,e){if(!this.obj[t]||!this.obj[t][e])throw new Error("Cannot delete entity [".concat(t,", ").concat(e,"], because entity does not exist."));delete this.obj[t][e],0===Object.keys(this.obj[t]).length&&delete this.obj[t]}},{key:"toSource",value:function(){return this.obj}}]),t}();var I=function(){function t(e,n){a(this,t),this.data={entities:new q(e.entities.data),roots:e.roots.data},this.optimistic={entities:new q(e.entities.optimistic),roots:e.roots.optimistic},this.response={entities:new q(n&&n.entities),roots:n&&n.roots||{},trash:[]}}return u(t,[{key:"insert",value:function(t,e,n){!function(t,e,n){if(t)throw new M("Cannot insert entity, because entity already exists.",n);if(e&&"DELETE"===e.type)throw new M("Cannot perform insert on optimistically deleted entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]);var r=new F(t,e);n(r),this.response.entities.set(t,e,r.data)}},{key:"update",value:function(t,e,n){var r=this.data.entities.get(t,e),i=this.optimistic.entities.get(t,e);!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform update on optimistically deleted entity.":"Cannot update entity, because entity does not exist.";throw new M(r,n)}if(e&&"CREATE"===e.type)throw new M("Cannot perform update on optimistically created entity.",n)}(r,i,[t,e]);var o=new F(t,e,r,i);n(o);var a=this.response.entities.get(t,e),s=a?f({},a,o.data):o.data;this.response.entities.set(t,e,s)}},{key:"delete",value:function(t,e){!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform delete on optimistically deleted entity.":"Cannot delete entity, because entity does not exist.";throw new M(r,n)}if(e&&"CREATE"===e.type)throw new M("Cannot perform delete on optimistically created entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]),this.response.trash.push([t,e])}},{key:"setRoot",value:function(t,e){var n=k(t),r=N(n,this.response.roots,this.data.roots,this.optimistic.roots),i=L(0,r,e);U(n,r,i,"root"),this.response.roots[n]=i}},{key:"toSource",value:function(){var t={},e=this.response.entities.toSource();Object.keys(e).length>0&&(t.entities=e);var n=this.response.roots;Object.keys(n).length>0&&(t.roots=n);var r=this.response.trash;return r.length>0&&(t.trash=r),t}}]),t}(),B=function(){function t(){a(this,t)}return u(t,null,[{key:"generate",value:function(){return this.counter+=1,this.counter}}]),t}();c(B,"counter",1);var Q,$=function(t){function e(t,n,r,i){var o;return a(this,e),(o=b(this,p(e).call(this,n))).name="TransporterError",o.type=t,o.data=r,o.code=i,o}return d(e,v(Error)),e}(),W="transporter";function V(t,e){var n=R(),r="TRANSPORTER_MUTATION"===t.type,i=t.id||B.generate(),o=r?t.mutation.loc.source.body:t.query.loc.source.body;function a(t,e,n){var i=n?f({},n):null;if(i&&r&&delete i.roots,!t)return i;var o=new I(e[W],i);return t(o,n),o.toSource()}return function(s,u){function c(e,n,r){return s({type:"TRANSPORTER_REQUEST_ERROR",id:i,endTime:R(),optimisticData:r,data:n,error:{type:e.type,message:e.message,data:e.data}}),Q&&Q(e,t),Promise.reject(e)}var l;if(r)try{l=a(t.optimisticUpdater,u())}catch(t){if("StoreError"===t.name){var f=new $("StoreError","Request failed (StoreError)",{error:t.message});return Q&&Q(f),Promise.reject(f)}throw t}return s({type:"TRANSPORTER_REQUEST_START",id:i,startTime:n,optimisticData:l}),e(o,t.variables).then(function(e){return e.json().then(function(r){if(!e.ok)return c(new $("HttpError","Request failed (HttpError - ".concat(e.status,")"),r,e.status),null,l);var o,f=u();if(f[W].info.lastReset>=n){var d=new M("Store reset after request was started.");return c(new $("StoreError","Request failed (StoreError)",{error:d.message}),null,null)}if(r.errors)return r.errors.forEach(function(t){console.error("GraphQLError: ".concat(t.message))}),c(new $("GraphQLError","Request failed (GraphQLError)",{errors:r.errors}),r.data,l);if(r.data)try{o=a(t.updater,f,r.data)}catch(d){if("StoreError"===d.name)return c(new $("StoreError","Request failed (StoreError)",{error:d.message}),r.data,l);throw d}return s({type:"TRANSPORTER_REQUEST_COMPLETED",id:i,endTime:R(),optimisticData:l,data:o}),r.data},function(t){return e.ok?c(new $("JsonError","".concat(t.message," (JsonError)")),null,l):c(new $("HttpError","Request failed (HttpError - ".concat(e.status,")"),null,e.status),null,l)})},function(t){return c(new $("NetworkError","".concat(t.message," (NetworkError)")),null,l)})}}function J(t,e,n,r){var i=f({},n),o={type:"UPDATE",data:r?f({},r.data):{}};return Object.keys(e).forEach(function(r){i[r]=e[r];var a=o.data[r]?{originalValue:o.data[r].originalValue,values:S(o.data[r].values)}:{originalValue:n[r],values:[]};a.values.push({active:!0,id:t,value:e[r]}),o.data[r]=a}),{data:i,optimistic:o}}var z=function(t,e,n,r,i){var o=i.data[e],a=o.originalValue,s=o.values;if(!(t===s.length-1)||!s[t].active)return r;var u=f({},r);return n&&void 0!==n[e]?u[e]=n[e]:1===s.length?void 0===a?delete u[e]:u[e]=a:u[e]=s[t-1].value,u},Y=function(t,e,n,r){var i=r.data[e].values,o={type:"UPDATE",data:f({},r.data)};if(1===i.length)return delete o.data[e],o;var a=n&&void 0!==n[e],s={originalValue:o.data[e].originalValue,values:S(o.data[e].values)};return a&&i[t].active&&(s.originalValue=n[e],s.values=s.values.map(function(e,n){return n<t?f({},e,{active:!1}):e})),s.values.splice(t,1),o.data[e]=s,o};function H(t,e,n,r,i){var o={data:r,optimistic:i};return Object.keys(e).forEach(function(e){var r=i.data[e].values.findIndex(function(e){return e.id===t});if(-1===r)throw new Error("Position not found.");o.data=z(r,e,n,o.data,o.optimistic),o.optimistic=Y(r,e,n,o.optimistic)}),0===Object.keys(o.optimistic.data).length&&(o.optimistic=null),o}function G(t,e){var n=Object.keys(t);return e?n.filter(function(t){return void 0===e[t]}):n}function K(t){var e={};return Object.keys(t).forEach(function(n){e[n]=f({},t[n])}),e}function X(t){var e={data:t,optimistic:{}};return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===n.type)return n.data&&n.data.entities?{data:n.data.entities,optimistic:{}}:e;if("TRANSPORTER_REQUEST_START"===n.type&&n.optimisticData){var r=new q(K(t.data)),i=new q(K(t.optimistic));if(n.optimisticData.entities)new q(n.optimisticData.entities).forEach(function(t){var e,o=E(t,3),a=o[0],s=o[1],u=o[2];if(!r.get(s,u)){var c=(e=n.id,{data:a,optimistic:{type:"CREATE",id:e}}),l=c.data,f=c.optimistic;r.set(s,u,l),i.set(s,u,f)}else{var d=J(n.id,a,r.get(s,u),i.get(s,u)),p=d.data,h=d.optimistic;r.set(s,u,p),i.set(s,u,h)}});if(n.optimisticData.trash)n.optimisticData.trash.forEach(function(t){var e,o,a=E(t,2),s=a[0],u=a[1],c=(e=n.id,o=r.get(s,u),{optimistic:{type:"DELETE",id:e,data:o}}).optimistic;r.delete(s,u),i.set(s,u,c)});return{data:r.toSource(),optimistic:i.toSource()}}if("TRANSPORTER_REQUEST_COMPLETED"===n.type||"TRANSPORTER_REQUEST_ERROR"===n.type){var o=new q(K(t.data)),a=new q(K(t.optimistic));if(n.optimisticData&&n.optimisticData.entities){var s=new q(n.data&&n.data.entities);new q(n.optimisticData.entities).forEach(function(t){var e=E(t,3),r=e[0],i=e[1],u=e[2];if(a.get(i,u)&&"CREATE"===a.get(i,u).type)o.delete(i,u),a.delete(i,u);else{var c=H(n.id,r,s.get(i,u),o.get(i,u),a.get(i,u)),l=c.data,f=c.optimistic;o.set(i,u,l),f?a.set(i,u,f):a.delete(i,u)}})}if(n.optimisticData&&n.optimisticData.trash){var u=n.data&&n.data.trash;n.optimisticData.trash.forEach(function(t){var e=E(t,2),r=e[0],i=e[1],s=function(t,e,n,r){if(r.id!==t)throw new Error("Optimistic deletion was processed by other request.");return e&&e.some(function(t){return C(t,n)})?{data:null}:{data:r.data}}(n.id,u,[r,i],a.get(r,i)).data;s&&o.set(r,i,s),a.delete(r,i)})}if(n.data&&n.data.entities){var c=new q(n.data.entities),l=new q(n.optimisticData&&n.optimisticData.entities);c.forEach(function(t){var e=E(t,3),n=e[0],r=e[1],i=e[2],a=o.get(r,i);a?(G(n,l.get(r,i)).forEach(function(t){a[t]=n[t]}),o.set(r,i,a)):o.set(r,i,n)})}if(n.data&&n.data.trash)(function(t,e){return e?t.filter(function(t){return e.some(function(e){return C(t,e)})}):t})(n.data.trash,n.optimisticData&&n.optimisticData.trash).forEach(function(t){var e=E(t,2),n=e[0],r=e[1];o.delete(n,r)});return{data:o.toSource(),optimistic:a.toSource()}}return t}}function Z(){var t=[];return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0,r=S(e);if("TRANSPORTER_REQUEST_START"===n.type&&r.push({id:n.id,startTime:n.startTime,endTime:null,loading:!0,errors:null}),"TRANSPORTER_REQUEST_COMPLETED"===n.type){var i=r.findIndex(function(t){return t.id===n.id});r[i]=f({},r[i],{endTime:n.endTime,loading:!1})}if("TRANSPORTER_REQUEST_COMPLETED"===n.type){var o=r.findIndex(function(t){return t.id===n.id});r[o]=f({},r[o],{endTime:n.endTime,loading:!1,errors:n.errors})}return r}}function tt(){var t={lastReset:null};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0;return"TRANSPORTER_STORE_RESET"===n.type?{lastReset:n.lastReset}:e}}var et=function(){function t(e){a(this,t),this.network=e.network,this.initialData=e.initialData}return u(t,[{key:"middleware",value:function(){var t=this;return function(){return function(e){return function(n){return"TRANSPORTER_QUERY"===n.type||"TRANSPORTER_MUTATION"===n.type?e(V(n,t.network.fetch)):e(n)}}}}},{key:"reducer",value:function(){return function(t,n){return e.combineReducers({roots:(r=t,i={data:r,optimistic:null},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,e=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===e.type)return e.data&&e.data.roots?{data:e.data.roots,optimistic:null}:i;if("TRANSPORTER_REQUEST_START"===e.type&&e.optimisticData&&e.optimisticData.roots)return J(e.id,e.optimisticData.roots,t.data,t.optimistic);if("TRANSPORTER_REQUEST_COMPLETED"===e.type||"TRANSPORTER_REQUEST_ERROR"===e.type){var n=e.optimisticData&&e.optimisticData.roots?H(e.id,e.optimisticData.roots,e.data&&e.data.roots,t.data,t.optimistic):{data:f({},t.data),optimistic:t.optimistic};return e.data&&e.data.roots&&G(e.data.roots,e.optimisticData&&e.optimisticData.roots).forEach(function(t){n.data[t]=e.data.roots[t]}),n}return t}),entities:X(n),requests:Z(),info:tt()});var r,i}(this.initialData&&this.initialData.roots?this.initialData.roots:{},this.initialData&&this.initialData.entities?this.initialData.entities:{})}},{key:"getConfig",value:function(){return this.config}}]),t}(),nt=Math.floor(1099511627776*Math.random()).toString(16),rt=new RegExp('"@__(F|R|D|M|S)-'+nt+'-(\\d+)__@"',"g"),it=/\{\s*\[native code\]\s*\}/g,ot=/function.*?\(/,at=/[<>\/\u2028\u2029]/g,st=["*","async"],ut={"<":"\\u003C",">":"\\u003E","/":"\\u002F","\u2028":"\\u2028","\u2029":"\\u2029"};function ct(t){return ut[t]}var lt=function t(e,n){n||(n={}),"number"!=typeof n&&"string"!=typeof n||(n={space:n});var r,i=[],o=[],a=[],s=[],u=[];return"string"!=typeof(r=n.isJSON&&!n.space?JSON.stringify(e):JSON.stringify(e,n.isJSON?null:function(t,e){if(!e)return e;var n=this[t],r=typeof n;if("object"===r){if(n instanceof RegExp)return"@__R-"+nt+"-"+(o.push(n)-1)+"__@";if(n instanceof Date)return"@__D-"+nt+"-"+(a.push(n)-1)+"__@";if(n instanceof Map)return"@__M-"+nt+"-"+(s.push(n)-1)+"__@";if(n instanceof Set)return"@__S-"+nt+"-"+(u.push(n)-1)+"__@"}return"function"===r?"@__F-"+nt+"-"+(i.push(n)-1)+"__@":e},n.space))?String(r):(!0!==n.unsafe&&(r=r.replace(at,ct)),0===i.length&&0===o.length&&0===a.length&&0===s.length&&0===u.length?r:r.replace(rt,function(e,r,c){return"D"===r?'new Date("'+a[c].toISOString()+'")':"R"===r?o[c].toString():"M"===r?"new Map("+t(Array.from(s[c].entries()),n)+")":"S"===r?"new Set("+t(Array.from(u[c].values()),n)+")":function(t){var e=t.toString();if(it.test(e))throw new TypeError("Serializing native function: "+t.name);if(ot.test(e))return e;var n=e.indexOf("("),r=e.substr(0,n).trim().split(" ").filter(function(t){return t.length>0});return r.filter(function(t){return-1===st.indexOf(t)}).length>0?(r.indexOf("async")>-1?"async ":"")+"function"+(r.join("").indexOf("*")>-1?"*":"")+e.substr(n):e}(i[c])}))},ft={componentWillUnmount:!1},dt=Symbol.for("react.forward_ref"),pt=function(t,e){var n=[];return function(t,e,n){return new Promise(function(r,i){var o=t[Symbol.iterator](),a=0;!function t(n){var s=o.next();s.done?r(n):Promise.all([n,s.value]).then(function(n){t(e(n[0],n[1],a++))}).catch(i)}(n)})}(t,function(t,r,i){return Promise.resolve(e(r,i)).then(function(t){n.push(t)})}).then(function(){return n})},ht=function t(e){return e&&"function"==typeof e.render?t(e.render()):e},yt=function(t){return t.props&&t.props.children?t.props.children:t.children?t.children:void 0},vt=function(t){return t.type||t.nodeName},mt=function(t){return t.props||t.attributes},gt=function(t){return!!vt(t)},bt=function(t){return t.prototype&&(t.prototype.render||t.prototype.isReactComponent||t.prototype.isPureReactComponent)},Et=function(t){return t.type&&t.type.$$typeof===dt},St=function(t){return!!t.getChildContext};var wt=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ft;return new Promise(function(i,o){var a=function(){try{return e.apply(void 0,arguments)}catch(t){o(t)}};(function t(e,n){if(Array.isArray(e))return Promise.all(e.map(function(e){return t(e,n)}));if(!e)return Promise.resolve();if("string"==typeof e||"number"==typeof e)return a(e,null,n),Promise.resolve();if(e.type&&(e.type._context&&(e.type._context._currentValue=e.props.value),e.type.Provider&&e.type.Consumer)){var i=e.props.children(e.type.Provider._context._currentValue);return t(i,n)}return gt(e)?new Promise(function(i){var s=function(n,r,s,u){return Promise.resolve(a(e,r,s,u)).then(function(e){if(!1!==e){var r=n(),a=ht(r);if(a)return Array.isArray(a)?pt(a,function(e){return e?t(e,u):Promise.resolve()}).then(i,o).catch(o):t(a,u).then(i,o).catch(o)}}).catch(o)};if("function"==typeof vt(e)||Et(e)){var u=vt(e),c=Object.assign({},u.defaultProps,mt(e),{children:yt(e)});if(Et(e))s(function(){return e.type.render(c)},null,n,n).then(i);else if(bt(u)){var l=new u(c,n);if(Object.defineProperty(l,"props",{value:l.props||c}),l.context=l.context||n,l.state=l.state||null,l.setState=function(t){"function"==typeof t&&(t=t(l.state,l.props,l.context)),l.state=Object.assign({},l.state,t)},u.getDerivedStateFromProps){var f=u.getDerivedStateFromProps(l.props,l.state);null!==f&&(l.state=Object.assign({},l.state,f))}else l.UNSAFE_componentWillMount?l.UNSAFE_componentWillMount():l.componentWillMount&&l.componentWillMount();var d=St(l)?Object.assign({},n,l.getChildContext()):n;s(function(){return l.render(l.props,l.state)},l,n,d).then(function(){r.componentWillUnmount&&l.componentWillUnmount&&l.componentWillUnmount()}).then(i)}else s(function(){return u(c,n)},null,n,n).then(i)}else s(function(){return yt(e)},null,n,n).then(i)}):e.containerInfo&&e.children&&e.children.props&&Array.isArray(e.children.props.children)?Promise.all(e.children.props.children.map(function(e){return t(e,n)})):Promise.resolve()})(t,n).then(i,o)})},Rt="undefined"!=typeof window,Tt=new(function(){function t(){a(this,t),c(this,"env",void 0),c(this,"phase",void 0),this.env=Rt?"browser":"node",this.phase="BOOTSTRAPPING",this.errors=Rt&&window.__ASYNC_DATA__?window.__ASYNC_DATA__.errors:{},this.ssr=!Rt||Rt&&window.__ASYNC_DATA__&&!!window.__ASYNC_DATA__.errors,this.ids={}}return u(t,[{key:"isSSREnabled",value:function(){return this.ssr}},{key:"generateId",value:function(t){var e=this.ids[t]?this.ids[t]+1:1;return this.ids[t]=e,e}},{key:"setPhaseToFirstRender",value:function(){this.phase="FIRST_RENDER",this.ids={}}},{key:"setPhaseToRender",value:function(){this.phase="RENDER",this.ids={}}},{key:"addError",value:function(t,e,n){this.errors[t]||(this.errors[t]={}),this.errors[t][e]=n}},{key:"getError",value:function(t,e){return this.errors[t]&&this.errors[t][e]&&0!==Object.keys(this.errors[t][e]).length?this.errors[t][e]:null}},{key:"getErrors",value:function(){return this.errors}},{key:"getEnv",value:function(){return this.env}},{key:"getPhase",value:function(){return this.phase}}]),t}());function Ot(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function kt(t,e){return t(e={exports:{}},e.exports),e.exports}var _t=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116;function v(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case r:switch(t=t.type){case l:case f:case o:case s:case a:case p:return t;default:switch(t=t&&t.$$typeof){case c:case d:case u:return t;default:return e}}case y:case h:case i:return e}}}function m(t){return v(t)===f}e.typeOf=v,e.AsyncMode=l,e.ConcurrentMode=f,e.ContextConsumer=c,e.ContextProvider=u,e.Element=r,e.ForwardRef=d,e.Fragment=o,e.Lazy=y,e.Memo=h,e.Portal=i,e.Profiler=s,e.StrictMode=a,e.Suspense=p,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===f||t===s||t===a||t===p||"object"==typeof t&&null!==t&&(t.$$typeof===y||t.$$typeof===h||t.$$typeof===u||t.$$typeof===c||t.$$typeof===d)},e.isAsyncMode=function(t){return m(t)||v(t)===l},e.isConcurrentMode=m,e.isContextConsumer=function(t){return v(t)===c},e.isContextProvider=function(t){return v(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},e.isForwardRef=function(t){return v(t)===d},e.isFragment=function(t){return v(t)===o},e.isLazy=function(t){return v(t)===y},e.isMemo=function(t){return v(t)===h},e.isPortal=function(t){return v(t)===i},e.isProfiler=function(t){return v(t)===s},e.isStrictMode=function(t){return v(t)===a},e.isSuspense=function(t){return v(t)===p}});Ot(_t);_t.typeOf,_t.AsyncMode,_t.ConcurrentMode,_t.ContextConsumer,_t.ContextProvider,_t.Element,_t.ForwardRef,_t.Fragment,_t.Lazy,_t.Memo,_t.Portal,_t.Profiler,_t.StrictMode,_t.Suspense,_t.isValidElementType,_t.isAsyncMode,_t.isConcurrentMode,_t.isContextConsumer,_t.isContextProvider,_t.isElement,_t.isForwardRef,_t.isFragment,_t.isLazy,_t.isMemo,_t.isPortal,_t.isProfiler,_t.isStrictMode,_t.isSuspense;var Pt=kt(function(t,e){});Ot(Pt);Pt.typeOf,Pt.AsyncMode,Pt.ConcurrentMode,Pt.ContextConsumer,Pt.ContextProvider,Pt.Element,Pt.ForwardRef,Pt.Fragment,Pt.Lazy,Pt.Memo,Pt.Portal,Pt.Profiler,Pt.StrictMode,Pt.Suspense,Pt.isValidElementType,Pt.isAsyncMode,Pt.isConcurrentMode,Pt.isContextConsumer,Pt.isContextProvider,Pt.isElement,Pt.isForwardRef,Pt.isFragment,Pt.isLazy,Pt.isMemo,Pt.isPortal,Pt.isProfiler,Pt.isStrictMode,Pt.isSuspense,kt(function(t){t.exports=_t});var jt=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}})()&&Object.assign;var Dt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Function.call.bind(Object.prototype.hasOwnProperty);function xt(){}function Mt(){}Mt.resetWarningCache=xt;var Nt=kt(function(t){t.exports=function(){function t(t,e,n,r,i,o){if(o!==Dt){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Mt,resetWarningCache:xt};return n.PropTypes=n,n}()});function Lt(t,e){var n={};return t?(Object.keys(t).forEach(function(r){n[r]=function(){return e(t[r].apply(t,arguments))}}),n):n}function Ut(t,e){var n={};return t?(Object.keys(t).forEach(function(r){n[r]=t[r](e)}),n):n}var Ft=r.connect(function(t,e){return Ut(e.selectors,t)},function(t,e){return Lt(e.actions,t)},function(t,e,n){var r=n.props;return Object.assign({},r,t,e)}),qt=function(t){return null==t||"function"!=typeof t&&"object"!==o(t)||!t.default?t:t.default},It={disabled:!1,defer:!0,error:null,loading:null},Bt=function(t){return t&&t.async?Object.assign({},It,t.async):It},Qt={store:Nt.object,isInBoundary:Nt.bool},$t={isInBoundary:Nt.bool};var Wt=function(t,e){if(t&&!e||!t&&e)return!1;if(t&&e){if(Object.keys(t).some(function(n){return!e[n]||t[n]!==e[n]}))return!1;if(Object.keys(e).some(function(n){return!t[n]||t[n]!==e[n]}))return!1}return!0};function Vt(t,e,n){switch(e){case"=":return t===n;case">":return t>n;case">=":return t>=n;case"<":return t<n;case"<=":return t<=n;default:throw new M("Unknown operator '".concat(e,"'"))}}function Jt(t,e,n){var r=n.get(t,e);if(!r)throw new M("Joined entity not found.",[t,e]);var i={__typename:t,id:e};return Object.keys(r).forEach(function(t){_(r[t])||(i[t]=r[t])}),i}function zt(t,e,n,r,i){var o=i.get(t,e);if(!o[n])throw new M('Joined relation "'.concat(n,'" not found.'),[t,e]);if(!_(o[n]))throw new M('Joined relation "'.concat(n,'" is not a connection.'),[t,e]);return null===o[n].link?null:Ht(o[n].link,r,i)}var Yt=function(){function t(e,n){a(this,t),this.link=e,this.isManyLink=P(e),this.data=this.isManyLink?e.map(function(t){return Jt.apply(void 0,S(t).concat([n]))}):Jt.apply(void 0,S(e).concat([n])),this.entities=n}return u(t,[{key:"where",value:function(t,e,n){var r=n||e,i=n?e:"=";return this.isManyLink||Vt(this.data[t],i,r)||(this.data=null),this.isManyLink&&(this.data=this.data.filter(function(e){return Vt(e[t],i,r)})),this}},{key:"orderBy",value:function(){return this}},{key:"limit",value:function(){return this}},{key:"join",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=k(t),i=T(t)?t:t[0];if(this.isManyLink)this.link.forEach(function(t,o){var a=zt.apply(void 0,S(e.link[o]).concat([r,n,e.entities]));e.data[o][i]=a});else{var o=zt.apply(void 0,S(this.link).concat([r,n,this.entities]));this.data[i]=o}return this}},{key:"getData",value:function(){return this.data}}]),t}();function Ht(t,e,n){if(null===t)return null;var r=new Yt(t,n);return(e?e(r):r).getData()}function Gt(t,e){if(!t.arguments||0===t.arguments.length)return t.name.value;var n={};return t.arguments.forEach(function(t){n[t.name.value]=i.valueFromASTUntyped(t.value,e)}),[t.name.value,n]}function Kt(t,e){return function(n){return t.selections.forEach(function(t){"Field"===t.kind&&t.selectionSet&&n.join(Gt(t,e.variables),Kt(t.selectionSet,e))}),n}}var Xt=function(){function t(e){a(this,t),this.roots=e.roots.data,this.entities=new q(e.entities.data)}return u(t,[{key:"select",value:function(t,e){return e.entry?this.selectByFragmentAST(t,e):this.selectByOperationAST(t,e)}},{key:"selectByFragmentAST",value:function(t,e){var n=t.definitions.find(function(t){return"FragmentDefinition"===t.kind});if(!n)throw new M("Option entry is set, but no fragment node found.");return this.selectByEntity.apply(this,S(e.entry).concat([Kt(n.selectionSet,e)]))}},{key:"selectByOperationAST",value:function(t,e){var n=t.definitions.find(function(t){return"OperationDefinition"===t.kind});if(!n)throw new M("No operation node found.");var r=n.selectionSet.selections[0];return this.selectByRoot(Gt(r,e.variables),Kt(r.selectionSet,e))}},{key:"selectByEntity",value:function(t,e,n){if(!this.entities.get(t,e))throw new M("Selected entity not found.",[t,e]);return Ht([t,e],n,this.entities)}},{key:"selectByRoot",value:function(t,e){var n=k(t);if(!this.roots[n])throw new M("Selected root '".concat(n,"' not found."),"root");return Ht(this.roots[n].link,e,this.entities)}},{key:"selectByRelation",value:function(t,e,n,r){var i=k(n),o=this.entities.get(t,e);if(!o||!o[i])throw new M("Selected relation '".concat(i,"' not found."),[t,e]);return Ht(o[i].link,r,this.entities)}}]),t}(),Zt="transporter";function te(t){return function(e,n){return t(new Xt(e[Zt]),n)}}t.Link=j,t.ManyLink=x,t.TransporterClient=et,t.TransporterNetwork=function t(e){var n=this;a(this,t),c(this,"fetch",function(t,e){return n.request(t,e)}),this.request=e},t.bootstrapper=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};wt(t,function(t,e){if(e&&"function"==typeof e.bootstrap)return e.bootstrap()},r).then(function(){if(Tt.setPhaseToFirstRender(),"node"===Tt.getEnv()){var t={errors:Tt.getErrors()};e({getScriptTag:function(){return'<script charset="UTF-8">window.__ASYNC_DATA__='.concat(lt(t),";<\/script>")},getScriptElement:function(){return n.createElement("script",{dangerouslySetInnerHTML:{__html:t}})}})}else e();Tt.setPhaseToRender()}).catch(function(t){return console.error(t)})},t.createAsyncContainer=function(t,r,i){var o={middleware:i&&i.middleware||null,async:Bt(i)},s=function(t){var e=r(t);return f({},e,{loaders:e.loaders||{}})},h=t.name&&t.bundle,y=t.displayName||t.name||"Component",v=function(e){function r(e,n){var i;a(this,r),i=b(this,p(r).call(this,e,n));var u=s(i.props),c=i.isPreload();n.isInBoundary&&!o.async.defer&&console.warn('Option "defer" is set to false inside a boundary.'),i.phase=Tt.getPhase(),i.hasUnmounted=!1,c&&(i.containerName="".concat(y,"-").concat(Tt.generateId(y)));var l={startTime:c?null:R(),endTime:null},d=h?{bundle:f({},l,{loading:c||h?"block":null,error:c?Tt.getError(i.containerName,"bundle"):null})}:{};return Object.keys(u.loaders).forEach(function(t){d[t]=f({},l,{loading:c?null:"block",error:c?Tt.getError(i.containerName,t):null})}),i.state={loaders:d},i.component={Component:h?null:t,isConnected:!1},i.cache={},i.handleLoad=i.handleLoad.bind(g(i)),i}return d(r,n.Component),u(r,[{key:"getChildContext",value:function(){return{isInBoundary:o.async.boundary}}},{key:"bootstrap",value:function(){var e=this,n=s(this.props),r=this.isPreload();if(!r)return!1;var i=[];return"node"===Tt.getEnv()&&Object.keys(n.loaders).forEach(function(t){var o=n.loaders[t],a=e.getCacheProvider();o.request({load:function(n){i.push(e.handleLoad(t,n,r))},cache:a},e.context.store.dispatch)}),h&&i.push(this.handleLoad("bundle",t.bundle(),r)),Promise.all(i).then(function(){return!o.async.boundary})}},{key:"componentDidMount",value:function(){var e=this,n=s(this.props);this.isPreload()||(Object.keys(n.loaders).forEach(function(t){var r=n.loaders[t],i=e.getCacheProvider();r.request({load:function(n){return e.handleLoad(t,n,!1)},cache:i},e.context.store.dispatch)}),h&&!this.component.Component&&this.handleLoad("bundle",t.bundle(),!1))}},{key:"componentWillReceiveProps",value:function(t,e){var n=this,r=s(t);Object.keys(r.loaders).forEach(function(i){var o=r.loaders[i];if(o.shouldReload&&!n.state.loaders[i].loading&&o.shouldReload({info:n.state.loaders[i],cache:n.getCacheProvider()},t,e.store.getState())){n.setRequestState(i,"block",null);var a=n.getCacheProvider();o.request({load:function(t,e){return n.handleLoad(i,t,!1,e)},cache:a},n.context.store.dispatch)}})}},{key:"handleLoad",value:function(t,e,n){var r=this;return e.then(function(e){"bundle"===t&&(r.component.Component=qt(e)),n||r.hasUnmounted||r.setRequestState(t,null,null)}).catch(function(e){n?(Tt.addError(r.containerName,t,e),r.state.loaders[t].error=e):r.hasUnmounted||r.setRequestState(t,null,e)})}},{key:"componentWillUnmount",value:function(){this.hasUnmounted=!0}},{key:"getCacheProvider",value:function(){var t=this;return{get:function(e){return t.cache[e]},set:function(e,n){t.cache[e]=n}}}},{key:"setRequestState",value:function(t,e,n){var r=R();this.setState(function(i){return{loaders:f({},i.loaders,c({},t,{startTime:e?r:i.loaders[t].startTime,endTime:e?i.loaders[t].endTime:r,loading:e,error:void 0===n?i.loaders[t].error:n}))}})}},{key:"isPreload",value:function(){return!(!Tt.isSSREnabled()||this.context.isInBoundary||o.async.defer||"BOOTSTRAPPING"!==this.phase&&"FIRST_RENDER"!==this.phase)}},{key:"render",value:function(){var t=this,e=s(this.props),r={};if(Object.keys(e.loaders).forEach(function(n){var i=e.loaders[n];if(i.props){var o=t.getCacheProvider();r[n]=f({},t.state.loaders[n],i.props({load:function(e,r){t.state.loaders[n].loading?console.error("Resource ".concat(y," ").concat(n," is already loading.")):(t.setRequestState(n,r&&r.showWhileLoading?"show":"block"),t.handleLoad(n,e,!1))},cache:o},t.context.store.dispatch))}}),Object.values(this.state.loaders).some(function(t){return"block"===t.loading})){if(!o.async.loading)return null;var i=o.async.loading;return n.createElement(i,l({},r,this.props))}if(Object.values(this.state.loaders).some(function(t){return null!==t.error})){if(!o.async.error)return null;var a=o.async.error;return n.createElement(a,l({},r,this.props))}var u=f({},r,this.props);if(e.selectors||e.actions){this.component.isConnected||(this.component.Component=Ft(this.component.Component),this.component.isConnected=!0);var c=this.component.Component;return n.createElement(c,{selectors:e.selectors,actions:e.actions,props:u})}var d=this.component.Component;return n.createElement(d,u)}}]),r}();return v.displayName="Load(".concat(y,")"),v.contextTypes=Qt,v.childContextTypes=$t,o.middleware?e.compose.apply(void 0,S(o.middleware))(v):v},t.createContainer=function(t,n,i){var o={middleware:i&&i.middleware||null},a=r.connect(function(t,e){return Ut(n(e).selectors,t)},function(t,e){return Lt(n(e).actions,t)});return o.middleware?e.compose.apply(void 0,S(o.middleware).concat([a]))(t):a(t)},t.createMutation=function(t,e){return f({type:"TRANSPORTER_MUTATION",mutation:t},e)},t.createQuery=w,t.onError=function(t){Q=t},t.query=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.loaderOptions,r=m(e,["loaderOptions"]);return{request:function(e,i){var o=e.load;return e.cache.set("variables",r.variables),n&&n.skip?o(new Promise(function(t){return t()})):o(i(w(t,r)))},props:function(e,n){var i=e.load,o=e.cache;return{refetch:function(){o.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return i(n(w(t,f({},r,a))))},fetchMore:function(){o.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return i(n(w(t,f({},r,a)),{showWhileLoading:!0}))},startPolling:function(e){var a=setInterval(function(){i(n(w(t,r),{showWhileLoading:!0}))},e);o.set("timeout",a)},endPolling:function(){clearInterval(o.get("timeout")),o.set("timeout",null)}}},shouldReload:function(t,e,n){var i=t.info,o=t.cache,a=o.get("variables");return o.set("variables",r.variables),i.startTime<n.transporter.info.lastReset||!Wt(a,r.variables)}}},t.resetStore=function(t){return{type:"TRANSPORTER_STORE_RESET",data:t,lastReset:R()}},t.select=function(t,e){return te(function(n){return n.select(t,e||{})})},t.selectAdvanced=te,t.selectByEntity=function(t,e,n){return te(function(r){return r.selectByEntity(t,e,n)})},t.selectByRelation=function(t,e,n,r){return te(function(i){return i.selectByRelation(t,e,n,r)})},t.selectByRoot=function(t,e){return te(function(n){return n.selectByRoot(t,e)})},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("redux"),require("react"),require("react-redux"),require("graphql/utilities/valueFromASTUntyped")):"function"==typeof define&&define.amd?define(["exports","redux","react","react-redux","graphql/utilities/valueFromASTUntyped"],e):e((t=t||self)["react-transporter"]={},t.Redux,t.React,t.ReactRedux,t.valueFromASTUntyped)}(this,function(t,e,n,r,o){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(){return(l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function m(t,e,n){return(m=v()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&y(o,n.prototype),o}).apply(null,arguments)}function b(t){var e="function"==typeof Map?new Map:void 0;return(b=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return m(t,arguments,h(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),y(r,t)})(t)}function g(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?E(t):e}function w(t){var e=v();return function(){var n,r=h(t);if(e){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S(this,n)}}function R(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||T(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||T(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){if(t){if("string"==typeof t)return k(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _(t,e){return d({type:"TRANSPORTER_QUERY",query:t},e)}function P(){return(new Date).getTime()}n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;function j(t){return"string"==typeof t||t instanceof String}var A=function t(e){var n=Object.keys(e);n.sort();var r=n.map(function(n){var r=function(e){return null===e?null:"object"===i(e)?t(e):JSON.stringify(e)}(e[n]);return null===r?r:'"'.concat(n,'":').concat(r)}).filter(function(t){return null!==t});return 0===r.length?null:"{".concat(r.join(","),"}")};function C(t){if(j(t))return t;var e=A(t[1]);return"".concat(t[0]).concat(e?"(".concat(e,")"):"")}function D(t){return!!t&&(Object.prototype.hasOwnProperty.call(t,"link")&&"function"!=typeof t.link)}function x(t){return!(null===t||j(t[0]))}var N=function(){function t(e,n){a(this,t),e?D(e)?(this.meta=e.meta,this.link=e.link):this.link=[e,n]:this.link=null}return u(t,[{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}();function M(t,e){return t[0]===e[0]&&t[1]===e[1]}function L(t,e){return D(t)?x(t.link)?t.link:[t.link]:j(t)?j(e)?[[t,e]]:e.map(function(e){return[t,e]}):t}function U(t,e){return t.filter(function(t){return!e.some(function(e){return M(t,e)})})}var I=function(){function t(e,n){a(this,t),e?(D(e)&&(this.meta=e.meta),this.link=L(e,n)):this.link=[]}return u(t,[{key:"prepend",value:function(t,e){var n=L(t,e);return this.link=[].concat(O(n),O(this.link)),this}},{key:"append",value:function(t,e){var n=L(t,e);return this.link=[].concat(O(this.link),O(n)),this}},{key:"syncPrepend",value:function(t,e){var n=L(t,e),r=U(this.link,n);return this.link=[].concat(O(n),O(r)),this}},{key:"syncAppend",value:function(t,e){var n=L(t,e),r=U(this.link,n);return this.link=[].concat(O(r),O(n)),this}},{key:"detach",value:function(t,e){var n=L(t,e);return this.link=null===n?[]:U(this.link,n),this}},{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}(),q=function(t){p(n,b(Error));var e=w(n);function n(t,r){var o;return a(this,n),(o=j(r)?e.call(this,"".concat(t," [").concat(r,"]")):r?e.call(this,"".concat(t," [").concat(r[0],", ").concat(r[1],"]")):e.call(this,t)).name="StoreError",console.error("StoreError: ".concat(o.message)),S(o)}return n}();function F(t,e,n,r){var o=function(t,e,n,r){return void 0!==e[t]?e[t]:r&&"UPDATE"===r.type&&void 0!==r.data[t]?r.data[t].originalValue:n[t]}(t,e,n,r);return D(o)?x(o.link)?new I(o):new N(o):o}function $(t,e,n){var r,o="function"==typeof n?n(e):n;return D(o)?o.toSource():(r=o,"[object Date]"===Object.prototype.toString.call(r)?o.toISOString():o)}function B(t,e,n,r){if(void 0!==e){if(D(e)&&!D(n)){var o='Cannot set field "'.concat(t,'", because it needs a scalar value, not a connection.');throw new q(o,r)}if(!D(e)&&D(n)){var i='Cannot set field "'.concat(t,'", because it needs a connection, not a scalar value.');throw new q(i,r)}if(D(e)&&D(n)){if(x(e.link)&&!x(n.link)){var a='Cannot set field "'.concat(t,'", because it is of type ManyLink, not Link.');throw new q(a,r)}if(!x(e.link)&&x(n.link)){var s='Cannot set field "'.concat(t,'", because it is of type Link, not ManyLink.');throw new q(s,r)}}}}var Q=function(){function t(e,n,r,o){a(this,t),this.type=e,this.id=n,this.originalData=r||{},this.data={},this.optimistic=o}return u(t,[{key:"get",value:function(t){if(void 0===this.data[t]&&void 0===this.originalData[t]){var e='Cannot get field "'.concat(t,'", because it does not exist.');throw new q(e,[this.type,this.id])}return F(t,this.data[t],this.originalData[t],this.optimistic)}},{key:"setDistinct",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.set(t,e)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=C(t),r=F(n,this.data,this.originalData,this.optimistic),o=$(0,r,e);B(n,r,o,[this.type,this.id]),this.data[n]=o}},{key:"fill",value:function(t){var e=this;Object.keys(t).forEach(function(n){e.set(n,t[n])})}}]),t}(),W=function(){function t(e){a(this,t),this.obj=e||{}}return u(t,[{key:"forEach",value:function(t){var e=this;Object.keys(this.obj).forEach(function(n){Object.keys(e.obj[n]).forEach(function(r){t([e.obj[n][r],n,r])})})}},{key:"get",value:function(t,e){if(this.obj[t]&&this.obj[t][e])return this.obj[t][e]}},{key:"set",value:function(t,e,n){this.obj[t]||(this.obj[t]={}),this.obj[t][e]=n}},{key:"delete",value:function(t,e){if(!this.obj[t]||!this.obj[t][e])throw new Error("Cannot delete entity [".concat(t,", ").concat(e,"], because entity does not exist."));delete this.obj[t][e],0===Object.keys(this.obj[t]).length&&delete this.obj[t]}},{key:"toSource",value:function(){return this.obj}}]),t}();var V=function(){function t(e,n){a(this,t),this.data={entities:new W(e.entities.data),roots:e.roots.data},this.optimistic={entities:new W(e.entities.optimistic),roots:e.roots.optimistic},this.response={entities:new W(n&&n.entities),roots:n&&n.roots||{},trash:[]}}return u(t,[{key:"insert",value:function(t,e,n){!function(t,e,n){if(t)throw new q("Cannot insert entity, because entity already exists.",n);if(e&&"DELETE"===e.type)throw new q("Cannot perform insert on optimistically deleted entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]);var r=new Q(t,e);n(r),this.response.entities.set(t,e,r.data)}},{key:"update",value:function(t,e,n){var r=this.data.entities.get(t,e),o=this.optimistic.entities.get(t,e);!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform update on optimistically deleted entity.":"Cannot update entity, because entity does not exist.";throw new q(r,n)}if(e&&"CREATE"===e.type)throw new q("Cannot perform update on optimistically created entity.",n)}(r,o,[t,e]);var i=new Q(t,e,r,o);n(i);var a=this.response.entities.get(t,e),s=a?d(d({},a),i.data):i.data;this.response.entities.set(t,e,s)}},{key:"delete",value:function(t,e){!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform delete on optimistically deleted entity.":"Cannot delete entity, because entity does not exist.";throw new q(r,n)}if(e&&"CREATE"===e.type)throw new q("Cannot perform delete on optimistically created entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]),this.response.trash.push([t,e])}},{key:"setRoot",value:function(t,e){var n=C(t),r=F(n,this.response.roots,this.data.roots,this.optimistic.roots),o=$(0,r,e);B(n,r,o,"root"),this.response.roots[n]=o}},{key:"toSource",value:function(){var t={},e=this.response.entities.toSource();Object.keys(e).length>0&&(t.entities=e);var n=this.response.roots;Object.keys(n).length>0&&(t.roots=n);var r=this.response.trash;return r.length>0&&(t.trash=r),t}}]),t}(),J=function(){function t(){a(this,t)}return u(t,null,[{key:"generate",value:function(){return this.counter+=1,this.counter}}]),t}();c(J,"counter",1);var Y,z=function(t){p(n,b(Error));var e=w(n);function n(t,r,o,i){var s;return a(this,n),(s=e.call(this,r)).name="TransporterError",s.type=t,s.data=o,s.code=i,s}return n}(),H="transporter";function G(t,e){var n=P(),r="TRANSPORTER_MUTATION"===t.type,o=t.id||J.generate(),i=r?t.mutation.loc.source.body:t.query.loc.source.body;function a(t,e,n){var o=n?d({},n):null;if(o&&r&&delete o.roots,!t)return o;var i=new V(e[H],o);return t(i,n),i.toSource()}return function(s,u){function c(e,n,r){return s({type:"TRANSPORTER_REQUEST_ERROR",id:o,endTime:P(),optimisticData:r,data:n,error:{type:e.type,message:e.message,data:e.data}}),Y&&Y(e,t),Promise.reject(e)}var l;if(r)try{l=a(t.optimisticUpdater,u())}catch(t){if("StoreError"===t.name){var f=new z("StoreError","Request failed (StoreError)",{error:t.message});return Y&&Y(f),Promise.reject(f)}throw t}return s({type:"TRANSPORTER_REQUEST_START",id:o,startTime:n,optimisticData:l}),e(i,t.variables).then(function(e){return e.json().then(function(r){if(!e.ok)return c(new z("HttpError","Request failed (HttpError - ".concat(e.status,")"),r,e.status),null,l);var i,f=u();if(f[H].info.lastReset>=n){var d=new q("Store reset after request was started.");return c(new z("StoreError","Request failed (StoreError)",{error:d.message}),null,null)}if(r.errors)return r.errors.forEach(function(t){console.error("GraphQLError: ".concat(t.message))}),c(new z("GraphQLError","Request failed (GraphQLError)",{errors:r.errors}),r.data,l);if(r.data)try{i=a(t.updater,f,r.data)}catch(d){if("StoreError"===d.name)return c(new z("StoreError","Request failed (StoreError)",{error:d.message}),r.data,l);throw d}return s({type:"TRANSPORTER_REQUEST_COMPLETED",id:o,endTime:P(),optimisticData:l,data:i}),r.data},function(t){return e.ok?c(new z("JsonError","".concat(t.message," (JsonError)")),null,l):c(new z("HttpError","Request failed (HttpError - ".concat(e.status,")"),null,e.status),null,l)})},function(t){return c(new z("NetworkError","".concat(t.message," (NetworkError)")),null,l)})}}function K(t,e,n,r){var o=d({},n),i={type:"UPDATE",data:r?d({},r.data):{}};return Object.keys(e).forEach(function(r){o[r]=e[r];var a=i.data[r]?{originalValue:i.data[r].originalValue,values:O(i.data[r].values)}:{originalValue:n[r],values:[]};a.values.push({active:!0,id:t,value:e[r]}),i.data[r]=a}),{data:o,optimistic:i}}var X=function(t,e,n,r,o){var i=o.data[e],a=i.originalValue,s=i.values;if(!(t===s.length-1)||!s[t].active)return r;var u=d({},r);return n&&void 0!==n[e]?u[e]=n[e]:1===s.length?void 0===a?delete u[e]:u[e]=a:u[e]=s[t-1].value,u},Z=function(t,e,n,r){var o=r.data[e].values,i={type:"UPDATE",data:d({},r.data)};if(1===o.length)return delete i.data[e],i;var a=n&&void 0!==n[e],s={originalValue:i.data[e].originalValue,values:O(i.data[e].values)};return a&&o[t].active&&(s.originalValue=n[e],s.values=s.values.map(function(e,n){return n<t?d(d({},e),{},{active:!1}):e})),s.values.splice(t,1),i.data[e]=s,i};function tt(t,e,n,r,o){var i={data:r,optimistic:o};return Object.keys(e).forEach(function(e){var r=o.data[e].values.findIndex(function(e){return e.id===t});if(-1===r)throw new Error("Position not found.");i.data=X(r,e,n,i.data,i.optimistic),i.optimistic=Z(r,e,n,i.optimistic)}),0===Object.keys(i.optimistic.data).length&&(i.optimistic=null),i}function et(t,e){var n=Object.keys(t);return e?n.filter(function(t){return void 0===e[t]}):n}function nt(t){var e={};return Object.keys(t).forEach(function(n){e[n]=d({},t[n])}),e}function rt(t){var e={data:t,optimistic:{}};return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===n.type)return n.data&&n.data.entities?{data:n.data.entities,optimistic:{}}:e;if("TRANSPORTER_REQUEST_START"===n.type&&n.optimisticData){var r=new W(nt(t.data)),o=new W(nt(t.optimistic));if(n.optimisticData.entities)new W(n.optimisticData.entities).forEach(function(t){var e,i=R(t,3),a=i[0],s=i[1],u=i[2];if(!r.get(s,u)){var c=(e=n.id,{data:a,optimistic:{type:"CREATE",id:e}}),l=c.data,f=c.optimistic;r.set(s,u,l),o.set(s,u,f)}else{var d=K(n.id,a,r.get(s,u),o.get(s,u)),p=d.data,h=d.optimistic;r.set(s,u,p),o.set(s,u,h)}});if(n.optimisticData.trash)n.optimisticData.trash.forEach(function(t){var e,i,a=R(t,2),s=a[0],u=a[1],c=(e=n.id,i=r.get(s,u),{optimistic:{type:"DELETE",id:e,data:i}}).optimistic;r.delete(s,u),o.set(s,u,c)});return{data:r.toSource(),optimistic:o.toSource()}}if("TRANSPORTER_REQUEST_COMPLETED"===n.type||"TRANSPORTER_REQUEST_ERROR"===n.type){var i=new W(nt(t.data)),a=new W(nt(t.optimistic));if(n.optimisticData&&n.optimisticData.entities){var s=new W(n.data&&n.data.entities);new W(n.optimisticData.entities).forEach(function(t){var e=R(t,3),r=e[0],o=e[1],u=e[2];if(a.get(o,u)&&"CREATE"===a.get(o,u).type)i.delete(o,u),a.delete(o,u);else{var c=tt(n.id,r,s.get(o,u),i.get(o,u),a.get(o,u)),l=c.data,f=c.optimistic;i.set(o,u,l),f?a.set(o,u,f):a.delete(o,u)}})}if(n.optimisticData&&n.optimisticData.trash){var u=n.data&&n.data.trash;n.optimisticData.trash.forEach(function(t){var e=R(t,2),r=e[0],o=e[1],s=function(t,e,n,r){if(r.id!==t)throw new Error("Optimistic deletion was processed by other request.");return e&&e.some(function(t){return M(t,n)})?{data:null}:{data:r.data}}(n.id,u,[r,o],a.get(r,o)).data;s&&i.set(r,o,s),a.delete(r,o)})}if(n.data&&n.data.entities){var c=new W(n.data.entities),l=new W(n.optimisticData&&n.optimisticData.entities);c.forEach(function(t){var e=R(t,3),n=e[0],r=e[1],o=e[2],a=i.get(r,o);a?(et(n,l.get(r,o)).forEach(function(t){a[t]=n[t]}),i.set(r,o,a)):i.set(r,o,n)})}if(n.data&&n.data.trash)(function(t,e){return e?t.filter(function(t){return e.some(function(e){return M(t,e)})}):t})(n.data.trash,n.optimisticData&&n.optimisticData.trash).forEach(function(t){var e=R(t,2),n=e[0],r=e[1];i.delete(n,r)});return{data:i.toSource(),optimistic:a.toSource()}}return t}}function ot(){var t=[];return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0,r=O(e);if("TRANSPORTER_REQUEST_START"===n.type&&r.push({id:n.id,startTime:n.startTime,endTime:null,loading:!0,errors:null}),"TRANSPORTER_REQUEST_COMPLETED"===n.type){var o=r.findIndex(function(t){return t.id===n.id});r[o]=d(d({},r[o]),{},{endTime:n.endTime,loading:!1})}if("TRANSPORTER_REQUEST_COMPLETED"===n.type){var i=r.findIndex(function(t){return t.id===n.id});r[i]=d(d({},r[i]),{},{endTime:n.endTime,loading:!1,errors:n.errors})}return r}}function it(){var t={lastReset:null};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0;return"TRANSPORTER_STORE_RESET"===n.type?{lastReset:n.lastReset}:e}}var at=function(){function t(e){a(this,t),this.network=e.network,this.initialData=e.initialData}return u(t,[{key:"middleware",value:function(){var t=this;return function(){return function(e){return function(n){return"TRANSPORTER_QUERY"===n.type||"TRANSPORTER_MUTATION"===n.type?e(G(n,t.network.fetch)):e(n)}}}}},{key:"reducer",value:function(){return function(t,n){return e.combineReducers({roots:(r=t,o={data:r,optimistic:null},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,e=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===e.type)return e.data&&e.data.roots?{data:e.data.roots,optimistic:null}:o;if("TRANSPORTER_REQUEST_START"===e.type&&e.optimisticData&&e.optimisticData.roots)return K(e.id,e.optimisticData.roots,t.data,t.optimistic);if("TRANSPORTER_REQUEST_COMPLETED"===e.type||"TRANSPORTER_REQUEST_ERROR"===e.type){var n=e.optimisticData&&e.optimisticData.roots?tt(e.id,e.optimisticData.roots,e.data&&e.data.roots,t.data,t.optimistic):{data:d({},t.data),optimistic:t.optimistic};return e.data&&e.data.roots&&et(e.data.roots,e.optimisticData&&e.optimisticData.roots).forEach(function(t){n.data[t]=e.data.roots[t]}),n}return t}),entities:rt(n),requests:ot(),info:it()});var r,o}(this.initialData&&this.initialData.roots?this.initialData.roots:{},this.initialData&&this.initialData.entities?this.initialData.entities:{})}},{key:"getConfig",value:function(){return this.config}}]),t}(),st=Math.floor(1099511627776*Math.random()).toString(16),ut=new RegExp('"@__(F|R|D|M|S)-'+st+'-(\\d+)__@"',"g"),ct=/\{\s*\[native code\]\s*\}/g,lt=/function.*?\(/,ft=/.*?=>.*?/,dt=/[<>\/\u2028\u2029]/g,pt=["*","async"],ht={"<":"\\u003C",">":"\\u003E","/":"\\u002F","\u2028":"\\u2028","\u2029":"\\u2029"};function yt(t){return ht[t]}var vt=function t(e,n){n||(n={}),"number"!=typeof n&&"string"!=typeof n||(n={space:n});var r,o=[],i=[],a=[],s=[],u=[];return"string"!=typeof(r=n.isJSON&&!n.space?JSON.stringify(e):JSON.stringify(e,n.isJSON?null:function(t,e){if(!e)return e;var n=this[t],r=typeof n;if("object"===r){if(n instanceof RegExp)return"@__R-"+st+"-"+(i.push(n)-1)+"__@";if(n instanceof Date)return"@__D-"+st+"-"+(a.push(n)-1)+"__@";if(n instanceof Map)return"@__M-"+st+"-"+(s.push(n)-1)+"__@";if(n instanceof Set)return"@__S-"+st+"-"+(u.push(n)-1)+"__@"}return"function"===r?"@__F-"+st+"-"+(o.push(n)-1)+"__@":e},n.space))?String(r):(!0!==n.unsafe&&(r=r.replace(dt,yt)),0===o.length&&0===i.length&&0===a.length&&0===s.length&&0===u.length?r:r.replace(ut,function(e,r,c){return"D"===r?'new Date("'+a[c].toISOString()+'")':"R"===r?i[c].toString():"M"===r?"new Map("+t(Array.from(s[c].entries()),n)+")":"S"===r?"new Set("+t(Array.from(u[c].values()),n)+")":function(t){var e=t.toString();if(ct.test(e))throw new TypeError("Serializing native function: "+t.name);if(lt.test(e))return e;if(ft.test(e))return e;var n=e.indexOf("("),r=e.substr(0,n).trim().split(" ").filter(function(t){return t.length>0});return r.filter(function(t){return-1===pt.indexOf(t)}).length>0?(r.indexOf("async")>-1?"async ":"")+"function"+(r.join("").indexOf("*")>-1?"*":"")+e.substr(n):e}(o[c])}))},mt={componentWillUnmount:!1},bt=Symbol.for("react.forward_ref"),gt=function(t,e){var n=[];return function(t,e,n){return new Promise(function(r,o){var i=t[Symbol.iterator](),a=0;!function t(n){var s=i.next();s.done?r(n):Promise.all([n,s.value]).then(function(n){t(e(n[0],n[1],a++))}).catch(o)}(n)})}(t,function(t,r,o){return Promise.resolve(e(r,o)).then(function(t){n.push(t)})}).then(function(){return n})},Et=function t(e){return e&&"function"==typeof e.render?t(e.render()):e},St=function(t){return t.props&&t.props.children?t.props.children:t.children?t.children:void 0},wt=function(t){return t.type||t.nodeName},Rt=function(t){return t.props||t.attributes},Ot=function(t){return!!wt(t)},Tt=function(t){return t.prototype&&(t.prototype.render||t.prototype.isReactComponent||t.prototype.isPureReactComponent)},kt=function(t){return t.type&&t.type.$$typeof===bt},_t=function(t){return!!t.getChildContext};var Pt=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:mt;return new Promise(function(o,i){var a=function(){try{return e.apply(void 0,arguments)}catch(t){i(t)}};(function t(e,n){if(Array.isArray(e))return Promise.all(e.map(function(e){return t(e,n)}));if(!e)return Promise.resolve();if("string"==typeof e||"number"==typeof e)return a(e,null,n),Promise.resolve();if(e.type&&(e.type._context&&(e.type._context._currentValue=e.props.value),e.type.Provider&&e.type.Consumer)){var o=e.props.children(e.type.Provider._context._currentValue);return t(o,n)}return Ot(e)?new Promise(function(o){var s=function(n,r,s,u){return Promise.resolve(a(e,r,s,u)).then(function(e){if(!1!==e){var r=n(),a=Et(r);if(a)return Array.isArray(a)?gt(a,function(e){return e?t(e,u):Promise.resolve()}).then(o,i).catch(i):t(a,u).then(o,i).catch(i)}}).catch(i)};if("function"==typeof wt(e)||kt(e)){var u=wt(e),c=Object.assign({},u.defaultProps,Rt(e),{children:St(e)});if(kt(e))s(function(){return e.type.render(c)},null,n,n).then(o);else if(Tt(u)){var l=new u(c,n);if(Object.defineProperty(l,"props",{value:l.props||c}),l.context=l.context||n,l.state=l.state||null,l.setState=function(t){"function"==typeof t&&(t=t(l.state,l.props,l.context)),l.state=Object.assign({},l.state,t)},u.getDerivedStateFromProps){var f=u.getDerivedStateFromProps(l.props,l.state);null!==f&&(l.state=Object.assign({},l.state,f))}else l.UNSAFE_componentWillMount?l.UNSAFE_componentWillMount():l.componentWillMount&&l.componentWillMount();var d=_t(l)?Object.assign({},n,l.getChildContext()):n;s(function(){return l.render(l.props,l.state)},l,n,d).then(function(){r.componentWillUnmount&&l.componentWillUnmount&&l.componentWillUnmount()}).then(o)}else s(function(){return u(c,n)},null,n,n).then(o)}else s(function(){return St(e)},null,n,n).then(o)}):e.containerInfo&&e.children&&e.children.props&&Array.isArray(e.children.props.children)?Promise.all(e.children.props.children.map(function(e){return t(e,n)})):Promise.resolve()})(t,n).then(o,i)})},jt="undefined"!=typeof window,At=new(function(){function t(){a(this,t),c(this,"env",void 0),c(this,"phase",void 0),this.env=jt?"browser":"node",this.phase="BOOTSTRAPPING",this.errors=jt&&window.__ASYNC_DATA__?window.__ASYNC_DATA__.errors:{},this.ssr=!jt||jt&&window.__ASYNC_DATA__&&!!window.__ASYNC_DATA__.errors,this.ids={}}return u(t,[{key:"isSSREnabled",value:function(){return this.ssr}},{key:"generateId",value:function(t){var e=this.ids[t]?this.ids[t]+1:1;return this.ids[t]=e,e}},{key:"setPhaseToFirstRender",value:function(){this.phase="FIRST_RENDER",this.ids={}}},{key:"setPhaseToRender",value:function(){this.phase="RENDER",this.ids={}}},{key:"addError",value:function(t,e,n){this.errors[t]||(this.errors[t]={}),this.errors[t][e]=n}},{key:"getError",value:function(t,e){return this.errors[t]&&this.errors[t][e]&&0!==Object.keys(this.errors[t][e]).length?this.errors[t][e]:null}},{key:"getErrors",value:function(){return this.errors}},{key:"getEnv",value:function(){return this.env}},{key:"getPhase",value:function(){return this.phase}}]),t}());function Ct(t,e){return t(e={exports:{}},e.exports),e.exports}var Dt="function"==typeof Symbol&&Symbol.for,xt=Dt?Symbol.for("react.element"):60103,Nt=Dt?Symbol.for("react.portal"):60106,Mt=Dt?Symbol.for("react.fragment"):60107,Lt=Dt?Symbol.for("react.strict_mode"):60108,Ut=Dt?Symbol.for("react.profiler"):60114,It=Dt?Symbol.for("react.provider"):60109,qt=Dt?Symbol.for("react.context"):60110,Ft=Dt?Symbol.for("react.async_mode"):60111,$t=Dt?Symbol.for("react.concurrent_mode"):60111,Bt=Dt?Symbol.for("react.forward_ref"):60112,Qt=Dt?Symbol.for("react.suspense"):60113,Wt=Dt?Symbol.for("react.suspense_list"):60120,Vt=Dt?Symbol.for("react.memo"):60115,Jt=Dt?Symbol.for("react.lazy"):60116,Yt=Dt?Symbol.for("react.block"):60121,zt=Dt?Symbol.for("react.fundamental"):60117,Ht=Dt?Symbol.for("react.responder"):60118,Gt=Dt?Symbol.for("react.scope"):60119;function Kt(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case xt:switch(t=t.type){case Ft:case $t:case Mt:case Ut:case Lt:case Qt:return t;default:switch(t=t&&t.$$typeof){case qt:case Bt:case Jt:case Vt:case It:return t;default:return e}}case Nt:return e}}}function Xt(t){return Kt(t)===$t}var Zt={AsyncMode:Ft,ConcurrentMode:$t,ContextConsumer:qt,ContextProvider:It,Element:xt,ForwardRef:Bt,Fragment:Mt,Lazy:Jt,Memo:Vt,Portal:Nt,Profiler:Ut,StrictMode:Lt,Suspense:Qt,isAsyncMode:function(t){return Xt(t)||Kt(t)===Ft},isConcurrentMode:Xt,isContextConsumer:function(t){return Kt(t)===qt},isContextProvider:function(t){return Kt(t)===It},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===xt},isForwardRef:function(t){return Kt(t)===Bt},isFragment:function(t){return Kt(t)===Mt},isLazy:function(t){return Kt(t)===Jt},isMemo:function(t){return Kt(t)===Vt},isPortal:function(t){return Kt(t)===Nt},isProfiler:function(t){return Kt(t)===Ut},isStrictMode:function(t){return Kt(t)===Lt},isSuspense:function(t){return Kt(t)===Qt},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===Mt||t===$t||t===Ut||t===Lt||t===Qt||t===Wt||"object"==typeof t&&null!==t&&(t.$$typeof===Jt||t.$$typeof===Vt||t.$$typeof===It||t.$$typeof===qt||t.$$typeof===Bt||t.$$typeof===zt||t.$$typeof===Ht||t.$$typeof===Gt||t.$$typeof===Yt)},typeOf:Kt},te=Ct(function(t,e){}),ee=(te.AsyncMode,te.ConcurrentMode,te.ContextConsumer,te.ContextProvider,te.Element,te.ForwardRef,te.Fragment,te.Lazy,te.Memo,te.Portal,te.Profiler,te.StrictMode,te.Suspense,te.isAsyncMode,te.isConcurrentMode,te.isContextConsumer,te.isContextProvider,te.isElement,te.isForwardRef,te.isFragment,te.isLazy,te.isMemo,te.isPortal,te.isProfiler,te.isStrictMode,te.isSuspense,te.isValidElementType,te.typeOf,Ct(function(t){t.exports=Zt}),Object.getOwnPropertySymbols),ne=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}})()&&Object.assign;var oe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Function.call.bind(Object.prototype.hasOwnProperty);function ie(){}function ae(){}ae.resetWarningCache=ie;var se=Ct(function(t){t.exports=function(){function t(t,e,n,r,o,i){if(i!==oe){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:ae,resetWarningCache:ie};return n.PropTypes=n,n}()});function ue(t,e){var n={};return t?(Object.keys(t).forEach(function(r){n[r]=function(){return e(t[r].apply(t,arguments))}}),n):n}function ce(t,e){var n={};return t?(Object.keys(t).forEach(function(r){n[r]=t[r](e)}),n):n}var le=r.connect(function(t,e){return ce(e.selectors,t)},function(t,e){return ue(e.actions,t)},function(t,e,n){var r=n.props;return Object.assign({},r,t,e)}),fe=function(t){return null==t||"function"!=typeof t&&"object"!==i(t)||!t.default?t:t.default},de={disabled:!1,defer:!0,error:null,loading:null},pe=function(t){return t&&t.async?Object.assign({},de,t.async):de},he={store:se.object,isInBoundary:se.bool},ye={isInBoundary:se.bool};var ve=function(t,e){if(t&&!e||!t&&e)return!1;if(t&&e){if(Object.keys(t).some(function(n){return!e[n]||t[n]!==e[n]}))return!1;if(Object.keys(e).some(function(n){return!t[n]||t[n]!==e[n]}))return!1}return!0};function me(t,e,n){switch(e){case"=":return t===n;case">":return t>n;case">=":return t>=n;case"<":return t<n;case"<=":return t<=n;default:throw new q("Unknown operator '".concat(e,"'"))}}function be(t,e,n){var r=n.get(t,e);if(!r)throw new q("Joined entity not found.",[t,e]);var o={__typename:t,id:e};return Object.keys(r).forEach(function(t){D(r[t])||(o[t]=r[t])}),o}function ge(t,e,n,r,o){var i=o.get(t,e);if(!i[n])throw new q('Joined relation "'.concat(n,'" not found.'),[t,e]);if(!D(i[n]))throw new q('Joined relation "'.concat(n,'" is not a connection.'),[t,e]);return null===i[n].link?null:Se(i[n].link,r,o)}var Ee=function(){function t(e,n){a(this,t),this.link=e,this.isManyLink=x(e),this.data=this.isManyLink?e.map(function(t){return be.apply(void 0,O(t).concat([n]))}):be.apply(void 0,O(e).concat([n])),this.entities=n}return u(t,[{key:"where",value:function(t,e,n){var r=n||e,o=n?e:"=";return this.isManyLink||me(this.data[t],o,r)||(this.data=null),this.isManyLink&&(this.data=this.data.filter(function(e){return me(e[t],o,r)})),this}},{key:"orderBy",value:function(){return this}},{key:"limit",value:function(){return this}},{key:"join",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=C(t),o=j(t)?t:t[0];if(this.isManyLink)this.link.forEach(function(t,i){var a=ge.apply(void 0,O(e.link[i]).concat([r,n,e.entities]));e.data[i][o]=a});else{var i=ge.apply(void 0,O(this.link).concat([r,n,this.entities]));this.data[o]=i}return this}},{key:"getData",value:function(){return this.data}}]),t}();function Se(t,e,n){if(null===t)return null;var r=new Ee(t,n);return(e?e(r):r).getData()}function we(t,e){if(!t.arguments||0===t.arguments.length)return t.name.value;var n={};return t.arguments.forEach(function(t){n[t.name.value]=o.valueFromASTUntyped(t.value,e)}),[t.name.value,n]}function Re(t,e){return function(n){return t.selections.forEach(function(t){"Field"===t.kind&&t.selectionSet&&n.join(we(t,e.variables),Re(t.selectionSet,e))}),n}}var Oe=function(){function t(e){a(this,t),this.roots=e.roots.data,this.entities=new W(e.entities.data)}return u(t,[{key:"select",value:function(t,e){return e.entry?this.selectByFragmentAST(t,e):this.selectByOperationAST(t,e)}},{key:"selectByFragmentAST",value:function(t,e){var n=t.definitions.find(function(t){return"FragmentDefinition"===t.kind});if(!n)throw new q("Option entry is set, but no fragment node found.");return this.selectByEntity.apply(this,O(e.entry).concat([Re(n.selectionSet,e)]))}},{key:"selectByOperationAST",value:function(t,e){var n=t.definitions.find(function(t){return"OperationDefinition"===t.kind});if(!n)throw new q("No operation node found.");var r=n.selectionSet.selections[0];return this.selectByRoot(we(r,e.variables),Re(r.selectionSet,e))}},{key:"selectByEntity",value:function(t,e,n){if(!this.entities.get(t,e))throw new q("Selected entity not found.",[t,e]);return Se([t,e],n,this.entities)}},{key:"selectByRoot",value:function(t,e){var n=C(t);if(!this.roots[n])throw new q("Selected root '".concat(n,"' not found."),"root");return Se(this.roots[n].link,e,this.entities)}},{key:"selectByRelation",value:function(t,e,n,r){var o=C(n),i=this.entities.get(t,e);if(!i||!i[o])throw new q("Selected relation '".concat(o,"' not found."),[t,e]);return Se(i[o].link,r,this.entities)}}]),t}(),Te="transporter";function ke(t){return function(e,n){return t(new Oe(e[Te]),n)}}t.Link=N,t.ManyLink=I,t.TransporterClient=at,t.TransporterNetwork=function t(e){var n=this;a(this,t),c(this,"fetch",function(t,e){return n.request(t,e)}),this.request=e},t.bootstrapper=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Pt(t,function(t,e){if(e&&"function"==typeof e.bootstrap)return e.bootstrap()},r).then(function(){if(At.setPhaseToFirstRender(),"node"===At.getEnv()){var t={errors:At.getErrors()};e({getScriptTag:function(){return'<script charset="UTF-8">window.__ASYNC_DATA__='.concat(vt(t),";<\/script>")},getScriptElement:function(){return n.createElement("script",{dangerouslySetInnerHTML:{__html:t}})}})}else e();At.setPhaseToRender()}).catch(function(t){return console.error(t)})},t.createAsyncContainer=function(t,r,o){var i={middleware:o&&o.middleware||null,async:pe(o)},s=function(t){var e=r(t);return d(d({},e),{},{loaders:e.loaders||{}})},f=t.name&&t.bundle,h=t.displayName||t.name||"Component",y=function(e){p(o,n.Component);var r=w(o);function o(e,n){var u;a(this,o),u=r.call(this,e,n);var c=s(u.props),l=u.isPreload();n.isInBoundary&&!i.async.defer&&console.warn('Option "defer" is set to false inside a boundary.'),u.phase=At.getPhase(),u.hasUnmounted=!1,l&&(u.containerName="".concat(h,"-").concat(At.generateId(h)));var p={startTime:l?null:P(),endTime:null},y=f?{bundle:d(d({},p),{},{loading:l||f?"block":null,error:l?At.getError(u.containerName,"bundle"):null})}:{};return Object.keys(c.loaders).forEach(function(t){y[t]=d(d({},p),{},{loading:l?null:"block",error:l?At.getError(u.containerName,t):null})}),u.state={loaders:y},u.component={Component:f?null:t,isConnected:!1},u.cache={},u.handleLoad=u.handleLoad.bind(E(u)),u}return u(o,[{key:"getChildContext",value:function(){return{isInBoundary:i.async.boundary}}},{key:"bootstrap",value:function(){var e=this,n=s(this.props),r=this.isPreload();if(!r)return!1;var o=[];return"node"===At.getEnv()&&Object.keys(n.loaders).forEach(function(t){var i=n.loaders[t],a=e.getCacheProvider();i.request({load:function(n){o.push(e.handleLoad(t,n,r))},cache:a},e.context.store.dispatch)}),f&&o.push(this.handleLoad("bundle",t.bundle(),r)),Promise.all(o).then(function(){return!i.async.boundary})}},{key:"componentDidMount",value:function(){var e=this,n=s(this.props);this.isPreload()||(Object.keys(n.loaders).forEach(function(t){var r=n.loaders[t],o=e.getCacheProvider();r.request({load:function(n){return e.handleLoad(t,n,!1)},cache:o},e.context.store.dispatch)}),f&&!this.component.Component&&this.handleLoad("bundle",t.bundle(),!1))}},{key:"componentWillReceiveProps",value:function(t,e){var n=this,r=s(t);Object.keys(r.loaders).forEach(function(o){var i=r.loaders[o];if(i.shouldReload&&!n.state.loaders[o].loading&&i.shouldReload({info:n.state.loaders[o],cache:n.getCacheProvider()},t,e.store.getState())){n.setRequestState(o,"block",null);var a=n.getCacheProvider();i.request({load:function(t,e){return n.handleLoad(o,t,!1,e)},cache:a},n.context.store.dispatch)}})}},{key:"handleLoad",value:function(t,e,n){var r=this;return e.then(function(e){"bundle"===t&&(r.component.Component=fe(e)),n||r.hasUnmounted||r.setRequestState(t,null,null)}).catch(function(e){n?(At.addError(r.containerName,t,e),r.state.loaders[t].error=e):r.hasUnmounted||r.setRequestState(t,null,e)})}},{key:"componentWillUnmount",value:function(){this.hasUnmounted=!0}},{key:"getCacheProvider",value:function(){var t=this;return{get:function(e){return t.cache[e]},set:function(e,n){t.cache[e]=n}}}},{key:"setRequestState",value:function(t,e,n){var r=P();this.setState(function(o){return{loaders:d(d({},o.loaders),{},c({},t,{startTime:e?r:o.loaders[t].startTime,endTime:e?o.loaders[t].endTime:r,loading:e,error:void 0===n?o.loaders[t].error:n}))}})}},{key:"isPreload",value:function(){return!(!At.isSSREnabled()||this.context.isInBoundary||i.async.defer||"BOOTSTRAPPING"!==this.phase&&"FIRST_RENDER"!==this.phase)}},{key:"render",value:function(){var t=this,e=s(this.props),r={};if(Object.keys(e.loaders).forEach(function(n){var o=e.loaders[n];if(o.props){var i=t.getCacheProvider();r[n]=d(d({},t.state.loaders[n]),o.props({load:function(e,r){t.state.loaders[n].loading?console.error("Resource ".concat(h," ").concat(n," is already loading.")):(t.setRequestState(n,r&&r.showWhileLoading?"show":"block"),t.handleLoad(n,e,!1))},cache:i},t.context.store.dispatch))}}),Object.values(this.state.loaders).some(function(t){return"block"===t.loading})){if(!i.async.loading)return null;var o=i.async.loading;return n.createElement(o,l({},r,this.props))}if(Object.values(this.state.loaders).some(function(t){return null!==t.error})){if(!i.async.error)return null;var a=i.async.error;return n.createElement(a,l({},r,this.props))}var u=d(d({},r),this.props);if(e.selectors||e.actions){this.component.isConnected||(this.component.Component=le(this.component.Component),this.component.isConnected=!0);var c=this.component.Component;return n.createElement(c,{selectors:e.selectors,actions:e.actions,props:u})}var f=this.component.Component;return n.createElement(f,u)}}]),o}();return y.displayName="Load(".concat(h,")"),y.contextTypes=he,y.childContextTypes=ye,i.middleware?e.compose.apply(void 0,O(i.middleware))(y):y},t.createContainer=function(t,n,o){var i={middleware:o&&o.middleware||null},a=r.connect(function(t,e){return ce(n(e).selectors,t)},function(t,e){return ue(n(e).actions,t)});return i.middleware?e.compose.apply(void 0,O(i.middleware).concat([a]))(t):a(t)},t.createMutation=function(t,e){return d({type:"TRANSPORTER_MUTATION",mutation:t},e)},t.createQuery=_,t.onError=function(t){Y=t},t.query=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.loaderOptions,r=g(e,["loaderOptions"]);return{request:function(e,o){var i=e.load;return e.cache.set("variables",r.variables),n&&n.skip?i(new Promise(function(t){return t()})):i(o(_(t,r)))},props:function(e,n){var o=e.load,i=e.cache;return{refetch:function(){i.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return o(n(_(t,d(d({},r),a))))},fetchMore:function(){i.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return o(n(_(t,d(d({},r),a)),{showWhileLoading:!0}))},startPolling:function(e){var a=setInterval(function(){o(n(_(t,r),{showWhileLoading:!0}))},e);i.set("timeout",a)},endPolling:function(){clearInterval(i.get("timeout")),i.set("timeout",null)}}},shouldReload:function(t,e,n){var o=t.info,i=t.cache,a=i.get("variables");return i.set("variables",r.variables),o.startTime<n.transporter.info.lastReset||!ve(a,r.variables)}}},t.resetStore=function(t){return{type:"TRANSPORTER_STORE_RESET",data:t,lastReset:P()}},t.select=function(t,e){return ke(function(n){return n.select(t,e||{})})},t.selectAdvanced=ke,t.selectByEntity=function(t,e,n){return ke(function(r){return r.selectByEntity(t,e,n)})},t.selectByRelation=function(t,e,n,r){return ke(function(o){return o.selectByRelation(t,e,n,r)})},t.selectByRoot=function(t,e){return ke(function(n){return n.selectByRoot(t,e)})},Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "react-transporter", | ||
"version": "0.5.18", | ||
"version": "0.5.19", | ||
"description": "React.js Redux GraphQL client", | ||
@@ -5,0 +5,0 @@ "author": "Markus Wetzel <markuswetzel@gmx.net>", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
334676
7885