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

react-transporter

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-transporter - npm Package Compare versions

Comparing version 0.6.6 to 1.0.0-alpha.0

42

dist/react-transporter.umd.min.js

@@ -1,41 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-dom"),require("graphql/utilities/valueFromASTUntyped")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","graphql/utilities/valueFromASTUntyped"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["react-transporter"]={},t.React,t.reactDom,t.valueFromASTUntyped)}(this,(function(t,e,n,r){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=o(e);function a(t){return(a="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 u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(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 s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),t}function f(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(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?l(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(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&&h(t,e)}function y(t){return(y=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 v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(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&&h(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,y(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,t)})(t)}function E(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 g(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function w(t){var e=v();return function(){var n,r=y(t);if(e){var o=y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function O(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,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||R(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 S(t){return function(t){if(Array.isArray(t))return T(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||R(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 R(t,e){if(t){if("string"==typeof t)return T(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)?T(t,e):void 0}}function T(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 k(t,e){return d({type:"TRANSPORTER_QUERY",query:t},e)}function j(){return(new Date).getTime()}function P(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})})),e}function _(t){var e={exports:{}};return t(e,e.exports),e.exports
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/}var D="function"==typeof Symbol&&Symbol.for,N=D?Symbol.for("react.element"):60103,A=D?Symbol.for("react.portal"):60106,C=D?Symbol.for("react.fragment"):60107,x=D?Symbol.for("react.strict_mode"):60108,M=D?Symbol.for("react.profiler"):60114,U=D?Symbol.for("react.provider"):60109,$=D?Symbol.for("react.context"):60110,L=D?Symbol.for("react.async_mode"):60111,I=D?Symbol.for("react.concurrent_mode"):60111,q=D?Symbol.for("react.forward_ref"):60112,B=D?Symbol.for("react.suspense"):60113,F=D?Symbol.for("react.suspense_list"):60120,Q=D?Symbol.for("react.memo"):60115,V=D?Symbol.for("react.lazy"):60116,W=D?Symbol.for("react.block"):60121,G=D?Symbol.for("react.fundamental"):60117,J=D?Symbol.for("react.responder"):60118,z=D?Symbol.for("react.scope"):60119;function H(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case N:switch(t=t.type){case L:case I:case C:case M:case x:case B:return t;default:switch(t=t&&t.$$typeof){case $:case q:case V:case Q:case U:return t;default:return e}}case A:return e}}}function X(t){return H(t)===I}var Y={AsyncMode:L,ConcurrentMode:I,ContextConsumer:$,ContextProvider:U,Element:N,ForwardRef:q,Fragment:C,Lazy:V,Memo:Q,Portal:A,Profiler:M,StrictMode:x,Suspense:B,isAsyncMode:function(t){return X(t)||H(t)===L},isConcurrentMode:X,isContextConsumer:function(t){return H(t)===$},isContextProvider:function(t){return H(t)===U},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===N},isForwardRef:function(t){return H(t)===q},isFragment:function(t){return H(t)===C},isLazy:function(t){return H(t)===V},isMemo:function(t){return H(t)===Q},isPortal:function(t){return H(t)===A},isProfiler:function(t){return H(t)===M},isStrictMode:function(t){return H(t)===x},isSuspense:function(t){return H(t)===B},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===C||t===I||t===M||t===x||t===B||t===F||"object"==typeof t&&null!==t&&(t.$$typeof===V||t.$$typeof===Q||t.$$typeof===U||t.$$typeof===$||t.$$typeof===q||t.$$typeof===G||t.$$typeof===J||t.$$typeof===z||t.$$typeof===W)},typeOf:H};
/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
_((function(t,e){}));var K=_((function(t){t.exports=Y}));
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,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;function Z(){}function tt(){}Function.call.bind(Object.prototype.hasOwnProperty),tt.resetWarningCache=Z;_((function(t){t.exports=function(){function t(t,e,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){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:tt,resetWarningCache:Z};return n.PropTypes=n,n}()}));var et=i.default.createContext(null);var nt=function(t){t()},rt=function(){return nt};var ot={notify:function(){},get:function(){return[]}};function it(t,e){var n,r=ot;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=e?e.addNestedSub(o):t.subscribe(o),r=function(){var t=rt(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t((function(){for(var t=e;t;)t.callback(),t=t.next}))},get:function(){for(var t=[],n=e;n;)t.push(n),n=n.next;return t},subscribe:function(t){var r=!0,o=n={callback:t,next:null,prev:n};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}var a={addNestedSub:function(t){return i(),r.subscribe(t)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=ot)},getListeners:function(){return r}};return a}var at="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function ut(t){var n=t.store,r=t.context,o=t.children,a=e.useMemo((function(){var t=it(n);return t.onStateChange=t.notifyNestedSubs,{store:n,subscription:t}}),[n]),u=e.useMemo((function(){return n.getState()}),[n]);at((function(){var t=a.subscription;return t.trySubscribe(),u!==n.getState()&&t.notifyNestedSubs(),function(){t.tryUnsubscribe(),t.onStateChange=null}}),[a,u]);var c=r||et;return i.default.createElement(c.Provider,{value:a},o)}var ct={};ct[K.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ct[K.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var st=60103,ft=60106,lt=60107,dt=60108,pt=60114,yt=60109,ht=60110,vt=60112,mt=60113,bt=60120,Et=60115,gt=60116,wt=60121,Ot=60122,St=60117,Rt=60129,Tt=60131;if("function"==typeof Symbol&&Symbol.for){var kt=Symbol.for;st=kt("react.element"),ft=kt("react.portal"),lt=kt("react.fragment"),dt=kt("react.strict_mode"),pt=kt("react.profiler"),yt=kt("react.provider"),ht=kt("react.context"),vt=kt("react.forward_ref"),mt=kt("react.suspense"),bt=kt("react.suspense_list"),Et=kt("react.memo"),gt=kt("react.lazy"),wt=kt("react.block"),Ot=kt("react.server.block"),St=kt("react.fundamental"),Rt=kt("react.debug_trace_mode"),Tt=kt("react.legacy_hidden")}function jt(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case st:switch(t=t.type){case lt:case pt:case dt:case mt:case bt:return t;default:switch(t=t&&t.$$typeof){case ht:case vt:case gt:case Et:case yt:return t;default:return e}}case ft:return e}}}var Pt={ContextConsumer:ht,ContextProvider:yt,Element:st,ForwardRef:vt,Fragment:lt,Lazy:gt,Memo:Et,Portal:ft,Profiler:pt,StrictMode:dt,Suspense:mt,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(t){return jt(t)===ht},isContextProvider:function(t){return jt(t)===yt},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===st},isForwardRef:function(t){return jt(t)===vt},isFragment:function(t){return jt(t)===lt},isLazy:function(t){return jt(t)===gt},isMemo:function(t){return jt(t)===Et},isPortal:function(t){return jt(t)===ft},isProfiler:function(t){return jt(t)===pt},isStrictMode:function(t){return jt(t)===dt},isSuspense:function(t){return jt(t)===mt},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===lt||t===pt||t===Rt||t===dt||t===mt||t===bt||t===Tt||"object"==typeof t&&null!==t&&(t.$$typeof===gt||t.$$typeof===Et||t.$$typeof===yt||t.$$typeof===ht||t.$$typeof===vt||t.$$typeof===St||t.$$typeof===wt||t[0]===Ot)},typeOf:jt};function _t(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function Dt(t,e){if(_t(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(e,n[o])||!_t(t[n[o]],e[n[o]]))return!1;return!0}function Nt(){return e.useContext(et)}function At(t){void 0===t&&(t=et);var n=t===et?Nt:function(){return e.useContext(t)};return function(){return n().store}}
/** @license React v17.0.2
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
_((function(t,e){})),_((function(t){t.exports=Pt}));var Ct=At();var xt,Mt=function(t,e){return t===e};xt=n.unstable_batchedUpdates,nt=xt;var Ut=i.default.createContext(null),$t=function(t){void 0===t&&(t=et);var e=t===et?Ct:At(t);return function(){return e().dispatch}}(Ut),Lt=function(t){void 0===t&&(t=et);var n=t===et?Nt:function(){return e.useContext(t)};return function(t,r){void 0===r&&(r=Mt);var o=n(),i=function(t,n,r,o){var i,a=e.useReducer((function(t){return t+1}),0)[1],u=e.useMemo((function(){return it(r,o)}),[r,o]),c=e.useRef(),s=e.useRef(),f=e.useRef(),l=e.useRef(),d=r.getState();try{if(t!==s.current||d!==f.current||c.current){var p=t(d);i=void 0!==l.current&&n(p,l.current)?l.current:p}else i=l.current}catch(t){throw c.current&&(t.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),t}return at((function(){s.current=t,f.current=d,l.current=i,c.current=void 0})),at((function(){function t(){try{var t=r.getState();if(t===f.current)return;var e=s.current(t);if(n(e,l.current))return;l.current=e,f.current=t}catch(t){c.current=t}a()}return u.onStateChange=t,u.trySubscribe(),t(),function(){return u.tryUnsubscribe()}}),[r,u]),i}(t,r,o.store,o.subscription);return e.useDebugValue(i),i}}(Ut),It=At(Ut);function qt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bt(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 Ft(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bt(Object(n),!0).forEach((function(e){qt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Qt(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Vt="function"==typeof Symbol&&Symbol.observable||"@@observable",Wt=function(){return Math.random().toString(36).substring(7).split("").join(".")},Gt={INIT:"@@redux/INIT"+Wt(),REPLACE:"@@redux/REPLACE"+Wt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Wt()}};function Jt(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function zt(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Qt(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Qt(1));return n(zt)(t,e)}if("function"!=typeof t)throw new Error(Qt(2));var o=t,i=e,a=[],u=a,c=!1;function s(){u===a&&(u=a.slice())}function f(){if(c)throw new Error(Qt(3));return i}function l(t){if("function"!=typeof t)throw new Error(Qt(4));if(c)throw new Error(Qt(5));var e=!0;return s(),u.push(t),function(){if(e){if(c)throw new Error(Qt(6));e=!1,s();var n=u.indexOf(t);u.splice(n,1),a=null}}}function d(t){if(!Jt(t))throw new Error(Qt(7));if(void 0===t.type)throw new Error(Qt(8));if(c)throw new Error(Qt(9));try{c=!0,i=o(i,t)}finally{c=!1}for(var e=a=u,n=0;n<e.length;n++){(0,e[n])()}return t}function p(t){if("function"!=typeof t)throw new Error(Qt(10));o=t,d({type:Gt.REPLACE})}function y(){var t,e=l;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(Qt(11));function n(){t.next&&t.next(f())}return n(),{unsubscribe:e(n)}}})[Vt]=function(){return this},t}return d({type:Gt.INIT}),(r={dispatch:d,subscribe:l,getState:f,replaceReducer:p})[Vt]=y,r}function Ht(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var o=e[r];"function"==typeof t[o]&&(n[o]=t[o])}var i,a=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:Gt.INIT}))throw new Error(Qt(12));if(void 0===n(void 0,{type:Gt.PROBE_UNKNOWN_ACTION()}))throw new Error(Qt(13))}))}(n)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var r=!1,o={},u=0;u<a.length;u++){var c=a[u],s=n[c],f=t[c],l=s(f,e);if(void 0===l)throw e&&e.type,new Error(Qt(14));o[c]=l,r=r||l!==f}return(r=r||a.length!==Object.keys(t).length)?o:t}}function Xt(t,e){return function(){return e(t.apply(this,arguments))}}function Yt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function Kt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error(Qt(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return r=Yt.apply(void 0,i)(n.dispatch),Ft(Ft({},n),{},{dispatch:r})}}}var Zt=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Gt,applyMiddleware:Kt,bindActionCreators:function(t,e){if("function"==typeof t)return Xt(t,e);if("object"!=typeof t||null===t)throw new Error(Qt(16));var n={};for(var r in t){var o=t[r];"function"==typeof o&&(n[r]=Xt(o,e))}return n},combineReducers:Ht,compose:Yt,createStore:zt});var te="undefined"==typeof window,ee=function(t,e,n){return d(d({},t.loaders[e]),n)},ne=function(t){var e=Object.values(t.loaders);return e.some((function(t){return t.loading}))?"LOADING":e.some((function(t){return!!t.error}))?"ERROR":"RESOLVED"};function re(t,n){var r,o=It(),i=(r=O(e.useState(0),2)[1],function(){return r((function(t){return t+1}))}),u=!(!t.name||!t.bundle),c=e.useMemo((function(){var e={status:"LOADING",phase:"MOUNTING",component:u?null:t,loaders:{},queue:[]},r={startTime:j(),endTime:null};return u&&(e.loaders.bundle=d(d({},r),{},{cache:null,loading:u,error:null})),Object.keys(n.loaders).forEach((function(t){var n;e.loaders[t]=d(d({},r),{},{cache:(n={},{get:function(t){return n[t]},set:function(t,e){n[t]=e}}),loading:!0,error:null})})),e}),[]);e.useEffect((function(){return c.phase="MOUNTED",c.queue.forEach((function(t){t()})),c.queue=[],function(){c.phase="UNMOUNTED"}}));var s=function(t){return function(e){return e.then((function(e){"UNMOUNTED"!==c.phase&&("bundle"===t&&(c.component=function(t){return null==t||"function"!=typeof t&&"object"!==a(t)||!t.default?t:t.default}(e)),c.loaders[t]=ee(c,t,{endTime:j(),loading:!1,error:null}),c.status=ne(c),i())})).catch((function(e){"UNMOUNTED"!==c.phase&&(c.loaders[t]=ee(c,t,{endTime:j(),loading:!1,error:e}),c.status=ne(c),i())}))}};te||"MOUNTING"!==c.phase||(Object.entries(n.loaders).forEach((function(t){var e=O(t,2),n=e[0],r=e[1];c.queue.push((function(){var t=s(n);r.request({load:t,cache:c.loaders[n].cache},o.dispatch)}))})),u&&c.queue.push((function(){s("bundle")(t.bundle())})));!function(){if("MOUNTED"===c.phase){var t=o.getState();Object.entries(n.loaders).forEach((function(e){var n=O(e,2),r=n[0],i=n[1];i.shouldReload({info:c.loaders[r],cache:c.loaders[r].cache},t)&&!c.loaders[r].loading&&(c.loaders[r]=ee(c,r,{startTime:j(),endTime:null,loading:!0,error:null}),c.status=ne(c),c.queue.push((function(){var t=s(r);i.request({load:t,cache:c.loaders[r].cache},o.dispatch)})))}))}}();var f={};return Object.entries(n.loaders).forEach((function(e){var n=O(e,2),r=n[0],a=n[1];f[r]=d(d({},c.loaders[r]),a.getProps({load:function(){if(c.loaders[r].loading){var e=t.displayName||t.name||"Component";console.error("Resource ".concat(e," ").concat(r," is already loading."))}var n=s(r);return i(),n},cache:c.loaders[r].cache},o.dispatch))})),[c,f]}function oe(t,e){return Lt((function(n){var r={};return e&&"RESOLVED"===t?(Object.keys(e).forEach((function(t){r[t]=e[t](n)})),r):r}),Dt)}var ie={error:null,loading:null},ae=function(t){return t&&t.async?d(d({},ie),t.async):ie};function ue(t){return"string"==typeof t||t instanceof String}var ce=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"===a(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 se(t){if(ue(t))return t;var e=ce(t[1]);return"".concat(t[0]).concat(e?"(".concat(e,")"):"")}function fe(t){return!!t&&(Object.prototype.hasOwnProperty.call(t,"link")&&"function"!=typeof t.link)}function le(t){return!(null===t||ue(t[0]))}var de=function(){function t(e,n){u(this,t),e?fe(e)?(this.meta=e.meta,this.link=e.link):this.link=[e,n]:this.link=null}return s(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 pe(t,e){return t[0]===e[0]&&t[1]===e[1]}function ye(t,e){return fe(t)?le(t.link)?t.link:[t.link]:ue(t)?ue(e)?[[t,e]]:e.map((function(e){return[t,e]})):t}function he(t,e){return t.filter((function(t){return!e.some((function(e){return pe(t,e)}))}))}var ve=function(){function t(e,n){u(this,t),e?(fe(e)&&(this.meta=e.meta),this.link=ye(e,n)):this.link=[]}return s(t,[{key:"prepend",value:function(t,e){var n=ye(t,e);return this.link=[].concat(S(n),S(this.link)),this}},{key:"append",value:function(t,e){var n=ye(t,e);return this.link=[].concat(S(this.link),S(n)),this}},{key:"syncPrepend",value:function(t,e){var n=ye(t,e),r=he(this.link,n);return this.link=[].concat(S(n),S(r)),this}},{key:"syncAppend",value:function(t,e){var n=ye(t,e),r=he(this.link,n);return this.link=[].concat(S(r),S(n)),this}},{key:"detach",value:function(t,e){var n=ye(t,e);return this.link=null===n?[]:he(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}(),me=function(t){p(n,t);var e=w(n);function n(t,r){var o;return u(this,n),(o=ue(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)),g(o)}return n}(b(Error));function be(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 fe(o)?le(o.link)?new ve(o):new de(o):o}function Ee(t,e,n){var r,o="function"==typeof n?n(e):n;return fe(o)?o.toSource():(r=o,"[object Date]"===Object.prototype.toString.call(r)?o.toISOString():o)}function ge(t,e,n,r){if(void 0!==e){if(fe(e)&&!fe(n)){var o='Cannot set field "'.concat(t,'", because it needs a scalar value, not a connection.');throw new me(o,r)}if(!fe(e)&&fe(n)){var i='Cannot set field "'.concat(t,'", because it needs a connection, not a scalar value.');throw new me(i,r)}if(fe(e)&&fe(n)){if(le(e.link)&&!le(n.link)){var a='Cannot set field "'.concat(t,'", because it is of type ManyLink, not Link.');throw new me(a,r)}if(!le(e.link)&&le(n.link)){var u='Cannot set field "'.concat(t,'", because it is of type Link, not ManyLink.');throw new me(u,r)}}}}var we=function(){function t(e,n,r,o){u(this,t),this.type=e,this.id=n,this.originalData=r||{},this.data={},this.optimistic=o}return s(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 me(e,[this.type,this.id])}return be(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=se(t),r=be(n,this.data,this.originalData,this.optimistic),o=Ee(0,r,e);ge(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}(),Oe=function(){function t(e){u(this,t),this.obj=e||{}}return s(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 Se=function(){function t(e,n){u(this,t),this.data={entities:new Oe(e.entities.data),roots:e.roots.data},this.optimistic={entities:new Oe(e.entities.optimistic),roots:e.roots.optimistic},this.response={entities:new Oe(n&&n.entities),roots:n&&n.roots||{},trash:[]}}return s(t,[{key:"insert",value:function(t,e,n){!function(t,e,n){if(t)throw new me("Cannot insert entity, because entity already exists.",n);if(e&&"DELETE"===e.type)throw new me("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 we(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 me(r,n)}if(e&&"CREATE"===e.type)throw new me("Cannot perform update on optimistically created entity.",n)}(r,o,[t,e]);var i=new we(t,e,r,o);n(i);var a=this.response.entities.get(t,e),u=a?d(d({},a),i.data):i.data;this.response.entities.set(t,e,u)}},{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 me(r,n)}if(e&&"CREATE"===e.type)throw new me("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=se(t),r=be(n,this.response.roots,this.data.roots,this.optimistic.roots),o=Ee(0,r,e);ge(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}(),Re=function(){function t(){u(this,t)}return s(t,null,[{key:"generate",value:function(){return this.counter+=1,this.counter}}]),t}();f(Re,"counter",1);var Te,ke=function(t){p(n,t);var e=w(n);function n(t,r,o,i){var a;return u(this,n),(a=e.call(this,r)).name="TransporterError",a.type=t,a.data=o,a.code=i,a}return n}(b(Error));function je(t,e){var n=j(),r="TRANSPORTER_MUTATION"===t.type,o=t.id||Re.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 Se(e,o);return t(i,n),i.toSource()}return function(u,c){function s(e,n,r){return u({type:"TRANSPORTER_REQUEST_ERROR",id:o,endTime:j(),optimisticData:r,data:n,error:{type:e.type,message:e.message,data:e.data}}),Te&&Te(e,t),Promise.reject(e)}var f;if(r)try{f=a(t.optimisticUpdater,c())}catch(t){if("StoreError"===t.name){var l=new ke("StoreError","Request failed (StoreError)",{error:t.message});return Te&&Te(l),Promise.reject(l)}throw t}return u({type:"TRANSPORTER_REQUEST_START",id:o,startTime:n,optimisticData:f}),e(i,t.variables).then((function(e){return e.json().then((function(r){if(!e.ok)return s(new ke("HttpError","Request failed (HttpError - ".concat(e.status,")"),r,e.status),null,f);var i,l=c();if(l.info.lastReset>=n){var d=new me("Store reset after request was started.");return s(new ke("StoreError","Request failed (StoreError)",{error:d.message}),null,null)}if(r.errors)return r.errors.forEach((function(t){console.error("GraphQLError: ".concat(t.message))})),s(new ke("GraphQLError","Request failed (GraphQLError)",{errors:r.errors}),r.data,f);if(r.data)try{i=a(t.updater,l,r.data)}catch(d){if("StoreError"===d.name)return s(new ke("StoreError","Request failed (StoreError)",{error:d.message}),r.data,f);throw d}return u({type:"TRANSPORTER_REQUEST_COMPLETED",id:o,endTime:j(),optimisticData:f,data:i}),r.data}),(function(t){return e.ok?s(new ke("JsonError","".concat(t.message," (JsonError)")),null,f):s(new ke("HttpError","Request failed (HttpError - ".concat(e.status,")"),null,e.status),null,f)}))}),(function(t){return s(new ke("NetworkError","".concat(t.message," (NetworkError)")),null,f)}))}}function Pe(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 me("Unknown operator '".concat(e,"'"))}}function _e(t,e,n){var r=n.get(t,e);if(!r)throw new me("Joined entity not found.",[t,e]);var o={__typename:t,id:e};return Object.keys(r).forEach((function(t){fe(r[t])||(o[t]=r[t])})),o}function De(t,e,n,r,o){var i=o.get(t,e);if(!i[n])throw new me('Joined relation "'.concat(n,'" not found.'),[t,e]);if(!fe(i[n]))throw new me('Joined relation "'.concat(n,'" is not a connection.'),[t,e]);return null===i[n].link?null:Ce(i[n].link,r,o)}function Ne(t,e){var n=d({},t);return Object.entries(e).forEach((function(e){var r=O(e,2),o=r[0],i=r[1];n[i]=t[o]})),n}var Ae=function(){function t(e,n){u(this,t),this.link=e,this.isManyLink=le(e),this.data=this.isManyLink?e.map((function(t){return _e.apply(void 0,S(t).concat([n]))})):_e.apply(void 0,S(e).concat([n])),this.entities=n,this.aliases={}}return s(t,[{key:"where",value:function(t,e,n){var r=n||e,o=n?e:"=";return this.isManyLink||Pe(this.data[t],o,r)||(this.data=null),this.isManyLink&&(this.data=this.data.filter((function(e){return Pe(e[t],o,r)}))),this}},{key:"alias",value:function(t){var e=ue(t)?t:t[0];return this.aliases[se(t)]=e,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=se(t),o=ue(t)?t:t[0];if(this.isManyLink)this.link.forEach((function(t,i){var a=De.apply(void 0,S(e.link[i]).concat([r,n,e.entities]));e.data[i][o]=a}));else{var i=De.apply(void 0,S(this.link).concat([r,n,this.entities]));this.data[o]=i}return this}},{key:"getData",value:function(){var t=this;return this.aliases&&this.data?this.isManyLink?this.data.map((function(e){return Ne(e,t.aliases)})):Ne(this.data,this.aliases):this.data}}]),t}();function Ce(t,e,n){if(null===t)return null;var r=new Ae(t,n);return(e?e(r):r).getData()}function xe(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]=r.valueFromASTUntyped(t.value,e)})),[t.name.value,n]}function Me(t,e){return function(n){return t.selections.forEach((function(t){if("Field"===t.kind){var r=xe(t,e.variables);t.selectionSet?n.join(r,Me(t.selectionSet,e)):ue(r)||n.alias(r)}})),n}}var Ue=function(){function t(e){u(this,t),this.roots=e.roots.data,this.entities=new Oe(e.entities.data)}return s(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 me("Option entry is set, but no fragment node found.");return this.selectByEntity.apply(this,S(e.entry).concat([Me(n.selectionSet,e)]))}},{key:"selectByOperationAST",value:function(t,e){var n=t.definitions.find((function(t){return"OperationDefinition"===t.kind}));if(!n)throw new me("No operation node found.");var r=n.selectionSet.selections[0];return this.selectByRoot(xe(r,e.variables),Me(r.selectionSet,e))}},{key:"selectByEntity",value:function(t,e,n){if(!this.entities.get(t,e))throw new me("Selected entity not found.",[t,e]);return Ce([t,e],n,this.entities)}},{key:"selectByRoot",value:function(t,e){var n=se(t);if(!this.roots[n])throw new me("Selected root '".concat(n,"' not found."),"root");return Ce(this.roots[n].link,e,this.entities)}},{key:"selectByRelation",value:function(t,e,n,r){var o=se(n),i=this.entities.get(t,e);if(!i||!i[o])throw new me("Selected relation '".concat(o,"' not found."),[t,e]);return Ce(i[o].link,r,this.entities)}}]),t}();function $e(t){return function(e,n){return t(new Ue(e),n)}}function Le(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(o){return"function"==typeof o?o(n,r,t):e(o)}}}}var Ie=Le();Ie.withExtraArgument=Le;var qe=P(Zt).compose,Be="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?qe:qe.apply(null,arguments)};function Fe(t,e){return{data:e,optimistic:{type:"CREATE",id:t}}}function Qe(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:S(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}}function Ve(t,e){return{optimistic:{type:"DELETE",id:t,data:e}}}function We(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=function(t,e,n,r,o){var i=o.data[e],a=i.originalValue,u=i.values;if(t!==u.length-1||!u[t].active)return r;var c=d({},r);return n&&void 0!==n[e]?c[e]=n[e]:1===u.length?void 0===a?delete c[e]:c[e]=a:c[e]=u[t-1].value,c}(r,e,n,i.data,i.optimistic),i.optimistic=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],u={originalValue:i.data[e].originalValue,values:S(i.data[e].values)};return a&&o[t].active&&(u.originalValue=n[e],u.values=u.values.map((function(e,n){return n<t?d(d({},e),{},{active:!1}):e}))),u.values.splice(t,1),i.data[e]=u,i}(r,e,n,i.optimistic)})),0===Object.keys(i.optimistic.data).length&&(i.optimistic=null),i}function Ge(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 pe(t,n)}))?{data:null}:{data:r.data}}function Je(t,e){var n=Object.keys(t);return e?n.filter((function(t){return void 0===e[t]})):n}function ze(t,e){return e?t.filter((function(t){return e.some((function(e){return pe(t,e)}))})):t}function He(t){var e={};return Object.keys(t).forEach((function(n){e[n]=d({},t[n])})),e}function Xe(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 Oe(He(t.data)),o=new Oe(He(t.optimistic));if(n.optimisticData.entities){var i=new Oe(n.optimisticData.entities);i.forEach((function(t){var e=O(t,3),i=e[0],a=e[1],u=e[2];if(!r.get(a,u)){var c=Fe(n.id,i),s=c.data,f=c.optimistic;r.set(a,u,s),o.set(a,u,f)}else{var l=Qe(n.id,i,r.get(a,u),o.get(a,u)),d=l.data,p=l.optimistic;r.set(a,u,d),o.set(a,u,p)}}))}if(n.optimisticData.trash){var a=n.optimisticData.trash;a.forEach((function(t){var e=O(t,2),i=e[0],a=e[1],u=Ve(n.id,r.get(i,a)).optimistic;r.delete(i,a),o.set(i,a,u)}))}return{data:r.toSource(),optimistic:o.toSource()}}if("TRANSPORTER_REQUEST_COMPLETED"===n.type||"TRANSPORTER_REQUEST_ERROR"===n.type){var u=new Oe(He(t.data)),c=new Oe(He(t.optimistic));if(n.optimisticData&&n.optimisticData.entities){var s=new Oe(n.data&&n.data.entities),f=new Oe(n.optimisticData.entities);f.forEach((function(t){var e=O(t,3),r=e[0],o=e[1],i=e[2];if(c.get(o,i)&&"CREATE"===c.get(o,i).type)u.delete(o,i),c.delete(o,i);else{var a=We(n.id,r,s.get(o,i),u.get(o,i),c.get(o,i)),f=a.data,l=a.optimistic;u.set(o,i,f),l?c.set(o,i,l):c.delete(o,i)}}))}if(n.optimisticData&&n.optimisticData.trash){var l=n.data&&n.data.trash,d=n.optimisticData.trash;d.forEach((function(t){var e=O(t,2),r=e[0],o=e[1],i=Ge(n.id,l,[r,o],c.get(r,o)).data;i&&u.set(r,o,i),c.delete(r,o)}))}if(n.data&&n.data.entities){var p=new Oe(n.data.entities),y=new Oe(n.optimisticData&&n.optimisticData.entities);p.forEach((function(t){var e=O(t,3),n=e[0],r=e[1],o=e[2],i=u.get(r,o);i?(Je(n,y.get(r,o)).forEach((function(t){i[t]=n[t]})),u.set(r,o,i)):u.set(r,o,n)}))}if(n.data&&n.data.trash){var h=n.data.trash,v=n.optimisticData&&n.optimisticData.trash,m=ze(h,v);m.forEach((function(t){var e=O(t,2),n=e[0],r=e[1];u.delete(n,r)}))}return{data:u.toSource(),optimistic:c.toSource()}}return t}}function Ye(){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 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 Ke(){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}}function Ze(t,e){var n=Be(Kt((function(){return function(t){return function(n){return["TRANSPORTER_QUERY","TRANSPORTER_MUTATION"].includes(n.type)?t(je(n,e.fetch)):t(n)}}}),Ie));return zt(function(t,e){return Ht({roots:(n=t,r={data:n,optimistic:null},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,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}:r;if("TRANSPORTER_REQUEST_START"===e.type&&e.optimisticData&&e.optimisticData.roots)return Qe(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?We(e.id,e.optimisticData.roots,e.data&&e.data.roots,t.data,t.optimistic):{data:d({},t.data),optimistic:t.optimistic};if(e.data&&e.data.roots)Je(e.data.roots,e.optimisticData&&e.optimisticData.roots).forEach((function(t){n.data[t]=e.data.roots[t]}));return n}return t}),entities:Xe(e),requests:Ye(),info:Ke()});var n,r}(t&&t.roots?t.roots:{},t&&t.entities?t.entities:{}),{},n)}var tn=function(){function t(e){u(this,t),this.config=e,this.store=null}return s(t,[{key:"buildStore",value:function(){if(this.store)throw new Error("Store was built before.");return this.store=Ze(this.config.initialData,this.config.network),this.store}},{key:"getStore",value:function(){return this.store}},{key:"getConfig",value:function(){return this.config}}]),t}();t.Link=de,t.ManyLink=ve,t.Provider=function(t){var n=t.children,r=t.client;if(!r)throw new Error("You must provide a transporter client.");var o=e.useMemo((function(){return r.buildStore()}),[]);return i.default.createElement(ut,{store:o,context:Ut},n)},t.TransporterClient=tn,t.TransporterNetwork=function t(e){var n=this;u(this,t),f(this,"fetch",(function(t,e){return n.request(t,e)})),this.request=e},t.createAsyncContainer=function(t,n,r){var o={middleware:r&&r.middleware||null,async:ae(r)};function i(r){var i=function(t){var e=n(t);return d(d({},e),{},{loaders:e.loaders||{}})}(r),a=O(re(t,i),2),u=a[0],c=a[1],s=oe(u.status,i.selectors),f=d(d(d({},c),s),r);return"LOADING"===u.status?e.createElement(o.async.loading,f):"ERROR"===u.status?e.createElement(o.async.error,f):e.createElement(u.component,f)}var a=t.displayName||t.name||"Component";return i.displayName="Load(".concat(a,")"),o.middleware?Yt.apply(void 0,S(o.middleware))(i):i},t.createContainer=function(t,n,r){var o={middleware:r&&r.middleware||null};function i(r){var o=d(d({},oe("RESOLVED",n(r).selectors)),r);return e.createElement(t,o)}return o.middleware?Yt.apply(void 0,S(o.middleware))(i):i},t.createMutation=function(t,e){return d({type:"TRANSPORTER_MUTATION",mutation:t},e)},t.createQuery=k,t.onError=function(t){Te=t},t.query=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.loaderOptions,r=E(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(k(t,r)))},getProps: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),u=0;u<e;u++)a[u]=arguments[u];return o(n(k(t,d(d({},r),a))))},fetchMore:function(){i.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return o(n(k(t,d(d({},r),a)),{showWhileLoading:!0}))},startPolling:function(e){var a=setInterval((function(){o(n(k(t,r),{showWhileLoading:!0}))}),e);i.set("timeout",a)},endPolling:function(){clearInterval(i.get("timeout")),i.set("timeout",null)}}},shouldReload:function(t,e){var n=t.info,o=t.cache,i=o.get("variables");o.set("variables",r.variables);var a=JSON.stringify(i)===JSON.stringify(r.variables);return n.startTime<e.info.lastReset||!a}}},t.resetStore=function(t){return{type:"TRANSPORTER_STORE_RESET",data:t,lastReset:j()}},t.select=function(t,e){return $e((function(n){return n.select(t,e||{})}))},t.selectAdvanced=$e,t.selectByEntity=function(t,e,n){return $e((function(r){return r.selectByEntity(t,e,n)}))},t.selectByRelation=function(t,e,n,r){return $e((function(o){return o.selectByRelation(t,e,n,r)}))},t.selectByRoot=function(t,e){return $e((function(n){return n.selectByRoot(t,e)}))},t.useDispatch=$t,t.useSelector=Lt,t.useStore=It,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-native"),require("graphql/utilities/valueFromASTUntyped")):"function"==typeof define&&define.amd?define(["exports","react","react-native","graphql/utilities/valueFromASTUntyped"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["react-transporter"]={},t.React,t.reactNative,t.valueFromASTUntyped)}(this,(function(t,e,r,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=i(e);function u(t){return(u="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 r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function c(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),t}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,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&&p(t,e)}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function m(t,e,r){return(m=y()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&p(i,r.prototype),i}).apply(null,arguments)}function g(t){var e="function"==typeof Map?new Map:void 0;return(g=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;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,n)}function n(){return m(t,arguments,v(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,t)})(t)}function b(t,e){if(null==t)return{};var r,n,i=function(t,e){if(null==t)return{};var r,n,i={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function w(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function E(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?w(t):e}function q(t){var e=y();return function(){var r,n=v(t);if(e){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return E(this,r)}}function O(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 r=[],n=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||j(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 S(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)||j(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 j(t,e){if(t){if("string"==typeof t)return k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var R=o.default.createContext(),_="undefined"==typeof window,P=!r.Platform||"web"===r.Platform.OS,A="pending",x="fulfilled",F="rejected",C="__typename",T="id",U="__ref",M=function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,t),f(this,"promise",void 0),f(this,"status",A),f(this,"response",void 0),f(this,"read",(function(){switch(r.status){case A:throw r.promise;case F:throw r.response;default:return r.response}}));var i=n.proxy,o=void 0!==i&&i;o?this.promise=new Promise((function(t,e){e(new Error("Proxied resource."))})):(this.promise=e(),this.promise.then((function(t){r.status=x,r.response=t}),(function(t){r.status=F,r.response=t})))};function Q(t){var r=t.component,n=t.options,i=t.values,o=n.container||function(){return null},u=e.useRef(!1),a=e.useContext(R),s=a.client,c=a.node;try{var f=O(M.all([function(){return o(c,i)},function(){return r()}]),2),l=f[0],h=f[1];return e.createElement(h,l)}catch(t){if(!_)throw t;if(t instanceof Promise){if(!s.ssr)return n.loading&&e.createElement(n.loading);throw u.current||(u.current=!0),t}return s.ssr&&u.current?n.loading&&e.createElement(n.loading):n.error&&e.createElement(n.error,{error:t})}}M.all=function(t){var e=[],r=t.map((function(t){try{return t()}catch(t){if(t instanceof Promise)return e.push(t);throw t}}));if(e.length>0)throw Promise.all(e);return r};var N=function t(e){var r=this;a(this,t),f(this,"status",x),f(this,"response",void 0),f(this,"read",(function(){return r.response})),this.response=e},B=function(t,e){return e.renderer?e.renderer(t):t},D=function(t){return t.__esModule?t.default:t.default||t};function I(t,e){if(t.payload&&t.payload._result){var r=t.payload._result;return"function"==typeof r?new M((function(){return r()})):_||!P?new M((function(){return t.load().then((function(){return t}))})):function(t){var e=t.resolve();return"undefined"!=typeof __webpack_modules__&&!!__webpack_modules__[e]}(r)?new N(D(r.requireSync())):new M((function(){return r.requireAsync().then((function(t){return D(t)}))}))}return t.bundle?new M((function(){return t.bundle().then((function(t){return B(D(t),e)}))})):new N(B(t,e))}var J=void 0,H=function(t,e){return e.filter((function(e){return e.__ref?!t.some((function(t){var r=O(t,2),n=r[0],i=r[1];return n===e[0]&&i===e[1]})):J.items.includes(e)}))},G=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a(this,t),f(this,"items",void 0),this.items=e}return c(t,[{key:"prepend",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.items=[].concat(e,S(this.items)),this}},{key:"append",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.items=[].concat(S(this.items),e),this}},{key:"syncPrepend",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=H(this.items,e);return this.items=[].concat(e,S(n)),this}},{key:"syncAppend",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=H(this.items,e);return this.items=[].concat(S(n),e),this}},{key:"detach",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.items=H(this.items,e),this}},{key:"toArray",value:function(){return this.items}}]),t}();var L=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};return Object.keys(e).some((function(e){return void 0!==t[e]&&r(e)}))},V=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){return t};if(!r)return h(h({},t),e);var n=h({},t);return Object.values(e).forEach((function(e){var i=O(e,2),o=i[0],u=i[1];n[o]=void 0===t[o]?u:r(o)})),n},W=function t(e,r){if(!r)return e;if(Array.isArray(e))return e.map((function(e,n){return t(e,r[n])}));if("object"!==("undefined"==typeof value?"undefined":u(value))||e.__ref)return r;var n={};return Object.keys(e).forEach((function(i){n[i]=t(e[i],r[i])})),n},Y=function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,t),f(this,"roots",void 0),f(this,"entities",void 0),f(this,"get",(function(t,r){var n,i,o=null===(n=e.entities[t])||void 0===n?void 0:n[r];return o?h((f(i={},C,t),f(i,T,r),i),o):null})),f(this,"getRoots",(function(){return e.roots})),f(this,"intersectWith",(function(t){var r=t.roots,n=t.entities;return L(e.roots,r),L(e.entities,n,(function(t){return L(e.entities[t],n[t],(function(r){return L(e.entities[t][r],n[t][r])}))}))})),f(this,"add",(function(t){var r=t.roots,n=t.entities;e.roots=V(e.roots,r),e.entities=V(e.entities,n,(function(t){return V(e.entities[t],n[t],(function(r){var i=e.entities[t][r],o=n[t][r],u=h({},i);return Object.keys(o).forEach((function(t){u[t]=W(i[t],o[t])})),u}))}))})),f(this,"merge",(function(r){var n=new t({roots:e.roots,entities:e.entities});return n.add(r),n})),f(this,"extract",(function(){return{roots:e.roots,entities:e.entities}}));var n=r.roots,i=void 0===n?{}:n,o=r.entities,u=void 0===o?{}:o;this.roots=i,this.entities=u},$=function(t,e){var r=O(e,2),n=r[0],i=r[1];return"".concat(t,".").concat(n,".").concat(i)},z=function t(){var e=this;a(this,t),f(this,"query",null),f(this,"fragments",{}),f(this,"getQuery",(function(){return e.query})),f(this,"setQuery",(function(t){e.query=t})),f(this,"getFragment",(function(t,r){var n=$(t,r);return e.fragments[n]})),f(this,"setFragment",(function(t,r,n){var i=$(t,r);e.fragments[i]=n})),f(this,"update",(function(t){var r=!1;return e.query&&e.query!==t.query&&(e.query=t.query,r=!0),Object.keys(e.fragments).forEach((function(n){e.fragments[n]!==t.fragments[n]&&(e.fragments[n]=t.fragments[n],r=!0)})),r}))},K=function(t){return null===t?null:"object"===u(t)?X(t):JSON.stringify(t)},X=function(t){var e=Object.keys(t);e.sort();var r=e.map((function(e){var r=K(t[e]);return null===r?r:'"'.concat(e,'":').concat(r)})).filter((function(t){return null!==t}));return 0===r.length?null:"{".concat(r.join(","),"}")};function Z(t,e){var r=X(e);return"".concat(t).concat(r?"(".concat(r,")"):"")}var tt=function(t){d(r,t);var e=q(r);function r(){var t;return a(this,r),(t=e.call(this,"Undefined value.")).name="ValueError",t}return r}(g(Error)),et=function t(e,r,i){var o=i.cache,u=i.handleFragment,a=o.request,s=a.ast,c=a.options,f={};return e.selections.forEach((function(e){if("Field"===e.kind){var o=function(t,e){var r=t.name.value;if(0===t.arguments.length)return r;var i={};return t.arguments.forEach((function(t){i[t.name.value]=n.valueFromASTUntyped(t.value,e)})),Z(r,i)}(e,c.variables);f[e.name.value]=rt(e.selectionSet,r[o],i)}if("InlineFragment"===e.kind&&console.log("TODO: inline fragment",e),"FragmentSpread"===e.kind){var a=s.definitions.find((function(t){return"FragmentDefinition"===t.kind&&t.name.value===e.name.value}));try{var l=t(a.selectionSet,r,i);Object.assign(f,u(a.name.value,r[C],r.id,l))}catch(t){if("ValueError"!==t.name)throw t;if(a.typeCondition.name.value===r[C])throw new Error('Fragment "'.concat(a.name.value,'" has an undefined value and has been skipped.'))}}})),f},rt=function(t,e,r){return void 0===t?e:Array.isArray(e)?e.map((function(e){return nt(t,e,r)})):nt(t,e,r)},nt=function(t,e,r){if(void 0===e)throw new tt;if(null===e)return null;var n=e.__ref;if(!n)return et(t,e,r);var i=r.cache,o=r.handleEntity,u=O(n,2),a=u[0],s=u[1],c=i.data.get(a,s);return o(a,s,et(t,c,r))};function it(t,e,r){var n=t.request.ast.definitions.find((function(t){return"OperationDefinition"===t.kind})),i=t.data.getRoots(),o={cache:t,handleFragment:e,handleEntity:r};try{return et(n.selectionSet,i,o)}catch(t){throw"ValueError"!==t.name?t:new Error('Query "'.concat(n.name.value,'" has an undefined value and has been skipped.'))}}var ot=function(t,e){return JSON.stringify(t)===JSON.stringify(e)};function ut(t){var e,r=new z,n=it(t,(function(e,n,i,o){var u,a=[n,i],s=null===(u=t.selectorSet)||void 0===u?void 0:u.getFragment(e,a);return r.setFragment(e,a,ot(o,s)?s:o),{}}),(function(t,e,r){var n;return h((f(n={},C,t),f(n,T,e),n),r)})),i=null===(e=t.selectorSet)||void 0===e?void 0:e.getQuery();return r.setQuery(ot(n,i)?i:n),r}var at=function t(e,r){var n=this;a(this,t),f(this,"request",void 0),f(this,"original",void 0),f(this,"updates",[]),f(this,"dirty",!1),f(this,"data",void 0),f(this,"selectorSet",void 0),f(this,"addUpdate",(function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n.data.intersectWith(t)){n.dirty=!0;var r={optimistic:e,data:t,cache:n.data.merge(t)};n.data=t,n.updates=[].concat(S(n.updates),[r])}})),f(this,"removeUpdate",(function(t){var e=!1,r=[];n.updates.forEach((function(i){if(i.data===t)n.dirty=!0,e=!0;else if(e){var o=r.length,u=o>0?r[o-1].cache:n.original;r.push(h(h({},i),{},{cache:u.merge(t)}))}else r.push(i)})),n.updates=r})),f(this,"commit",(function(){var t,e,r;n.dirty&&(n.selectorSet=ut(n),n.updates.some((function(t){return t.optimistic}))||(n.original=(t=n,e=new Y,r=it(t,(function(t,e,r,n){return n}),(function(t,r,n){return e.add({entities:f({},C,f({},T,n))}),f({},U,[t,r])})),e.add({roots:r}),e),n.updates=[]),n.dirty=!1)})),this.request=e,this.original=r,this.data=r,this.selectorSet=ut(this)},st=function(t){d(r,t);var e=q(r);function r(t,n){var i,o=n.type,u=b(n,["type"]);return a(this,r),(i=e.call(this,t,u)).name="TransporterError",i.type=o,i}return r}(g(Error));function ct(t,e,r){return new Promise((function(n,i){var o;t(e.loc.source.body,r).then((function(t){return(o=t).json()})).then((function(t){if(!o.ok)throw new st("Request failed (HttpError - ".concat(o.status,")"),{type:"HttpError",cause:t});t.errors&&(t.errors.forEach((function(t){console.error("GraphQLError: ".concat(t.message))})),i(new st("Request failed (GraphQLError)",{type:"GraphQLError",cause:t.errors}))),n(t)})).catch((function(t){o&&o.ok?i(new st("".concat(t.message," (JsonError)"),{type:"JsonError",cause:t})):i(new st("Request failed (HttpError - ".concat(o?o.status:"Unknown",")"),{type:"HttpError",cause:t}))}))}))}var ft=function t(){var e=this;a(this,t),f(this,"promise",void 0),f(this,"read",(function(){throw e.promise})),this.promise=new Promise((function(){}))},lt=function t(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a(this,t),f(this,"store",void 0),f(this,"ast",void 0),f(this,"options",void 0),f(this,"resource",void 0),f(this,"selectors",[]),f(this,"loading",!1),f(this,"aborted",!1),f(this,"cache",void 0),f(this,"read",(function(){n.resource.read()})),f(this,"isEqual",(function(t,e){return n.ast===t&&JSON.stringify(n.options.variables)===JSON.stringify(e)})),f(this,"sync",(function(){n.loading||n.aborted||n.cache.commit()})),f(this,"invalidate",(function(){n.aborted=!0,n.store.queries.delete(n.options.name)})),this.store=e,this.ast=r,this.options=i;var o=function(t){if(!n.aborted){var r=new Y(t.data),i=new Y({entities:r.entities});e.queries.forEach((function(t){t.addUpdate(i)})),n.cache=new at(n,r),e.queries.set(n.options.name,n.cache),e.refresh()}},u=e.cache,s=u[this.options.name];s?(this.resource=new N(s),o({data:s}),delete u[this.options.name]):(this.resource=!_||e.ssr?new M((function(){return ct(e.request,r,i.variables)})):new ft,this.loading=!0,this.resource.promise.then((function(t){n.loading=!1,_&&(u[n.options.name]=t),o(t)}),(function(){n.loading=!1,n.aborted=!0})))},ht=function(t){return t instanceof G?t.toArray():(e=t,"[object Date]"===Object.prototype.toString.call(e)?t.toISOString():t);var e},dt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,t),f(this,"original",void 0),f(this,"values",{}),this.original=e}return c(t,[{key:"set",value:function(t,e){var r,n=Array.isArray(t)?Z.apply(void 0,S(t)):t;"function"==typeof e?("function"==typeof this.original&&(this.original=this.original()||{}),r=e(Array.isArray(this.original[n])?new G(this.original[n]):this.original[n])):r=e;this.values[n]=ht(r)}},{key:"fill",value:function(t){var e=this;Object.keys(t).forEach((function(r){e.set(r,t[r])}))}}]),t}();function vt(t,e,r){if(!e)return r;var n=r;return e({insert:function(t,e,r){var i=new dt;r(i),n.add({entities:f({},t,f({},e,i.values))})},update:function(e,r,i){var o=new dt((function(){return h(h({},function(t,e,r){var n=null;return t.queries.forEach((function(t){var i=t.data.get(e,r);if(i){if(t.updates.some((function(t){return t.optimistic&&t.data.get(e,r)})))throw new Error("Cannot perform update on optimistically updated entity. [".concat(e,".").concat(r,"]"));n=h(h({},n),i)}})),n}(t,e,r)),n.get(e,r))}));i(o),n.add({entities:f({},e,f({},r,o.values))})},updateRoots:function(e){var r=new dt((function(){return function(t){var e=null;return t.queries.forEach((function(t){var r=t.data.getRoots();e=h(h({},e),r)})),e}(t)}));e(r),n.add({roots:r.values})}}),n}var pt=function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a(this,t),f(this,"mutation",void 0),f(this,"options",void 0),f(this,"resource",void 0),this.mutation=r,this.options=n;var i=vt(e,n.optimisticUpdater,new Y);e.queries.forEach((function(t){t.addUpdate(i,!0)})),e.refresh(),this.resource=new M((function(){return ct(e.request,r,n.variables)})),this.resource.promise.then((function(t){var r=vt(e,n.updater,new Y({entities:t.entities}));i&&e.queries.forEach((function(t){t.removeUpdate(i)})),e.queries.forEach((function(t){t.addUpdate(r)})),e.refresh()}),(function(t){t.message&&console.error("Mutation Error: ".concat(t.message)),i&&(e.queries.forEach((function(t){t.removeUpdate(i)})),e.refresh())}))},yt=function t(e,r){var n=this;a(this,t),f(this,"parent",void 0),f(this,"executeQuery",void 0),f(this,"children",[]),f(this,"requests",void 0),f(this,"selectorSetsByRequest",void 0),f(this,"listeners",[]),f(this,"preload",(function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.name||(null===(e=t.definitions.find((function(t){return"OperationDefinition"===t.kind})))||void 0===e?void 0:e.name.value);if(!i)throw new Error("No query name found.");var o=n.requests.get(i);return o&&!o.isEqual(t,r.variables)&&(n.requests.delete(i),n.selectorSetsByRequest.delete(i),o.invalidate(),o=null),o||(o=n.executeQuery(t,h(h({},r),{},{name:i})),n.requests.set(i,o)),i})),f(this,"load",(function(t,e){var r=n.preload(t,e);return n.select(r)})),f(this,"getRequest",(function(t){var e=n.requests.get(t);if(!e){if(!n.parent)throw new Error('Query "'.concat(t,'" was not found.'));e=n.parent.getRequest(t)}return e})),f(this,"select",(function(t){var e=n.getRequest(t);e.read();var r=e.cache.selectorSet.getQuery();return n.selectorSetsByRequest.has(e)||n.selectorSetsByRequest.set(e,new z),n.selectorSetsByRequest.get(e).setQuery(r),r})),f(this,"getFragmentRequest",(function(t,e){var r=Array.from(n.requests.values()).find((function(r){var n=r.cache;return null==n?void 0:n.selectorSet.getFragment(t,e)}));if(!r){if(!n.parent){var i=JSON.stringify(e);throw new Error('Fragment "'.concat(t,'" (entry: [').concat(i,"]) was not found."))}r=n.parent.getFragmentRequest(t,e)}return r})),f(this,"selectFragment",(function(t,e){var r=n.getFragmentRequest(t,e);r.read();var i=r.cache.selectorSet.getFragment(t,e);return n.selectorSetsByRequest.has(r)||n.selectorSetsByRequest.set(r,new z),n.selectorSetsByRequest.get(r).setFragment(t,e,i),i})),f(this,"addChild",(function(t){n.children=[].concat(S(n.children),[t])})),f(this,"removeChild",(function(t){n.children=n.children.filter((function(e){return e!==t}))})),f(this,"subscribe",(function(t){return n.listeners=[].concat(S(n.listeners),[t]),function(){n.listeners=n.listeners.filter((function(e){return e!==t}))}})),f(this,"refresh",(function(){n.requests.forEach((function(t){t.sync()}));var t=!1;n.selectorSetsByRequest.forEach((function(e,r){e.update(r.cache.selectorSet)&&(t=!0)})),t?n.listeners.forEach((function(t){t()})):n.children.forEach((function(t){t.refresh()}))})),f(this,"reset",(function(){n.requests=new Map,n.children.forEach((function(t){t.reset()}))})),f(this,"destroy",(function(){n.parent.removeChild(n),n.requests.forEach((function(t){t.invalidate()}))})),this.parent=e,this.executeQuery=r,this.requests=new Map,this.selectorSetsByRequest=new Map,e&&e.addChild(this)};var mt="pending",gt="fulfilled";t.ReferenceMap=G,t.Resource=M,t.Transporter=function t(e){var r=this,n=e.request,i=e.cache,o=void 0===i?{}:i,u=e.ssr,s=void 0!==u&&u;a(this,t),f(this,"request",void 0),f(this,"root",void 0),f(this,"cache",void 0),f(this,"ssr",void 0),f(this,"queries",void 0),f(this,"query",(function(t,e){return new lt(r,t,e)})),f(this,"createNode",(function(t){return new yt(t,r.query)})),f(this,"mutate",(function(t,e){return new pt(r,t,e)})),f(this,"refresh",(function(){r.root.refresh()})),f(this,"reset",(function(){r.root.reset(),r.queries=new Map,r.root.refresh()})),f(this,"extract",(function(){var t={};return r.queries.forEach((function(e,r){t[r]=e.data.extract()})),t})),this.request=n,this.root=this.createNode(null),this.cache=o,this.ssr=s,this.queries=new Map},t.TransporterProvider=function(t){var r=t.children,n=t.client;if(!n)throw new Error("TransporterProvider: You must provide a Transporter instance.");var i=n.root;return e.useSyncExternalStore(i.subscribe,(function(){}),(function(){})),o.default.createElement(R.Provider,{value:{client:n,node:i}},r)},t.createContainer=function(t,r){var n,i=function(){return n||(n=I(t,r)),n.read()},u=function(t){d(u,t);var n=q(u);function u(t){var e;return a(this,u),f(w(e=n.call(this,t)),"node",void 0),e.state={error:null},e}return c(u,[{key:"componentDidCatch",value:function(t,e){console.error(t,e)}},{key:"componentWillUnmount",value:function(){this.node.destroy()}},{key:"renderContainer",value:function(){var t=this.context.client,n=this.state.error;if(n)return r.error&&e.createElement(r.error,{error:n});var u=o.default.createElement(Q,{component:i,options:r,values:this.props});return _&&!t.ssr?u:o.default.createElement(o.default.Suspense,{fallback:r.loading&&e.createElement(r.loading)},u)}},{key:"render",value:function(){var t=this.context,e=t.client,r=t.node;return this.node||(this.node=e.createNode(r)),o.default.createElement(R.Provider,{value:{client:e,node:this.node}},this.renderContainer())}}],[{key:"getDerivedStateFromError",value:function(t){return{error:t}}}]),u}(o.default.Component);u.contextType=R;var s=t.displayName||t.name;return u.displayName=s?"Container(".concat(s,")"):"Container",u},t.ref=function(t,e){return f({},U,[t,e])},t.useMutation=function(t,r){var n,i=e.useContext(R);if(!i)throw new Error('"useMutation" hook is used outside of TransporterContext.');return[function(e){if(n)throw new Error("Mutation was dispatched before.");return n=i.store.mutate(t,h(h({},r),e))},{get ok(){return n&&n.status!==mt?n.status===gt:null},get loading(){return!!n&&n.status===mt},get executed(){return!!n&&(n.status===gt||"rejected"===n.status)}}]},t.useReset=function(){var t=e.useContext(R);if(!t)throw new Error('"useReset" hook is used outside of TransporterContext.');var r=t.store;return function(){r.reset()}},Object.defineProperty(t,"__esModule",{value:!0})}));

23

package.json
{
"name": "react-transporter",
"version": "0.6.6",
"description": "React.js Redux GraphQL client",
"version": "1.0.0-alpha.0",
"description": "React.js GraphQL client",
"author": "Markus Wetzel <markuswetzel@gmx.net>",

@@ -9,3 +9,2 @@ "license": "MIT",

"react",
"redux",
"graphql",

@@ -23,2 +22,3 @@ "api"

"dev": "packsy dev",
"test": "jest",
"prepublishOnly": "packsy validate && packsy build"

@@ -29,18 +29,13 @@ },

],
"dependencies": {
"prop-types": "^15.7.2",
"react-redux": "^7.2.5",
"redux": "^4.1.1",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.3.0",
"serialize-javascript": "^6.0.0"
},
"devDependencies": {
"graphql": "15.5.3",
"eslint-plugin-jest": "27.2.0",
"graphql": "16.6.0",
"graphql-tag": "2.12.6",
"jest": "29.3.1",
"packsy": "0.2.2",
"react": "16.13.1"
"react": "18.2.0"
},
"peerDependencies": {
"graphql": ">=14",
"react": ">=16"
"react": ">=18"
},

@@ -47,0 +42,0 @@ "husky": {

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

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