var n=function(n,r,t,e,o,i,u,f){if(!n){var c;if(void 0===r)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=[t,e,o,i,u,f],d=0;(c=new Error(r.replace(/%s/g,(function(){return a[d++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}};const r=function(n){return"function"==typeof n},t=function(n){return n.toString()},e=function(n){return n},o=function(n){return null===n};function i(t,i,u){void 0===i&&(i=e),n(r(i)||o(i),"Expected payloadCreator to be a function, undefined or null");var f=o(i)||i===e?e:function(n){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];return n instanceof Error?n:i.apply(void 0,[n].concat(t))},c=r(u),a=t.toString(),d=function(){var n=f.apply(void 0,arguments),r={type:t};return n instanceof Error&&(r.error=!0),void 0!==n&&(r.payload=n),c&&(r.meta=u.apply(void 0,arguments)),r};return d.toString=function(){return a},d}const u=function(n){if("object"!=typeof n||null===n)return!1;for(var r=n;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r},f=function(n){return"undefined"!=typeof Map&&n instanceof Map};function c(n){if(f(n))return Array.from(n.keys());if("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys)return Reflect.ownKeys(n);var r=Object.getOwnPropertyNames(n);return"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n))),r}function a(n,r){return f(r)?r.get(n):r[n]}const d=function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];var e="function"!=typeof r[r.length-1]&&r.pop(),o=r;if(void 0===e)throw new TypeError("The initial state may not be undefined. If you do not want to set a value for this reducer, you can use null instead of undefined.");return function(n,r){for(var t=arguments.length,i=Array(t>2?t-2:0),u=2;u<t;u++)i[u-2]=arguments[u];var f=void 0===n,c=void 0===r;return f&&c&&e?e:o.reduce((function(n,t){return t.apply(void 0,[n,r].concat(i))}),f&&!c&&e?e:n)}},v=(l=function(n){return(u(n)||f(n))&&(t=(r=c(n)).every((function(n){return"next"===n||"throw"===n})),!(r.length&&r.length<=2&&t));var r,t},function n(r,t,e,o){var i=void 0===t?{}:t,u=i.namespace,f=void 0===u?"/":u,d=i.prefix;return void 0===e&&(e={}),void 0===o&&(o=""),c(r).forEach((function(t){var i=function(n){return o||!d||d&&new RegExp("^"+d+f).test(n)?n:""+d+f+n}(function(n){var r;if(!o)return n;var t=n.toString().split("||"),e=o.split("||");return(r=[]).concat.apply(r,e.map((function(n){return t.map((function(r){return""+n+f+r}))}))).join("||")}(t)),u=a(t,r);l(u)?n(u,{namespace:f,prefix:d},e,i):e[i]=u})),e});var l;function s(o,i,l){void 0===l&&(l={}),n(u(o)||f(o),"Expected handlers to be a plain object.");var s=v(o,l),p=c(s).map((function(o){return function(o,i,f){void 0===i&&(i=e);var c=t(o).split("||");n(!(void 0===f),"defaultState for reducer handling "+c.join(", ")+" should be defined"),n(r(i)||u(i),"Expected reducer to be a function or object with next and throw reducers");var a=r(i)?[i,i]:[i.next,i.throw].map((function(n){return null==n?e:n})),d=a[0],v=a[1];return function(n,r){void 0===n&&(n=f);var e=r.type;return e&&-1!==c.indexOf(t(e))?(!0===r.error?v:d)(n,r):n}}(o,a(o,s),i)})),y=d.apply(void 0,p.concat([i]));return function(n,r){return void 0===n&&(n=i),y(n,r)}}export{n as b,i as c,s as h}