redux-rails
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -1,1 +0,1 @@ | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("redux")):"function"==typeof define&&define.amd?define(["redux"],r):"object"==typeof exports?exports["redux-rails"]=r(require("redux")):t["redux-rails"]=r(t.redux)}("undefined"!=typeof self?self:this,(function(t){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=108)}([function(t,r,e){var n=e(28)("wks"),o=e(20),i=e(1).Symbol,c="function"==typeof i;(t.exports=function(t){return n[t]||(n[t]=c&&i[t]||(c?i:o)("Symbol."+t))}).store=n},function(t,r){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,r,e){var n=e(6);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,r,e){var n=e(1),o=e(10),i=e(8),c=e(9),a=e(14),u=function(t,r,e){var s,f,l,d,p=t&u.F,v=t&u.G,h=t&u.S,y=t&u.P,g=t&u.B,b=v?n:h?n[r]||(n[r]={}):(n[r]||{}).prototype,m=v?o:o[r]||(o[r]={}),O=m.prototype||(m.prototype={});for(s in v&&(e=r),e)l=((f=!p&&b&&void 0!==b[s])?b:e)[s],d=g&&f?a(l,n):y&&"function"==typeof l?a(Function.call,l):l,b&&c(b,s,l,t&u.U),m[s]!=l&&i(m,s,d),y&&O[s]!=l&&(O[s]=l)};n.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,r,e){t.exports=!e(7)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,r,e){var n=e(2),o=e(47),i=e(37),c=Object.defineProperty;r.f=e(4)?Object.defineProperty:function(t,r,e){if(n(t),r=i(r,!0),n(e),o)try{return c(t,r,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[r]=e.value),t}},function(t,r){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,r){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,r,e){var n=e(5),o=e(19);t.exports=e(4)?function(t,r,e){return n.f(t,r,o(1,e))}:function(t,r,e){return t[r]=e,t}},function(t,r,e){var n=e(1),o=e(8),i=e(11),c=e(20)("src"),a=e(74),u=(""+a).split("toString");e(10).inspectSource=function(t){return a.call(t)},(t.exports=function(t,r,e,a){var s="function"==typeof e;s&&(i(e,"name")||o(e,"name",r)),t[r]!==e&&(s&&(i(e,c)||o(e,c,t[r]?""+t[r]:u.join(String(r)))),t===n?t[r]=e:a?t[r]?t[r]=e:o(t,r,e):(delete t[r],o(t,r,e)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[c]||a.call(this)}))},function(t,r){var e=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=e)},function(t,r){var e={}.hasOwnProperty;t.exports=function(t,r){return e.call(t,r)}},function(t,r,e){var n=e(39),o=e(22);t.exports=function(t){return n(o(t))}},function(t,r,e){var n=e(22);t.exports=function(t){return Object(n(t))}},function(t,r,e){var n=e(29);t.exports=function(t,r,e){if(n(t),void 0===r)return t;switch(e){case 1:return function(e){return t.call(r,e)};case 2:return function(e,n){return t.call(r,e,n)};case 3:return function(e,n,o){return t.call(r,e,n,o)}}return function(){return t.apply(r,arguments)}}},function(t,r){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,r,e){var n=e(30),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,r,e){var n=e(48),o=e(41);t.exports=Object.keys||function(t){return n(t,o)}},function(t,r,e){"use strict";var n=e(46),o=e(100),i=e(23),c=e(12);t.exports=e(70)(Array,"Array",(function(t,r){this._t=c(t),this._i=0,this._k=r}),(function(){var t=this._t,r=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,o(1)):o(0,"keys"==r?e:"values"==r?t[e]:[e,t[e]])}),"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},function(t,r){t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},function(t,r){var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},function(t,r){t.exports=!1},function(t,r){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,r){t.exports={}},function(t,r,e){for(var n=e(18),o=e(17),i=e(9),c=e(1),a=e(8),u=e(23),s=e(0),f=s("iterator"),l=s("toStringTag"),d=u.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},v=o(p),h=0;h<v.length;h++){var y,g=v[h],b=p[g],m=c[g],O=m&&m.prototype;if(O&&(O[f]||a(O,f,d),O[l]||a(O,l,g),u[g]=d,b))for(y in n)O[y]||i(O,y,n[y],!0)}},function(t,r,e){"use strict";var n=e(35),o={};o[e(0)("toStringTag")]="z",o+""!="[object z]"&&e(9)(Object.prototype,"toString",(function(){return"[object "+n(this)+"]"}),!0)},function(t,r,e){var n=e(13),o=e(17);e(103)("keys",(function(){return function(t){return o(n(t))}}))},function(t,r,e){var n=e(3),o=e(75),i=e(12),c=e(50),a=e(51);n(n.S,"Object",{getOwnPropertyDescriptors:function(t){for(var r,e,n=i(t),u=c.f,s=o(n),f={},l=0;s.length>l;)void 0!==(e=u(n,r=s[l++]))&&a(f,r,e);return f}})},function(t,r,e){var n=e(10),o=e(1),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,r){return i[t]||(i[t]=void 0!==r?r:{})})("versions",[]).push({version:n.version,mode:e(21)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,r){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,r){var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},function(t,r){r.f=Object.getOwnPropertySymbols},function(t,r){r.f={}.propertyIsEnumerable},function(t,r,e){"use strict";var n=e(1),o=e(11),i=e(4),c=e(3),a=e(9),u=e(77).KEY,s=e(7),f=e(28),l=e(34),d=e(20),p=e(0),v=e(53),h=e(52),y=e(78),g=e(54),b=e(2),m=e(6),O=e(13),x=e(12),S=e(37),E=e(19),j=e(55),P=e(80),_=e(50),w=e(31),I=e(5),A=e(17),D=_.f,T=I.f,R=P.f,C=n.Symbol,k=n.JSON,M=k&&k.stringify,U=p("_hidden"),L=p("toPrimitive"),N={}.propertyIsEnumerable,F=f("symbol-registry"),q=f("symbols"),G=f("op-symbols"),W=Object.prototype,H="function"==typeof C&&!!w.f,X=n.QObject,Y=!X||!X.prototype||!X.prototype.findChild,$=i&&s((function(){return 7!=j(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a}))?function(t,r,e){var n=D(W,r);n&&delete W[r],T(t,r,e),n&&t!==W&&T(W,r,n)}:T,V=function(t){var r=q[t]=j(C.prototype);return r._k=t,r},B=H&&"symbol"==typeof C.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof C},K=function(t,r,e){return t===W&&K(G,r,e),b(t),r=S(r,!0),b(e),o(q,r)?(e.enumerable?(o(t,U)&&t[U][r]&&(t[U][r]=!1),e=j(e,{enumerable:E(0,!1)})):(o(t,U)||T(t,U,E(1,{})),t[U][r]=!0),$(t,r,e)):T(t,r,e)},z=function(t,r){b(t);for(var e,n=y(r=x(r)),o=0,i=n.length;i>o;)K(t,e=n[o++],r[e]);return t},J=function(t){var r=N.call(this,t=S(t,!0));return!(this===W&&o(q,t)&&!o(G,t))&&(!(r||!o(this,t)||!o(q,t)||o(this,U)&&this[U][t])||r)},Q=function(t,r){if(t=x(t),r=S(r,!0),t!==W||!o(q,r)||o(G,r)){var e=D(t,r);return!e||!o(q,r)||o(t,U)&&t[U][r]||(e.enumerable=!0),e}},Z=function(t){for(var r,e=R(x(t)),n=[],i=0;e.length>i;)o(q,r=e[i++])||r==U||r==u||n.push(r);return n},tt=function(t){for(var r,e=t===W,n=R(e?G:x(t)),i=[],c=0;n.length>c;)!o(q,r=n[c++])||e&&!o(W,r)||i.push(q[r]);return i};H||(a((C=function(){if(this instanceof C)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),r=function(e){this===W&&r.call(G,e),o(this,U)&&o(this[U],t)&&(this[U][t]=!1),$(this,t,E(1,e))};return i&&Y&&$(W,t,{configurable:!0,set:r}),V(t)}).prototype,"toString",(function(){return this._k})),_.f=Q,I.f=K,e(38).f=P.f=Z,e(32).f=J,w.f=tt,i&&!e(21)&&a(W,"propertyIsEnumerable",J,!0),v.f=function(t){return V(p(t))}),c(c.G+c.W+c.F*!H,{Symbol:C});for(var rt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;rt.length>et;)p(rt[et++]);for(var nt=A(p.store),ot=0;nt.length>ot;)h(nt[ot++]);c(c.S+c.F*!H,"Symbol",{for:function(t){return o(F,t+="")?F[t]:F[t]=C(t)},keyFor:function(t){if(!B(t))throw TypeError(t+" is not a symbol!");for(var r in F)if(F[r]===t)return r},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),c(c.S+c.F*!H,"Object",{create:function(t,r){return void 0===r?j(t):z(j(t),r)},defineProperty:K,defineProperties:z,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:tt});var it=s((function(){w.f(1)}));c(c.S+c.F*it,"Object",{getOwnPropertySymbols:function(t){return w.f(O(t))}}),k&&c(c.S+c.F*(!H||s((function(){var t=C();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(Object(t))}))),"JSON",{stringify:function(t){for(var r,e,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);if(e=r=n[1],(m(r)||void 0!==t)&&!B(t))return g(r)||(r=function(t,r){if("function"==typeof e&&(r=e.call(this,t,r)),!B(r))return r}),n[1]=r,M.apply(k,n)}}),C.prototype[L]||e(8)(C.prototype,L,C.prototype.valueOf),l(C,"Symbol"),l(Math,"Math",!0),l(n.JSON,"JSON",!0)},function(t,r,e){var n=e(5).f,o=e(11),i=e(0)("toStringTag");t.exports=function(t,r,e){t&&!o(t=e?t:t.prototype,i)&&n(t,i,{configurable:!0,value:r})}},function(t,r,e){var n=e(15),o=e(0)("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=function(t){var r,e,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=Object(t),o))?e:i?n(r):"Object"==(c=n(r))&&"function"==typeof r.callee?"Arguments":c}},function(t,r,e){var n=e(6),o=e(1).document,i=n(o)&&n(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,r,e){var n=e(6);t.exports=function(t,r){if(!n(t))return t;var e,o;if(r&&"function"==typeof(e=t.toString)&&!n(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!n(o=e.call(t)))return o;if(!r&&"function"==typeof(e=t.toString)&&!n(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,r,e){var n=e(48),o=e(41).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},function(t,r,e){var n=e(15);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,r,e){var n=e(28)("keys"),o=e(20);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,r,e){e(52)("asyncIterator")},function(t,r,e){"use strict";var n,o,i=e(44),c=RegExp.prototype.exec,a=String.prototype.replace,u=c,s=(n=/a/,o=/b*/g,c.call(n,"a"),c.call(o,"a"),0!==n.lastIndex||0!==o.lastIndex),f=void 0!==/()??/.exec("")[1];(s||f)&&(u=function(t){var r,e,n,o,u=this;return f&&(e=new RegExp("^"+u.source+"$(?!\\s)",i.call(u))),s&&(r=u.lastIndex),n=c.call(u,t),s&&n&&(u.lastIndex=u.global?n.index+n[0].length:r),f&&n&&n.length>1&&a.call(n[0],e,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n}),t.exports=u},function(t,r,e){"use strict";var n=e(2);t.exports=function(){var t=n(this),r="";return t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),t.sticky&&(r+="y"),r}},function(t,r,e){"use strict";e(93);var n=e(2),o=e(44),i=e(4),c=/./.toString,a=function(t){e(9)(RegExp.prototype,"toString",t,!0)};e(7)((function(){return"/a/b"!=c.call({source:"a",flags:"b"})}))?a((function(){var t=n(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)})):"toString"!=c.name&&a((function(){return c.call(this)}))},function(t,r,e){var n=e(0)("unscopables"),o=Array.prototype;null==o[n]&&e(8)(o,n,{}),t.exports=function(t){o[n][t]=!0}},function(t,r,e){t.exports=!e(4)&&!e(7)((function(){return 7!=Object.defineProperty(e(36)("div"),"a",{get:function(){return 7}}).a}))},function(t,r,e){var n=e(11),o=e(12),i=e(49)(!1),c=e(40)("IE_PROTO");t.exports=function(t,r){var e,a=o(t),u=0,s=[];for(e in a)e!=c&&n(a,e)&&s.push(e);for(;r.length>u;)n(a,e=r[u++])&&(~i(s,e)||s.push(e));return s}},function(t,r,e){var n=e(12),o=e(16),i=e(76);t.exports=function(t){return function(r,e,c){var a,u=n(r),s=o(u.length),f=i(c,s);if(t&&e!=e){for(;s>f;)if((a=u[f++])!=a)return!0}else for(;s>f;f++)if((t||f in u)&&u[f]===e)return t||f||0;return!t&&-1}}},function(t,r,e){var n=e(32),o=e(19),i=e(12),c=e(37),a=e(11),u=e(47),s=Object.getOwnPropertyDescriptor;r.f=e(4)?s:function(t,r){if(t=i(t),r=c(r,!0),u)try{return s(t,r)}catch(t){}if(a(t,r))return o(!n.f.call(t,r),t[r])}},function(t,r,e){"use strict";var n=e(5),o=e(19);t.exports=function(t,r,e){r in t?n.f(t,r,o(0,e)):t[r]=e}},function(t,r,e){var n=e(1),o=e(10),i=e(21),c=e(53),a=e(5).f;t.exports=function(t){var r=o.Symbol||(o.Symbol=i?{}:n.Symbol||{});"_"==t.charAt(0)||t in r||a(r,t,{value:c.f(t)})}},function(t,r,e){r.f=e(0)},function(t,r,e){var n=e(15);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,r,e){var n=e(2),o=e(79),i=e(41),c=e(40)("IE_PROTO"),a=function(){},u=function(){var t,r=e(36)("iframe"),n=i.length;for(r.style.display="none",e(56).appendChild(r),r.src="javascript:",(t=r.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;n--;)delete u.prototype[i[n]];return u()};t.exports=Object.create||function(t,r){var e;return null!==t?(a.prototype=n(t),e=new a,a.prototype=null,e[c]=t):e=u(),void 0===r?e:o(e,r)}},function(t,r,e){var n=e(1).document;t.exports=n&&n.documentElement},function(t,r,e){var n=e(6),o=e(15),i=e(0)("match");t.exports=function(t){var r;return n(t)&&(void 0!==(r=t[i])?!!r:"RegExp"==o(t))}},function(t,r,e){var n=e(2),o=e(29),i=e(0)("species");t.exports=function(t,r){var e,c=n(t).constructor;return void 0===c||null==(e=n(c)[i])?r:o(e)}},function(t,r,e){"use strict";var n=e(60)(!0);t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},function(t,r,e){var n=e(30),o=e(22);t.exports=function(t){return function(r,e){var i,c,a=String(o(r)),u=n(e),s=a.length;return u<0||u>=s?t?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===s||(c=a.charCodeAt(u+1))<56320||c>57343?t?a.charAt(u):i:t?a.slice(u,u+2):c-56320+(i-55296<<10)+65536}}},function(t,r,e){"use strict";var n=e(35),o=RegExp.prototype.exec;t.exports=function(t,r){var e=t.exec;if("function"==typeof e){var i=e.call(t,r);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==n(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,r)}},function(t,r,e){"use strict";e(82);var n=e(9),o=e(8),i=e(7),c=e(22),a=e(0),u=e(43),s=a("species"),f=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e="ab".split(t);return 2===e.length&&"a"===e[0]&&"b"===e[1]}();t.exports=function(t,r,e){var d=a(t),p=!i((function(){var r={};return r[d]=function(){return 7},7!=""[t](r)})),v=p?!i((function(){var r=!1,e=/a/;return e.exec=function(){return r=!0,null},"split"===t&&(e.constructor={},e.constructor[s]=function(){return e}),e[d](""),!r})):void 0;if(!p||!v||"replace"===t&&!f||"split"===t&&!l){var h=/./[d],y=e(c,d,""[t],(function(t,r,e,n,o){return r.exec===u?p&&!o?{done:!0,value:h.call(r,e,n)}:{done:!0,value:t.call(e,r,n)}:{done:!1}})),g=y[0],b=y[1];n(String.prototype,t,g),o(RegExp.prototype,d,2==r?function(t,r){return b.call(t,this,r)}:function(t){return b.call(t,this)})}}},function(t,r,e){var n=e(2);t.exports=function(t,r,e,o){try{return o?r(n(e)[0],e[1]):r(e)}catch(r){var i=t.return;throw void 0!==i&&n(i.call(t)),r}}},function(t,r,e){var n=e(23),o=e(0)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||i[o]===t)}},function(t,r,e){var n=e(35),o=e(0)("iterator"),i=e(23);t.exports=e(10).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[n(t)]}},function(t,r,e){var n,o,i,c=e(14),a=e(86),u=e(56),s=e(36),f=e(1),l=f.process,d=f.setImmediate,p=f.clearImmediate,v=f.MessageChannel,h=f.Dispatch,y=0,g={},b=function(){var t=+this;if(g.hasOwnProperty(t)){var r=g[t];delete g[t],r()}},m=function(t){b.call(t.data)};d&&p||(d=function(t){for(var r=[],e=1;arguments.length>e;)r.push(arguments[e++]);return g[++y]=function(){a("function"==typeof t?t:Function(t),r)},n(y),y},p=function(t){delete g[t]},"process"==e(15)(l)?n=function(t){l.nextTick(c(b,t,1))}:h&&h.now?n=function(t){h.now(c(b,t,1))}:v?(i=(o=new v).port2,o.port1.onmessage=m,n=c(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(n=function(t){f.postMessage(t+"","*")},f.addEventListener("message",m,!1)):n="onreadystatechange"in s("script")?function(t){u.appendChild(s("script")).onreadystatechange=function(){u.removeChild(this),b.call(t)}}:function(t){setTimeout(c(b,t,1),0)}),t.exports={set:d,clear:p}},function(t,r,e){"use strict";var n=e(29);function o(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw TypeError("Bad Promise constructor");r=t,e=n})),this.resolve=n(r),this.reject=n(e)}t.exports.f=function(t){return new o(t)}},function(t,r,e){var n=e(0)("iterator"),o=!1;try{var i=[7][n]();i.return=function(){o=!0},Array.from(i,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!o)return!1;var e=!1;try{var i=[7],c=i[n]();c.next=function(){return{done:e=!0}},i[n]=function(){return c},t(i)}catch(t){}return e}},function(t,r,e){var n=e(3);n(n.S+n.F,"Object",{assign:e(94)})},function(t,r,e){"use strict";var n=e(21),o=e(3),i=e(9),c=e(8),a=e(23),u=e(101),s=e(34),f=e(102),l=e(0)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,r,e,v,h,y,g){u(e,r,v);var b,m,O,x=function(t){if(!d&&t in P)return P[t];switch(t){case"keys":case"values":return function(){return new e(this,t)}}return function(){return new e(this,t)}},S=r+" Iterator",E="values"==h,j=!1,P=t.prototype,_=P[l]||P["@@iterator"]||h&&P[h],w=_||x(h),I=h?E?x("entries"):w:void 0,A="Array"==r&&P.entries||_;if(A&&(O=f(A.call(new t)))!==Object.prototype&&O.next&&(s(O,S,!0),n||"function"==typeof O[l]||c(O,l,p)),E&&_&&"values"!==_.name&&(j=!0,w=function(){return _.call(this)}),n&&!g||!d&&!j&&P[l]||c(P,l,w),a[r]=w,a[S]=p,h)if(b={values:E?w:x("values"),keys:y?w:x("keys"),entries:I},g)for(m in b)m in P||i(P,m,b[m]);else o(o.P+o.F*(d||j),r,b);return b}},function(t,r,e){"use strict";var n=e(60)(!0);e(70)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,r=this._t,e=this._i;return e>=r.length?{value:void 0,done:!0}:(t=n(r,e),this._i+=t.length,{value:t,done:!1})}))},function(t,r,e){"use strict";var n=e(14),o=e(3),i=e(13),c=e(63),a=e(64),u=e(16),s=e(51),f=e(65);o(o.S+o.F*!e(68)((function(t){Array.from(t)})),"Array",{from:function(t){var r,e,o,l,d=i(t),p="function"==typeof this?this:Array,v=arguments.length,h=v>1?arguments[1]:void 0,y=void 0!==h,g=0,b=f(d);if(y&&(h=n(h,v>2?arguments[2]:void 0,2)),null==b||p==Array&&a(b))for(e=new p(r=u(d.length));r>g;g++)s(e,g,y?h(d[g],g):d[g]);else for(l=b.call(d),e=new p;!(o=l.next()).done;g++)s(e,g,y?c(l,h,[o.value,g],!0):o.value);return e.length=g,e}})},function(r,e){r.exports=t},function(t,r,e){t.exports=e(28)("native-function-to-string",Function.toString)},function(t,r,e){var n=e(38),o=e(31),i=e(2),c=e(1).Reflect;t.exports=c&&c.ownKeys||function(t){var r=n.f(i(t)),e=o.f;return e?r.concat(e(t)):r}},function(t,r,e){var n=e(30),o=Math.max,i=Math.min;t.exports=function(t,r){return(t=n(t))<0?o(t+r,0):i(t,r)}},function(t,r,e){var n=e(20)("meta"),o=e(6),i=e(11),c=e(5).f,a=0,u=Object.isExtensible||function(){return!0},s=!e(7)((function(){return u(Object.preventExtensions({}))})),f=function(t){c(t,n,{value:{i:"O"+ ++a,w:{}}})},l=t.exports={KEY:n,NEED:!1,fastKey:function(t,r){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,n)){if(!u(t))return"F";if(!r)return"E";f(t)}return t[n].i},getWeak:function(t,r){if(!i(t,n)){if(!u(t))return!0;if(!r)return!1;f(t)}return t[n].w},onFreeze:function(t){return s&&l.NEED&&u(t)&&!i(t,n)&&f(t),t}}},function(t,r,e){var n=e(17),o=e(31),i=e(32);t.exports=function(t){var r=n(t),e=o.f;if(e)for(var c,a=e(t),u=i.f,s=0;a.length>s;)u.call(t,c=a[s++])&&r.push(c);return r}},function(t,r,e){var n=e(5),o=e(2),i=e(17);t.exports=e(4)?Object.defineProperties:function(t,r){o(t);for(var e,c=i(r),a=c.length,u=0;a>u;)n.f(t,e=c[u++],r[e]);return t}},function(t,r,e){var n=e(12),o=e(38).f,i={}.toString,c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return c&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return c.slice()}}(t):o(n(t))}},function(t,r,e){"use strict";var n=e(57),o=e(2),i=e(58),c=e(59),a=e(16),u=e(61),s=e(43),f=e(7),l=Math.min,d=[].push,p=!f((function(){RegExp(4294967295,"y")}));e(62)("split",2,(function(t,r,e,f){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var o=String(this);if(void 0===t&&0===r)return[];if(!n(t))return e.call(o,t,r);for(var i,c,a,u=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,p=void 0===r?4294967295:r>>>0,v=new RegExp(t.source,f+"g");(i=s.call(v,o))&&!((c=v.lastIndex)>l&&(u.push(o.slice(l,i.index)),i.length>1&&i.index<o.length&&d.apply(u,i.slice(1)),a=i[0].length,l=c,u.length>=p));)v.lastIndex===i.index&&v.lastIndex++;return l===o.length?!a&&v.test("")||u.push(""):u.push(o.slice(l)),u.length>p?u.slice(0,p):u}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:e.call(this,t,r)}:e,[function(e,n){var o=t(this),i=null==e?void 0:e[r];return void 0!==i?i.call(e,o,n):v.call(String(o),e,n)},function(t,r){var n=f(v,t,this,r,v!==e);if(n.done)return n.value;var s=o(t),d=String(this),h=i(s,RegExp),y=s.unicode,g=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(p?"y":"g"),b=new h(p?s:"^(?:"+s.source+")",g),m=void 0===r?4294967295:r>>>0;if(0===m)return[];if(0===d.length)return null===u(b,d)?[d]:[];for(var O=0,x=0,S=[];x<d.length;){b.lastIndex=p?x:0;var E,j=u(b,p?d:d.slice(x));if(null===j||(E=l(a(b.lastIndex+(p?0:x)),d.length))===O)x=c(d,x,y);else{if(S.push(d.slice(O,x)),S.length===m)return S;for(var P=1;P<=j.length-1;P++)if(S.push(j[P]),S.length===m)return S;x=O=E}}return S.push(d.slice(O)),S}]}))},function(t,r,e){"use strict";var n=e(43);e(3)({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},function(t,r,e){"use strict";var n,o,i,c,a=e(21),u=e(1),s=e(14),f=e(35),l=e(3),d=e(6),p=e(29),v=e(84),h=e(85),y=e(58),g=e(66).set,b=e(87)(),m=e(67),O=e(88),x=e(89),S=e(90),E=u.TypeError,j=u.process,P=j&&j.versions,_=P&&P.v8||"",w=u.Promise,I="process"==f(j),A=function(){},D=o=m.f,T=!!function(){try{var t=w.resolve(1),r=(t.constructor={})[e(0)("species")]=function(t){t(A,A)};return(I||"function"==typeof PromiseRejectionEvent)&&t.then(A)instanceof r&&0!==_.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(t){}}(),R=function(t){var r;return!(!d(t)||"function"!=typeof(r=t.then))&&r},C=function(t,r){if(!t._n){t._n=!0;var e=t._c;b((function(){for(var n=t._v,o=1==t._s,i=0,c=function(r){var e,i,c,a=o?r.ok:r.fail,u=r.resolve,s=r.reject,f=r.domain;try{a?(o||(2==t._h&&U(t),t._h=1),!0===a?e=n:(f&&f.enter(),e=a(n),f&&(f.exit(),c=!0)),e===r.promise?s(E("Promise-chain cycle")):(i=R(e))?i.call(e,u,s):u(e)):s(n)}catch(t){f&&!c&&f.exit(),s(t)}};e.length>i;)c(e[i++]);t._c=[],t._n=!1,r&&!t._h&&k(t)}))}},k=function(t){g.call(u,(function(){var r,e,n,o=t._v,i=M(t);if(i&&(r=O((function(){I?j.emit("unhandledRejection",o,t):(e=u.onunhandledrejection)?e({promise:t,reason:o}):(n=u.console)&&n.error&&n.error("Unhandled promise rejection",o)})),t._h=I||M(t)?2:1),t._a=void 0,i&&r.e)throw r.v}))},M=function(t){return 1!==t._h&&0===(t._a||t._c).length},U=function(t){g.call(u,(function(){var r;I?j.emit("rejectionHandled",t):(r=u.onrejectionhandled)&&r({promise:t,reason:t._v})}))},L=function(t){var r=this;r._d||(r._d=!0,(r=r._w||r)._v=t,r._s=2,r._a||(r._a=r._c.slice()),C(r,!0))},N=function(t){var r,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw E("Promise can't be resolved itself");(r=R(t))?b((function(){var n={_w:e,_d:!1};try{r.call(t,s(N,n,1),s(L,n,1))}catch(t){L.call(n,t)}})):(e._v=t,e._s=1,C(e,!1))}catch(t){L.call({_w:e,_d:!1},t)}}};T||(w=function(t){v(this,w,"Promise","_h"),p(t),n.call(this);try{t(s(N,this,1),s(L,this,1))}catch(t){L.call(this,t)}},(n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=e(91)(w.prototype,{then:function(t,r){var e=D(y(this,w));return e.ok="function"!=typeof t||t,e.fail="function"==typeof r&&r,e.domain=I?j.domain:void 0,this._c.push(e),this._a&&this._a.push(e),this._s&&C(this,!1),e.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new n;this.promise=t,this.resolve=s(N,t,1),this.reject=s(L,t,1)},m.f=D=function(t){return t===w||t===c?new i(t):o(t)}),l(l.G+l.W+l.F*!T,{Promise:w}),e(34)(w,"Promise"),e(92)("Promise"),c=e(10).Promise,l(l.S+l.F*!T,"Promise",{reject:function(t){var r=D(this);return(0,r.reject)(t),r.promise}}),l(l.S+l.F*(a||!T),"Promise",{resolve:function(t){return S(a&&this===c?w:this,t)}}),l(l.S+l.F*!(T&&e(68)((function(t){w.all(t).catch(A)}))),"Promise",{all:function(t){var r=this,e=D(r),n=e.resolve,o=e.reject,i=O((function(){var e=[],i=0,c=1;h(t,!1,(function(t){var a=i++,u=!1;e.push(void 0),c++,r.resolve(t).then((function(t){u||(u=!0,e[a]=t,--c||n(e))}),o)})),--c||n(e)}));return i.e&&o(i.v),e.promise},race:function(t){var r=this,e=D(r),n=e.reject,o=O((function(){h(t,!1,(function(t){r.resolve(t).then(e.resolve,n)}))}));return o.e&&n(o.v),e.promise}})},function(t,r){t.exports=function(t,r,e,n){if(!(t instanceof r)||void 0!==n&&n in t)throw TypeError(e+": incorrect invocation!");return t}},function(t,r,e){var n=e(14),o=e(63),i=e(64),c=e(2),a=e(16),u=e(65),s={},f={};(r=t.exports=function(t,r,e,l,d){var p,v,h,y,g=d?function(){return t}:u(t),b=n(e,l,r?2:1),m=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(i(g)){for(p=a(t.length);p>m;m++)if((y=r?b(c(v=t[m])[0],v[1]):b(t[m]))===s||y===f)return y}else for(h=g.call(t);!(v=h.next()).done;)if((y=o(h,b,v.value,r))===s||y===f)return y}).BREAK=s,r.RETURN=f},function(t,r){t.exports=function(t,r,e){var n=void 0===e;switch(r.length){case 0:return n?t():t.call(e);case 1:return n?t(r[0]):t.call(e,r[0]);case 2:return n?t(r[0],r[1]):t.call(e,r[0],r[1]);case 3:return n?t(r[0],r[1],r[2]):t.call(e,r[0],r[1],r[2]);case 4:return n?t(r[0],r[1],r[2],r[3]):t.call(e,r[0],r[1],r[2],r[3])}return t.apply(e,r)}},function(t,r,e){var n=e(1),o=e(66).set,i=n.MutationObserver||n.WebKitMutationObserver,c=n.process,a=n.Promise,u="process"==e(15)(c);t.exports=function(){var t,r,e,s=function(){var n,o;for(u&&(n=c.domain)&&n.exit();t;){o=t.fn,t=t.next;try{o()}catch(n){throw t?e():r=void 0,n}}r=void 0,n&&n.enter()};if(u)e=function(){c.nextTick(s)};else if(!i||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var f=a.resolve(void 0);e=function(){f.then(s)}}else e=function(){o.call(n,s)};else{var l=!0,d=document.createTextNode("");new i(s).observe(d,{characterData:!0}),e=function(){d.data=l=!l}}return function(n){var o={fn:n,next:void 0};r&&(r.next=o),t||(t=o,e()),r=o}}},function(t,r){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,r,e){var n=e(1).navigator;t.exports=n&&n.userAgent||""},function(t,r,e){var n=e(2),o=e(6),i=e(67);t.exports=function(t,r){if(n(t),o(r)&&r.constructor===t)return r;var e=i.f(t);return(0,e.resolve)(r),e.promise}},function(t,r,e){var n=e(9);t.exports=function(t,r,e){for(var o in r)n(t,o,r[o],e);return t}},function(t,r,e){"use strict";var n=e(1),o=e(5),i=e(4),c=e(0)("species");t.exports=function(t){var r=n[t];i&&r&&!r[c]&&o.f(r,c,{configurable:!0,get:function(){return this}})}},function(t,r,e){e(4)&&"g"!=/./g.flags&&e(5).f(RegExp.prototype,"flags",{configurable:!0,get:e(44)})},function(t,r,e){"use strict";var n=e(4),o=e(17),i=e(31),c=e(32),a=e(13),u=e(39),s=Object.assign;t.exports=!s||e(7)((function(){var t={},r={},e=Symbol(),n="abcdefghijklmnopqrst";return t[e]=7,n.split("").forEach((function(t){r[t]=t})),7!=s({},t)[e]||Object.keys(s({},r)).join("")!=n}))?function(t,r){for(var e=a(t),s=arguments.length,f=1,l=i.f,d=c.f;s>f;)for(var p,v=u(arguments[f++]),h=l?o(v).concat(l(v)):o(v),y=h.length,g=0;y>g;)p=h[g++],n&&!d.call(v,p)||(e[p]=v[p]);return e}:s},function(t,r,e){"use strict";var n=e(2),o=e(13),i=e(16),c=e(30),a=e(59),u=e(61),s=Math.max,f=Math.min,l=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g;e(62)("replace",2,(function(t,r,e,v){return[function(n,o){var i=t(this),c=null==n?void 0:n[r];return void 0!==c?c.call(n,i,o):e.call(String(i),n,o)},function(t,r){var o=v(e,t,this,r);if(o.done)return o.value;var l=n(t),d=String(this),p="function"==typeof r;p||(r=String(r));var y=l.global;if(y){var g=l.unicode;l.lastIndex=0}for(var b=[];;){var m=u(l,d);if(null===m)break;if(b.push(m),!y)break;""===String(m[0])&&(l.lastIndex=a(d,i(l.lastIndex),g))}for(var O,x="",S=0,E=0;E<b.length;E++){m=b[E];for(var j=String(m[0]),P=s(f(c(m.index),d.length),0),_=[],w=1;w<m.length;w++)_.push(void 0===(O=m[w])?O:String(O));var I=m.groups;if(p){var A=[j].concat(_,P,d);void 0!==I&&A.push(I);var D=String(r.apply(void 0,A))}else D=h(j,d,P,_,I,r);P>=S&&(x+=d.slice(S,P)+D,S=P+j.length)}return x+d.slice(S)}];function h(t,r,n,i,c,a){var u=n+t.length,s=i.length,f=p;return void 0!==c&&(c=o(c),f=d),e.call(a,f,(function(e,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return r.slice(0,n);case"'":return r.slice(u);case"<":a=c[o.slice(1,-1)];break;default:var f=+o;if(0===f)return e;if(f>s){var d=l(f/10);return 0===d?e:d<=s?void 0===i[d-1]?o.charAt(1):i[d-1]+o.charAt(1):e}a=i[f-1]}return void 0===a?"":a}))}}))},function(t,r,e){"use strict";var n=e(3),o=e(49)(!0);n(n.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),e(46)("includes")},function(t,r,e){"use strict";var n=e(3),o=e(98);n(n.P+n.F*e(99)("includes"),"String",{includes:function(t){return!!~o(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,r,e){var n=e(57),o=e(22);t.exports=function(t,r,e){if(n(r))throw TypeError("String#"+e+" doesn't accept regex!");return String(o(t))}},function(t,r,e){var n=e(0)("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[n]=!1,!"/./"[t](r)}catch(t){}}return!0}},function(t,r){t.exports=function(t,r){return{value:r,done:!!t}}},function(t,r,e){"use strict";var n=e(55),o=e(19),i=e(34),c={};e(8)(c,e(0)("iterator"),(function(){return this})),t.exports=function(t,r,e){t.prototype=n(c,{next:o(1,e)}),i(t,r+" Iterator")}},function(t,r,e){var n=e(11),o=e(13),i=e(40)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),n(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},function(t,r,e){var n=e(3),o=e(10),i=e(7);t.exports=function(t,r){var e=(o.Object||{})[t]||Object[t],c={};c[t]=r(e),n(n.S+n.F*i((function(){e(1)})),"Object",c)}},function(t,r,e){"use strict";var n=e(3),o=e(105)(5),i=!0;"find"in[]&&Array(1).find((function(){i=!1})),n(n.P+n.F*i,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),e(46)("find")},function(t,r,e){var n=e(14),o=e(39),i=e(13),c=e(16),a=e(106);t.exports=function(t,r){var e=1==t,u=2==t,s=3==t,f=4==t,l=6==t,d=5==t||l,p=r||a;return function(r,a,v){for(var h,y,g=i(r),b=o(g),m=n(a,v,3),O=c(b.length),x=0,S=e?p(r,O):u?p(r,0):void 0;O>x;x++)if((d||x in b)&&(y=m(h=b[x],x,g),t))if(e)S[x]=y;else if(y)switch(t){case 3:return!0;case 5:return h;case 6:return x;case 2:S.push(h)}else if(f)return!1;return l?-1:s||f?f:S}}},function(t,r,e){var n=e(107);t.exports=function(t,r){return new(n(t))(r)}},function(t,r,e){var n=e(6),o=e(54),i=e(0)("species");t.exports=function(t){var r;return o(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!o(r.prototype)||(r=void 0),n(r)&&null===(r=r[i])&&(r=void 0)),void 0===r?Array:r}},function(t,r,e){"use strict";e.r(r);e(27),e(42),e(33),e(81),e(83),e(45),e(69),e(95),e(96),e(97),e(24),e(18),e(25),e(26);var n=0,o=function(t){var r=t.resourceConfig,e=t.config,n=t.defaultConfig,o=void 0===n?{}:n;return u(r.optimisticUpdateEnabled)?r.optimisticUpdateEnabled:u(e.resources.optimisticUpdateEnabled)?e.resources.optimisticUpdateEnabled:u(e.optimisticUpdateEnabled)?e.optimisticUpdateEnabled:!u(o.optimisticUpdateEnabled)||o.optimisticUpdateEnabled},i=function(t){var r=t.controller;return"s"===r[r.length-1]?"collection":"member"},c=function(t){var r=t.config,e=t.resource,n=r.resources[e].controller;return"collection"===i({controller:n})?"models":"attributes"},a=function(t){var r=t.config,e=t.resource;return r.resources[e].idAttribute||"id"},u=function(t){return"boolean"==typeof t},s=function(t){var r=t.config,e=t.store;return"function"==typeof r?r(e):r};function f(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var e=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(e.push(c.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function d(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var v={},h={SHOW:"GET",INDEX:"GET",CREATE:"POST",UPDATE:"PUT",DESTROY:"DELETE"},y=function(t,r){return"".concat(t,"=").concat(encodeURIComponent(r))},g=function(t,r){return Array.isArray(r)?function(t,r){return r.map((function(r){return y("".concat(t,"[]"),r)}))}(t,r):y(t,r)},b=function(t){var r,e=t.baseUrl,n=t.controller,o=t.railsAction,c=t.data,a=t.queryParams,u=void 0===a?{}:a,s=i({controller:n}),f=function(t){return t.includes("/:id/")}(n),l=function(){return f||"collection"===s&&"INDEX"!==o&&"CREATE"!==o?"/".concat(c.id):""},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,e=Object.keys(t).filter((function(r){return void 0!==t[r]||null!==t[r]}));if(0===e.length||"GET"!==h[r])return"";var n=e.map((function(r){return g(r,t[r])})).join("&");return"?".concat(n)}(u,o);return r=f?"".concat(e).concat(n).replace("/:id",l()):"".concat(e).concat(n).concat(l()),"".concat(r).concat(d)},m=function(t){var r=t.store,e=t.resource,n=t.railsAction,o=t.error,i=t.id,c=t.cId,a=t.optimisticUpdateEnabled,u=t.reject,s={type:"".concat(e,".").concat(n,"_ERROR"),error:o,id:i,cId:c},f="CREATE"===n;r.dispatch(s),["CREATE","UPDATE"].includes(n)&&a&&r.dispatch({type:"".concat(e,".UNSET_OPTIMISTIC_DATA"),id:i,cId:c,destroy:f}),u(s)},O=function(t){var r,e=t.store,c=t.resource,u=t.config,s=t.data,f=void 0===s?{}:s,l=t.railsAction,d=t.controllerOverride,v=t.fetchParamsOverride,y=t.queryParamsOverride,g=t.resolve,E=t.reject,j=u.resources[c],P=j.baseUrl||u.baseUrl,_=d||j.controller,w=a({config:u,resource:c}),I=v||j.fetchParams||u.fetchParams,A=y||j.queryParams||u.queryParams,D=function(t){var r=t.railsAction,e=(t.resource,t.config,t.data),n=t.fetchParams,o=void 0===n?{}:n,i=h[r],c=new Headers(o.headers||{}),a=Object.assign({},o,{method:i,headers:c});return"object"===p(e)&&"GET"!==i&&(a.body=JSON.stringify(e)),a}({railsAction:l,resource:c,data:f,config:u,fetchParams:I}),T=b({baseUrl:P,controller:_,railsAction:l,data:f,fetchParams:I,queryParams:A}),R=o({resourceConfig:j,config:u});"CREATE"===l&&(r=++n,e.dispatch({type:"".concat(c,".ASSIGN_CID"),cId:r}),e.dispatch({type:"".concat(c,".SET_LOADING"),cId:r})),["CREATE","UPDATE"].includes(l)&&R&&e.dispatch({type:"".concat(c,".SET_OPTIMISTIC_DATA"),id:f.id,cId:r,data:f}),fetch(T,D).then((function(t){t.json().then((function(n){var o=n&&n[w]||f.id;if(!t.ok)return m({store:e,resource:c,railsAction:l,id:o,cId:r,optimisticUpdateEnabled:R,reject:E,error:n.error||{message:t.statusText}});!function(t){var r=t.store,e=t.resource,n=t.railsAction,o=t.id,c=t.cId,a=t.json,u=t.config,s=t.controller,f=t.resolve,l="".concat(e,".").concat(n,"_SUCCESS"),d=S({json:a,resource:e,config:u,resourceType:i({controller:s})}),p=d.response,v={cId:c,id:o,metaData:d.metaData,response:p,type:l};r.dispatch(v),f(v)}({store:e,resource:c,railsAction:l,id:o,cId:r,json:n,config:u,controller:_,optimisticUpdateEnabled:R,resolve:g})})).catch((function(t){var n=t&&t.toString&&t.toString();m({store:e,resource:c,railsAction:l,error:n,id:f.id,cId:r,optimisticUpdateEnabled:R,reject:E})}))})).catch((function(t){m({store:e,resource:c,railsAction:l,error:t,id:f.id,cId:r,optimisticUpdateEnabled:R,reject:E})})).then((function(){return function(t){var r=t.resource,e=x({resource:r});e.shift(),e.length>0&&O(e[0])}({resource:c})}))},x=function(t){var r=t.resource;return v[r]||(v[r]={queue:[]}),v[r].queue},S=function(t){var r,e=t.json,n=t.resource,o=t.config,i=t.resourceType,c=o.resources[n].parse,a=o.resources[n].setMetadata,u={};switch(p(c)){case"object":var s=c&&c[i];if(!s){r=e;break}r=s(e);break;case"function":r=c(e);break;default:r=e}switch(p(a)){case"object":var f=a&&a[i];if(!f)break;u=f(e);break;case"function":u=a(e);break;default:u={}}return{response:r,metaData:u}},E=function(t){var r=t.action,e=t.config,n=t.fetchData,o=t.next,i=t.resource,c=t.resourceConfig,a=new Promise((function(t,r){var o=function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?l(Object(e),!0).forEach((function(r){d(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):l(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}({resolve:t,reject:r},n);(e.disableFetchQueueing||c.disableFetchQueueing)&&O(o),function(t,r){var e=x({resource:t});e.push(r),e.length<=1&&O(r)}(i,o)}));return o(r),a},j=function(t){return function(r){return function(e){return function(n){var o=s({config:t,store:r.getState()}),i=f(n.type.split("."),2),c=i[0],a=i[1],u=n.data,l=n.controller,d=n.fetchParams,p=(u||{}).queryParams,v={store:r,resource:c,config:o,data:u,railsAction:a,controllerOverride:l,fetchParamsOverride:d,queryParamsOverride:p},y=o.resources[c];return y&&h[a]?E({action:n,config:o,fetchData:v,next:e,resource:c,resourceConfig:y}):e(n)}}}},P=(e(71),e(72),e(73));e(104);function _(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function w(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function I(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?w(Object(e),!0).forEach((function(r){A(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):w(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function A(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var D={loading:!1,loadingError:void 0,__prevData:void 0},T=function(t){var r,e,n=t.id,o=t.cId,i=t.state;return(i.models&&i.models.slice(0)||[]).find((function(t){return r=void 0!==t.id,e=void 0!==o,r&&t.id===n||e&&t.cId===o}))},R=function(t){var r=t.id,e=t.cId,n=t.metaData,o=t.attributes,i={id:r,cId:e,attributes:I({},void 0===o?{}:o)};return Object.keys(i).forEach((function(t){return void 0===i[t]?delete i[t]:""})),I({},D,{},n,{},i)},C=function(t){var r=t.metaData,e=t.models;return I({},D,{},r,{models:void 0===e?[]:e})},k=function(t){var r=t.state,e=t.model,n=r.models||[];return[].concat(_(n),[e])},M=function(t){var r,e,n=t.id,o=t.cId,i=t.state,c=t.updatedModel;return(i.models&&i.models.slice(0)||[]).map((function(t){return r=void 0!==t.id,e=void 0!==o,r&&t.id===n||e&&t.cId===o?c:t}))},U=function(t){var r,e=t.id,n=t.data,o=t.metaData,i=t.state,c=t.cId,a=t.replaceAttributes,u=void 0===a||a,s=(t.replaceMeta,T({id:e,cId:c,state:i}));return s?(r=u?n:I({},s.attributes,{},n),!c&&s.cId&&(c=s.cId),M({id:e,cId:c,state:i,updatedModel:R({id:e,cId:c,metaData:o,attributes:r})})):k({state:i,model:R({id:e,cId:c,metaData:o,attributes:n})})},L=function(t){var r=t.id;return t.state.models.filter((function(t){return t.id!==r}))},N=function(t){var r=t.cId;return t.state.models.filter((function(t){return t.cId!==r}))},F=function(t){var r=t.id,e=t.cId,n=t.state,o=t.queryParams,i=T({id:r,cId:e,state:n});return i?M({id:r,cId:e,state:n,updatedModel:R({id:r,cId:e,metaData:{loading:!0,queryParams:o},attributes:i.attributes})}):k({state:n,model:R({id:r,cId:e,metaData:{loading:!0,queryParams:o}})})},q=function(t){var r=t.id,e=t.cId,n=t.state,o=t.error,i=T({id:r,cId:e,state:n});return i||r?i?M({id:r,state:n,cId:e,updatedModel:R(I({},i,{metaData:{loadingError:o,__prevData:i.__prevData}}))}):k({state:n,model:R({id:r,metaData:{loadingError:o}})}):n.models.slice(0)},G=function(t){var r,e=t.config,n=t.resource,o=c({config:e,resource:n}),i="attributes"===o,u=e.resources[n]||{},s=a({config:e,resource:n});return i?(r=u[o]?u[s]||u.attributes[s]:void 0,R({id:r,idAttribute:s,attributes:u.attributes})):C({models:(u.models||[]).map((function(t){return R({idAttribute:s,id:t[s],attributes:t})}))})};function W(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function H(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function X(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?H(Object(e),!0).forEach((function(r){Y(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):H(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function Y(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var $=function(t){var r=s({config:t}),e={};return Object.keys(r.resources).forEach((function(t){e[t]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G({config:r,resource:t}),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.resources[t]||{},i=c({config:r,resource:t}),u="attributes"===i,s=a({config:r,resource:t}),f=n.data||{},l=f.queryParams;switch(n.type){case"".concat(t,".INDEX"):var d=o.paginated;return X({},e,{},C({metaData:{loading:!0,queryParams:l},models:d?e.models:[]}));case"".concat(t,".INDEX_SUCCESS"):var p=n.response,v=n.metaData,h=n.response[t]||n.response[t.toLowerCase()];if(!Array.isArray(n.response)){if(!h||!Array.isArray(h))return console.error("Response to INDEX actions must be of type array OR contain a top-level key matching the resource name with an array as the value. You can use the parse method(s) set in your config for this resource to transform returned data if needed."),X({},e,{},C({metaData:{loading:!1,loadingError:"Bad data received from server. INDEX calls expect an array."}}));p=h}if(o.paginated){var y=p.reduce((function(t,r){return X({},t,Y({},r.id,r))}),{}),g=e.models.map((function(t){return t.attributes})),b={},m=g.map((function(t){return y[t.id]?(b[t.id]=!0,y[t.id]):t}));p=[].concat(W(m),W(p.filter((function(t){return!b[t.id]}))))}return X({},e,{},C({models:p.map((function(t){return R({id:t[s],attributes:t})})),metaData:v}));case"".concat(t,".INDEX_ERROR"):var O=n.error;return X({},e,{},C({metaData:{loading:!1,loadingError:O}}));case"".concat(t,".SHOW"):var x=n.data||{},S=x.id;return u?R({metaData:{loading:!0,queryParams:l},attributes:e.attributes}):X({},e,{},{models:F({id:S,state:e,queryParams:l})});case"".concat(t,".SHOW_SUCCESS"):var E=n.id,j=n.response,P=n.metaData,_=j;return u?R({id:E,metaData:P,attributes:X({},e.attributes,{},_)}):X({},e,{},C({models:U({id:E,data:_,state:e,metaData:X({loading:!1},P)})}));case"".concat(t,".SHOW_ERROR"):var w=n.id,I=n.error;return u?R({id:w,attributes:X({},e.attributes),metaData:{loadingError:I}}):X({},e,{},{models:q({state:e,id:w,error:I})});case"".concat(t,".ASSIGN_CID"):var A=n.cId;return u?R({cId:A}):C({models:U({cId:A,state:e})});case"".concat(t,".CREATE_SUCCESS"):var k=n.cId,M=n.id,H=n.response,$=n.metaData,V=H;return u?R({id:M,cId:k,attributes:X({},e.attributes,{},V),metaData:$}):C({models:U({data:V,state:e,id:M,cId:k,metaData:$})});case"".concat(t,".CREATE_ERROR"):var B=n.id,K=n.cId,z=n.error;return u?R({id:B,cId:K,metaData:{loadingError:z}}):X({},e,{},{models:q({state:e,id:B,cId:K,error:z})});case"".concat(t,".UPDATE"):var J=n.data||{},Q=J.id,Z=e.__prevData;return u?R({id:Q,metaData:{loading:!0,__prevData:Z},attributes:e.attributes}):X({},e,{},{models:F({id:Q,state:e})});case"".concat(t,".UPDATE_SUCCESS"):var tt=n.id,rt=n.metaData,et=n.response,nt=et;return u?R({id:tt,attributes:X({},e.attributes,{},nt),metaData:rt}):X({},e,{},{models:U({id:tt,data:nt,metaData:rt,state:e,replaceAttributes:!1})});case"".concat(t,".UPDATE_ERROR"):var ot=n.id,it=n.error;return u?R({id:ot,attributes:e.attributes,metaData:{loadingError:it}}):X({},e,{},{models:q({state:e,id:ot,error:it})});case"".concat(t,".DESTROY"):var ct=n.data||{},at=ct.id||e.id;return u?R({id:at,attributes:e.attributes,metaData:{loading:!0}}):X({},e,{},{models:F({idAttribute:s,id:at,state:e})});case"".concat(t,".DESTROY_SUCCESS"):var ut=n.id;return u?null:X({},e,{},{models:L({idAttribute:s,id:ut,state:e})});case"".concat(t,".DESTROY_ERROR"):var st=n.id,ft=n.error;return X({},e,{},u?{loading:!1,loadingError:ft}:{models:q({state:e,id:st,idAttribute:s,error:ft})});case"".concat(t,".SET_LOADING"):var lt=n.id,dt=n.cId;return X({},e,{},u?{loading:!0,loadingError:void 0}:{models:F({idAttribute:s,id:lt,cId:dt,state:e})});case"".concat(t,".SET_OPTIMISTIC_DATA"):var pt,vt=n.id,ht=n.cId,yt=n.data,gt=u?e:T({id:vt,cId:ht,state:e}),bt=X({},gt.attributes),mt={};return Object.keys(D).forEach((function(t){mt[t]=gt[t]})),pt=X({},mt,{__prevData:bt}),u?R({id:vt,cId:ht,attributes:X({},gt.attributes,{},yt),metaData:pt}):C({models:U({data:yt,state:e,id:vt,cId:ht,metaData:pt})});case"".concat(t,".UNSET_OPTIMISTIC_DATA"):var Ot=n.id,xt=n.cId,St=n.destroy,Et=u?e:T({id:Ot,cId:xt,state:e});return St&&u?null:St?X({},e,{},{models:N({cId:xt,state:e})}):u?R({id:Ot,cId:xt,attributes:Et.__prevData}):C({models:U({data:Et.__prevData,state:e,id:Ot,cId:xt})});default:var jt=r.resources[t];return jt&&jt.reducer?jt.reducer(e,n):e}}})),Object(P.combineReducers)(e)};function V(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function B(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?V(Object(e),!0).forEach((function(r){K(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):V(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function K(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var z={index:function(t){var r=t.resource,e=t.controller,n=t.queryParams;return{type:"".concat(r,".INDEX"),data:{queryParams:n},controller:e}},show:function(t){var r=t.id,e=t.resource,n=t.controller,o=t.queryParams;return{type:"".concat(e,".SHOW"),data:{id:r,queryParams:o},controller:n}},update:function(t){var r=t.id,e=t.attributes,n=t.resource,o=t.controller;return{type:"".concat(n,".UPDATE"),data:B({id:r},e),controller:o}},create:function(t){var r=t.resource,e=t.attributes,n=t.controller;return{type:"".concat(r,".CREATE"),data:e,controller:n}},destroy:function(t){var r=t.id,e=t.resource,n=t.controller;return{type:"".concat(e,".DESTROY"),data:{id:r},controller:n}}},J=function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];var n=s({config:r[0]})||{},i=Object.assign({},n,{resources:Object.assign({},n.resources)});return r.map((function(t){var r=s({config:t});if(r.resources){var e={};return Object.keys(r.resources||{}).forEach((function(t){var i=r.resources[t];"baseUrl"===t&&"string"==typeof i||"optimisticUpdateEnabled"===t&&u(i)||(e[t]=Object.assign({},i,{baseUrl:i.baseUrl||r.resources.baseUrl||n.baseUrl,optimisticUpdateEnabled:o({resourceConfig:i,config:r,defaultConfig:n})}))})),e}})).filter((function(t){return void 0!==t})).forEach((function(t){Object.keys(t).forEach((function(r){var e=t[r];i.resources[r]=Object.assign({},e)}))})),i};e.d(r,"apiReducer",(function(){return $})),e.d(r,"combineConfigs",(function(){return J})),e.d(r,"middleWare",(function(){return j})),e.d(r,"railsActions",(function(){return z}))}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("redux")):"function"==typeof define&&define.amd?define(["redux"],t):"object"==typeof exports?exports["redux-rails"]=t(require("redux")):e["redux-rails"]=t(e.redux)}("undefined"!=typeof self?self:this,(function(e){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(a,o,function(t){return e[t]}.bind(null,o));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t),r.d(t,"apiReducer",(function(){return x})),r.d(t,"combineConfigs",(function(){return k})),r.d(t,"middleWare",(function(){return D})),r.d(t,"railsActions",(function(){return N}));let a=0;const o=({resourceConfig:e,config:t,defaultConfig:r={}})=>d(e.optimisticUpdateEnabled)?e.optimisticUpdateEnabled:d(t.resources.optimisticUpdateEnabled)?t.resources.optimisticUpdateEnabled:d(t.optimisticUpdateEnabled)?t.optimisticUpdateEnabled:!d(r.optimisticUpdateEnabled)||r.optimisticUpdateEnabled,s=({controller:e})=>"s"===e[e.length-1]?"collection":"member",i=({config:e,resource:t})=>{const r=e.resources[t].controller;return"collection"===s({controller:r})?"models":"attributes"},c=({config:e,resource:t})=>e.resources[t].idAttribute||"id",d=e=>"boolean"==typeof e,n=({config:e,store:t})=>"function"==typeof e?e(t):e;let u={};const l={SHOW:"GET",INDEX:"GET",CREATE:"POST",UPDATE:"PUT",DESTROY:"DELETE"},m=(e,t)=>`${e}=${encodeURIComponent(t)}`,f=(e,t)=>Array.isArray(t)?((e,t)=>t.map(t=>m(e+"[]",t)))(e,t):m(e,t),p=({baseUrl:e,controller:t,railsAction:r,data:a,queryParams:o={}})=>{const i=s({controller:t}),c=(e=>e.includes("/:id/"))(t),d=()=>c||"collection"===i&&"INDEX"!==r&&"CREATE"!==r?"/"+a.id:"",n=((e={},t)=>{const r=Object.keys(e).filter(t=>void 0!==e[t]||null!==e[t]);if(0===r.length||"GET"!==l[t])return"";return"?"+r.map(t=>f(t,e[t])).join("&")})(o,r);let u;return u=c?`${e}${t}`.replace("/:id",d()):`${e}${t}${d()}`,`${u}${n}`},b=({store:e,resource:t,railsAction:r,error:a,id:o,cId:s,optimisticUpdateEnabled:i,reject:c})=>{const d={type:`${t}.${r}_ERROR`,error:a,id:o,cId:s},n="CREATE"===r;e.dispatch(d),["CREATE","UPDATE"].includes(r)&&i&&e.dispatch({type:t+".UNSET_OPTIMISTIC_DATA",id:o,cId:s,destroy:n}),c(d)},E=({store:e,resource:t,config:r,data:i={},railsAction:d,controllerOverride:n,fetchParamsOverride:u,queryParamsOverride:m,resolve:f,reject:y})=>{const D=r.resources[t],A=D.baseUrl||r.baseUrl,h=n||D.controller,S=c({config:r,resource:t}),T=u||D.fetchParams||r.fetchParams,O=m||D.queryParams||r.queryParams,_=(({railsAction:e,resource:t,config:r,data:a,fetchParams:o={}})=>{const s=l[e],i=new Headers(o.headers||{});let c=Object.assign({},o,{method:s,headers:i});return"object"==typeof a&&"GET"!==s&&(c.body=JSON.stringify(a)),c})({railsAction:d,resource:t,data:i,config:r,fetchParams:T}),P=p({baseUrl:A,controller:h,railsAction:d,data:i,fetchParams:T,queryParams:O}),v=o({resourceConfig:D,config:r});let U;"CREATE"===d&&(U=++a,e.dispatch({type:t+".ASSIGN_CID",cId:U}),e.dispatch({type:t+".SET_LOADING",cId:U})),["CREATE","UPDATE"].includes(d)&&v&&e.dispatch({type:t+".SET_OPTIMISTIC_DATA",id:i.id,cId:U,data:i}),fetch(P,_).then(a=>{a.json().then(o=>{const c=o&&o[S]||i.id;if(!a.ok)return b({store:e,resource:t,railsAction:d,id:c,cId:U,optimisticUpdateEnabled:v,reject:y,error:o.error||{message:a.statusText}});(({store:e,resource:t,railsAction:r,id:a,cId:o,json:i,config:c,controller:d,resolve:n})=>{const u=`${t}.${r}_SUCCESS`,{response:l,metaData:m}=I({json:i,resource:t,config:c,resourceType:s({controller:d})}),f={cId:o,id:a,metaData:m,response:l,type:u};e.dispatch(f),n(f)})({store:e,resource:t,railsAction:d,id:c,cId:U,json:o,config:r,controller:h,optimisticUpdateEnabled:v,resolve:f})}).catch(r=>{const a=r&&r.toString&&r.toString();b({store:e,resource:t,railsAction:d,error:a,id:i.id,cId:U,optimisticUpdateEnabled:v,reject:y})})}).catch(r=>{b({store:e,resource:t,railsAction:d,error:r,id:i.id,cId:U,optimisticUpdateEnabled:v,reject:y})}).then(()=>(({resource:e})=>{const t=g({resource:e});t.shift(),t.length>0&&E(t[0])})({resource:t}))},g=({resource:e})=>(u[e]||(u[e]={queue:[]}),u[e].queue),I=({json:e,resource:t,config:r,resourceType:a})=>{const o=r.resources[t].parse,s=r.resources[t].setMetadata;let i,c={};switch(typeof o){case"object":{const t=o&&o[a];if(!t){i=e;break}i=t(e);break}case"function":i=o(e);break;default:i=e}switch(typeof s){case"object":{const t=s&&s[a];if(!t)break;c=t(e);break}case"function":c=s(e);break;default:c={}}return{response:i,metaData:c}},y=({action:e,config:t,fetchData:r,next:a,resource:o,resourceConfig:s})=>{const i=new Promise((e,a)=>{const i={resolve:e,reject:a,...r};(t.disableFetchQueueing||s.disableFetchQueueing)&&E(i),((e,t)=>{const r=g({resource:e});r.push(t),r.length<=1&&E(t)})(o,i)});return a(e),i};var D=e=>t=>r=>a=>{const o=n({config:e,store:t.getState()}),[s,i]=a.type.split("."),{data:c,controller:d,fetchParams:u}=a,{queryParams:m}=c||{},f={store:t,resource:s,config:o,data:c,railsAction:i,controllerOverride:d,fetchParamsOverride:u,queryParamsOverride:m},p=o.resources[s];return p&&l[i]?y({action:a,config:o,fetchData:f,next:r,resource:s,resourceConfig:p}):r(a)},A=r(0);const h={loading:!1,loadingError:void 0,__prevData:void 0},S=({id:e,cId:t,state:r})=>{let a,o;return(r.models&&r.models.slice(0)||[]).find(r=>(a=void 0!==r.id,o=void 0!==t,a&&r.id===e||o&&r.cId===t))},T=({id:e,cId:t,metaData:r,attributes:a={}})=>{let o={id:e,cId:t,attributes:{...a}};return Object.keys(o).forEach(e=>void 0===o[e]?delete o[e]:""),{...h,...r,...o}},O=({metaData:e,models:t=[]})=>({...h,...e,models:t}),_=({state:e,model:t})=>[...e.models||[],t],P=({id:e,cId:t,state:r,updatedModel:a})=>{let o,s;return(r.models&&r.models.slice(0)||[]).map(r=>(o=void 0!==r.id,s=void 0!==t,o&&r.id===e||s&&r.cId===t?a:r))},v=({id:e,data:t,metaData:r,state:a,cId:o,replaceAttributes:s=!0,replaceMeta:i=!0})=>{const c=S({id:e,cId:o,state:a});let d;return c?(d=s?t:{...c.attributes,...t},!o&&c.cId&&(o=c.cId),P({id:e,cId:o,state:a,updatedModel:T({id:e,cId:o,metaData:r,attributes:d})})):_({state:a,model:T({id:e,cId:o,metaData:r,attributes:t})})},U=({id:e,state:t})=>t.models.filter(t=>t.id!==e),j=({cId:e,state:t})=>t.models.filter(t=>t.cId!==e),C=({id:e,cId:t,state:r,queryParams:a})=>{const o=S({id:e,cId:t,state:r});return o?P({id:e,cId:t,state:r,updatedModel:T({id:e,cId:t,metaData:{loading:!0,queryParams:a},attributes:o.attributes})}):_({state:r,model:T({id:e,cId:t,metaData:{loading:!0,queryParams:a}})})},R=({id:e,cId:t,state:r,error:a})=>{const o=S({id:e,cId:t,state:r});return o||e?o?P({id:e,state:r,cId:t,updatedModel:T({...o,metaData:{loadingError:a,__prevData:o.__prevData}})}):_({state:r,model:T({id:e,metaData:{loadingError:a}})}):r.models.slice(0)},q=({config:e,resource:t})=>{const r=i({config:e,resource:t}),a="attributes"===r,o=e.resources[t]||{},s=c({config:e,resource:t});let d;return a?(d=o[r]?o[s]||o.attributes[s]:void 0,T({id:d,idAttribute:s,attributes:o.attributes})):O({models:(o.models||[]).map(e=>T({idAttribute:s,id:e[s],attributes:e}))})};var x=e=>{const t=n({config:e}),r={};return Object.keys(t.resources).forEach(e=>{r[e]=(r=q({config:t,resource:e}),a={})=>{const o=t.resources[e]||{},s="attributes"===i({config:t,resource:e}),d=c({config:t,resource:e}),{queryParams:n}=a.data||{};switch(a.type){case e+".INDEX":{const{paginated:e}=o;return{...r,...O({metaData:{loading:!0,queryParams:n},models:e?r.models:[]})}}case e+".INDEX_SUCCESS":{let{response:t,metaData:s}=a;const i=a.response[e]||a.response[e.toLowerCase()];if(!Array.isArray(a.response)){if(!i||!Array.isArray(i))return console.error("Response to INDEX actions must be of type array OR contain a top-level key matching the resource name with an array as the value. You can use the parse method(s) set in your config for this resource to transform returned data if needed."),{...r,...O({metaData:{loading:!1,loadingError:"Bad data received from server. INDEX calls expect an array."}})};t=i}if(o.paginated){const e=t.reduce((e,t)=>({...e,[t.id]:t}),{}),a=r.models.map(e=>e.attributes),o={};t=[...a.map(t=>e[t.id]?(o[t.id]=!0,e[t.id]):t),...t.filter(e=>!o[e.id])]}return{...r,...O({models:t.map(e=>T({id:e[d],attributes:e})),metaData:s})}}case e+".INDEX_ERROR":{const{error:e}=a;return{...r,...O({metaData:{loading:!1,loadingError:e}})}}case e+".SHOW":{const e=a.data||{},{id:t}=e;return s?T({metaData:{loading:!0,queryParams:n},attributes:r.attributes}):{...r,models:C({id:t,state:r,queryParams:n})}}case e+".SHOW_SUCCESS":{const{id:e,response:t,metaData:o}=a,i=t;return s?T({id:e,metaData:o,attributes:{...r.attributes,...i}}):{...r,...O({models:v({id:e,data:i,state:r,metaData:{loading:!1,...o}})})}}case e+".SHOW_ERROR":{const{id:e,error:t}=a;return s?T({id:e,attributes:{...r.attributes},metaData:{loadingError:t}}):{...r,models:R({state:r,id:e,error:t})}}case e+".ASSIGN_CID":{const{cId:e}=a;return s?T({cId:e}):O({models:v({cId:e,state:r})})}case e+".CREATE_SUCCESS":{const{cId:e,id:t,response:o,metaData:i}=a,c=o;return s?T({id:t,cId:e,attributes:{...r.attributes,...c},metaData:i}):O({models:v({data:c,state:r,id:t,cId:e,metaData:i})})}case e+".CREATE_ERROR":{const{id:e,cId:t,error:o}=a;return s?T({id:e,cId:t,metaData:{loadingError:o}}):{...r,models:R({state:r,id:e,cId:t,error:o})}}case e+".UPDATE":{const e=a.data||{},{id:t}=e,o=r.__prevData;return s?T({id:t,metaData:{loading:!0,__prevData:o},attributes:r.attributes}):{...r,models:C({id:t,state:r})}}case e+".UPDATE_SUCCESS":{const{id:e,metaData:t,response:o}=a,i=o;return s?T({id:e,attributes:{...r.attributes,...i},metaData:t}):{...r,models:v({id:e,data:i,metaData:t,state:r,replaceAttributes:!1})}}case e+".UPDATE_ERROR":{const{id:e,error:t}=a;return s?T({id:e,attributes:r.attributes,metaData:{loadingError:t}}):{...r,models:R({state:r,id:e,error:t})}}case e+".DESTROY":{const e=(a.data||{}).id||r.id;return s?T({id:e,attributes:r.attributes,metaData:{loading:!0}}):{...r,models:C({idAttribute:d,id:e,state:r})}}case e+".DESTROY_SUCCESS":{const{id:e}=a;return s?null:{...r,models:U({idAttribute:d,id:e,state:r})}}case e+".DESTROY_ERROR":{const{id:e,error:t}=a;return s?{...r,loading:!1,loadingError:t}:{...r,models:R({state:r,id:e,idAttribute:d,error:t})}}case e+".SET_LOADING":{const{id:e,cId:t}=a;return s?{...r,loading:!0,loadingError:void 0}:{...r,models:C({idAttribute:d,id:e,cId:t,state:r})}}case e+".SET_OPTIMISTIC_DATA":{const{id:e,cId:t,data:o}=a,i=s?r:S({id:e,cId:t,state:r}),c={...i.attributes};let d,n={};return Object.keys(h).forEach(e=>{n[e]=i[e]}),d={...n,__prevData:c},s?T({id:e,cId:t,attributes:{...i.attributes,...o},metaData:d}):O({models:v({data:o,state:r,id:e,cId:t,metaData:d})})}case e+".UNSET_OPTIMISTIC_DATA":{const{id:e,cId:t,destroy:o}=a,i=s?r:S({id:e,cId:t,state:r});return o&&s?null:o?{...r,models:j({cId:t,state:r})}:s?T({id:e,cId:t,attributes:i.__prevData}):O({models:v({data:i.__prevData,state:r,id:e,cId:t})})}default:{const o=t.resources[e];return o&&o.reducer?o.reducer(r,a):r}}}}),Object(A.combineReducers)(r)};var N={index:({resource:e,controller:t,queryParams:r})=>({type:e+".INDEX",data:{queryParams:r},controller:t}),show:({id:e,resource:t,controller:r,queryParams:a})=>({type:t+".SHOW",data:{id:e,queryParams:a},controller:r}),update:({id:e,attributes:t,resource:r,controller:a})=>({type:r+".UPDATE",data:{id:e,...t},controller:a}),create:({resource:e,attributes:t,controller:r})=>({type:e+".CREATE",data:t,controller:r}),destroy:({id:e,resource:t,controller:r})=>({type:t+".DESTROY",data:{id:e},controller:r})},k=(...e)=>{const t=n({config:e[0]})||{};let r=Object.assign({},t,{resources:Object.assign({},t.resources)});return e.map(e=>{const r=n({config:e});if(!r.resources)return;const a={};return Object.keys(r.resources||{}).forEach(e=>{const s=r.resources[e];"baseUrl"===e&&"string"==typeof s||"optimisticUpdateEnabled"===e&&d(s)||(a[e]=Object.assign({},s,{baseUrl:s.baseUrl||r.resources.baseUrl||t.baseUrl,optimisticUpdateEnabled:o({resourceConfig:s,config:r,defaultConfig:t})}))}),a}).filter(e=>void 0!==e).forEach(e=>{Object.keys(e).forEach(t=>{let a=e[t];r.resources[t]=Object.assign({},a)})}),r}}])})); |
{ | ||
"name": "redux-rails", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Redux and your server talking without fuss.", | ||
@@ -35,3 +35,2 @@ "main": "dist/redux-rails.js", | ||
"babel-polyfill": "^6.22.0", | ||
"es6-promise": "^4.0.5", | ||
"isomorphic-fetch": "^2.2.1", | ||
@@ -38,0 +37,0 @@ "jest": "^24.8.0", |
@@ -15,3 +15,2 @@ import { createStore, compose ,applyMiddleware } from 'redux' | ||
import nock from 'nock' | ||
require('es6-promise').polyfill(); | ||
require('isomorphic-fetch'); | ||
@@ -18,0 +17,0 @@ |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
711101
13
2
36
6753