Comparing version 3.4.0 to 3.5.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FakeRest=e():t.FakeRest=e()}(this,(function(){return function(){var t={8552:function(t,e,r){var n=r(852)(r(5639),"DataView");t.exports=n},1989:function(t,e,r){var n=r(1789),o=r(401),i=r(7667),u=r(1327),a=r(1866);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},8407:function(t,e,r){var n=r(7040),o=r(4125),i=r(2117),u=r(7518),a=r(4705);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},7071:function(t,e,r){var n=r(852)(r(5639),"Map");t.exports=n},3369:function(t,e,r){var n=r(4785),o=r(1285),i=r(6e3),u=r(9916),a=r(5265);function c(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,t.exports=c},3818:function(t,e,r){var n=r(852)(r(5639),"Promise");t.exports=n},8525:function(t,e,r){var n=r(852)(r(5639),"Set");t.exports=n},8668:function(t,e,r){var n=r(3369),o=r(619),i=r(2385);function u(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}u.prototype.add=u.prototype.push=o,u.prototype.has=i,t.exports=u},6384:function(t,e,r){var n=r(8407),o=r(7465),i=r(3779),u=r(7599),a=r(4758),c=r(4309);function s(t){var e=this.__data__=new n(t);this.size=e.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=u,s.prototype.has=a,s.prototype.set=c,t.exports=s},2705:function(t,e,r){var n=r(5639).Symbol;t.exports=n},1149:function(t,e,r){var n=r(5639).Uint8Array;t.exports=n},577:function(t,e,r){var n=r(852)(r(5639),"WeakMap");t.exports=n},7412:function(t){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}},4963:function(t){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var u=t[r];e(u,r,t)&&(i[o++]=u)}return i}},4636:function(t,e,r){var n=r(2545),o=r(5694),i=r(1469),u=r(4144),a=r(5776),c=r(6719),s=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=i(t),f=!r&&o(t),l=!r&&!f&&u(t),p=!r&&!f&&!l&&c(t),h=r||f||l||p,d=h?n(t.length,String):[],y=d.length;for(var v in t)!e&&!s.call(t,v)||h&&("length"==v||l&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,y))||d.push(v);return d}},9932:function(t){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},2488:function(t){t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},2908:function(t){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}},4865:function(t,e,r){var n=r(9465),o=r(7813),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var u=t[e];i.call(t,e)&&o(u,r)&&(void 0!==r||e in t)||n(t,e,r)}},8470:function(t,e,r){var n=r(7813);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},4037:function(t,e,r){var n=r(8363),o=r(3674);t.exports=function(t,e){return t&&n(e,o(e),t)}},3886:function(t,e,r){var n=r(8363),o=r(1704);t.exports=function(t,e){return t&&n(e,o(e),t)}},9465:function(t,e,r){var n=r(8777);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},5990:function(t,e,r){var n=r(6384),o=r(7412),i=r(4865),u=r(4037),a=r(3886),c=r(4626),s=r(278),f=r(8805),l=r(1911),p=r(8234),h=r(6904),d=r(4160),y=r(3824),v=r(9148),b=r(8517),g=r(1469),m=r(4144),j=r(6688),x=r(3218),O=r(2928),w=r(3674),_=r(1704),A="[object Arguments]",S="[object Function]",E="[object Object]",k={};k[A]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[E]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[S]=k["[object WeakMap]"]=!1,t.exports=function t(e,r,C,T,P,I){var U,q=1&r,R=2&r,N=4&r;if(C&&(U=P?C(e,T,P,I):C(e)),void 0!==U)return U;if(!x(e))return e;var z=g(e);if(z){if(U=y(e),!q)return s(e,U)}else{var F=d(e),M=F==S||"[object GeneratorFunction]"==F;if(m(e))return c(e,q);if(F==E||F==A||M&&!P){if(U=R||M?{}:b(e),!q)return R?l(e,a(U,e)):f(e,u(U,e))}else{if(!k[F])return P?e:{};U=v(e,F,q)}}I||(I=new n);var B=I.get(e);if(B)return B;I.set(e,U),O(e)?e.forEach((function(n){U.add(t(n,r,C,n,e,I))})):j(e)&&e.forEach((function(n,o){U.set(o,t(n,r,C,o,e,I))}));var $=z?void 0:(N?R?h:p:R?_:w)(e);return o($||e,(function(n,o){$&&(n=e[o=n]),i(U,o,t(n,r,C,o,e,I))})),U}},3118:function(t,e,r){var n=r(3218),o=Object.create,i=function(){function t(){}return function(e){if(!n(e))return{};if(o)return o(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=i},7786:function(t,e,r){var n=r(1811),o=r(327);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},8866:function(t,e,r){var n=r(2488),o=r(1469);t.exports=function(t,e,r){var i=e(t);return o(t)?i:n(i,r(t))}},4239:function(t,e,r){var n=r(2705),o=r(9607),i=r(2333),u=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},9454:function(t,e,r){var n=r(4239),o=r(7005);t.exports=function(t){return o(t)&&"[object Arguments]"==n(t)}},939:function(t,e,r){var n=r(2492),o=r(7005);t.exports=function t(e,r,i,u,a){return e===r||(null==e||null==r||!o(e)&&!o(r)?e!=e&&r!=r:n(e,r,i,u,t,a))}},2492:function(t,e,r){var n=r(6384),o=r(7114),i=r(8351),u=r(6096),a=r(4160),c=r(1469),s=r(4144),f=r(6719),l="[object Arguments]",p="[object Array]",h="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,y,v,b){var g=c(t),m=c(e),j=g?p:a(t),x=m?p:a(e),O=(j=j==l?h:j)==h,w=(x=x==l?h:x)==h,_=j==x;if(_&&s(t)){if(!s(e))return!1;g=!0,O=!1}if(_&&!O)return b||(b=new n),g||f(t)?o(t,e,r,y,v,b):i(t,e,j,r,y,v,b);if(!(1&r)){var A=O&&d.call(t,"__wrapped__"),S=w&&d.call(e,"__wrapped__");if(A||S){var E=A?t.value():t,k=S?e.value():e;return b||(b=new n),v(E,k,r,y,b)}}return!!_&&(b||(b=new n),u(t,e,r,y,v,b))}},5588:function(t,e,r){var n=r(4160),o=r(7005);t.exports=function(t){return o(t)&&"[object Map]"==n(t)}},2958:function(t,e,r){var n=r(6384),o=r(939);t.exports=function(t,e,r,i){var u=r.length,a=u,c=!i;if(null==t)return!a;for(t=Object(t);u--;){var s=r[u];if(c&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++u<a;){var f=(s=r[u])[0],l=t[f],p=s[1];if(c&&s[2]){if(void 0===l&&!(f in t))return!1}else{var h=new n;if(i)var d=i(l,p,f,t,e,h);if(!(void 0===d?o(p,l,3,i,h):d))return!1}}return!0}},8458:function(t,e,r){var n=r(3560),o=r(5346),i=r(3218),u=r(346),a=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,f=c.toString,l=s.hasOwnProperty,p=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?p:a).test(u(t))}},9221:function(t,e,r){var n=r(4160),o=r(7005);t.exports=function(t){return o(t)&&"[object Set]"==n(t)}},8749:function(t,e,r){var n=r(4239),o=r(1780),i=r(7005),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!u[n(t)]}},280:function(t,e,r){var n=r(5726),o=r(6916),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=[];for(var r in Object(t))i.call(t,r)&&"constructor"!=r&&e.push(r);return e}},313:function(t,e,r){var n=r(3218),o=r(5726),i=r(3498),u=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return i(t);var e=o(t),r=[];for(var a in t)("constructor"!=a||!e&&u.call(t,a))&&r.push(a);return r}},1573:function(t,e,r){var n=r(2958),o=r(1499),i=r(2634);t.exports=function(t){var e=o(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(r){return r===t||n(r,t,e)}}},2545:function(t){t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},531:function(t,e,r){var n=r(2705),o=r(9932),i=r(1469),u=r(3448),a=n?n.prototype:void 0,c=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(u(e))return c?c.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r}},1717:function(t){t.exports=function(t){return function(e){return t(e)}}},4757:function(t){t.exports=function(t,e){return t.has(e)}},1811:function(t,e,r){var n=r(1469),o=r(5403),i=r(5514),u=r(9833);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(u(t))}},4318:function(t,e,r){var n=r(1149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},4626:function(t,e,r){t=r.nmd(t);var n=r(5639),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,u=i&&i.exports===o?n.Buffer:void 0,a=u?u.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=a?a(r):new t.constructor(r);return t.copy(n),n}},7157:function(t,e,r){var n=r(4318);t.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}},3147:function(t){var e=/\w*$/;t.exports=function(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}},419:function(t,e,r){var n=r(2705),o=n?n.prototype:void 0,i=o?o.valueOf:void 0;t.exports=function(t){return i?Object(i.call(t)):{}}},7133:function(t,e,r){var n=r(4318);t.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},278:function(t){t.exports=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}},8363:function(t,e,r){var n=r(4865),o=r(9465);t.exports=function(t,e,r,i){var u=!r;r||(r={});for(var a=-1,c=e.length;++a<c;){var s=e[a],f=i?i(r[s],t[s],s,r,t):void 0;void 0===f&&(f=t[s]),u?o(r,s,f):n(r,s,f)}return r}},8805:function(t,e,r){var n=r(8363),o=r(9551);t.exports=function(t,e){return n(t,o(t),e)}},1911:function(t,e,r){var n=r(8363),o=r(1442);t.exports=function(t,e){return n(t,o(t),e)}},4429:function(t,e,r){var n=r(5639)["__core-js_shared__"];t.exports=n},8777:function(t,e,r){var n=r(852),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},7114:function(t,e,r){var n=r(8668),o=r(2908),i=r(4757);t.exports=function(t,e,r,u,a,c){var s=1&r,f=t.length,l=e.length;if(f!=l&&!(s&&l>f))return!1;var p=c.get(t),h=c.get(e);if(p&&h)return p==e&&h==t;var d=-1,y=!0,v=2&r?new n:void 0;for(c.set(t,e),c.set(e,t);++d<f;){var b=t[d],g=e[d];if(u)var m=s?u(g,b,d,e,t,c):u(b,g,d,t,e,c);if(void 0!==m){if(m)continue;y=!1;break}if(v){if(!o(e,(function(t,e){if(!i(v,e)&&(b===t||a(b,t,r,u,c)))return v.push(e)}))){y=!1;break}}else if(b!==g&&!a(b,g,r,u,c)){y=!1;break}}return c.delete(t),c.delete(e),y}},8351:function(t,e,r){var n=r(2705),o=r(1149),i=r(7813),u=r(7114),a=r(8776),c=r(1814),s=n?n.prototype:void 0,f=s?s.valueOf:void 0;t.exports=function(t,e,r,n,s,l,p){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new o(t),new o(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var h=a;case"[object Set]":var d=1&n;if(h||(h=c),t.size!=e.size&&!d)return!1;var y=p.get(t);if(y)return y==e;n|=2,p.set(t,e);var v=u(h(t),h(e),n,s,l,p);return p.delete(t),v;case"[object Symbol]":if(f)return f.call(t)==f.call(e)}return!1}},6096:function(t,e,r){var n=r(8234),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,i,u,a){var c=1&r,s=n(t),f=s.length;if(f!=n(e).length&&!c)return!1;for(var l=f;l--;){var p=s[l];if(!(c?p in e:o.call(e,p)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var y=!0;a.set(t,e),a.set(e,t);for(var v=c;++l<f;){var b=t[p=s[l]],g=e[p];if(i)var m=c?i(g,b,p,e,t,a):i(b,g,p,t,e,a);if(!(void 0===m?b===g||u(b,g,r,i,a):m)){y=!1;break}v||(v="constructor"==p)}if(y&&!v){var j=t.constructor,x=e.constructor;j==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof j&&j instanceof j&&"function"==typeof x&&x instanceof x||(y=!1)}return a.delete(t),a.delete(e),y}},1957:function(t,e,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},8234:function(t,e,r){var n=r(8866),o=r(9551),i=r(3674);t.exports=function(t){return n(t,i,o)}},6904:function(t,e,r){var n=r(8866),o=r(1442),i=r(1704);t.exports=function(t){return n(t,i,o)}},5050:function(t,e,r){var n=r(7019);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},1499:function(t,e,r){var n=r(9162),o=r(3674);t.exports=function(t){for(var e=o(t),r=e.length;r--;){var i=e[r],u=t[i];e[r]=[i,u,n(u)]}return e}},852:function(t,e,r){var n=r(8458),o=r(7801);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},5924:function(t,e,r){var n=r(5569)(Object.getPrototypeOf,Object);t.exports=n},9607:function(t,e,r){var n=r(2705),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var o=u.call(t);return n&&(e?t[a]=r:delete t[a]),o}},9551:function(t,e,r){var n=r(4963),o=r(479),i=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,a=u?function(t){return null==t?[]:(t=Object(t),n(u(t),(function(e){return i.call(t,e)})))}:o;t.exports=a},1442:function(t,e,r){var n=r(2488),o=r(5924),i=r(9551),u=r(479),a=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,i(t)),t=o(t);return e}:u;t.exports=a},4160:function(t,e,r){var n=r(8552),o=r(7071),i=r(3818),u=r(8525),a=r(577),c=r(4239),s=r(346),f="[object Map]",l="[object Promise]",p="[object Set]",h="[object WeakMap]",d="[object DataView]",y=s(n),v=s(o),b=s(i),g=s(u),m=s(a),j=c;(n&&j(new n(new ArrayBuffer(1)))!=d||o&&j(new o)!=f||i&&j(i.resolve())!=l||u&&j(new u)!=p||a&&j(new a)!=h)&&(j=function(t){var e=c(t),r="[object Object]"==e?t.constructor:void 0,n=r?s(r):"";if(n)switch(n){case y:return d;case v:return f;case b:return l;case g:return p;case m:return h}return e}),t.exports=j},7801:function(t){t.exports=function(t,e){return null==t?void 0:t[e]}},1789:function(t,e,r){var n=r(4536);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:function(t){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},7667:function(t,e,r){var n=r(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(e,t)?e[t]:void 0}},1327:function(t,e,r){var n=r(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:o.call(e,t)}},1866:function(t,e,r){var n=r(4536);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},3824:function(t){var e=Object.prototype.hasOwnProperty;t.exports=function(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}},9148:function(t,e,r){var n=r(4318),o=r(7157),i=r(3147),u=r(419),a=r(7133);t.exports=function(t,e,r){var c=t.constructor;switch(e){case"[object ArrayBuffer]":return n(t);case"[object Boolean]":case"[object Date]":return new c(+t);case"[object DataView]":return o(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(t,r);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(t);case"[object RegExp]":return i(t);case"[object Symbol]":return u(t)}}},8517:function(t,e,r){var n=r(3118),o=r(5924),i=r(5726);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:n(o(t))}},5776:function(t){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}},5403:function(t,e,r){var n=r(1469),o=r(3448),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||(u.test(t)||!i.test(t)||null!=e&&t in Object(e))}},7019:function(t){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},5346:function(t,e,r){var n,o=r(4429),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},5726:function(t){var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},9162:function(t,e,r){var n=r(3218);t.exports=function(t){return t==t&&!n(t)}},7040:function(t){t.exports=function(){this.__data__=[],this.size=0}},4125:function(t,e,r){var n=r(8470),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():o.call(e,r,1),--this.size,!0)}},2117:function(t,e,r){var n=r(8470);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},7518:function(t,e,r){var n=r(8470);t.exports=function(t){return n(this.__data__,t)>-1}},4705:function(t,e,r){var n=r(8470);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},4785:function(t,e,r){var n=r(1989),o=r(8407),i=r(7071);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},1285:function(t,e,r){var n=r(5050);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},6e3:function(t,e,r){var n=r(5050);t.exports=function(t){return n(this,t).get(t)}},9916:function(t,e,r){var n=r(5050);t.exports=function(t){return n(this,t).has(t)}},5265:function(t,e,r){var n=r(5050);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},8776:function(t){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}},2634:function(t){t.exports=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}},4523:function(t,e,r){var n=r(8306);t.exports=function(t){var e=n(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}},4536:function(t,e,r){var n=r(852)(Object,"create");t.exports=n},6916:function(t,e,r){var n=r(5569)(Object.keys,Object);t.exports=n},3498:function(t){t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},1167:function(t,e,r){t=r.nmd(t);var n=r(1957),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,u=i&&i.exports===o&&n.process,a=function(){try{var t=i&&i.require&&i.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=a},2333:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:function(t){t.exports=function(t,e){return function(r){return t(e(r))}}},5639:function(t,e,r){var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},619:function(t){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},2385:function(t){t.exports=function(t){return this.__data__.has(t)}},1814:function(t){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}},7465:function(t,e,r){var n=r(8407);t.exports=function(){this.__data__=new n,this.size=0}},3779:function(t){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},7599:function(t){t.exports=function(t){return this.__data__.get(t)}},4758:function(t){t.exports=function(t){return this.__data__.has(t)}},4309:function(t,e,r){var n=r(8407),o=r(7071),i=r(3369);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var u=r.__data__;if(!o||u.length<199)return u.push([t,e]),this.size=++r.size,this;r=this.__data__=new i(u)}return r.set(t,e),this.size=r.size,this}},5514:function(t,e,r){var n=r(4523),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,u=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)})),e}));t.exports=u},327:function(t,e,r){var n=r(3448);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}},346:function(t){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},7813:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},7361:function(t,e,r){var n=r(7786);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},5694:function(t,e,r){var n=r(9454),o=r(7005),i=Object.prototype,u=i.hasOwnProperty,a=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(t){return o(t)&&u.call(t,"callee")&&!a.call(t,"callee")};t.exports=c},1469:function(t){var e=Array.isArray;t.exports=e},8612:function(t,e,r){var n=r(3560),o=r(1780);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},4144:function(t,e,r){t=r.nmd(t);var n=r(5639),o=r(5062),i=e&&!e.nodeType&&e,u=i&&t&&!t.nodeType&&t,a=u&&u.exports===i?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;t.exports=c},3560:function(t,e,r){var n=r(4239),o=r(3218);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},6688:function(t,e,r){var n=r(5588),o=r(1717),i=r(1167),u=i&&i.isMap,a=u?o(u):n;t.exports=a},3218:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},2928:function(t,e,r){var n=r(9221),o=r(1717),i=r(1167),u=i&&i.isSet,a=u?o(u):n;t.exports=a},3448:function(t,e,r){var n=r(4239),o=r(7005);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},6719:function(t,e,r){var n=r(8749),o=r(1717),i=r(1167),u=i&&i.isTypedArray,a=u?o(u):n;t.exports=a},3674:function(t,e,r){var n=r(4636),o=r(280),i=r(8612);t.exports=function(t){return i(t)?n(t):o(t)}},1704:function(t,e,r){var n=r(4636),o=r(313),i=r(8612);t.exports=function(t){return i(t)?n(t,!0):o(t)}},6410:function(t,e,r){var n=r(5990),o=r(1573);t.exports=function(t){return o(n(t,1))}},8306:function(t,e,r){var n=r(3369);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u)||i,u};return r.cache=new(o.Cache||n),r}o.Cache=n,t.exports=o},479:function(t){t.exports=function(){return[]}},5062:function(t){t.exports=function(){return!1}},9833:function(t,e,r){var n=r(531);t.exports=function(t){return null==t?"":n(t)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={id:n,loaded:!1,exports:{}};return t[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var n={};return function(){"use strict";r.r(n),r.d(n,{Collection:function(){return d},FetchServer:function(){return N},Server:function(){return S},Single:function(){return b},default:function(){return z}});var t=r(7361),e=r.n(t),o=r(6410),i=r.n(o);function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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 in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(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 f(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}function l(t){return l="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},l(t)}var p=function(t,r){if(-1!==t.indexOf("_q")){var n=t.replace(/(_q)$/,""),o=new RegExp(r,"i");return function(t){var r;return null!==(null===(r=e()(t,n))||void 0===r?void 0:r.match(o))}}if(-1!==t.indexOf("_lte")){var u=t.replace(/(_lte)$/,"");return function(t){return e()(t,u)<=r}}if(-1!==t.indexOf("_gte")){var a=t.replace(/(_gte)$/,"");return function(t){return e()(t,a)>=r}}if(-1!==t.indexOf("_lt")){var c=t.replace(/(_lt)$/,"");return function(t){return e()(t,c)<r}}if(-1!==t.indexOf("_gt")){var s=t.replace(/(_gt)$/,"");return function(t){return e()(t,s)>r}}if(-1!==t.indexOf("_neq")){var f=t.replace(/(_neq)$/,"");return function(t){return e()(t,f)!=r}}return Array.isArray(r)?function(n){return Array.isArray(e()(n,t))?(o=function(r){return o=e()(n,t),i=function(t){return t==r},o.reduce((function(t,e){return t||i(e)}),!1);var o,i},r.reduce((function(t,e){return t&&o(e)}),!0)):r.filter((function(r){return r==e()(n,t)})).length>0;var o}:"object"===l(r)?function(n){return i()(r)(e()(n,t))}:function(n){return Array.isArray(e()(n,t))&&"string"==typeof r?-1!==e()(n,t).indexOf(r):"boolean"==typeof e()(n,t)&&"string"==typeof r?e()(n,t)==("true"===r):e()(n,t)==r}};function h(t,r){if("function"==typeof r)return t.filter(r);if(r instanceof Object){var n=Object.keys(r).map((function(t){if("q"===t){var n=new RegExp(r.q,"i");return function t(e){for(var r in e){if("object"===l(e[r])&&t(e[r]))return!0;if(e[r]&&e[r].match&&null!==e[r].match(n))return!0}return!1}}var o=t.split("."),i=r[t];return o.length>1?function(r){var n=function(t,r){return t.reduce((function(n,o,i){if(null!=n)return n;var u=t.slice(0,i+1).join("."),a=t.slice(i+1).join("."),c=e()(r,u);return Array.isArray(c)&&i<t.length-1?[u,a]:void 0}),void 0)}(o,r);if(n){var u=s(n,2),a=u[0],f=u[1];return h(e()(r,a),c({},f,i)).length>0}return p(t,i)(r)}:p(t,i)}));return t.filter((function(t){return n.reduce((function(e,r){return e&&r(t)}),!0)}))}throw new Error("Unsupported filter type")}var d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id";if(u(this,t),c(this,"sequence",0),c(this,"items",[]),c(this,"server",null),c(this,"name",null),c(this,"identifierName","id"),!Array.isArray(e))throw new Error("Can't initialize a Collection with anything else than an array of items");this.identifierName=r,e.map(this.addOne.bind(this))}var e,r,n;return e=t,(r=[{key:"setServer",value:function(t){this.server=t}},{key:"setName",value:function(t){this.name=t}},{key:"_oneToManyEmbedder",value:function(t){var e=this;if(null==this.name)throw new Error("Can't embed references without a collection name");var r=this.name.slice(0,-1)+"_id";return function(n){if(null==e.server)throw new Error("Can't embed references without a server");var o=e.server.collections[t];if(!o)throw new Error("Can't embed a non-existing collection ".concat(t));return Array.isArray(n[t])?n[t]=o.getAll({filter:function(e){return-1!==n[t].indexOf(e[o.identifierName])}}):n[t]=o.getAll({filter:function(t){return t[r]==n[e.identifierName]}}),n}}},{key:"_manyToOneEmbedder",value:function(t){var e=this,r=t+"s",n=t+"_id";return function(o){if(null==e.server)throw new Error("Can't embed references without a server");var i=e.server.collections[r];if(!i)throw new Error("Can't embed a non-existing collection ".concat(t));try{o[t]=i.getOne(o[n])}catch(t){}return o}}},{key:"_itemEmbedder",value:function(t){var e=this,r=(Array.isArray(t)?t:[t]).map((function(t){return t.endsWith("s")?e._oneToManyEmbedder(t):e._manyToOneEmbedder(t)}));return function(t){return r.reduce((function(t,e){return e(t)}),t)}}},{key:"getCount",value:function(t){return this.getAll(t).length}},{key:"getAll",value:function(t){var e=this.items.slice(0);return t&&(t.filter&&(e=h(e,t.filter)),t.sort&&(e=function(t,e){if("function"==typeof e)return t.sort(e);if("string"==typeof e)return t.sort((function(t,r){return t[e]>r[e]?1:t[e]<r[e]?-1:0}));if(Array.isArray(e)){var r=e[0],n="asc"==e[1].toLowerCase()?1:-1;return t.sort((function(t,e){return t[r]>e[r]?n:t[r]<e[r]?-1*n:0}))}throw new Error("Unsupported sort type")}(e,t.sort)),t.range&&(e=function(t,e){if(Array.isArray(e))return t.slice(e[0],void 0!==e[1]?e[1]+1:void 0);throw new Error("Unsupported range type")}(e,t.range)),e=e.map((function(t){return Object.assign({},t)})),t.embed&&this.server&&(e=e.map(this._itemEmbedder(t.embed)))),e}},{key:"getIndex",value:function(t){var e=this;return this.items.findIndex((function(r){return r[e.identifierName]==t}))}},{key:"getOne",value:function(t,e){var r=this.getIndex(t);if(-1===r)throw new Error("No item with identifier ".concat(t));var n=this.items[r];return n=Object.assign({},n),e&&e.embed&&this.server&&(n=this._itemEmbedder(e.embed)(n)),n}},{key:"addOne",value:function(t){var e=t[this.identifierName];if(void 0!==e){if(-1!==this.getIndex(e))throw new Error("An item with the identifier ".concat(e," already exists"));this.sequence=Math.max(this.sequence,e)+1}else t[this.identifierName]=this.sequence++;return this.items.push(t),Object.assign({},t)}},{key:"updateOne",value:function(t,e){var r=this.getIndex(t);if(-1===r)throw new Error("No item with identifier ".concat(t));for(var n in e)this.items[r][n]=e[n];return Object.assign({},this.items[r])}},{key:"removeOne",value:function(t){var e=this.getIndex(t);if(-1===e)throw new Error("No item with identifier ".concat(t));var r=this.items[e];return this.items.splice(e,1),t==this.sequence-1&&this.sequence--,r}}])&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function y(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 v(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var b=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),v(this,"obj",null),v(this,"server",null),v(this,"name",null),!(e instanceof Object))throw new Error("Can't initialize a Single with anything except an object");this.obj=e}var e,r,n;return e=t,(r=[{key:"setServer",value:function(t){this.server=t}},{key:"setName",value:function(t){this.name=t}},{key:"_oneToManyEmbedder",value:function(t){var e=this;return function(r){if(null==e.server)throw new Error("Can't embed references without a server");var n=e.server.collections[t];if(!n)throw new Error("Can't embed a non-existing collection ".concat(t));return r[t]=n.getAll({filter:function(e){return-1!==r[t].indexOf(e[n.identifierName])}}),r}}},{key:"_manyToOneEmbedder",value:function(t){var e=this,r=t+"s",n=t+"_id";return function(o){if(null==e.server)throw new Error("Can't embed references without a server");var i=e.server.collections[r];if(!i)throw new Error("Can't embed a non-existing collection ".concat(t));try{o[t]=i.getOne(o[n])}catch(t){}return o}}},{key:"_itemEmbedder",value:function(t){var e=this,r=(Array.isArray(t)?t:[t]).map((function(t){return t.endsWith("s")?e._oneToManyEmbedder(t):e._manyToOneEmbedder(t)}));return function(t){return r.reduce((function(t,e){return e(t)}),t)}}},{key:"getOnly",value:function(t){var e=this.obj;return t&&t.embed&&this.server&&(e=Object.assign({},e),e=this._itemEmbedder(t.embed)(e)),e}},{key:"updateOnly",value:function(t){for(var e in t)this.obj[e]=t[e];return this.obj}}])&&y(e.prototype,r),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,e)}(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 m(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}function j(t){if(!t)return{};var e={};return t.split("&").map((function(t){if(-1===t.indexOf("="))e[t]=!0;else{var r=g(t.split("="),2),n=r[0],o=r[1];0!==o.indexOf("[")&&0!==o.indexOf("{")||(o=JSON.parse(o)),e[n.trim()]=o}})),e}function x(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return O(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw i}}}}function O(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}function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 A(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var S=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";w(this,t),A(this,"baseUrl",null),A(this,"loggingEnabled",!1),A(this,"defaultQuery",(function(){})),A(this,"batchUrl",null),A(this,"collections",{}),A(this,"singles",{}),A(this,"requestInterceptors",[]),A(this,"responseInterceptors",[]),this.baseUrl=e}var e,r,n;return e=t,r=[{key:"init",value:function(t){for(var e in t)Array.isArray(t[e])?this.addCollection(e,new d(t[e],"id")):this.addSingle(e,new b(t[e]))}},{key:"toggleLogging",value:function(){this.loggingEnabled=!this.loggingEnabled}},{key:"setDefaultQuery",value:function(t){this.defaultQuery=t}},{key:"setBatchUrl",value:function(t){this.batchUrl=t}},{key:"setBatch",value:function(t){console.warn("Server.setBatch() is deprecated, use Server.setBatchUrl() instead"),this.batchUrl=t}},{key:"addCollection",value:function(t,e){this.collections[t]=e,e.setServer(this),e.setName(t)}},{key:"getCollection",value:function(t){return this.collections[t]}},{key:"getCollectionNames",value:function(){return Object.keys(this.collections)}},{key:"addSingle",value:function(t,e){this.singles[t]=e,e.setServer(this),e.setName(t)}},{key:"getSingle",value:function(t){return this.singles[t]}},{key:"getSingleNames",value:function(){return Object.keys(this.singles)}},{key:"addRequestInterceptor",value:function(t){this.requestInterceptors.push(t)}},{key:"addResponseInterceptor",value:function(t){this.responseInterceptors.push(t)}},{key:"getCount",value:function(t,e){return this.collections[t].getCount(e)}},{key:"getAll",value:function(t,e){return this.collections[t].getAll(e)}},{key:"getOne",value:function(t,e,r){return this.collections[t].getOne(e,r)}},{key:"addOne",value:function(t,e){return this.collections.hasOwnProperty(t)||this.addCollection(t,new d([],"id")),this.collections[t].addOne(e)}},{key:"updateOne",value:function(t,e,r){return this.collections[t].updateOne(e,r)}},{key:"removeOne",value:function(t,e){return this.collections[t].removeOne(e)}},{key:"getOnly",value:function(t,e){return this.singles[t].getOnly()}},{key:"updateOnly",value:function(t,e){return this.singles[t].updateOnly(e)}},{key:"decode",value:function(t){if(t.queryString=decodeURIComponent(t.url.slice(t.url.indexOf("?")+1)),t.params=j(t.queryString),t.requestBody)try{t.json=JSON.parse(t.requestBody)}catch(t){}return this.requestInterceptors.reduce((function(t,e){return e(t)}),t)}},{key:"respond",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200;e||(e={}),e["Content-Type"]||(e["Content-Type"]="application/json");var o={status:n,headers:e,body:t};return o=this.responseInterceptors.reduce((function(t,e){return e(t,r)}),o),this.log(r,o),r.respond(o.status,o.headers,JSON.stringify(o.body))}},{key:"log",value:function(t,e){this.loggingEnabled&&(console.group?(console.groupCollapsed(t.method,t.url,"(FakeRest)"),console.group("request"),console.log(t.method,t.url),console.log("headers",t.requestHeaders),console.log("body ",t.requestBody),console.groupEnd(),console.group("response",e.status),console.log("headers",e.headers),console.log("body ",e.body),console.groupEnd(),console.groupEnd()):(console.log("FakeRest request ",t.method,t.url,"headers",t.requestHeaders,"body",t.requestBody),console.log("FakeRest response",e.status,"headers",e.headers,"body",e.body)))}},{key:"batch",value:function(t){var e=t.json,r=this.handle.bind(this),n=Object.keys(e).reduce((function(t,n){var o,i={url:e[n],method:"GET",params:{},respond:function(t,e,r){o={code:t,headers:Object.keys(e||{}).map((function(t){return{name:t,value:e[t]}})),body:r||{}}}};return r(i),t[n]=o||{code:404,headers:[],body:{}},t}),{});return this.respond(n,{},t,200)}},{key:"handle",value:function(t){if(t=this.decode(t),this.batchUrl&&this.batchUrl===t.url&&"POST"===t.method)return this.batch(t);var e,r=x(this.getSingleNames());try{for(r.s();!(e=r.n()).done;){var n=e.value;if(t.url.match(new RegExp("^"+this.baseUrl+"\\/("+n+")(\\/?.*)?$"))){if("GET"==t.method)try{var o=this.getOnly(n);return this.respond(o,null,t)}catch(e){return t.respond(404)}if("PUT"==t.method)try{var i=this.updateOnly(n,t.json);return this.respond(i,null,t)}catch(e){return t.respond(404)}if("PATCH"==t.method)try{var u=this.updateOnly(n,t.json);return this.respond(u,null,t)}catch(e){return t.respond(404)}}}}catch(t){r.e(t)}finally{r.f()}var a=t.url.match(new RegExp("^"+this.baseUrl+"\\/([^\\/?]+)(\\/(\\d+))?(\\?.*)?$"));if(a){var c=a[1],s=Object.assign({},this.defaultQuery(c),t.params);if(a[2]){if(!this.getCollection(c))return;var f=a[3];if("GET"==t.method)try{var l=this.getOne(c,f,s);return this.respond(l,null,t)}catch(e){return t.respond(404)}if("PUT"==t.method)try{var p=this.updateOne(c,f,t.json);return this.respond(p,null,t)}catch(e){return t.respond(404)}if("PATCH"==t.method)try{var h=this.updateOne(c,f,t.json);return this.respond(h,null,t)}catch(e){return t.respond(404)}if("DELETE"==t.method)try{var d=this.removeOne(c,f);return this.respond(d,null,t)}catch(e){return t.respond(404)}}else{if("GET"==t.method){if(!this.getCollection(c))return;var y,v,b,g=this.getCount(c,s.filter?{filter:s.filter}:{});if(g>0){y=this.getAll(c,s);var m=s.range?s.range[0]:0,j=s.range?Math.min(y.length-1+m,s.range[1]):y.length-1;v="items ".concat(m,"-").concat(j,"/").concat(g),b=y.length==g?200:206}else y=[],v="items */0",b=200;return this.respond(y,{"Content-Range":v},t,b)}if("POST"==t.method){var O=this.addOne(c,t.json),w=this.baseUrl+"/"+c+"/"+O[this.getCollection(c).identifierName];return this.respond(O,{Location:w},t,201)}}}}},{key:"getHandler",value:function(){return this.handle.bind(this)}}],r&&_(e.prototype,r),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function E(t){return E="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},E(t)}function k(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return C(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw i}}}}function C(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}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P(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 I(t,e){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},I(t,e)}function U(t){var e=function(){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}}();return function(){var r,n=R(t);if(e){var o=R(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return q(this,r)}}function q(t,e){if(e&&("object"===E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function R(t){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},R(t)}var N=function(t){!function(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&I(t,e)}(i,t);var e,r,n,o=U(i);function i(){return T(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"decode",value:function(t,e){var r=this,n="string"==typeof t?new Request(t,e):t;return n.queryString=decodeURIComponent(n.url.slice(n.url.indexOf("?")+1)),n.params=j(n.queryString),n.text().then((function(t){n.requestBody=t;try{n.requestJson=JSON.parse(t)}catch(t){}})).then((function(){return r.requestInterceptors.reduce((function(t,e){return e(t)}),n)}))}},{key:"respond",value:function(t,e){return t=this.responseInterceptors.reduce((function(t,r){return r(t,e)}),t),this.log(e,t),t.headers=new Headers(t.headers),t}},{key:"log",value:function(t,e){this.loggingEnabled&&(console.group?(console.groupCollapsed(t.method,t.url,"(FakeRest)"),console.group("request"),console.log(t.method,t.url),console.log("headers",t.headers),console.log("body ",t.requestBody),console.groupEnd(),console.group("response",e.status),console.log("headers",e.headers),console.log("body ",e.body),console.groupEnd(),console.groupEnd()):(console.log("FakeRest request ",t.method,t.url,"headers",t.headers,"body",t.requestBody),console.log("FakeRest response",e.status,"headers",e.headers,"body",e.body)))}},{key:"batch",value:function(t){throw new Error("not implemented")}},{key:"handle",value:function(t,e){var r=this;return this.decode(t,e).then((function(t){var e={headers:{"Content-Type":"application/json"},status:200};if(r.batchUrl&&r.batchUrl===t.url&&"POST"===t.method)return r.batch(t);var n,o=k(r.getSingleNames());try{for(o.s();!(n=o.n()).done;){var i=n.value;if(t.url.match(new RegExp("^"+r.baseUrl+"\\/("+i+")(\\/?.*)?$"))){if("GET"==t.method){try{e.body=r.getOnly(i)}catch(t){reponse.status=404}return r.respond(e,t)}if("PUT"==t.method){try{e.body=r.updateOnly(i,t.requestJson)}catch(t){reponse.status=404}return r.respond(e,t)}if("PATCH"==t.method){try{e.body=r.updateOnly(i,t.requestJson)}catch(t){reponse.status=404}return r.respond(e,t)}}}}catch(t){o.e(t)}finally{o.f()}var u,a=k(r.getCollectionNames());try{for(a.s();!(u=a.n()).done;){var c=u.value,s=t.url.match(new RegExp("^"+r.baseUrl+"\\/("+c+")(\\/(\\d+))?(\\?.*)?$"));if(s){var f=Object.assign({},r.defaultQuery(c),t.params);if(s[2]){var l=s[3];if("GET"==t.method){try{e.body=r.getOne(c,l,f)}catch(t){e.status=404}return r.respond(e,t)}if("PUT"==t.method){try{e.body=r.updateOne(c,l,t.requestJson)}catch(t){e.status=404}return r.respond(e,t)}if("PATCH"==t.method){try{e.body=r.updateOne(c,l,t.requestJson)}catch(t){e.status=404}return r.respond(e,t)}if("DELETE"==t.method){try{e.body=r.removeOne(c,l)}catch(t){e.status=404}return r.respond(e,t)}}else{if("GET"==t.method){var p=r.getCount(c,f.filter?{filter:f.filter}:{});if(p>0){var h=r.getAll(c,f),d=f.range?f.range[0]:0,y=f.range?Math.min(h.length-1+d,f.range[1]):h.length-1;e.body=h,e.headers["Content-Range"]="items ".concat(d,"-").concat(y,"/").concat(p),e.status=h.length==p?200:206}else e.body=[],e.headers["Content-Range"]="items */0";return r.respond(e,t)}if("POST"==t.method){var v=r.addOne(c,t.requestJson),b=r.baseUrl+"/"+c+"/"+v[r.getCollection(c).identifierName];return e.body=v,e.headers.Location=b,e.status=201,r.respond(e,t)}}}}}catch(t){a.e(t)}finally{a.f()}return r.respond(e,t)}))}}])&&P(e.prototype,r),n&&P(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(S),z={Server:S,FetchServer:N,Collection:d,Single:b}}(),n}()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FakeRest=t():e.FakeRest=t()}(this,(function(){return function(){var e={8552:function(e,t,r){var n=r(852)(r(5639),"DataView");e.exports=n},1989:function(e,t,r){var n=r(1789),o=r(401),i=r(7667),u=r(1327),a=r(1866);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,e.exports=c},8407:function(e,t,r){var n=r(7040),o=r(4125),i=r(2117),u=r(7518),a=r(4705);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,e.exports=c},7071:function(e,t,r){var n=r(852)(r(5639),"Map");e.exports=n},3369:function(e,t,r){var n=r(4785),o=r(1285),i=r(6e3),u=r(9916),a=r(5265);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=u,c.prototype.set=a,e.exports=c},3818:function(e,t,r){var n=r(852)(r(5639),"Promise");e.exports=n},8525:function(e,t,r){var n=r(852)(r(5639),"Set");e.exports=n},8668:function(e,t,r){var n=r(3369),o=r(619),i=r(2385);function u(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}u.prototype.add=u.prototype.push=o,u.prototype.has=i,e.exports=u},6384:function(e,t,r){var n=r(8407),o=r(7465),i=r(3779),u=r(7599),a=r(4758),c=r(4309);function s(e){var t=this.__data__=new n(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=u,s.prototype.has=a,s.prototype.set=c,e.exports=s},2705:function(e,t,r){var n=r(5639).Symbol;e.exports=n},1149:function(e,t,r){var n=r(5639).Uint8Array;e.exports=n},577:function(e,t,r){var n=r(852)(r(5639),"WeakMap");e.exports=n},7412:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},4963:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var u=e[r];t(u,r,e)&&(i[o++]=u)}return i}},4636:function(e,t,r){var n=r(2545),o=r(5694),i=r(1469),u=r(4144),a=r(5776),c=r(6719),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),f=!r&&o(e),l=!r&&!f&&u(e),p=!r&&!f&&!l&&c(e),y=r||f||l||p,d=y?n(e.length,String):[],h=d.length;for(var v in e)!t&&!s.call(e,v)||y&&("length"==v||l&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,h))||d.push(v);return d}},9932:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}},2488:function(e){e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},2908:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},4865:function(e,t,r){var n=r(9465),o=r(7813),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var u=e[t];i.call(e,t)&&o(u,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:function(e,t,r){var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:function(e,t,r){var n=r(8363),o=r(3674);e.exports=function(e,t){return e&&n(t,o(t),e)}},3886:function(e,t,r){var n=r(8363),o=r(1704);e.exports=function(e,t){return e&&n(t,o(t),e)}},9465:function(e,t,r){var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},5990:function(e,t,r){var n=r(6384),o=r(7412),i=r(4865),u=r(4037),a=r(3886),c=r(4626),s=r(278),f=r(8805),l=r(1911),p=r(8234),y=r(6904),d=r(4160),h=r(3824),v=r(9148),b=r(8517),g=r(1469),m=r(4144),j=r(6688),x=r(3218),_=r(2928),O=r(3674),w=r(1704),A="[object Arguments]",S="[object Function]",E="[object Object]",k={};k[A]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[E]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[S]=k["[object WeakMap]"]=!1,e.exports=function e(t,r,C,T,P,q){var I,U=1&r,R=2&r,N=4&r;if(C&&(I=P?C(t,T,P,q):C(t)),void 0!==I)return I;if(!x(t))return t;var $=g(t);if($){if(I=h(t),!U)return s(t,I)}else{var z=d(t),F=z==S||"[object GeneratorFunction]"==z;if(m(t))return c(t,U);if(z==E||z==A||F&&!P){if(I=R||F?{}:b(t),!U)return R?l(t,a(I,t)):f(t,u(I,t))}else{if(!k[z])return P?t:{};I=v(t,z,U)}}q||(q=new n);var M=q.get(t);if(M)return M;q.set(t,I),_(t)?t.forEach((function(n){I.add(e(n,r,C,n,t,q))})):j(t)&&t.forEach((function(n,o){I.set(o,e(n,r,C,o,t,q))}));var B=$?void 0:(N?R?y:p:R?w:O)(t);return o(B||t,(function(n,o){B&&(n=t[o=n]),i(I,o,e(n,r,C,o,t,q))})),I}},3118:function(e,t,r){var n=r(3218),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},7786:function(e,t,r){var n=r(1811),o=r(327);e.exports=function(e,t){for(var r=0,i=(t=n(t,e)).length;null!=e&&r<i;)e=e[o(t[r++])];return r&&r==i?e:void 0}},8866:function(e,t,r){var n=r(2488),o=r(1469);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},4239:function(e,t,r){var n=r(2705),o=r(9607),i=r(2333),u=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?o(e):i(e)}},9454:function(e,t,r){var n=r(4239),o=r(7005);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},939:function(e,t,r){var n=r(2492),o=r(7005);e.exports=function e(t,r,i,u,a){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,i,u,e,a))}},2492:function(e,t,r){var n=r(6384),o=r(7114),i=r(8351),u=r(6096),a=r(4160),c=r(1469),s=r(4144),f=r(6719),l="[object Arguments]",p="[object Array]",y="[object Object]",d=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,h,v,b){var g=c(e),m=c(t),j=g?p:a(e),x=m?p:a(t),_=(j=j==l?y:j)==y,O=(x=x==l?y:x)==y,w=j==x;if(w&&s(e)){if(!s(t))return!1;g=!0,_=!1}if(w&&!_)return b||(b=new n),g||f(e)?o(e,t,r,h,v,b):i(e,t,j,r,h,v,b);if(!(1&r)){var A=_&&d.call(e,"__wrapped__"),S=O&&d.call(t,"__wrapped__");if(A||S){var E=A?e.value():e,k=S?t.value():t;return b||(b=new n),v(E,k,r,h,b)}}return!!w&&(b||(b=new n),u(e,t,r,h,v,b))}},5588:function(e,t,r){var n=r(4160),o=r(7005);e.exports=function(e){return o(e)&&"[object Map]"==n(e)}},2958:function(e,t,r){var n=r(6384),o=r(939);e.exports=function(e,t,r,i){var u=r.length,a=u,c=!i;if(null==e)return!a;for(e=Object(e);u--;){var s=r[u];if(c&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++u<a;){var f=(s=r[u])[0],l=e[f],p=s[1];if(c&&s[2]){if(void 0===l&&!(f in e))return!1}else{var y=new n;if(i)var d=i(l,p,f,e,t,y);if(!(void 0===d?o(p,l,3,i,y):d))return!1}}return!0}},8458:function(e,t,r){var n=r(3560),o=r(5346),i=r(3218),u=r(346),a=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,f=c.toString,l=s.hasOwnProperty,p=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?p:a).test(u(e))}},9221:function(e,t,r){var n=r(4160),o=r(7005);e.exports=function(e){return o(e)&&"[object Set]"==n(e)}},8749:function(e,t,r){var n=r(4239),o=r(1780),i=r(7005),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!u[n(e)]}},280:function(e,t,r){var n=r(5726),o=r(6916),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:function(e,t,r){var n=r(3218),o=r(5726),i=r(3498),u=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var a in e)("constructor"!=a||!t&&u.call(e,a))&&r.push(a);return r}},1573:function(e,t,r){var n=r(2958),o=r(1499),i=r(2634);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},2545:function(e){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},531:function(e,t,r){var n=r(2705),o=r(9932),i=r(1469),u=r(3448),a=n?n.prototype:void 0,c=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(u(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r}},1717:function(e){e.exports=function(e){return function(t){return e(t)}}},4757:function(e){e.exports=function(e,t){return e.has(t)}},1811:function(e,t,r){var n=r(1469),o=r(5403),i=r(5514),u=r(9833);e.exports=function(e,t){return n(e)?e:o(e,t)?[e]:i(u(e))}},4318:function(e,t,r){var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:function(e,t,r){e=r.nmd(e);var n=r(5639),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,u=i&&i.exports===o?n.Buffer:void 0,a=u?u.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},7157:function(e,t,r){var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:function(e){var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:function(e,t,r){var n=r(2705),o=n?n.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},7133:function(e,t,r){var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},278:function(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},8363:function(e,t,r){var n=r(4865),o=r(9465);e.exports=function(e,t,r,i){var u=!r;r||(r={});for(var a=-1,c=t.length;++a<c;){var s=t[a],f=i?i(r[s],e[s],s,r,e):void 0;void 0===f&&(f=e[s]),u?o(r,s,f):n(r,s,f)}return r}},8805:function(e,t,r){var n=r(8363),o=r(9551);e.exports=function(e,t){return n(e,o(e),t)}},1911:function(e,t,r){var n=r(8363),o=r(1442);e.exports=function(e,t){return n(e,o(e),t)}},4429:function(e,t,r){var n=r(5639)["__core-js_shared__"];e.exports=n},8777:function(e,t,r){var n=r(852),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},7114:function(e,t,r){var n=r(8668),o=r(2908),i=r(4757);e.exports=function(e,t,r,u,a,c){var s=1&r,f=e.length,l=t.length;if(f!=l&&!(s&&l>f))return!1;var p=c.get(e),y=c.get(t);if(p&&y)return p==t&&y==e;var d=-1,h=!0,v=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++d<f;){var b=e[d],g=t[d];if(u)var m=s?u(g,b,d,t,e,c):u(b,g,d,e,t,c);if(void 0!==m){if(m)continue;h=!1;break}if(v){if(!o(t,(function(e,t){if(!i(v,t)&&(b===e||a(b,e,r,u,c)))return v.push(t)}))){h=!1;break}}else if(b!==g&&!a(b,g,r,u,c)){h=!1;break}}return c.delete(e),c.delete(t),h}},8351:function(e,t,r){var n=r(2705),o=r(1149),i=r(7813),u=r(7114),a=r(8776),c=r(1814),s=n?n.prototype:void 0,f=s?s.valueOf:void 0;e.exports=function(e,t,r,n,s,l,p){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!l(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var y=a;case"[object Set]":var d=1&n;if(y||(y=c),e.size!=t.size&&!d)return!1;var h=p.get(e);if(h)return h==t;n|=2,p.set(e,t);var v=u(y(e),y(t),n,s,l,p);return p.delete(e),v;case"[object Symbol]":if(f)return f.call(e)==f.call(t)}return!1}},6096:function(e,t,r){var n=r(8234),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,u,a){var c=1&r,s=n(e),f=s.length;if(f!=n(t).length&&!c)return!1;for(var l=f;l--;){var p=s[l];if(!(c?p in t:o.call(t,p)))return!1}var y=a.get(e),d=a.get(t);if(y&&d)return y==t&&d==e;var h=!0;a.set(e,t),a.set(t,e);for(var v=c;++l<f;){var b=e[p=s[l]],g=t[p];if(i)var m=c?i(g,b,p,t,e,a):i(b,g,p,e,t,a);if(!(void 0===m?b===g||u(b,g,r,i,a):m)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var j=e.constructor,x=t.constructor;j==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof j&&j instanceof j&&"function"==typeof x&&x instanceof x||(h=!1)}return a.delete(e),a.delete(t),h}},1957:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8234:function(e,t,r){var n=r(8866),o=r(9551),i=r(3674);e.exports=function(e){return n(e,i,o)}},6904:function(e,t,r){var n=r(8866),o=r(1442),i=r(1704);e.exports=function(e){return n(e,i,o)}},5050:function(e,t,r){var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},1499:function(e,t,r){var n=r(9162),o=r(3674);e.exports=function(e){for(var t=o(e),r=t.length;r--;){var i=t[r],u=e[i];t[r]=[i,u,n(u)]}return t}},852:function(e,t,r){var n=r(8458),o=r(7801);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},5924:function(e,t,r){var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:function(e,t,r){var n=r(2705),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var o=u.call(e);return n&&(t?e[a]=r:delete e[a]),o}},9551:function(e,t,r){var n=r(4963),o=r(479),i=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,a=u?function(e){return null==e?[]:(e=Object(e),n(u(e),(function(t){return i.call(e,t)})))}:o;e.exports=a},1442:function(e,t,r){var n=r(2488),o=r(5924),i=r(9551),u=r(479),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=o(e);return t}:u;e.exports=a},4160:function(e,t,r){var n=r(8552),o=r(7071),i=r(3818),u=r(8525),a=r(577),c=r(4239),s=r(346),f="[object Map]",l="[object Promise]",p="[object Set]",y="[object WeakMap]",d="[object DataView]",h=s(n),v=s(o),b=s(i),g=s(u),m=s(a),j=c;(n&&j(new n(new ArrayBuffer(1)))!=d||o&&j(new o)!=f||i&&j(i.resolve())!=l||u&&j(new u)!=p||a&&j(new a)!=y)&&(j=function(e){var t=c(e),r="[object Object]"==t?e.constructor:void 0,n=r?s(r):"";if(n)switch(n){case h:return d;case v:return f;case b:return l;case g:return p;case m:return y}return t}),e.exports=j},7801:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},1789:function(e,t,r){var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:function(e,t,r){var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},1327:function(e,t,r){var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},1866:function(e,t,r){var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:function(e,t,r){var n=r(4318),o=r(7157),i=r(3147),u=r(419),a=r(7133);e.exports=function(e,t,r){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,r);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return u(e)}}},8517:function(e,t,r){var n=r(3118),o=r(5924),i=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},5776:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},5403:function(e,t,r){var n=r(1469),o=r(3448),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!o(e))||(u.test(e)||!i.test(e)||null!=t&&e in Object(t))}},7019:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:function(e,t,r){var n,o=r(4429),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},5726:function(e){var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},9162:function(e,t,r){var n=r(3218);e.exports=function(e){return e==e&&!n(e)}},7040:function(e){e.exports=function(){this.__data__=[],this.size=0}},4125:function(e,t,r){var n=r(8470),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():o.call(t,r,1),--this.size,!0)}},2117:function(e,t,r){var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:function(e,t,r){var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:function(e,t,r){var n=r(8470);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},4785:function(e,t,r){var n=r(1989),o=r(8407),i=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},1285:function(e,t,r){var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:function(e,t,r){var n=r(5050);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},2634:function(e){e.exports=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}},4523:function(e,t,r){var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},4536:function(e,t,r){var n=r(852)(Object,"create");e.exports=n},6916:function(e,t,r){var n=r(5569)(Object.keys,Object);e.exports=n},3498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:function(e,t,r){e=r.nmd(e);var n=r(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,u=i&&i.exports===o&&n.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||u&&u.binding&&u.binding("util")}catch(e){}}();e.exports=a},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},5639:function(e,t,r){var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},7465:function(e,t,r){var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,r){var n=r(8407),o=r(7071),i=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var u=r.__data__;if(!o||u.length<199)return u.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(u)}return r.set(e,t),this.size=r.size,this}},5514:function(e,t,r){var n=r(4523),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,u=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,r,n,o){t.push(n?o.replace(i,"$1"):r||e)})),t}));e.exports=u},327:function(e,t,r){var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},7361:function(e,t,r){var n=r(7786);e.exports=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}},5694:function(e,t,r){var n=r(9454),o=r(7005),i=Object.prototype,u=i.hasOwnProperty,a=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&u.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,r){var n=r(3560),o=r(1780);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},4144:function(e,t,r){e=r.nmd(e);var n=r(5639),o=r(5062),i=t&&!t.nodeType&&t,u=i&&e&&!e.nodeType&&e,a=u&&u.exports===i?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;e.exports=c},3560:function(e,t,r){var n=r(4239),o=r(3218);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:function(e,t,r){var n=r(5588),o=r(1717),i=r(1167),u=i&&i.isMap,a=u?o(u):n;e.exports=a},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},2928:function(e,t,r){var n=r(9221),o=r(1717),i=r(1167),u=i&&i.isSet,a=u?o(u):n;e.exports=a},3448:function(e,t,r){var n=r(4239),o=r(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},6719:function(e,t,r){var n=r(8749),o=r(1717),i=r(1167),u=i&&i.isTypedArray,a=u?o(u):n;e.exports=a},3674:function(e,t,r){var n=r(4636),o=r(280),i=r(8612);e.exports=function(e){return i(e)?n(e):o(e)}},1704:function(e,t,r){var n=r(4636),o=r(313),i=r(8612);e.exports=function(e){return i(e)?n(e,!0):o(e)}},6410:function(e,t,r){var n=r(5990),o=r(1573);e.exports=function(e){return o(n(e,1))}},8306:function(e,t,r){var n=r(3369);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=e.apply(this,n);return r.cache=i.set(o,u)||i,u};return r.cache=new(o.Cache||n),r}o.Cache=n,e.exports=o},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},9833:function(e,t,r){var n=r(531);e.exports=function(e){return null==e?"":n(e)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var n={};return function(){"use strict";r.r(n),r.d(n,{Collection:function(){return d},FetchServer:function(){return N},Server:function(){return S},Single:function(){return b},default:function(){return $}});var e=r(7361),t=r.n(e),o=r(6410),i=r.n(o);function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);u=!0);}catch(e){a=!0,o=e}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e,t)||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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}var p=function(e,r){if(-1!==e.indexOf("_q")){var n=e.replace(/(_q)$/,""),o=new RegExp(r,"i");return function(e){var r;return null!==(null===(r=t()(e,n))||void 0===r?void 0:r.match(o))}}if(-1!==e.indexOf("_lte")){var u=e.replace(/(_lte)$/,"");return function(e){return t()(e,u)<=r}}if(-1!==e.indexOf("_gte")){var a=e.replace(/(_gte)$/,"");return function(e){return t()(e,a)>=r}}if(-1!==e.indexOf("_lt")){var c=e.replace(/(_lt)$/,"");return function(e){return t()(e,c)<r}}if(-1!==e.indexOf("_gt")){var s=e.replace(/(_gt)$/,"");return function(e){return t()(e,s)>r}}if(-1!==e.indexOf("_neq_any")){var f=e.replace(/(_neq_any)$/,""),p=Array.isArray(r)?r:[r];return function(e){return p.every((function(r){return t()(e,f)!=r}))}}if(-1!==e.indexOf("_neq")){var y=e.replace(/(_neq)$/,"");return function(e){return t()(e,y)!=r}}if(-1!==e.indexOf("_eq_any")){var d=e.replace(/(_eq_any)$/,""),h=Array.isArray(r)?r:[r];return function(e){return h.some((function(r){return t()(e,d)==r}))}}if(-1!==e.indexOf("_eq")){var v=e.replace(/(_eq)$/,"");return function(e){return t()(e,v)==r}}if(-1!==e.indexOf("_inc_any")){var b=e.replace(/(_inc_any)$/,""),g=Array.isArray(r)?r:[r];return function(e){return g.some((function(r){return t()(e,b).includes(r)}))}}if(-1!==e.indexOf("_inc")){var m=e.replace(/(_inc)$/,""),j=Array.isArray(r)?r:[r];return function(e){return j.every((function(r){return t()(e,m).includes(r)}))}}if(-1!==e.indexOf("_ninc_any")){var x=e.replace(/(_ninc_any)$/,""),_=Array.isArray(r)?r:[r];return function(e){return _.every((function(r){return!t()(e,x).includes(r)}))}}return Array.isArray(r)?function(n){return Array.isArray(t()(n,e))?(o=function(r){return o=t()(n,e),i=function(e){return e==r},o.reduce((function(e,t){return e||i(t)}),!1);var o,i},r.reduce((function(e,t){return e&&o(t)}),!0)):r.filter((function(r){return r==t()(n,e)})).length>0;var o}:"object"===l(r)?function(n){return i()(r)(t()(n,e))}:function(n){return Array.isArray(t()(n,e))&&"string"==typeof r?-1!==t()(n,e).indexOf(r):"boolean"==typeof t()(n,e)&&"string"==typeof r?t()(n,e)==("true"===r):t()(n,e)==r}};function y(e,r){if("function"==typeof r)return e.filter(r);if(r instanceof Object){var n=Object.keys(r).map((function(e){if("q"===e){var n=new RegExp(r.q,"i");return function e(t){for(var r in t){if("object"===l(t[r])&&e(t[r]))return!0;if(t[r]&&t[r].match&&null!==t[r].match(n))return!0}return!1}}var o=e.split("."),i=r[e];return o.length>1?function(r){var n=function(e,r){return e.reduce((function(n,o,i){if(null!=n)return n;var u=e.slice(0,i+1).join("."),a=e.slice(i+1).join("."),c=t()(r,u);return Array.isArray(c)&&i<e.length-1?[u,a]:void 0}),void 0)}(o,r);if(n){var u=s(n,2),a=u[0],f=u[1];return y(t()(r,a),c({},f,i)).length>0}return p(e,i)(r)}:p(e,i)}));return e.filter((function(e){return n.reduce((function(t,r){return t&&r(e)}),!0)}))}throw new Error("Unsupported filter type")}var d=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id";if(u(this,e),c(this,"sequence",0),c(this,"items",[]),c(this,"server",null),c(this,"name",null),c(this,"identifierName","id"),!Array.isArray(t))throw new Error("Can't initialize a Collection with anything else than an array of items");this.identifierName=r,t.map(this.addOne.bind(this))}var t,r,n;return t=e,(r=[{key:"setServer",value:function(e){this.server=e}},{key:"setName",value:function(e){this.name=e}},{key:"_oneToManyEmbedder",value:function(e){var t=this;if(null==this.name)throw new Error("Can't embed references without a collection name");var r=this.name.slice(0,-1)+"_id";return function(n){if(null==t.server)throw new Error("Can't embed references without a server");var o=t.server.collections[e];if(!o)throw new Error("Can't embed a non-existing collection ".concat(e));return Array.isArray(n[e])?n[e]=o.getAll({filter:function(t){return-1!==n[e].indexOf(t[o.identifierName])}}):n[e]=o.getAll({filter:function(e){return e[r]==n[t.identifierName]}}),n}}},{key:"_manyToOneEmbedder",value:function(e){var t=this,r=e+"s",n=e+"_id";return function(o){if(null==t.server)throw new Error("Can't embed references without a server");var i=t.server.collections[r];if(!i)throw new Error("Can't embed a non-existing collection ".concat(e));try{o[e]=i.getOne(o[n])}catch(e){}return o}}},{key:"_itemEmbedder",value:function(e){var t=this,r=(Array.isArray(e)?e:[e]).map((function(e){return e.endsWith("s")?t._oneToManyEmbedder(e):t._manyToOneEmbedder(e)}));return function(e){return r.reduce((function(e,t){return t(e)}),e)}}},{key:"getCount",value:function(e){return this.getAll(e).length}},{key:"getAll",value:function(e){var t=this.items.slice(0);return e&&(e.filter&&(t=y(t,e.filter)),e.sort&&(t=function(e,t){if("function"==typeof t)return e.sort(t);if("string"==typeof t)return e.sort((function(e,r){return e[t]>r[t]?1:e[t]<r[t]?-1:0}));if(Array.isArray(t)){var r=t[0],n="asc"==t[1].toLowerCase()?1:-1;return e.sort((function(e,t){return e[r]>t[r]?n:e[r]<t[r]?-1*n:0}))}throw new Error("Unsupported sort type")}(t,e.sort)),e.range&&(t=function(e,t){if(Array.isArray(t))return e.slice(t[0],void 0!==t[1]?t[1]+1:void 0);throw new Error("Unsupported range type")}(t,e.range)),t=t.map((function(e){return Object.assign({},e)})),e.embed&&this.server&&(t=t.map(this._itemEmbedder(e.embed)))),t}},{key:"getIndex",value:function(e){var t=this;return this.items.findIndex((function(r){return r[t.identifierName]==e}))}},{key:"getOne",value:function(e,t){var r=this.getIndex(e);if(-1===r)throw new Error("No item with identifier ".concat(e));var n=this.items[r];return n=Object.assign({},n),t&&t.embed&&this.server&&(n=this._itemEmbedder(t.embed)(n)),n}},{key:"addOne",value:function(e){var t=e[this.identifierName];if(void 0!==t){if(-1!==this.getIndex(t))throw new Error("An item with the identifier ".concat(t," already exists"));this.sequence=Math.max(this.sequence,t)+1}else e[this.identifierName]=this.sequence++;return this.items.push(e),Object.assign({},e)}},{key:"updateOne",value:function(e,t){var r=this.getIndex(e);if(-1===r)throw new Error("No item with identifier ".concat(e));for(var n in t)this.items[r][n]=t[n];return Object.assign({},this.items[r])}},{key:"removeOne",value:function(e){var t=this.getIndex(e);if(-1===t)throw new Error("No item with identifier ".concat(e));var r=this.items[t];return this.items.splice(t,1),e==this.sequence-1&&this.sequence--,r}}])&&a(t.prototype,r),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,"obj",null),v(this,"server",null),v(this,"name",null),!(t instanceof Object))throw new Error("Can't initialize a Single with anything except an object");this.obj=t}var t,r,n;return t=e,(r=[{key:"setServer",value:function(e){this.server=e}},{key:"setName",value:function(e){this.name=e}},{key:"_oneToManyEmbedder",value:function(e){var t=this;return function(r){if(null==t.server)throw new Error("Can't embed references without a server");var n=t.server.collections[e];if(!n)throw new Error("Can't embed a non-existing collection ".concat(e));return r[e]=n.getAll({filter:function(t){return-1!==r[e].indexOf(t[n.identifierName])}}),r}}},{key:"_manyToOneEmbedder",value:function(e){var t=this,r=e+"s",n=e+"_id";return function(o){if(null==t.server)throw new Error("Can't embed references without a server");var i=t.server.collections[r];if(!i)throw new Error("Can't embed a non-existing collection ".concat(e));try{o[e]=i.getOne(o[n])}catch(e){}return o}}},{key:"_itemEmbedder",value:function(e){var t=this,r=(Array.isArray(e)?e:[e]).map((function(e){return e.endsWith("s")?t._oneToManyEmbedder(e):t._manyToOneEmbedder(e)}));return function(e){return r.reduce((function(e,t){return t(e)}),e)}}},{key:"getOnly",value:function(e){var t=this.obj;return e&&e.embed&&this.server&&(t=Object.assign({},t),t=this._itemEmbedder(e.embed)(t)),t}},{key:"updateOnly",value:function(e){for(var t in e)this.obj[t]=e[t];return this.obj}}])&&h(t.prototype,r),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);u=!0);}catch(e){a=!0,o=e}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||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 m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e){if(!e)return{};var t={};return e.split("&").map((function(e){if(-1===e.indexOf("="))t[e]=!0;else{var r=g(e.split("="),2),n=r[0],o=r[1];0!==o.indexOf("[")&&0!==o.indexOf("{")||(o=JSON.parse(o)),t[n.trim()]=o}})),t}function x(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){a=!0,i=e},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw i}}}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var S=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";O(this,e),A(this,"baseUrl",null),A(this,"loggingEnabled",!1),A(this,"defaultQuery",(function(){})),A(this,"batchUrl",null),A(this,"collections",{}),A(this,"singles",{}),A(this,"requestInterceptors",[]),A(this,"responseInterceptors",[]),this.baseUrl=t}var t,r,n;return t=e,r=[{key:"init",value:function(e){for(var t in e)Array.isArray(e[t])?this.addCollection(t,new d(e[t],"id")):this.addSingle(t,new b(e[t]))}},{key:"toggleLogging",value:function(){this.loggingEnabled=!this.loggingEnabled}},{key:"setDefaultQuery",value:function(e){this.defaultQuery=e}},{key:"setBatchUrl",value:function(e){this.batchUrl=e}},{key:"setBatch",value:function(e){console.warn("Server.setBatch() is deprecated, use Server.setBatchUrl() instead"),this.batchUrl=e}},{key:"addCollection",value:function(e,t){this.collections[e]=t,t.setServer(this),t.setName(e)}},{key:"getCollection",value:function(e){return this.collections[e]}},{key:"getCollectionNames",value:function(){return Object.keys(this.collections)}},{key:"addSingle",value:function(e,t){this.singles[e]=t,t.setServer(this),t.setName(e)}},{key:"getSingle",value:function(e){return this.singles[e]}},{key:"getSingleNames",value:function(){return Object.keys(this.singles)}},{key:"addRequestInterceptor",value:function(e){this.requestInterceptors.push(e)}},{key:"addResponseInterceptor",value:function(e){this.responseInterceptors.push(e)}},{key:"getCount",value:function(e,t){return this.collections[e].getCount(t)}},{key:"getAll",value:function(e,t){return this.collections[e].getAll(t)}},{key:"getOne",value:function(e,t,r){return this.collections[e].getOne(t,r)}},{key:"addOne",value:function(e,t){return this.collections.hasOwnProperty(e)||this.addCollection(e,new d([],"id")),this.collections[e].addOne(t)}},{key:"updateOne",value:function(e,t,r){return this.collections[e].updateOne(t,r)}},{key:"removeOne",value:function(e,t){return this.collections[e].removeOne(t)}},{key:"getOnly",value:function(e,t){return this.singles[e].getOnly()}},{key:"updateOnly",value:function(e,t){return this.singles[e].updateOnly(t)}},{key:"decode",value:function(e){if(e.queryString=decodeURIComponent(e.url.slice(e.url.indexOf("?")+1)),e.params=j(e.queryString),e.requestBody)try{e.json=JSON.parse(e.requestBody)}catch(e){}return this.requestInterceptors.reduce((function(e,t){return t(e)}),e)}},{key:"respond",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200;t||(t={}),t["Content-Type"]||(t["Content-Type"]="application/json");var o={status:n,headers:t,body:e};return o=this.responseInterceptors.reduce((function(e,t){return t(e,r)}),o),this.log(r,o),r.respond(o.status,o.headers,JSON.stringify(o.body))}},{key:"log",value:function(e,t){this.loggingEnabled&&(console.group?(console.groupCollapsed(e.method,e.url,"(FakeRest)"),console.group("request"),console.log(e.method,e.url),console.log("headers",e.requestHeaders),console.log("body ",e.requestBody),console.groupEnd(),console.group("response",t.status),console.log("headers",t.headers),console.log("body ",t.body),console.groupEnd(),console.groupEnd()):(console.log("FakeRest request ",e.method,e.url,"headers",e.requestHeaders,"body",e.requestBody),console.log("FakeRest response",t.status,"headers",t.headers,"body",t.body)))}},{key:"batch",value:function(e){var t=e.json,r=this.handle.bind(this),n=Object.keys(t).reduce((function(e,n){var o,i={url:t[n],method:"GET",params:{},respond:function(e,t,r){o={code:e,headers:Object.keys(t||{}).map((function(e){return{name:e,value:t[e]}})),body:r||{}}}};return r(i),e[n]=o||{code:404,headers:[],body:{}},e}),{});return this.respond(n,{},e,200)}},{key:"handle",value:function(e){if(e=this.decode(e),this.batchUrl&&this.batchUrl===e.url&&"POST"===e.method)return this.batch(e);var t,r=x(this.getSingleNames());try{for(r.s();!(t=r.n()).done;){var n=t.value;if(e.url.match(new RegExp("^"+this.baseUrl+"\\/("+n+")(\\/?.*)?$"))){if("GET"==e.method)try{var o=this.getOnly(n);return this.respond(o,null,e)}catch(t){return e.respond(404)}if("PUT"==e.method)try{var i=this.updateOnly(n,e.json);return this.respond(i,null,e)}catch(t){return e.respond(404)}if("PATCH"==e.method)try{var u=this.updateOnly(n,e.json);return this.respond(u,null,e)}catch(t){return e.respond(404)}}}}catch(e){r.e(e)}finally{r.f()}var a=e.url.match(new RegExp("^"+this.baseUrl+"\\/([^\\/?]+)(\\/(\\d+))?(\\?.*)?$"));if(a){var c=a[1],s=Object.assign({},this.defaultQuery(c),e.params);if(a[2]){if(!this.getCollection(c))return;var f=a[3];if("GET"==e.method)try{var l=this.getOne(c,f,s);return this.respond(l,null,e)}catch(t){return e.respond(404)}if("PUT"==e.method)try{var p=this.updateOne(c,f,e.json);return this.respond(p,null,e)}catch(t){return e.respond(404)}if("PATCH"==e.method)try{var y=this.updateOne(c,f,e.json);return this.respond(y,null,e)}catch(t){return e.respond(404)}if("DELETE"==e.method)try{var d=this.removeOne(c,f);return this.respond(d,null,e)}catch(t){return e.respond(404)}}else{if("GET"==e.method){if(!this.getCollection(c))return;var h,v,b,g=this.getCount(c,s.filter?{filter:s.filter}:{});if(g>0){h=this.getAll(c,s);var m=s.range?s.range[0]:0,j=s.range?Math.min(h.length-1+m,s.range[1]):h.length-1;v="items ".concat(m,"-").concat(j,"/").concat(g),b=h.length==g?200:206}else h=[],v="items */0",b=200;return this.respond(h,{"Content-Range":v},e,b)}if("POST"==e.method){var _=this.addOne(c,e.json),O=this.baseUrl+"/"+c+"/"+_[this.getCollection(c).identifierName];return this.respond(_,{Location:O},e,201)}}}}},{key:"getHandler",value:function(){return this.handle.bind(this)}}],r&&w(t.prototype,r),n&&w(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function k(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){a=!0,i=e},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw i}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},q(e,t)}function I(e){var t=function(){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(e){return!1}}();return function(){var r,n=R(e);if(t){var o=R(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return U(this,r)}}function U(e,t){if(t&&("object"===E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}(i,e);var t,r,n,o=I(i);function i(){return T(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"decode",value:function(e,t){var r=this,n="string"==typeof e?new Request(e,t):e;return n.queryString=decodeURIComponent(n.url.slice(n.url.indexOf("?")+1)),n.params=j(n.queryString),n.text().then((function(e){n.requestBody=e;try{n.requestJson=JSON.parse(e)}catch(e){}})).then((function(){return r.requestInterceptors.reduce((function(e,t){return t(e)}),n)}))}},{key:"respond",value:function(e,t){return e=this.responseInterceptors.reduce((function(e,r){return r(e,t)}),e),this.log(t,e),e.headers=new Headers(e.headers),e}},{key:"log",value:function(e,t){this.loggingEnabled&&(console.group?(console.groupCollapsed(e.method,e.url,"(FakeRest)"),console.group("request"),console.log(e.method,e.url),console.log("headers",e.headers),console.log("body ",e.requestBody),console.groupEnd(),console.group("response",t.status),console.log("headers",t.headers),console.log("body ",t.body),console.groupEnd(),console.groupEnd()):(console.log("FakeRest request ",e.method,e.url,"headers",e.headers,"body",e.requestBody),console.log("FakeRest response",t.status,"headers",t.headers,"body",t.body)))}},{key:"batch",value:function(e){throw new Error("not implemented")}},{key:"handle",value:function(e,t){var r=this;return this.decode(e,t).then((function(e){var t={headers:{"Content-Type":"application/json"},status:200};if(r.batchUrl&&r.batchUrl===e.url&&"POST"===e.method)return r.batch(e);var n,o=k(r.getSingleNames());try{for(o.s();!(n=o.n()).done;){var i=n.value;if(e.url.match(new RegExp("^"+r.baseUrl+"\\/("+i+")(\\/?.*)?$"))){if("GET"==e.method){try{t.body=r.getOnly(i)}catch(e){reponse.status=404}return r.respond(t,e)}if("PUT"==e.method){try{t.body=r.updateOnly(i,e.requestJson)}catch(e){reponse.status=404}return r.respond(t,e)}if("PATCH"==e.method){try{t.body=r.updateOnly(i,e.requestJson)}catch(e){reponse.status=404}return r.respond(t,e)}}}}catch(e){o.e(e)}finally{o.f()}var u,a=k(r.getCollectionNames());try{for(a.s();!(u=a.n()).done;){var c=u.value,s=e.url.match(new RegExp("^"+r.baseUrl+"\\/("+c+")(\\/(\\d+))?(\\?.*)?$"));if(s){var f=Object.assign({},r.defaultQuery(c),e.params);if(s[2]){var l=s[3];if("GET"==e.method){try{t.body=r.getOne(c,l,f)}catch(e){t.status=404}return r.respond(t,e)}if("PUT"==e.method){try{t.body=r.updateOne(c,l,e.requestJson)}catch(e){t.status=404}return r.respond(t,e)}if("PATCH"==e.method){try{t.body=r.updateOne(c,l,e.requestJson)}catch(e){t.status=404}return r.respond(t,e)}if("DELETE"==e.method){try{t.body=r.removeOne(c,l)}catch(e){t.status=404}return r.respond(t,e)}}else{if("GET"==e.method){var p=r.getCount(c,f.filter?{filter:f.filter}:{});if(p>0){var y=r.getAll(c,f),d=f.range?f.range[0]:0,h=f.range?Math.min(y.length-1+d,f.range[1]):y.length-1;t.body=y,t.headers["Content-Range"]="items ".concat(d,"-").concat(h,"/").concat(p),t.status=y.length==p?200:206}else t.body=[],t.headers["Content-Range"]="items */0";return r.respond(t,e)}if("POST"==e.method){var v=r.addOne(c,e.requestJson),b=r.baseUrl+"/"+c+"/"+v[r.getCollection(c).identifierName];return t.body=v,t.headers.Location=b,t.status=201,r.respond(t,e)}}}}}catch(e){a.e(e)}finally{a.f()}return r.respond(t,e)}))}}])&&P(t.prototype,r),n&&P(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(S),$={Server:S,FetchServer:N,Collection:d,Single:b}}(),n}()})); | ||
//# sourceMappingURL=FakeRest.min.js.map |
{ | ||
"name": "fakerest", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"repository": "https://github.com/marmelab/FakeRest", | ||
@@ -5,0 +5,0 @@ "description": "Patch XMLHttpRequest to fake a REST server based on JSON data. ", |
@@ -265,2 +265,48 @@ # FakeRest [![Build Status](https://travis-ci.org/marmelab/FakeRest.svg?branch=master)](https://travis-ci.org/marmelab/FakeRest) | ||
## Supported Filters | ||
Operators are specified as suffixes on each filtered field. For instance, applying the `_lte` operator on the `price` field for the `books` resource is done by like this: | ||
GET /books?filter={"price_lte":20} // return books where price is less than or equal to 20 | ||
- `_eq`: check for equality on simple values: | ||
GET /books?filter={"price_eq":20} // return books where price is equal to 20 | ||
- `_neq`: check for inequality on simple values | ||
GET /books?filter={"price_neq":20} // return books where price is not equal to 20 | ||
- `_eq_any`: check for equality on any passed values | ||
GET /books?filter={"price_eq_any":[20, 30]} // return books where price is equal to 20 or 30 | ||
- `_neq_any`: check for inequality on any passed values | ||
GET /books?filter={"price_neq_any":[20, 30]} // return books where price is not equal to 20 nor 30 | ||
- `_inc_any`: check for items that includes any of the passed values | ||
GET /books?filter={"authors_inc_any":['William Gibson', 'Pat Cadigan']} // return books where authors includes either 'William Gibson' or 'Pat Cadigan' or both | ||
- `_q`: check for items that contains the provided text | ||
GET /books?filter={"author_q":['Gibson']} // return books where author includes 'Gibson' not considering the other fields | ||
- `_lt`: check for items that has a value lower than the provided value | ||
GET /books?filter={"price_lte":100} // return books that have a price lower that 100 | ||
- `_lte`: check for items that has a value lower or equal than the provided value | ||
GET /books?filter={"price_lte":100} // return books that have a price lower or equal to 100 | ||
- `_gt`: check for items that has a value greater than the provided value | ||
GET /books?filter={"price_gte":100} // return books that have a price greater that 100 | ||
- `_gte`: check for items that has a value greater or equal than the provided value | ||
GET /books?filter={"price_gte":100} // return books that have a price greater or equal to 100 | ||
## Usage and Configuration | ||
@@ -267,0 +313,0 @@ |
@@ -57,2 +57,8 @@ import get from 'lodash/get'; | ||
} | ||
if (key.indexOf("_neq_any") !== -1) { | ||
// not equal to any | ||
let realKey = key.replace(/(_neq_any)$/, ""); | ||
let finalValue = Array.isArray(value) ? value : [value]; | ||
return (item) => finalValue.every((val) => get(item, realKey) != val); | ||
} | ||
if (key.indexOf('_neq') !== -1) { | ||
@@ -63,2 +69,31 @@ // not equal | ||
} | ||
if (key.indexOf("_eq_any") !== -1) { | ||
// equal any | ||
let realKey = key.replace(/(_eq_any)$/, ""); | ||
let finalValue = Array.isArray(value) ? value : [value]; | ||
return (item) => finalValue.some((val) => get(item, realKey) == val); | ||
} | ||
if (key.indexOf('_eq') !== -1) { | ||
// equal | ||
let realKey = key.replace(/(_eq)$/, ''); | ||
return item => get(item, realKey) == value; | ||
} | ||
if (key.indexOf('_inc_any') !== -1) { | ||
// include any | ||
let realKey = key.replace(/(_inc_any)$/, ""); | ||
let finalValue = Array.isArray(value) ? value : [value]; | ||
return item => finalValue.some(val => get(item, realKey).includes(val)); | ||
} | ||
if (key.indexOf('_inc') !== -1) { | ||
// includes all | ||
let realKey = key.replace(/(_inc)$/, ""); | ||
let finalValue = Array.isArray(value) ? value : [value]; | ||
return item => finalValue.every(val => get(item, realKey).includes(val)); | ||
} | ||
if (key.indexOf('_ninc_any') !== -1) { | ||
// does not include any | ||
let realKey = key.replace(/(_ninc_any)$/, ""); | ||
let finalValue = Array.isArray(value) ? value : [value]; | ||
return item => finalValue.every(val => !get(item, realKey).includes(val)); | ||
} | ||
if (Array.isArray(value)) { | ||
@@ -65,0 +100,0 @@ return item => { |
@@ -378,2 +378,50 @@ import expect from "expect"; | ||
it("should filter by equality using _eq", () => { | ||
const collection = new Collection([{ v: 1 }, { v: 2 }, { v: 3 }]); | ||
expect(collection.getAll({ filter: { v_eq: 2 } })).toEqual([ | ||
{ v: 2, id: 1 }, | ||
]); | ||
}); | ||
it("should filter using _eq_any", () => { | ||
const collection = new Collection([{ v: 1 }, { v: 2 }, { v: 3 }]); | ||
expect(collection.getAll({ filter: { v_eq_any: [1, 3] } })).toEqual([ | ||
{ v: 1, id: 0 }, | ||
{ v: 3, id: 2 }, | ||
]); | ||
}); | ||
it("should filter using _neq_any", () => { | ||
const collection = new Collection([{ v: 1 }, { v: 2 }, { v: 3 }]); | ||
expect(collection.getAll({ filter: { v_neq_any: [1, 3] } })).toEqual([ | ||
{ v: 2, id: 1 }, | ||
]); | ||
}); | ||
it("should filter using _inc_any", () => { | ||
const collection = new Collection([{ v: [1, 2] }, { v: [2, 4] }, { v: [3, 1] }]); | ||
expect(collection.getAll({ filter: { v_inc_any: [1, 3] } })).toEqual([ | ||
{ v: [1, 2], id: 0 }, | ||
{ v: [3, 1], id: 2 }, | ||
]); | ||
}); | ||
it("should filter using _ninc_any", () => { | ||
const collection = new Collection([{ v: [1, 2] }, { v: [2, 4] }, { v: [3, 1] }]); | ||
expect(collection.getAll({ filter: { v_ninc_any: [1, 3] } })).toEqual([ | ||
{ v: [2, 4], id: 1 }, | ||
]); | ||
}); | ||
it("should filter using _inc", () => { | ||
const collection = new Collection([ | ||
{ v: [1, 2] }, | ||
{ v: [2, 4] }, | ||
{ v: [3, 1] }, | ||
]); | ||
expect(collection.getAll({ filter: { v_inc: [1, 3] } })).toEqual([ | ||
{ v: [3, 1], id: 2 }, | ||
]); | ||
}); | ||
it("should filter by text search using _q", () => { | ||
@@ -380,0 +428,0 @@ const collection = new Collection([{ v: 'abCd' }, { v: 'cDef' }, { v: 'EFgh' }]); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
838627
8522
389