Socket
Socket
Sign inDemoInstall

reduxed-chrome-storage

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reduxed-chrome-storage - npm Package Compare versions

Comparing version 1.0.12 to 1.1.0

41

lib/index.esm.js

@@ -26,3 +26,4 @@ import cloneDeep from 'lodash.clonedeep';

this.state = initialState;
this.buffStore = this.buffState0 = null;
this.buffStore = null;
this.lastState = null;
this.listeners = [];

@@ -39,3 +40,3 @@ this.dispatch = this.dispatch.bind(this);

).getState();
// Subscribe for changes in chrome.storage
// subscribe for changes in chrome.storage
this.storage.subscribe(data => {

@@ -51,4 +52,4 @@ if (isEqual(data, this.state))

return new Promise(resolve => {
// Try to restore the last state stored in chrome.storage, if any
this.storage.load(lastState => {
// try to restore the last state stored in chrome.storage, if any
this.storage.load(storedState => {
const mergeOrReplace = (data0, data) =>

@@ -60,4 +61,4 @@ typeof data0 === 'object' && !Array.isArray(data0)?

: data;
let state = lastState?
mergeOrReplace(defaultState, lastState) : defaultState;
let state = storedState?
mergeOrReplace(defaultState, storedState) : defaultState;
if (initialState) {

@@ -67,3 +68,3 @@ state = mergeOrReplace(state, initialState);

this.setState(state);
if (!isEqual(state, lastState)) {
if (!isEqual(state, storedState)) {
this.storage.save(state);

@@ -115,6 +116,8 @@ }

if (!this.buffStore) {
// this.buffStore is to be used with sync actions
this.buffStore = this.createStore(
this.reducer, this.state, this.enhancer
);
this.buffState0 = this.buffStore.getState();
// this.lastState is shared by both sync and async actions
this.lastState = this.buffStore.getState();
setTimeout(() => {

@@ -124,10 +127,22 @@ this.buffStore = null;

}
this.buffStore.subscribe(() => {
const state = this.buffStore.getState();
if (isEqual(state, this.buffState0))
// lastStore, holding an extra reference to the last created store, is to be used with async actions (e.g. via Redux Thunk);
// then when this.buffStore is reset to null this variable should still refer to the same store
let lastStore = this.buffStore;
// set up a one-time state change listener
const unsubscribe = lastStore.subscribe(() => {
// if this.buffStore is non-empty, use it for getting the current state,
// otherwise an async action is implied, so use lastStore instead
const state = (this.buffStore || lastStore).getState();
// we need a state change to be effective, so the current state should differ from the last saved one
if (isEqual(state, this.lastState))
return;
// save the current state in chrome.storage / update this.lastState
this.storage.save(state);
this.buffState0 = state;
this.lastState = state;
// as we already catched the 1st effective state change, we don't need this listener and lastStore anymore,
// so we unsubscribe the former and reset the latter in order to release the related resources
unsubscribe();
lastStore = null;
});
return this.buffStore.dispatch(action);
return lastStore.dispatch(action);
}

@@ -134,0 +149,0 @@ }

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).reduxedChromeStorage=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}var r=e((function(e,r){var n="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",a="[object Map]",u="[object Set]",c=/\w*$/,f=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,l={};l[n]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object DataView]"]=l["[object Boolean]"]=l["[object Date]"]=l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l[a]=l["[object Number]"]=l["[object Object]"]=l["[object RegExp]"]=l[u]=l["[object String]"]=l["[object Symbol]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l["[object Error]"]=l[o]=l["[object WeakMap]"]=!1;var h="object"==typeof self&&self&&self.Object===Object&&self,p="object"==typeof t&&t&&t.Object===Object&&t||h||Function("return this")(),_=r&&!r.nodeType&&r,y=_&&e&&!e.nodeType&&e,b=y&&y.exports===_;function v(t,e){return t.set(e[0],e[1]),t}function d(t,e){return t.add(e),t}function j(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function g(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function w(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function A(t,e){return function(r){return t(e(r))}}function m(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var O,S=Array.prototype,z=Function.prototype,x=Object.prototype,k=p["__core-js_shared__"],E=(O=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",F=z.toString,P=x.hasOwnProperty,U=x.toString,$=RegExp("^"+F.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=b?p.Buffer:void 0,M=p.Symbol,B=p.Uint8Array,D=A(Object.getPrototypeOf,Object),T=Object.create,L=x.propertyIsEnumerable,V=S.splice,R=Object.getOwnPropertySymbols,C=I?I.isBuffer:void 0,N=A(Object.keys,Object),W=yt(p,"DataView"),q=yt(p,"Map"),G=yt(p,"Promise"),K=yt(p,"Set"),H=yt(p,"WeakMap"),J=yt(Object,"create"),Q=gt(W),X=gt(q),Y=gt(G),Z=gt(K),tt=gt(H),et=M?M.prototype:void 0,rt=et?et.valueOf:void 0;function nt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){this.__data__=new ot(t)}function ut(t,e){var r=At(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&mt(t)}(t)&&P.call(t,"callee")&&(!L.call(t,"callee")||U.call(t)==n)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],o=r.length,i=!!o;for(var a in t)!e&&!P.call(t,a)||i&&("length"==a||dt(a,o))||r.push(a);return r}function ct(t,e,r){var n=t[e];P.call(t,e)&&wt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function ft(t,e){for(var r=t.length;r--;)if(wt(t[r][0],e))return r;return-1}function st(t,e,r,f,s,h,p){var _;if(f&&(_=h?f(t,s,h,p):f(t)),void 0!==_)return _;if(!zt(t))return t;var y=At(t);if(y){if(_=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&P.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,_)}else{var b=vt(t),A=b==o||b==i;if(Ot(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if("[object Object]"==b||b==n||A&&!h){if(g(t))return h?t:{};if(_=function(t){return"function"!=typeof t.constructor||jt(t)?{}:(e=D(t),zt(e)?T(e):{});var e}(A?{}:t),!e)return function(t,e){return pt(t,bt(t),e)}(t,function(t,e){return t&&pt(e,xt(e),t)}(_,t))}else{if(!l[b])return h?t:{};_=function(t,e,r,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return ht(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?ht(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);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 function(t,e){var r=e?ht(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case a:return function(t,e,r){return j(e?r(w(t),!0):w(t),v,new t.constructor)}(t,n,r);case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,c.exec(t));return e.lastIndex=t.lastIndex,e}(t);case u:return function(t,e,r){return j(e?r(m(t),!0):m(t),d,new t.constructor)}(t,n,r);case"[object Symbol]":return i=t,rt?Object(rt.call(i)):{}}var i}(t,b,st,e)}}p||(p=new at);var O=p.get(t);if(O)return O;if(p.set(t,_),!y)var S=r?function(t){return function(t,e,r){var n=e(t);return At(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,xt,bt)}(t):xt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(S||t,(function(n,o){S&&(n=t[o=n]),ct(_,o,st(n,e,r,f,o,t,p))})),_}function lt(t){return!(!zt(t)||(e=t,E&&E in e))&&(St(t)||g(t)?$:f).test(gt(t));var e}function ht(t){var e=new t.constructor(t.byteLength);return new B(e).set(new B(t)),e}function pt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;ct(r,a,void 0===u?t[a]:u)}return r}function _t(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function yt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return lt(r)?r:void 0}nt.prototype.clear=function(){this.__data__=J?J(null):{}},nt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},nt.prototype.get=function(t){var e=this.__data__;if(J){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return P.call(e,t)?e[t]:void 0},nt.prototype.has=function(t){var e=this.__data__;return J?void 0!==e[t]:P.call(e,t)},nt.prototype.set=function(t,e){return this.__data__[t]=J&&void 0===e?"__lodash_hash_undefined__":e,this},ot.prototype.clear=function(){this.__data__=[]},ot.prototype.delete=function(t){var e=this.__data__,r=ft(e,t);return r>=0&&(r==e.length-1?e.pop():V.call(e,r,1),!0)},ot.prototype.get=function(t){var e=this.__data__,r=ft(e,t);return 0>r?void 0:e[r][1]},ot.prototype.has=function(t){return ft(this.__data__,t)>-1},ot.prototype.set=function(t,e){var r=this.__data__,n=ft(r,t);return 0>n?r.push([t,e]):r[n][1]=e,this},it.prototype.clear=function(){this.__data__={hash:new nt,map:new(q||ot),string:new nt}},it.prototype.delete=function(t){return _t(this,t).delete(t)},it.prototype.get=function(t){return _t(this,t).get(t)},it.prototype.has=function(t){return _t(this,t).has(t)},it.prototype.set=function(t,e){return _t(this,t).set(t,e),this},at.prototype.clear=function(){this.__data__=new ot},at.prototype.delete=function(t){return this.__data__.delete(t)},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ot){var n=r.__data__;if(!q||199>n.length)return n.push([t,e]),this;r=this.__data__=new it(n)}return r.set(t,e),this};var bt=R?A(R,Object):function(){return[]},vt=function(t){return U.call(t)};function dt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||s.test(t))&&t>-1&&t%1==0&&e>t}function jt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||x)}function gt(t){if(null!=t){try{return F.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function wt(t,e){return t===e||t!=t&&e!=e}(W&&"[object DataView]"!=vt(new W(new ArrayBuffer(1)))||q&&vt(new q)!=a||G&&"[object Promise]"!=vt(G.resolve())||K&&vt(new K)!=u||H&&"[object WeakMap]"!=vt(new H))&&(vt=function(t){var e=U.call(t),r="[object Object]"==e?t.constructor:void 0,n=r?gt(r):void 0;if(n)switch(n){case Q:return"[object DataView]";case X:return a;case Y:return"[object Promise]";case Z:return u;case tt:return"[object WeakMap]"}return e});var At=Array.isArray;function mt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&9007199254740991>=t}(t.length)&&!St(t)}var Ot=C||function(){return!1};function St(t){var e=zt(t)?U.call(t):"";return e==o||e==i}function zt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function xt(t){return mt(t)?ut(t):function(t){if(!jt(t))return N(t);var e=[];for(var r in Object(t))P.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}e.exports=function(t){return st(t,!0,!0)}})),n=e((function(e,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[n]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f["[object Function]"]=f[o]=f["[object Number]"]=f[i]=f["[object RegExp]"]=f[a]=f["[object String]"]=f["[object WeakMap]"]=!1;var s="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,h=s||l||Function("return this")(),p=r&&!r.nodeType&&r,_=p&&e&&!e.nodeType&&e,y=_&&_.exports===p,b=y&&s.process,v=function(){try{return b&&b.binding&&b.binding("util")}catch(t){}}(),d=v&&v.isTypedArray;function j(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function g(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function w(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var A,m,O,S=Array.prototype,z=Object.prototype,x=h["__core-js_shared__"],k=Function.prototype.toString,E=z.hasOwnProperty,F=(A=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",P=z.toString,U=RegExp("^"+k.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=y?h.Buffer:void 0,I=h.Symbol,M=h.Uint8Array,B=z.propertyIsEnumerable,D=S.splice,T=I?I.toStringTag:void 0,L=Object.getOwnPropertySymbols,V=$?$.isBuffer:void 0,R=(m=Object.keys,O=Object,function(t){return m(O(t))}),C=bt(h,"DataView"),N=bt(h,"Map"),W=bt(h,"Promise"),q=bt(h,"Set"),G=bt(h,"WeakMap"),K=bt(Object,"create"),H=gt(C),J=gt(N),Q=gt(W),X=gt(q),Y=gt(G),Z=I?I.prototype:void 0,tt=Z?Z.valueOf:void 0;function et(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])}}function rt(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])}}function nt(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])}}function ot(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new nt;++e<r;)this.add(t[e])}function it(t){var e=this.__data__=new rt(t);this.size=e.size}function at(t,e){var r=mt(t),n=!r&&At(t),o=!r&&!n&&Ot(t),i=!r&&!n&&!o&&Et(t),a=r||n||o||i,u=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=u.length;for(var f in t)!e&&!E.call(t,f)||a&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||jt(f,c))||u.push(f);return u}function ut(t,e){for(var r=t.length;r--;)if(wt(t[r][0],e))return r;return-1}function ct(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":T&&T in Object(t)?function(t){var e=E.call(t,T),r=t[T];try{t[T]=void 0;var n=!0}catch(t){}var o=P.call(t);n&&(e?t[T]=r:delete t[T]);return o}(t):function(t){return P.call(t)}(t)}function ft(t){return kt(t)&&ct(t)==n}function st(t,e,r,u,c){return t===e||(null==t||null==e||!kt(t)&&!kt(e)?t!=t&&e!=e:function(t,e,r,u,c,f){var s=mt(t),l=mt(e),h=s?"[object Array]":dt(t),p=l?"[object Array]":dt(e),_=(h=h==n?i:h)==i,y=(p=p==n?i:p)==i,b=h==p;if(b&&Ot(t)){if(!Ot(e))return!1;s=!0,_=!1}if(b&&!_)return f||(f=new it),s||Et(t)?pt(t,e,r,u,c,f):function(t,e,r,n,i,u,c){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||!u(new M(t),new M(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return wt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var f=g;case a:var s=1&n;if(f||(f=w),t.size!=e.size&&!s)return!1;var l=c.get(t);if(l)return l==e;n|=2,c.set(t,e);var h=pt(f(t),f(e),n,i,u,c);return c.delete(t),h;case"[object Symbol]":if(tt)return tt.call(t)==tt.call(e)}return!1}(t,e,h,r,u,c,f);if(!(1&r)){var v=_&&E.call(t,"__wrapped__"),d=y&&E.call(e,"__wrapped__");if(v||d){var j=v?t.value():t,A=d?e.value():e;return f||(f=new it),c(j,A,r,u,f)}}if(!b)return!1;return f||(f=new it),function(t,e,r,n,o,i){var a=1&r,u=_t(t),c=u.length,f=_t(e);if(c!=f.length&&!a)return!1;var s=c;for(;s--;){var l=u[s];if(!(a?l in e:E.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var _=a;for(;++s<c;){var y=t[l=u[s]],b=e[l];if(n)var v=a?n(b,y,l,e,t,i):n(y,b,l,t,e,i);if(!(void 0===v?y===b||o(y,b,r,n,i):v)){p=!1;break}_||(_="constructor"==l)}if(p&&!_){var d=t.constructor,j=e.constructor;d==j||!("constructor"in t)||!("constructor"in e)||"function"==typeof d&&d instanceof d&&"function"==typeof j&&j instanceof j||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,u,c,f)}(t,e,r,u,st,c))}function lt(t){return!(!xt(t)||function(t){return!!F&&F in t}(t))&&(St(t)?U:u).test(gt(t))}function ht(t){if((e=t)!==("function"==typeof(r=e&&e.constructor)&&r.prototype||z))return R(t);var e,r,n=[];for(var o in Object(t))E.call(t,o)&&"constructor"!=o&&n.push(o);return n}function pt(t,e,r,n,o,i){var a=1&r,u=t.length,c=e.length;if(!(u==c||a&&c>u))return!1;var f=i.get(t);if(f&&i.get(e))return f==e;var s=-1,l=!0,h=2&r?new ot:void 0;for(i.set(t,e),i.set(e,t);++s<u;){var p=t[s],_=e[s];if(n)var y=a?n(_,p,s,e,t,i):n(p,_,s,t,e,i);if(void 0!==y){if(y)continue;l=!1;break}if(h){if(!j(e,(function(t,e){if(!h.has(e)&&(p===t||o(p,t,r,n,i)))return h.push(e)}))){l=!1;break}}else if(p!==_&&!o(p,_,r,n,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function _t(t){return function(t,e,r){var n=e(t);return mt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Ft,vt)}function yt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function bt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return lt(r)?r:void 0}et.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},et.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},et.prototype.get=function(t){var e=this.__data__;if(K){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return E.call(e,t)?e[t]:void 0},et.prototype.has=function(t){var e=this.__data__;return K?void 0!==e[t]:E.call(e,t)},et.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=K&&void 0===e?"__lodash_hash_undefined__":e,this},rt.prototype.clear=function(){this.__data__=[],this.size=0},rt.prototype.delete=function(t){var e=this.__data__,r=ut(e,t);return r>=0&&(r==e.length-1?e.pop():D.call(e,r,1),--this.size,!0)},rt.prototype.get=function(t){var e=this.__data__,r=ut(e,t);return 0>r?void 0:e[r][1]},rt.prototype.has=function(t){return ut(this.__data__,t)>-1},rt.prototype.set=function(t,e){var r=this.__data__,n=ut(r,t);return 0>n?(++this.size,r.push([t,e])):r[n][1]=e,this},nt.prototype.clear=function(){this.size=0,this.__data__={hash:new et,map:new(N||rt),string:new et}},nt.prototype.delete=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e},nt.prototype.get=function(t){return yt(this,t).get(t)},nt.prototype.has=function(t){return yt(this,t).has(t)},nt.prototype.set=function(t,e){var r=yt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},ot.prototype.add=ot.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ot.prototype.has=function(t){return this.__data__.has(t)},it.prototype.clear=function(){this.__data__=new rt,this.size=0},it.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},it.prototype.get=function(t){return this.__data__.get(t)},it.prototype.has=function(t){return this.__data__.has(t)},it.prototype.set=function(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!N||199>n.length)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new nt(n)}return r.set(t,e),this.size=r.size,this};var vt=L?function(t){return null==t?[]:function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}(L(t=Object(t)),(function(e){return B.call(t,e)}))}:function(){return[]},dt=ct;function jt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||c.test(t))&&t>-1&&t%1==0&&e>t}function gt(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function wt(t,e){return t===e||t!=t&&e!=e}(C&&"[object DataView]"!=dt(new C(new ArrayBuffer(1)))||N&&dt(new N)!=o||W&&"[object Promise]"!=dt(W.resolve())||q&&dt(new q)!=a||G&&"[object WeakMap]"!=dt(new G))&&(dt=function(t){var e=ct(t),r=e==i?t.constructor:void 0,n=r?gt(r):"";if(n)switch(n){case H:return"[object DataView]";case J:return o;case Q:return"[object Promise]";case X:return a;case Y:return"[object WeakMap]"}return e});var At=ft(function(){return arguments}())?ft:function(t){return kt(t)&&E.call(t,"callee")&&!B.call(t,"callee")},mt=Array.isArray;var Ot=V||function(){return!1};function St(t){if(!xt(t))return!1;var e=ct(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&9007199254740991>=t}function xt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function kt(t){return null!=t&&"object"==typeof t}var Et=d?function(t){return function(e){return t(e)}}(d):function(t){return kt(t)&&zt(t.length)&&!!f[ct(t)]};function Ft(t){return null!=(e=t)&&zt(e.length)&&!St(e)?at(t):ht(t);var e}e.exports=function(t,e){return st(t,e)}})),o=e((function(e,r){var n=/^\[object .+?Constructor\]$/,o=/^(?:0|[1-9]\d*)$/,i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1;var a="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,c=a||u||Function("return this")(),f=r&&!r.nodeType&&r,s=f&&e&&!e.nodeType&&e,l=s&&s.exports===f,h=l&&a.process,p=function(){try{var t=s&&s.require&&s.require("util").types;return t||h&&h.binding&&h.binding("util")}catch(t){}}(),_=p&&p.isTypedArray;function y(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var b,v,d,j=Array.prototype,g=Object.prototype,w=c["__core-js_shared__"],A=Function.prototype.toString,m=g.hasOwnProperty,O=(b=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",S=g.toString,z=A.call(Object),x=RegExp("^"+A.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=l?c.Buffer:void 0,E=c.Symbol,F=c.Uint8Array,P=k?k.allocUnsafe:void 0,U=(v=Object.getPrototypeOf,d=Object,function(t){return v(d(t))}),$=Object.create,I=g.propertyIsEnumerable,M=j.splice,B=E?E.toStringTag:void 0,D=function(){try{var t=ct(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),T=k?k.isBuffer:void 0,L=Math.max,V=Date.now,R=ct(c,"Map"),C=ct(Object,"create"),N=function(){function t(){}return function(e){if(!gt(e))return{};if($)return $(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function W(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])}}function q(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])}}function G(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])}}function K(t){var e=this.__data__=new q(t);this.size=e.size}function H(t,e){var r=yt(t),n=!r&&_t(t),o=!r&&!n&&vt(t),i=!r&&!n&&!o&&At(t),a=r||n||o||i,u=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=u.length;for(var f in t)!e&&!m.call(t,f)||a&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||ft(f,c))||u.push(f);return u}function J(t,e,r){(void 0!==r&&!pt(t[e],r)||void 0===r&&!(e in t))&&Y(t,e,r)}function Q(t,e,r){var n=t[e];m.call(t,e)&&pt(n,r)&&(void 0!==r||e in t)||Y(t,e,r)}function X(t,e){for(var r=t.length;r--;)if(pt(t[r][0],e))return r;return-1}function Y(t,e,r){"__proto__"==e&&D?D(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}W.prototype.clear=function(){this.__data__=C?C(null):{},this.size=0},W.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},W.prototype.get=function(t){var e=this.__data__;if(C){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return m.call(e,t)?e[t]:void 0},W.prototype.has=function(t){var e=this.__data__;return C?void 0!==e[t]:m.call(e,t)},W.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=C&&void 0===e?"__lodash_hash_undefined__":e,this},q.prototype.clear=function(){this.__data__=[],this.size=0},q.prototype.delete=function(t){var e=this.__data__,r=X(e,t);return r>=0&&(r==e.length-1?e.pop():M.call(e,r,1),--this.size,!0)},q.prototype.get=function(t){var e=this.__data__,r=X(e,t);return 0>r?void 0:e[r][1]},q.prototype.has=function(t){return X(this.__data__,t)>-1},q.prototype.set=function(t,e){var r=this.__data__,n=X(r,t);return 0>n?(++this.size,r.push([t,e])):r[n][1]=e,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new W,map:new(R||q),string:new W}},G.prototype.delete=function(t){var e=ut(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return ut(this,t).get(t)},G.prototype.has=function(t){return ut(this,t).has(t)},G.prototype.set=function(t,e){var r=ut(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},K.prototype.clear=function(){this.__data__=new q,this.size=0},K.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},K.prototype.get=function(t){return this.__data__.get(t)},K.prototype.has=function(t){return this.__data__.has(t)},K.prototype.set=function(t,e){var r=this.__data__;if(r instanceof q){var n=r.__data__;if(!R||199>n.length)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new G(n)}return r.set(t,e),this.size=r.size,this};var Z,tt=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),a=i.length;a--;){var u=i[Z?a:++n];if(!1===e(o[u],u,o))break}return t};function et(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?function(t){var e=m.call(t,B),r=t[B];try{t[B]=void 0;var n=!0}catch(t){}var o=S.call(t);n&&(e?t[B]=r:delete t[B]);return o}(t):function(t){return S.call(t)}(t)}function rt(t){return wt(t)&&"[object Arguments]"==et(t)}function nt(t){return!(!gt(t)||function(t){return!!O&&O in t}(t))&&(dt(t)?x:n).test(function(t){if(null!=t){try{return A.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ot(t){if(!gt(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=st(t),r=[];for(var n in t)("constructor"!=n||!e&&m.call(t,n))&&r.push(n);return r}function it(t,e,r,n,o){t!==e&&tt(e,(function(i,a){if(o||(o=new K),gt(i))!function(t,e,r,n,o,i,a){var u=lt(t,r),c=lt(e,r),f=a.get(c);if(f)return void J(t,r,f);var s=i?i(u,c,r+"",t,e,a):void 0,l=void 0===s;if(l){var h=yt(c),p=!h&&vt(c),_=!h&&!p&&At(c);s=c,h||p||_?yt(u)?s=u:wt(j=u)&&bt(j)?s=function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(u):p?(l=!1,s=function(t,e){if(e)return t.slice();var r=t.length,n=P?P(r):new t.constructor(r);return t.copy(n),n}(c,!0)):_?(l=!1,y=c,b=!0?(new F(d=new(v=y.buffer).constructor(v.byteLength)).set(new F(v)),d):y.buffer,s=new y.constructor(b,y.byteOffset,y.length)):s=[]:function(t){if(!wt(t)||"[object Object]"!=et(t))return!1;var e=U(t);if(null===e)return!0;var r=m.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&A.call(r)==z}(c)||_t(c)?(s=u,_t(u)?s=function(t){return function(t,e,r,n){var o=!r;r||(r={});var i=-1,a=e.length;for(;++i<a;){var u=e[i],c=n?n(r[u],t[u],u,r,t):void 0;void 0===c&&(c=t[u]),o?Y(r,u,c):Q(r,u,c)}return r}(t,mt(t))}(u):gt(u)&&!dt(u)||(s=function(t){return"function"!=typeof t.constructor||st(t)?{}:N(U(t))}(c))):l=!1}var y,b,v,d;var j;l&&(a.set(c,s),o(s,c,n,i,a),a.delete(c));J(t,r,s)}(t,e,a,r,it,n,o);else{var u=n?n(lt(t,a),i,a+"",t,e,o):void 0;void 0===u&&(u=i),J(t,a,u)}}),mt)}function at(t,e){return ht(function(t,e,r){return e=L(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=L(n.length-e,0),a=Array(i);++o<i;)a[o]=n[e+o];o=-1;for(var u=Array(e+1);++o<e;)u[o]=n[o];return u[e]=r(a),y(t,this,u)}}(t,e,zt),t+"")}function ut(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function ct(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return nt(r)?r:void 0}function ft(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&o.test(t))&&t>-1&&t%1==0&&e>t}function st(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||g)}function lt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var ht=function(t){var e=0,r=0;return function(){var n=V(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(D?function(t,e){return D(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:zt);function pt(t,e){return t===e||t!=t&&e!=e}var _t=rt(function(){return arguments}())?rt:function(t){return wt(t)&&m.call(t,"callee")&&!I.call(t,"callee")},yt=Array.isArray;function bt(t){return null!=t&&jt(t.length)&&!dt(t)}var vt=T||function(){return!1};function dt(t){if(!gt(t))return!1;var e=et(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function jt(t){return"number"==typeof t&&t>-1&&t%1==0&&9007199254740991>=t}function gt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function wt(t){return null!=t&&"object"==typeof t}var At=_?function(t){return function(e){return t(e)}}(_):function(t){return wt(t)&&jt(t.length)&&!!i[et(t)]};function mt(t){return bt(t)?H(t,!0):ot(t)}var Ot,St=(Ot=function(t,e,r,n){it(t,e,r,n)},at((function(t,e){var r=-1,n=e.length,o=n>1?e[n-1]:void 0,i=n>2?e[2]:void 0;for(o=Ot.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,e,r){if(!gt(r))return!1;var n=typeof e;return!!("number"==n?bt(r)&&ft(e,r.length):"string"==n&&e in r)&&pt(r[e],t)}(e[0],e[1],i)&&(o=3>n?void 0:o,n=1),t=Object(t);++r<n;){var a=e[r];a&&Ot(t,a,r,o)}return t})));function zt(t){return t}e.exports=St})),i=function(t){var e=t.storage,r=t.bufferLife,n=t.reducer,o=t.initialState,i=t.enhancer;this.createStore=t.createStore,this.storage=e,this.reducer=n,this.enhancer=i,this.buffLife=r?Math.min(Math.max(r,0),2e3):100,this.state=o,this.buffStore=this.buffState0=null,this.listeners=[],this.dispatch=this.dispatch.bind(this),this.subscribe=this.subscribe.bind(this)};i.prototype.init=function(){var t=this,e=this.state;this.state=null;var r=this.createStore(this.reducer,void 0,this.enhancer).getState();return this.storage.subscribe((function(e){if(!n(e,t.state)){t.setState(e);for(var r=0,o=t.listeners;o.length>r;r+=1){(0,o[r])()}}})),new Promise((function(i){t.storage.load((function(a){var u=function(t,e){return"object"!=typeof t||Array.isArray(t)?e:o({},t,e,(function(t,e){return Array.isArray(t)?e:void 0}))},c=a?u(r,a):r;e&&(c=u(c,e)),t.setState(c),n(c,a)||t.storage.save(c),i(t)}))}))},i.prototype.setState=function(t){t&&(this.state=r(t))},i.prototype.getState=function(){return this.state},i.prototype.subscribe=function(t){var e=this;return"function"==typeof t&&this.listeners.push(t),function(){"function"==typeof t&&(e.listeners=e.listeners.filter((function(e){return e!==t})))}},i.prototype.dispatch=function(t){var e=this;return this.buffStore||(this.buffStore=this.createStore(this.reducer,this.state,this.enhancer),this.buffState0=this.buffStore.getState(),setTimeout((function(){e.buffStore=null}),this.buffLife)),this.buffStore.subscribe((function(){var t=e.buffStore.getState();n(t,e.buffState0)||(e.storage.save(t),e.buffState0=t)})),this.buffStore.dispatch(t)};var a=function(t){var e=t.area,r=t.key;this.chrome=t.chrome,this.key=r,this.areaName="local"===e?"local":"sync",this.areaApi=this.chrome.storage[this.areaName],this.listeners=[]};return a.prototype.init=function(){var t=this;this.chrome.storage.onChanged.addListener((function(e,r){if(r===t.areaName&&t.key in e){var n=e[t.key].newValue;if(n)for(var o=0,i=t.listeners;i.length>o;o+=1){(0,i[o])(n)}}}))},a.prototype.subscribe=function(t){"function"==typeof t&&this.listeners.push(t)},a.prototype.load=function(t){var e=this;"function"==typeof t&&this.areaApi.get(this.key,(function(r){t(!e.chrome.runtime.lastError&&r&&r[e.key])}))},a.prototype.save=function(t){var e;this.areaApi.set(((e={})[this.key]=t,e))},function(t){var e=t.createStore,r=t.storageArea,n=t.storageKey,o=t.bufferLife,u="Missing or invalid argument";if(!function(t){if("function"!=typeof t)return!1;try{var e=t((function(t){return t||{}}));return"object"==typeof e&&"function"==typeof e.getState&&"function"==typeof e.dispatch}catch(t){return!1}}(e))throw Error("(Factory) "+u+": createStore");var c=new a({chrome:chrome,area:r,key:n||"reduxed"});return c.init(),function(t,r,n){if("function"!=typeof t)throw Error("(StoreCreator) "+u+": reducer");return new i({createStore:e,storage:c,bufferLife:o,reducer:t,initialState:r,enhancer:n}).init()}}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).reduxedChromeStorage=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}var r=e((function(e,r){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Boolean]",a="[object Date]",c="[object Function]",s="[object GeneratorFunction]",f="[object Map]",l="[object Number]",h="[object Object]",p="[object Promise]",_="[object RegExp]",y="[object Set]",v="[object String]",b="[object Symbol]",d="[object WeakMap]",g="[object ArrayBuffer]",j="[object DataView]",w="[object Float32Array]",m="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",S="[object Int32Array]",z="[object Uint8Array]",x="[object Uint8ClampedArray]",k="[object Uint16Array]",E="[object Uint32Array]",$=/\w*$/,F=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,T={};T[i]=T["[object Array]"]=T[g]=T[j]=T[u]=T[a]=T[w]=T[m]=T[A]=T[O]=T[S]=T[f]=T[l]=T[h]=T[_]=T[y]=T[v]=T[b]=T[z]=T[x]=T[k]=T[E]=!0,T["[object Error]"]=T[c]=T[d]=!1;var U="object"==typeof self&&self&&self.Object===Object&&self,I="object"==typeof t&&t&&t.Object===Object&&t||U||Function("return this")(),L=r&&!r.nodeType&&r,M=L&&e&&!e.nodeType&&e,B=M&&M.exports===L;function D(t,e){return t.set(e[0],e[1]),t}function C(t,e){return t.add(e),t}function R(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function N(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function W(t,e){return function(r){return t(e(r))}}function q(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var G,K=Array.prototype,H=Function.prototype,J=Object.prototype,Q=I["__core-js_shared__"],X=(G=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",Y=H.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=B?I.Buffer:void 0,nt=I.Symbol,ot=I.Uint8Array,it=W(Object.getPrototypeOf,Object),ut=Object.create,at=J.propertyIsEnumerable,ct=K.splice,st=Object.getOwnPropertySymbols,ft=rt?rt.isBuffer:void 0,lt=W(Object.keys,Object),ht=Mt(I,"DataView"),pt=Mt(I,"Map"),_t=Mt(I,"Promise"),yt=Mt(I,"Set"),vt=Mt(I,"WeakMap"),bt=Mt(Object,"create"),dt=Nt(ht),gt=Nt(pt),jt=Nt(_t),wt=Nt(yt),mt=Nt(vt),At=nt?nt.prototype:void 0,Ot=At?At.valueOf:void 0;function St(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function zt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function xt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kt(t){this.__data__=new zt(t)}function Et(t,e){var r=Wt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&qt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==i)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var u in t)!e&&!Z.call(t,u)||o&&("length"==u||Ct(u,n))||r.push(u);return r}function $t(t,e,r){var n=t[e];Z.call(t,e)&&Vt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Ft(t,e){for(var r=t.length;r--;)if(Vt(t[r][0],e))return r;return-1}function Pt(t,e,r,n,o,p,d){var F;if(n&&(F=p?n(t,o,p,d):n(t)),void 0!==F)return F;if(!Ht(t))return t;var P=Wt(t);if(P){if(F=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,F)}else{var U=Dt(t),I=U==c||U==s;if(Gt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(U==h||U==i||I&&!p){if(N(t))return p?t:{};if(F=function(t){return"function"!=typeof t.constructor||Rt(t)?{}:(e=it(t),Ht(e)?ut(e):{});var e}(I?{}:t),!e)return function(t,e){return It(t,Bt(t),e)}(t,function(t,e){return t&&It(e,Jt(e),t)}(F,t))}else{if(!T[U])return p?t:{};F=function(t,e,r,n){var o=t.constructor;switch(e){case g:return Ut(t);case u:case a:return new o(+t);case j:return function(t,e){var r=e?Ut(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case w:case m:case A:case O:case S:case z:case x:case k:case E:return function(t,e){var r=e?Ut(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case f:return function(t,e,r){return R(e?r(V(t),!0):V(t),D,new t.constructor)}(t,n,r);case l:case v:return new o(t);case _:return function(t){var e=new t.constructor(t.source,$.exec(t));return e.lastIndex=t.lastIndex,e}(t);case y:return function(t,e,r){return R(e?r(q(t),!0):q(t),C,new t.constructor)}(t,n,r);case b:return i=t,Ot?Object(Ot.call(i)):{}}var i}(t,U,Pt,e)}}d||(d=new kt);var L=d.get(t);if(L)return L;if(d.set(t,F),!P)var M=r?function(t){return function(t,e,r){var n=e(t);return Wt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Jt,Bt)}(t):Jt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(M||t,(function(o,i){M&&(o=t[i=o]),$t(F,i,Pt(o,e,r,n,i,t,d))})),F}function Tt(t){return!(!Ht(t)||(e=t,X&&X in e))&&(Kt(t)||N(t)?et:F).test(Nt(t));var e}function Ut(t){var e=new t.constructor(t.byteLength);return new ot(e).set(new ot(t)),e}function It(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var u=e[o],a=n?n(r[u],t[u],u,r,t):void 0;$t(r,u,void 0===a?t[u]:a)}return r}function Lt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Mt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Tt(r)?r:void 0}St.prototype.clear=function(){this.__data__=bt?bt(null):{}},St.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},St.prototype.get=function(t){var e=this.__data__;if(bt){var r=e[t];return r===n?void 0:r}return Z.call(e,t)?e[t]:void 0},St.prototype.has=function(t){var e=this.__data__;return bt?void 0!==e[t]:Z.call(e,t)},St.prototype.set=function(t,e){return this.__data__[t]=bt&&void 0===e?n:e,this},zt.prototype.clear=function(){this.__data__=[]},zt.prototype.delete=function(t){var e=this.__data__,r=Ft(e,t);return r>=0&&(r==e.length-1?e.pop():ct.call(e,r,1),!0)},zt.prototype.get=function(t){var e=this.__data__,r=Ft(e,t);return 0>r?void 0:e[r][1]},zt.prototype.has=function(t){return Ft(this.__data__,t)>-1},zt.prototype.set=function(t,e){var r=this.__data__,n=Ft(r,t);return 0>n?r.push([t,e]):r[n][1]=e,this},xt.prototype.clear=function(){this.__data__={hash:new St,map:new(pt||zt),string:new St}},xt.prototype.delete=function(t){return Lt(this,t).delete(t)},xt.prototype.get=function(t){return Lt(this,t).get(t)},xt.prototype.has=function(t){return Lt(this,t).has(t)},xt.prototype.set=function(t,e){return Lt(this,t).set(t,e),this},kt.prototype.clear=function(){this.__data__=new zt},kt.prototype.delete=function(t){return this.__data__.delete(t)},kt.prototype.get=function(t){return this.__data__.get(t)},kt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof zt){var n=r.__data__;if(!pt||199>n.length)return n.push([t,e]),this;r=this.__data__=new xt(n)}return r.set(t,e),this};var Bt=st?W(st,Object):function(){return[]},Dt=function(t){return tt.call(t)};function Ct(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||P.test(t))&&t>-1&&t%1==0&&e>t}function Rt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Nt(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(ht&&Dt(new ht(new ArrayBuffer(1)))!=j||pt&&Dt(new pt)!=f||_t&&Dt(_t.resolve())!=p||yt&&Dt(new yt)!=y||vt&&Dt(new vt)!=d)&&(Dt=function(t){var e=tt.call(t),r=e==h?t.constructor:void 0,n=r?Nt(r):void 0;if(n)switch(n){case dt:return j;case gt:return f;case jt:return p;case wt:return y;case mt:return d}return e});var Wt=Array.isArray;function qt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&o>=t}(t.length)&&!Kt(t)}var Gt=ft||function(){return!1};function Kt(t){var e=Ht(t)?tt.call(t):"";return e==c||e==s}function Ht(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return qt(t)?Et(t):function(t){if(!Rt(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}e.exports=function(t){return Pt(t,!0,!0)}})),n=e((function(e,r){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Array]",a="[object Boolean]",c="[object Date]",s="[object Error]",f="[object Function]",l="[object Map]",h="[object Number]",p="[object Object]",_="[object Promise]",y="[object RegExp]",v="[object Set]",b="[object String]",d="[object Symbol]",g="[object WeakMap]",j="[object ArrayBuffer]",w="[object DataView]",m=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,O={};O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O[i]=O[u]=O[j]=O[a]=O[w]=O[c]=O[s]=O[f]=O[l]=O[h]=O[p]=O[y]=O[v]=O[b]=O[g]=!1;var S="object"==typeof t&&t&&t.Object===Object&&t,z="object"==typeof self&&self&&self.Object===Object&&self,x=S||z||Function("return this")(),k=r&&!r.nodeType&&r,E=k&&e&&!e.nodeType&&e,$=E&&E.exports===k,F=$&&S.process,P=function(){try{return F&&F.binding&&F.binding("util")}catch(t){}}(),T=P&&P.isTypedArray;function U(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function I(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function L(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var M,B,D,C=Array.prototype,R=Object.prototype,N=x["__core-js_shared__"],V=Function.prototype.toString,W=R.hasOwnProperty,q=(M=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",G=R.toString,K=RegExp("^"+V.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=$?x.Buffer:void 0,J=x.Symbol,Q=x.Uint8Array,X=R.propertyIsEnumerable,Y=C.splice,Z=J?J.toStringTag:void 0,tt=Object.getOwnPropertySymbols,et=H?H.isBuffer:void 0,rt=(B=Object.keys,D=Object,function(t){return B(D(t))}),nt=Ft(x,"DataView"),ot=Ft(x,"Map"),it=Ft(x,"Promise"),ut=Ft(x,"Set"),at=Ft(x,"WeakMap"),ct=Ft(Object,"create"),st=It(nt),ft=It(ot),lt=It(it),ht=It(ut),pt=It(at),_t=J?J.prototype:void 0,yt=_t?_t.valueOf:void 0;function vt(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])}}function bt(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])}}function dt(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])}}function gt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new dt;++e<r;)this.add(t[e])}function jt(t){var e=this.__data__=new bt(t);this.size=e.size}function wt(t,e){var r=Bt(t),n=!r&&Mt(t),o=!r&&!n&&Dt(t),i=!r&&!n&&!o&&Wt(t),u=r||n||o||i,a=u?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=a.length;for(var s in t)!e&&!W.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ut(s,c))||a.push(s);return a}function mt(t,e){for(var r=t.length;r--;)if(Lt(t[r][0],e))return r;return-1}function At(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Z&&Z in Object(t)?function(t){var e=W.call(t,Z),r=t[Z];try{t[Z]=void 0;var n=!0}catch(t){}var o=G.call(t);n&&(e?t[Z]=r:delete t[Z]);return o}(t):function(t){return G.call(t)}(t)}function Ot(t){return Vt(t)&&At(t)==i}function St(t,e,r,n,o){return t===e||(null==t||null==e||!Vt(t)&&!Vt(e)?t!=t&&e!=e:function(t,e,r,n,o,f){var _=Bt(t),g=Bt(e),m=_?u:Tt(t),A=g?u:Tt(e),O=(m=m==i?p:m)==p,S=(A=A==i?p:A)==p,z=m==A;if(z&&Dt(t)){if(!Dt(e))return!1;_=!0,O=!1}if(z&&!O)return f||(f=new jt),_||Wt(t)?kt(t,e,r,n,o,f):function(t,e,r,n,o,i,u){switch(r){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!i(new Q(t),new Q(e)));case a:case c:case h:return Lt(+t,+e);case s:return t.name==e.name&&t.message==e.message;case y:case b:return t==e+"";case l:var f=I;case v:if(f||(f=L),t.size!=e.size&&!(1&n))return!1;var p=u.get(t);if(p)return p==e;n|=2,u.set(t,e);var _=kt(f(t),f(e),n,o,i,u);return u.delete(t),_;case d:if(yt)return yt.call(t)==yt.call(e)}return!1}(t,e,m,r,n,o,f);if(!(1&r)){var x=O&&W.call(t,"__wrapped__"),k=S&&W.call(e,"__wrapped__");if(x||k){var E=x?t.value():t,$=k?e.value():e;return f||(f=new jt),o(E,$,r,n,f)}}if(!z)return!1;return f||(f=new jt),function(t,e,r,n,o,i){var u=1&r,a=Et(t),c=a.length,s=Et(e);if(c!=s.length&&!u)return!1;var f=c;for(;f--;){var l=a[f];if(!(u?l in e:W.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var _=u;for(;++f<c;){var y=t[l=a[f]],v=e[l];if(n)var b=u?n(v,y,l,e,t,i):n(y,v,l,t,e,i);if(!(void 0===b?y===v||o(y,v,r,n,i):b)){p=!1;break}_||(_="constructor"==l)}if(p&&!_){var d=t.constructor,g=e.constructor;d==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof d&&d instanceof d&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,n,o,f)}(t,e,r,n,St,o))}function zt(t){return!(!Nt(t)||function(t){return!!q&&q in t}(t))&&(Ct(t)?K:m).test(It(t))}function xt(t){if((e=t)!==("function"==typeof(r=e&&e.constructor)&&r.prototype||R))return rt(t);var e,r,n=[];for(var o in Object(t))W.call(t,o)&&"constructor"!=o&&n.push(o);return n}function kt(t,e,r,n,o,i){var u=1&r,a=t.length,c=e.length;if(!(a==c||u&&c>a))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var f=-1,l=!0,h=2&r?new gt:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var p=t[f],_=e[f];if(n)var y=u?n(_,p,f,e,t,i):n(p,_,f,t,e,i);if(void 0!==y){if(y)continue;l=!1;break}if(h){if(!U(e,(function(t,e){if(!h.has(e)&&(p===t||o(p,t,r,n,i)))return h.push(e)}))){l=!1;break}}else if(p!==_&&!o(p,_,r,n,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function Et(t){return function(t,e,r){var n=e(t);return Bt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,qt,Pt)}function $t(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Ft(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return zt(r)?r:void 0}vt.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},vt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},vt.prototype.get=function(t){var e=this.__data__;if(ct){var r=e[t];return r===n?void 0:r}return W.call(e,t)?e[t]:void 0},vt.prototype.has=function(t){var e=this.__data__;return ct?void 0!==e[t]:W.call(e,t)},vt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ct&&void 0===e?n:e,this},bt.prototype.clear=function(){this.__data__=[],this.size=0},bt.prototype.delete=function(t){var e=this.__data__,r=mt(e,t);return r>=0&&(r==e.length-1?e.pop():Y.call(e,r,1),--this.size,!0)},bt.prototype.get=function(t){var e=this.__data__,r=mt(e,t);return 0>r?void 0:e[r][1]},bt.prototype.has=function(t){return mt(this.__data__,t)>-1},bt.prototype.set=function(t,e){var r=this.__data__,n=mt(r,t);return 0>n?(++this.size,r.push([t,e])):r[n][1]=e,this},dt.prototype.clear=function(){this.size=0,this.__data__={hash:new vt,map:new(ot||bt),string:new vt}},dt.prototype.delete=function(t){var e=$t(this,t).delete(t);return this.size-=e?1:0,e},dt.prototype.get=function(t){return $t(this,t).get(t)},dt.prototype.has=function(t){return $t(this,t).has(t)},dt.prototype.set=function(t,e){var r=$t(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},gt.prototype.add=gt.prototype.push=function(t){return this.__data__.set(t,n),this},gt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.clear=function(){this.__data__=new bt,this.size=0},jt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof bt){var n=r.__data__;if(!ot||199>n.length)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new dt(n)}return r.set(t,e),this.size=r.size,this};var Pt=tt?function(t){return null==t?[]: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}(tt(t=Object(t)),(function(e){return X.call(t,e)}))}:function(){return[]},Tt=At;function Ut(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||A.test(t))&&t>-1&&t%1==0&&e>t}function It(t){if(null!=t){try{return V.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Lt(t,e){return t===e||t!=t&&e!=e}(nt&&Tt(new nt(new ArrayBuffer(1)))!=w||ot&&Tt(new ot)!=l||it&&Tt(it.resolve())!=_||ut&&Tt(new ut)!=v||at&&Tt(new at)!=g)&&(Tt=function(t){var e=At(t),r=e==p?t.constructor:void 0,n=r?It(r):"";if(n)switch(n){case st:return w;case ft:return l;case lt:return _;case ht:return v;case pt:return g}return e});var Mt=Ot(function(){return arguments}())?Ot:function(t){return Vt(t)&&W.call(t,"callee")&&!X.call(t,"callee")},Bt=Array.isArray;var Dt=et||function(){return!1};function Ct(t){if(!Nt(t))return!1;var e=At(t);return e==f||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Rt(t){return"number"==typeof t&&t>-1&&t%1==0&&o>=t}function Nt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Vt(t){return null!=t&&"object"==typeof t}var Wt=T?function(t){return function(e){return t(e)}}(T):function(t){return Vt(t)&&Rt(t.length)&&!!O[At(t)]};function qt(t){return null!=(e=t)&&Rt(e.length)&&!Ct(e)?wt(t):xt(t);var e}e.exports=function(t,e){return St(t,e)}})),o=e((function(e,r){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Function]",a="[object Object]",c=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[i]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[u]=f["[object Map]"]=f["[object Number]"]=f[a]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var l="object"==typeof t&&t&&t.Object===Object&&t,h="object"==typeof self&&self&&self.Object===Object&&self,p=l||h||Function("return this")(),_=r&&!r.nodeType&&r,y=_&&e&&!e.nodeType&&e,v=y&&y.exports===_,b=v&&l.process,d=function(){try{var t=y&&y.require&&y.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),g=d&&d.isTypedArray;function j(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var w,m,A,O=Array.prototype,S=Object.prototype,z=p["__core-js_shared__"],x=Function.prototype.toString,k=S.hasOwnProperty,E=(w=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",$=S.toString,F=x.call(Object),P=RegExp("^"+x.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v?p.Buffer:void 0,U=p.Symbol,I=p.Uint8Array,L=T?T.allocUnsafe:void 0,M=(m=Object.getPrototypeOf,A=Object,function(t){return m(A(t))}),B=Object.create,D=S.propertyIsEnumerable,C=O.splice,R=U?U.toStringTag:void 0,N=function(){try{var t=pt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),V=T?T.isBuffer:void 0,W=Math.max,q=Date.now,G=pt(p,"Map"),K=pt(Object,"create"),H=function(){function t(){}return function(e){if(!St(e))return{};if(B)return B(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function J(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])}}function Q(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])}}function X(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])}}function Y(t){var e=this.__data__=new Q(t);this.size=e.size}function Z(t,e){var r=jt(t),n=!r&&gt(t),o=!r&&!n&&mt(t),i=!r&&!n&&!o&&xt(t),u=r||n||o||i,a=u?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=a.length;for(var s in t)!e&&!k.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||_t(s,c))||a.push(s);return a}function tt(t,e,r){(void 0!==r&&!dt(t[e],r)||void 0===r&&!(e in t))&&nt(t,e,r)}function et(t,e,r){var n=t[e];k.call(t,e)&&dt(n,r)&&(void 0!==r||e in t)||nt(t,e,r)}function rt(t,e){for(var r=t.length;r--;)if(dt(t[r][0],e))return r;return-1}function nt(t,e,r){"__proto__"==e&&N?N(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}J.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},J.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},J.prototype.get=function(t){var e=this.__data__;if(K){var r=e[t];return r===n?void 0:r}return k.call(e,t)?e[t]:void 0},J.prototype.has=function(t){var e=this.__data__;return K?void 0!==e[t]:k.call(e,t)},J.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=K&&void 0===e?n:e,this},Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(t){var e=this.__data__,r=rt(e,t);return r>=0&&(r==e.length-1?e.pop():C.call(e,r,1),--this.size,!0)},Q.prototype.get=function(t){var e=this.__data__,r=rt(e,t);return 0>r?void 0:e[r][1]},Q.prototype.has=function(t){return rt(this.__data__,t)>-1},Q.prototype.set=function(t,e){var r=this.__data__,n=rt(r,t);return 0>n?(++this.size,r.push([t,e])):r[n][1]=e,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(G||Q),string:new J}},X.prototype.delete=function(t){var e=ht(this,t).delete(t);return this.size-=e?1:0,e},X.prototype.get=function(t){return ht(this,t).get(t)},X.prototype.has=function(t){return ht(this,t).has(t)},X.prototype.set=function(t,e){var r=ht(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Y.prototype.clear=function(){this.__data__=new Q,this.size=0},Y.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Y.prototype.get=function(t){return this.__data__.get(t)},Y.prototype.has=function(t){return this.__data__.has(t)},Y.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Q){var n=r.__data__;if(!G||199>n.length)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new X(n)}return r.set(t,e),this.size=r.size,this};var ot,it=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),u=i.length;u--;){var a=i[ot?u:++n];if(!1===e(o[a],a,o))break}return t};function ut(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":R&&R in Object(t)?function(t){var e=k.call(t,R),r=t[R];try{t[R]=void 0;var n=!0}catch(t){}var o=$.call(t);n&&(e?t[R]=r:delete t[R]);return o}(t):function(t){return $.call(t)}(t)}function at(t){return zt(t)&&ut(t)==i}function ct(t){return!(!St(t)||function(t){return!!E&&E in t}(t))&&(At(t)?P:c).test(function(t){if(null!=t){try{return x.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function st(t){if(!St(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=yt(t),r=[];for(var n in t)("constructor"!=n||!e&&k.call(t,n))&&r.push(n);return r}function ft(t,e,r,n,o){t!==e&&it(e,(function(i,u){if(o||(o=new Y),St(i))!function(t,e,r,n,o,i,u){var c=vt(t,r),s=vt(e,r),f=u.get(s);if(f)return void tt(t,r,f);var l=i?i(c,s,r+"",t,e,u):void 0,h=void 0===l;if(h){var p=jt(s),_=!p&&mt(s),y=!p&&!_&&xt(s);l=s,p||_||y?jt(c)?l=c:zt(j=c)&&wt(j)?l=function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(c):_?(h=!1,l=function(t,e){if(e)return t.slice();var r=t.length,n=L?L(r):new t.constructor(r);return t.copy(n),n}(s,!0)):y?(h=!1,v=s,b=!0?(new I(g=new(d=v.buffer).constructor(d.byteLength)).set(new I(d)),g):v.buffer,l=new v.constructor(b,v.byteOffset,v.length)):l=[]:function(t){if(!zt(t)||ut(t)!=a)return!1;var e=M(t);if(null===e)return!0;var r=k.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&x.call(r)==F}(s)||gt(s)?(l=c,gt(c)?l=function(t){return function(t,e,r,n){var o=!r;r||(r={});var i=-1,u=e.length;for(;++i<u;){var a=e[i],c=n?n(r[a],t[a],a,r,t):void 0;void 0===c&&(c=t[a]),o?nt(r,a,c):et(r,a,c)}return r}(t,kt(t))}(c):St(c)&&!At(c)||(l=function(t){return"function"!=typeof t.constructor||yt(t)?{}:H(M(t))}(s))):h=!1}var v,b,d,g;var j;h&&(u.set(s,l),o(l,s,n,i,u),u.delete(s));tt(t,r,l)}(t,e,u,r,ft,n,o);else{var c=n?n(vt(t,u),i,u+"",t,e,o):void 0;void 0===c&&(c=i),tt(t,u,c)}}),kt)}function lt(t,e){return bt(function(t,e,r){return e=W(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=W(n.length-e,0),u=Array(i);++o<i;)u[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=r(u),j(t,this,a)}}(t,e,Ft),t+"")}function ht(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ct(r)?r:void 0}function _t(t,e){var r=typeof t;return!!(e=null==e?o:e)&&("number"==r||"symbol"!=r&&s.test(t))&&t>-1&&t%1==0&&e>t}function yt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||S)}function vt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bt=function(t){var e=0,r=0;return function(){var n=q(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(N?function(t,e){return N(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:Ft);function dt(t,e){return t===e||t!=t&&e!=e}var gt=at(function(){return arguments}())?at:function(t){return zt(t)&&k.call(t,"callee")&&!D.call(t,"callee")},jt=Array.isArray;function wt(t){return null!=t&&Ot(t.length)&&!At(t)}var mt=V||function(){return!1};function At(t){if(!St(t))return!1;var e=ut(t);return e==u||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ot(t){return"number"==typeof t&&t>-1&&t%1==0&&o>=t}function St(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zt(t){return null!=t&&"object"==typeof t}var xt=g?function(t){return function(e){return t(e)}}(g):function(t){return zt(t)&&Ot(t.length)&&!!f[ut(t)]};function kt(t){return wt(t)?Z(t,!0):st(t)}var Et,$t=(Et=function(t,e,r,n){ft(t,e,r,n)},lt((function(t,e){var r=-1,n=e.length,o=n>1?e[n-1]:void 0,i=n>2?e[2]:void 0;for(o=Et.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,e,r){if(!St(r))return!1;var n=typeof e;return!!("number"==n?wt(r)&&_t(e,r.length):"string"==n&&e in r)&&dt(r[e],t)}(e[0],e[1],i)&&(o=3>n?void 0:o,n=1),t=Object(t);++r<n;){var u=e[r];u&&Et(t,u,r,o)}return t})));function Ft(t){return t}e.exports=$t})),i=function(t){var e=t.storage,r=t.bufferLife,n=t.reducer,o=t.initialState,i=t.enhancer;this.createStore=t.createStore,this.storage=e,this.reducer=n,this.enhancer=i,this.buffLife=r?Math.min(Math.max(r,0),2e3):100,this.state=o,this.buffStore=null,this.lastState=null,this.listeners=[],this.dispatch=this.dispatch.bind(this),this.subscribe=this.subscribe.bind(this)};i.prototype.init=function(){var t=this,e=this.state;this.state=null;var r=this.createStore(this.reducer,void 0,this.enhancer).getState();return this.storage.subscribe((function(e){if(!n(e,t.state)){t.setState(e);for(var r=0,o=t.listeners;o.length>r;r+=1){(0,o[r])()}}})),new Promise((function(i){t.storage.load((function(u){var a=function(t,e){return"object"!=typeof t||Array.isArray(t)?e:o({},t,e,(function(t,e){return Array.isArray(t)?e:void 0}))},c=u?a(r,u):r;e&&(c=a(c,e)),t.setState(c),n(c,u)||t.storage.save(c),i(t)}))}))},i.prototype.setState=function(t){t&&(this.state=r(t))},i.prototype.getState=function(){return this.state},i.prototype.subscribe=function(t){var e=this;return"function"==typeof t&&this.listeners.push(t),function(){"function"==typeof t&&(e.listeners=e.listeners.filter((function(e){return e!==t})))}},i.prototype.dispatch=function(t){var e=this;this.buffStore||(this.buffStore=this.createStore(this.reducer,this.state,this.enhancer),this.lastState=this.buffStore.getState(),setTimeout((function(){e.buffStore=null}),this.buffLife));var r=this.buffStore,o=r.subscribe((function(){var t=(e.buffStore||r).getState();n(t,e.lastState)||(e.storage.save(t),e.lastState=t,o(),r=null)}));return r.dispatch(t)};var u=function(t){var e=t.area,r=t.key;this.chrome=t.chrome,this.key=r,this.areaName="local"===e?"local":"sync",this.areaApi=this.chrome.storage[this.areaName],this.listeners=[]};return u.prototype.init=function(){var t=this;this.chrome.storage.onChanged.addListener((function(e,r){if(r===t.areaName&&t.key in e){var n=e[t.key].newValue;if(n)for(var o=0,i=t.listeners;i.length>o;o+=1){(0,i[o])(n)}}}))},u.prototype.subscribe=function(t){"function"==typeof t&&this.listeners.push(t)},u.prototype.load=function(t){var e=this;"function"==typeof t&&this.areaApi.get(this.key,(function(r){t(!e.chrome.runtime.lastError&&r&&r[e.key])}))},u.prototype.save=function(t){var e;this.areaApi.set(((e={})[this.key]=t,e))},function(t){var e=t.createStore,r=t.storageArea,n=t.storageKey,o=t.bufferLife,a="Missing or invalid argument";if(!function(t){if("function"!=typeof t)return!1;try{var e=t((function(t){return t||{}}));return"object"==typeof e&&"function"==typeof e.getState&&"function"==typeof e.dispatch}catch(t){return!1}}(e))throw Error("(Factory) "+a+": createStore");var c=new u({chrome:chrome,area:r,key:n||"reduxed"});return c.init(),function(t,r,n){if("function"!=typeof t)throw Error("(StoreCreator) "+a+": reducer");return new i({createStore:e,storage:c,bufferLife:o,reducer:t,initialState:r,enhancer:n}).init()}}}));
{
"name": "reduxed-chrome-storage",
"version": "1.0.12",
"version": "1.1.0",
"description": "Redux interface to chrome.storage, the only way to get Redux working in event-driven (non-persistent) Chrome extensions",

@@ -31,12 +31,13 @@ "license": "MIT",

"eslint": "^6.0.0",
"lodash": "^4.17.15",
"mocha": "^7.1.2",
"lodash": "^4.17.20",
"mocha": "^8.2.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"reify": "^0.20.12",
"rollup": "^2.10.0",
"rollup": "^2.26.0",
"@rollup/plugin-buble": "^0.21.0",
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"rollup-plugin-terser": "^5.3.0",
"sinon": "^9.0.0"
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"rollup-plugin-terser": "^7.0.0",
"sinon": "^9.2.0"
},

@@ -43,0 +44,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc