diff --git a/CHANGELOG.md b/CHANGELOG.md
index 74c014a..d4deb17 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,12 +2,21 @@
+## 2.1.2
+
+### Improvements
+
+1. Added the `options` parameter to the API method `removeItem()`, in order to allow passing metadata to the cookie to delete.
+ When using `"cookieStorage"` the new signature is: `instance.removeItem(key, options)`
+1. Checks if the cookie was created on `setItem()`, or delete it if the domain or path are not valid.
+
+---
+
## 2.1.1
### Fixes
-1. [#4](https://github.com/jherax/proxy-storage/issues/4):
- Removing cookies are failing when the domain or path were set in the cookie.
+1. [#4](https://github.com/jherax/proxy-storage/issues/4): Removing cookies are failing when the `domain` or `path` were set in the cookie.
1. `setItem`: prevents converting strings values to JSON to avoid extra quotes.
---
diff --git a/README.md b/README.md
index 7520c3e..cabf20e 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,7 @@ $ yarn add proxy-storage
-
+
```
In the above case, [`proxyStorage`](#api) is included as a global object
@@ -153,7 +153,9 @@ It inherits the following members from the `WebStorage` prototype:
The `options` parameter is used only when you set `"cookieStorage"`.
Read more details [here](#handling-cookies).
- **`getItem`**`(key)`: retrieves a value by its `key` name.
-- **`removeItem`**`(key)`: deletes an item from the storage.
+- **`removeItem`**`(key [,options])`: deletes an item from the storage.
+
The `options` parameter is used only when you set `"cookieStorage"`.
+ Read more details [here](#handling-cookies).
- **`clear`**`()`: removes all items from the storage instance.
- **`length`**: gets the number of items stored in the storage instance.
@@ -234,7 +236,9 @@ Each instance handles an adapter with the following API:
The `options` parameter is used only when you set `"cookieStorage"`.
Read more details [here](#handling-cookies).
- **`getItem`**`(key)`: retrieves a value by its `key` name.
-- **`removeItem`**`(key)`: deletes an item from the storage.
+- **`removeItem`**`(key [,options])`: deletes an item from the storage.
+
The `options` parameter is used only when you set `"cookieStorage"`.
+ Read more details [here](#handling-cookies).
- **`clear`**`()`: removes all items from the storage instance.
- **`length`**: gets the number of items stored in the storage instance.
@@ -253,7 +257,7 @@ const sessionStore = new WebStorage('sessionStorage');
sessionStore.setItem('character', { name: 'Mordecai' });
// store in cookies
-const options = { expires: {days:1} };
+const options = { expires: {days: 1} };
const cookieStore = new WebStorage('cookieStorage');
cookieStore.setItem('character', { name: 'Rigby' }, options);
```
@@ -341,7 +345,8 @@ cookieStore.setItem('testing3', 3, {
**Important**: Take into account that if you want to modify or remove a cookie
that was created with a specific `path` or `domain` / subdomain, you need to
-explicitate the domain attribute in `setItem(key, value, options)`.
+explicitate the domain attribute in the `options` when calling
+`setItem(key, value, options)` or `removeItem(key, options)`.
![cookies](https://www.dropbox.com/s/wlvgm0t8xc07me1/cookies-metadata.gif?dl=1)
@@ -359,9 +364,8 @@ cookieStore.setItem('landedAnswers', 999, {
});
// remove an external cookie in a subdomain
-cookieStore.setItem('optimizelyEndUserId', '', {
+cookieStore.removeItem('optimizelyEndUserId', {
domain: '.healthcare.org',
- expires: {days: -1}, // trick!
});
```
@@ -443,7 +447,7 @@ the _value_ passed and returned in each callback.
import storage, { WebStorage } from 'proxy-storage';
// adds first interceptor for 'setItem'
-WebStorage.interceptors('setItem', (key, value) => {
+WebStorage.interceptors('setItem', (key, value/*, options*/) => {
if (key === 'storage-test') {
// transform the 'id' property by encoding it to base64
value.id = btoa(value.id);
@@ -454,7 +458,7 @@ WebStorage.interceptors('setItem', (key, value) => {
// adds second interceptor for 'setItem'
WebStorage.interceptors('setItem', (key, value) => {
// does not apply any transformation
- console.info('setItem: See the localStorage in your browser');
+ console.info('setItem: See the application storage in your browser');
console.log(`${key}: ${JSON.stringify(value)}`);
});
@@ -467,7 +471,7 @@ WebStorage.interceptors('getItem', (key, value) => {
return value;
});
-WebStorage.interceptors('removeItem', (key) => {
+WebStorage.interceptors('removeItem', (key/*, options*/) => {
console.log(`removeItem: ${key}`);
});
@@ -552,20 +556,29 @@ console.log('in memoryStorage', data);
## Shimming-polyfills
-
-
This library is written using some of the new ES6 features, e.g.
-`Object.assign()`. If your target browsers does not have support,
-you can polyfill some of the ES2015 features with the next alternatives:
+`Object.assign()`. If you have to support Non-standard-compliant browsers
+(e.g. Internet Explorer), you can polyfill some of the ES2015 features with
+the following alternatives:
-The reason is because this library use some of the new features in ES5-ES6.
-To overcome this problem, you may include in your project the
-[es6-shim](https://github.com/paulmillr/es6-shim) script before all scripts.
+**[es6-shim](https://github.com/paulmillr/es6-shim)**
```html
-
+
+
```
+**[polyfill.io](https://polyfill.io/v2/docs/)**
+
+```html
+
+
+```
+
+[Polyfill.io](https://polyfill.io/v2/docs/examples) reads the `User-Agent`
+header of each request and returns the polyfills that are suitable for the
+requesting browser.
+
## Running the project
If you want to fork or build your own, you must run this project.
diff --git a/dist/proxy-storage.js b/dist/proxy-storage.js
index 2cfbeac..a6575f3 100644
--- a/dist/proxy-storage.js
+++ b/dist/proxy-storage.js
@@ -1,4 +1,4 @@
-/*! proxyStorage@v2.1.1. Jherax 2017. Visit https://github.com/jherax/proxy-storage */
+/*! proxyStorage@v2.1.2. Jherax 2017. Visit https://github.com/jherax/proxy-storage */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
@@ -150,7 +150,7 @@ function setProperty(obj, name, value) {
/**
* Validates if the key is not empty.
- * (null, undefined either empty string)
+ * (null, undefined or empty string)
*
* @param {string} key: keyname of an element in the storage mechanism
* @return {void}
@@ -231,6 +231,15 @@ var _interceptors = {
clear: []
};
+/**
+ * @private
+ *
+ * Keys not allowed for cookies.
+ *
+ * @type {RegExp}
+ */
+var bannedKeys = /^(?:expires|max-age|path|domain|secure)$/i;
+
/**
* @private
*
@@ -376,14 +385,20 @@ var WebStorage = function () {
key: 'setItem',
value: function setItem(key, value, options) {
(0, _utils.checkEmpty)(key);
+ var storageType = this.__storage__;
+ if (storageType === 'cookieStorage' && bannedKeys.test(key)) {
+ throw new Error('The key is a reserved word, therefore not allowed');
+ }
var v = executeInterceptors('setItem', key, value, options);
if (v !== undefined) value = v;
this[key] = value;
// prevents converting strings to JSON to avoid extra quotes
if (typeof value !== 'string') value = JSON.stringify(value);
- // TODO: should add setTimeout for options.expires?
- // TODO: prevent adding cookies when the domain or path are not valid?
- _proxyMechanism.proxy[this.__storage__].setItem(key, value, options);
+ _proxyMechanism.proxy[storageType].setItem(key, value, options);
+ // checks if the cookie was created, or delete it if the domain or path are not valid
+ if (storageType === 'cookieStorage' && _proxyMechanism.proxy[storageType].getItem(key) === null) {
+ delete this[key];
+ }
}
/**
@@ -416,6 +431,7 @@ var WebStorage = function () {
* Deletes a key from the storage.
*
* @param {string} key: keyname of the storage
+ * @param {object} options: additional options for cookieStorage
* @return {void}
*
* @memberOf WebStorage
@@ -423,11 +439,11 @@ var WebStorage = function () {
}, {
key: 'removeItem',
- value: function removeItem(key) {
+ value: function removeItem(key, options) {
(0, _utils.checkEmpty)(key);
- executeInterceptors('removeItem', key);
+ executeInterceptors('removeItem', key, options);
delete this[key];
- _proxyMechanism.proxy[this.__storage__].removeItem(key);
+ _proxyMechanism.proxy[this.__storage__].removeItem(key, options);
}
/**
@@ -542,11 +558,19 @@ function buildExpirationString(date) {
return expires.toUTCString();
}
-// @private
-var buildStringFor = function buildStringFor(key, data) {
+/**
+ * @private
+ *
+ * Builds the string for the cookie's metadata.
+ *
+ * @param {string} key: name of the metadata
+ * @param {object} data: metadata of the cookie
+ * @return {string}
+ */
+function buildMetadataFor(key, data) {
if (!data[key]) return '';
return '; ' + key + '=' + data[key];
-};
+}
/**
* @private
@@ -583,9 +607,9 @@ function cookieStorage() {
if (options.domain && typeof options.domain === 'string') {
metadata.domain = options.domain.trim();
}
- var expires = buildStringFor('expires', metadata);
- var domain = buildStringFor('domain', metadata);
- var path = buildStringFor('path', metadata);
+ var expires = buildMetadataFor('expires', metadata);
+ var domain = buildMetadataFor('domain', metadata);
+ var path = buildMetadataFor('path', metadata);
var cookie = key + '=' + encodeURIComponent(value) + expires + domain + path;
$cookie.set(cookie);
},
@@ -601,8 +625,8 @@ function cookieStorage() {
if (value === null) delete $cookie.data[key];
return value;
},
- removeItem: function removeItem(key) {
- var metadata = Object.assign({}, $cookie.data[key]);
+ removeItem: function removeItem(key, options) {
+ var metadata = Object.assign({}, $cookie.data[key], options);
metadata.expires = { days: -1 };
api.setItem(key, '', metadata);
delete $cookie.data[key];
diff --git a/dist/proxy-storage.min.js b/dist/proxy-storage.min.js
index 90de146..500bb7d 100644
--- a/dist/proxy-storage.min.js
+++ b/dist/proxy-storage.min.js
@@ -1,3 +1,3 @@
-/*! proxyStorage@v2.1.1. Jherax 2017. Visit https://github.com/jherax/proxy-storage */
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.proxyStorage=t():e.proxyStorage=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,n){"use strict";function o(e){return"[object Object]"===Object.prototype.toString.call(e)}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},e),n=t.date instanceof Date?t.date:new Date;return+t.minutes&&n.setMinutes(n.getMinutes()+t.minutes),+t.hours&&n.setHours(n.getHours()+t.hours),+t.days&&n.setDate(n.getDate()+t.days),+t.months&&n.setMonth(n.getMonth()+t.months),+t.years&&n.setFullYear(n.getFullYear()+t.years),n}function i(e,t,n){var o={configurable:!1,enumerable:!1,writable:!1};"undefined"!=typeof n&&(o.value=n),Object.defineProperty(e,t,o)}function a(e){if(null==e||""===e)throw new Error("The key provided can not be empty")}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=o,t.alterDate=r,t.setProperty=i,t.checkEmpty=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isAvailable={localStorage:!1,sessionStorage:!1,cookieStorage:!1,memoryStorage:!0}},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o-1&&(t=o.substring(0,n),e.removeItem(t.trim()))})},initialize:function(){u.get().split(";").forEach(function(t){var n=t.indexOf("="),o=t.substring(0,n).trim(),r=t.substring(n+1).trim();o&&(e[o]=decodeURIComponent(r))})}};return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var a=n(0),u={get:function(){return document.cookie},set:function(e){document.cookie=e},data:{}},s=function(e,t){return t[e]?"; "+e+"="+t[e]:""}},function(e,t,n){"use strict";function o(){try{var e=JSON.parse(window.self.name);if(e&&"object"===("undefined"==typeof e?"undefined":a(e)))return e}catch(e){return{}}}function r(e){var t=JSON.stringify(e);window.self.name=t}function i(){var e=o(),t={setItem:function(t,n){e[t]=n,r(e)},getItem:function(t){var n=e[t];return void 0===n?null:n},removeItem:function(t){delete e[t],r(e)},clear:function(){Object.keys(e).forEach(function(t){return delete e[t]}),r(e)},initialize:function(){Object.assign(t,e)}};return t}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=i},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(!e.initialize)return e;for(var t in e)"initialize"!==t&&(0,c.setProperty)(e,t);return e.initialize(),delete e.initialize,e}Object.defineProperty(t,"__esModule",{value:!0}),t.proxy=void 0;var i=n(3),a=o(i),u=n(4),s=o(u),c=n(0);t.proxy={localStorage:window.localStorage,sessionStorage:window.sessionStorage,cookieStorage:r((0,a.default)()),memoryStorage:r((0,s.default)())}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=u.proxy[e],n="__proxy-storage__";try{return t.setItem(n,n),t.removeItem(n),!0}catch(e){return!1}}function i(e){return c.isAvailable[e]&&(u.webStorageSettings.default=e,f.set(e)),c.isAvailable[e]}function a(){c.isAvailable.localStorage=r("localStorage"),c.isAvailable.sessionStorage=r("sessionStorage"),c.isAvailable.cookieStorage=r("cookieStorage"),u.webStorageSettings.isAvailable=c.isAvailable,Object.keys(c.isAvailable).some(i)}Object.defineProperty(t,"__esModule",{value:!0}),t.isAvailable=t.configStorage=t.WebStorage=t.default=void 0;var u=n(2),s=o(u),c=n(1),l=null,f={get:function(){return l.__storage__},set:function(e){if(!Object.prototype.hasOwnProperty.call(u.proxy,e))throw new Error('Storage type "'+e+'" is not valid');t.default=l=new s.default(e)}};a(),t.default=l,t.WebStorage=s.default,t.configStorage=f,t.isAvailable=c.isAvailable}])});
+/*! proxyStorage@v2.1.2. Jherax 2017. Visit https://github.com/jherax/proxy-storage */
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.proxyStorage=t():e.proxyStorage=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,o){"use strict";function n(e){return"[object Object]"===Object.prototype.toString.call(e)}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},e),o=t.date instanceof Date?t.date:new Date;return+t.minutes&&o.setMinutes(o.getMinutes()+t.minutes),+t.hours&&o.setHours(o.getHours()+t.hours),+t.days&&o.setDate(o.getDate()+t.days),+t.months&&o.setMonth(o.getMonth()+t.months),+t.years&&o.setFullYear(o.getFullYear()+t.years),o}function i(e,t,o){var n={configurable:!1,enumerable:!1,writable:!1};"undefined"!=typeof o&&(n.value=o),Object.defineProperty(e,t,n)}function a(e){if(null==e||""===e)throw new Error("The key provided can not be empty")}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=n,t.alterDate=r,t.setProperty=i,t.checkEmpty=a},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isAvailable={localStorage:!1,sessionStorage:!1,cookieStorage:!1,memoryStorage:!0}},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n-1&&(t=n.substring(0,o),e.removeItem(t.trim()))})},initialize:function(){s.get().split(";").forEach(function(t){var o=t.indexOf("="),n=t.substring(0,o).trim(),r=t.substring(o+1).trim();n&&(e[n]=decodeURIComponent(r))})}};return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var u=o(0),s={get:function(){return document.cookie},set:function(e){document.cookie=e},data:{}}},function(e,t,o){"use strict";function n(){try{var e=JSON.parse(window.self.name);if(e&&"object"===("undefined"==typeof e?"undefined":a(e)))return e}catch(e){return{}}}function r(e){var t=JSON.stringify(e);window.self.name=t}function i(){var e=n(),t={setItem:function(t,o){e[t]=o,r(e)},getItem:function(t){var o=e[t];return void 0===o?null:o},removeItem:function(t){delete e[t],r(e)},clear:function(){Object.keys(e).forEach(function(t){return delete e[t]}),r(e)},initialize:function(){Object.assign(t,e)}};return t}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=i},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e){if(!e.initialize)return e;for(var t in e)"initialize"!==t&&(0,c.setProperty)(e,t);return e.initialize(),delete e.initialize,e}Object.defineProperty(t,"__esModule",{value:!0}),t.proxy=void 0;var i=o(3),a=n(i),u=o(4),s=n(u),c=o(0);t.proxy={localStorage:window.localStorage,sessionStorage:window.sessionStorage,cookieStorage:r((0,a.default)()),memoryStorage:r((0,s.default)())}},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=u.proxy[e],o="__proxy-storage__";try{return t.setItem(o,o),t.removeItem(o),!0}catch(e){return!1}}function i(e){return c.isAvailable[e]&&(u.webStorageSettings.default=e,f.set(e)),c.isAvailable[e]}function a(){c.isAvailable.localStorage=r("localStorage"),c.isAvailable.sessionStorage=r("sessionStorage"),c.isAvailable.cookieStorage=r("cookieStorage"),u.webStorageSettings.isAvailable=c.isAvailable,Object.keys(c.isAvailable).some(i)}Object.defineProperty(t,"__esModule",{value:!0}),t.isAvailable=t.configStorage=t.WebStorage=t.default=void 0;var u=o(2),s=n(u),c=o(1),l=null,f={get:function(){return l.__storage__},set:function(e){if(!Object.prototype.hasOwnProperty.call(u.proxy,e))throw new Error('Storage type "'+e+'" is not valid');t.default=l=new s.default(e)}};a(),t.default=l,t.WebStorage=s.default,t.configStorage=f,t.isAvailable=c.isAvailable}])});
//# sourceMappingURL=proxy-storage.min.map
\ No newline at end of file
diff --git a/dist/proxy-storage.min.map b/dist/proxy-storage.min.map
index 970313f..d698151 100644
--- a/dist/proxy-storage.min.map
+++ b/dist/proxy-storage.min.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///proxy-storage.min.js","webpack:///webpack/bootstrap bd9e754be3231a1fcd0a","webpack:///./src/utils.js","webpack:///./src/is-available.js","webpack:///./src/web-storage.js","webpack:///./src/cookie-storage.js","webpack:///./src/memory-storage.js","webpack:///./src/proxy-mechanism.js","webpack:///./src/proxy-storage.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","isObject","toString","alterDate","options","arguments","length","undefined","opt","assign","date","Date","minutes","setMinutes","getMinutes","hours","setHours","getHours","days","setDate","getDate","months","setMonth","getMonth","years","setFullYear","getFullYear","setProperty","obj","descriptor","writable","checkEmpty","key","Error","isAvailable","localStorage","sessionStorage","cookieStorage","memoryStorage","_classCallCheck","instance","Constructor","TypeError","executeInterceptors","command","_len","args","Array","_key","shift","_typeof","JSON","parse","stringify","_interceptors","reduce","val","action","transformed","concat","tryParse","parsed","e","copyKeys","storage","keys","forEach","storageAvailable","storageType","webStorageSettings","console","warn","default","proxy","_createClass","defineProperties","target","props","protoProps","staticProps","Symbol","iterator","constructor","_proxyMechanism","_utils","_isAvailable","_instances","setItem","getItem","removeItem","clear","WebStorage","cachedInstance","v","__storage__","_this","push","buildExpirationString","expires","toUTCString","findCookie","cookie","nameEQ","trim","indexOf","api","path","$cookie","data","metadata","domain","buildStringFor","encodeURIComponent","set","split","find","substring","decodeURIComponent","indexEQ","initialize","index","document","getStoreFromWindow","store","window","self","setStoreToWindow","hashtable","_interopRequireDefault","initApi","prop","_cookieStorage","_cookieStorage2","_memoryStorage","_memoryStorage2","isStorageAvailable","storageObj","_webStorage","configStorage","init","some","_webStorage2"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,aAAAD,IAEAD,EAAA,aAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,I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B,KAAhC6J,EAAAhE,MAA4CL,GAC/C,KAAM,IAAInC,OAAJ,iBAA2BmC,EAA3B,iBAERnG,GA2DeuG,QA3DfR,EAAU,GAAA6E,GAAArE,QAAeJ,IAwD7BuE,KRyyBA1K,EQtyBmBuG,QAAXR,ERuyBR/F,EQvyB4B0H,WRuyBPkD,EAAarE,QAClCvG,EQxyBwCyK,gBRyyBxCzK,EQzyBuDiE,YRyyBjCmD,EAAanD","file":"proxy-storage.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 6);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isObject = isObject;\nexports.alterDate = alterDate;\nexports.setProperty = setProperty;\nexports.checkEmpty = checkEmpty;\n/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Adds or subtracts date portions to the given date and returns the new date.\n *\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var opt = Object.assign({}, options);\n var d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nfunction setProperty(obj, name, value) {\n var descriptor = {\n configurable: false,\n enumerable: false,\n writable: false\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined either empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nfunction checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nvar isAvailable = exports.isAvailable = {\n localStorage: false,\n sessionStorage: false,\n cookieStorage: false,\n memoryStorage: true };\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = exports.webStorageSettings = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _proxyMechanism = __webpack_require__(5);\n\nvar _utils = __webpack_require__(0);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nvar _instances = {};\n\n/**\n * @private\n *\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nvar _interceptors = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: []\n};\n\n/**\n * @private\n *\n * Executes the interceptors for a WebStorage method and\n * allows the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var key = args.shift();\n var value = args.shift();\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return _interceptors[command].reduce(function (val, action) {\n var transformed = action.apply(undefined, [key, val].concat(args));\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/**\n * @private\n *\n * Try to parse a value\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/**\n * @private\n *\n * Copies all existing keys in the WebStorage instance.\n *\n * @param {WebStorage} instance: the instance to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {void}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach(function (key) {\n instance[key] = tryParse(storage[key]);\n });\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nvar webStorageSettings = {\n default: null,\n isAvailable: _isAvailable.isAvailable\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n console.warn(storageType + ' is not available. Falling back to ' + webStorageSettings.default); // eslint-disable-line\n return webStorageSettings.default;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\n\nvar WebStorage = function () {\n\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n function WebStorage(storageType) {\n _classCallCheck(this, WebStorage);\n\n if (!Object.prototype.hasOwnProperty.call(_proxyMechanism.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n // gets the requested storage mechanism\n var storage = _proxyMechanism.proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n var cachedInstance = _instances[storageType];\n if (cachedInstance) {\n copyKeys(cachedInstance, storage);\n return cachedInstance;\n }\n (0, _utils.setProperty)(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n copyKeys(this, storage);\n _instances[storageType] = this;\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n\n _createClass(WebStorage, [{\n key: 'setItem',\n value: function setItem(key, value, options) {\n (0, _utils.checkEmpty)(key);\n var v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n // TODO: should add setTimeout for options.expires?\n // TODO: prevent adding cookies when the domain or path are not valid?\n _proxyMechanism.proxy[this.__storage__].setItem(key, value, options);\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'getItem',\n value: function getItem(key) {\n (0, _utils.checkEmpty)(key);\n var value = _proxyMechanism.proxy[this.__storage__].getItem(key);\n if (value == null) {\n delete this[key];\n value = null;\n } else {\n value = tryParse(value);\n this[key] = value;\n }\n var v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'removeItem',\n value: function removeItem(key) {\n (0, _utils.checkEmpty)(key);\n executeInterceptors('removeItem', key);\n delete this[key];\n _proxyMechanism.proxy[this.__storage__].removeItem(key);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n var _this = this;\n\n executeInterceptors('clear');\n Object.keys(this).forEach(function (key) {\n delete _this[key];\n }, this);\n _proxyMechanism.proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'length',\n get: function get() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }], [{\n key: 'interceptors',\n value: function interceptors(command, action) {\n if (command in _interceptors && typeof action === 'function') {\n _interceptors[command].push(action);\n }\n }\n }]);\n\n return WebStorage;\n}();\n\n// @public API\n\n\nexports.default = WebStorage;\nexports.webStorageSettings = webStorageSettings;\nexports.proxy = _proxyMechanism.proxy;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cookieStorage;\n\nvar _utils = __webpack_require__(0);\n\n/**\n * @private\n *\n * Proxy for the default cookie storage associated with the current document.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nvar $cookie = {\n get: function get() {\n return document.cookie;\n },\n set: function set(value) {\n document.cookie = value;\n },\n data: {} };\n\n/**\n * @private\n *\n * Builds the expiration part for the cookie.\n *\n * @see utils.alterDate(options)\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\n/* eslint-disable no-invalid-this */\nfunction buildExpirationString(date) {\n var expires = date instanceof Date ? (0, _utils.alterDate)({ date: date }) : (0, _utils.alterDate)(date);\n return expires.toUTCString();\n}\n\n// @private\nvar buildStringFor = function buildStringFor(key, data) {\n if (!data[key]) return '';\n return '; ' + key + '=' + data[key];\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n var nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document cookies\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n var api = {\n setItem: function setItem(key, value, options) {\n options = Object.assign({ path: '/' }, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = { path: options.path };\n var metadata = $cookie.data[key];\n if ((0, _utils.isObject)(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpirationString(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n var expires = buildStringFor('expires', metadata);\n var domain = buildStringFor('domain', metadata);\n var path = buildStringFor('path', metadata);\n var cookie = key + '=' + encodeURIComponent(value) + expires + domain + path;\n $cookie.set(cookie);\n },\n getItem: function getItem(key) {\n var value = null;\n var nameEQ = key + '=';\n var cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n removeItem: function removeItem(key) {\n var metadata = Object.assign({}, $cookie.data[key]);\n metadata.expires = { days: -1 };\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n clear: function clear() {\n var key = void 0,\n indexEQ = void 0; // eslint-disable-line\n $cookie.get().split(';').forEach(function (cookie) {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n\n\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize: function initialize() {\n $cookie.get().split(';').forEach(function (cookie) {\n var index = cookie.indexOf('=');\n var key = cookie.substring(0, index).trim();\n var value = cookie.substring(index + 1).trim();\n // copies all existing elements in the storage\n if (key) api[key] = decodeURIComponent(value);\n });\n }\n };\n return api;\n}\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = memoryStorage;\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n // eslint-disable-line\n try {\n var store = JSON.parse(window.self.name);\n if (store && (typeof store === 'undefined' ? 'undefined' : _typeof(store)) === 'object') return store;\n } catch (e) {\n return {};\n }\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n var store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory store and\n * implements the Web Storage interface. It also adds a hack\n * to persist the store in session for the current browser-tab.\n *\n * @return {object}\n */\nfunction memoryStorage() {\n var hashtable = getStoreFromWindow();\n var api = {\n setItem: function setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem: function getItem(key) {\n var value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem: function removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear: function clear() {\n Object.keys(hashtable).forEach(function (key) {\n return delete hashtable[key];\n });\n setStoreToWindow(hashtable);\n },\n\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize: function initialize() {\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n }\n };\n return api;\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = undefined;\n\nvar _cookieStorage = __webpack_require__(3);\n\nvar _cookieStorage2 = _interopRequireDefault(_cookieStorage);\n\nvar _memoryStorage = __webpack_require__(4);\n\nvar _memoryStorage2 = _interopRequireDefault(_memoryStorage);\n\nvar _utils = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n *\n * Adds the current elements in the storage object.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initApi(api) {\n if (!api.initialize) return api;\n // sets read-only and non-enumerable properties\n for (var prop in api) {\n // eslint-disable-line\n if (prop !== 'initialize') {\n (0, _utils.setProperty)(api, prop);\n }\n }\n api.initialize();\n // this method is removed after being invoked\n // because is not part of the Web Storage interface\n delete api.initialize;\n return api;\n}\n\n/**\n * @public\n *\n * Proxy for storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nvar proxy = exports.proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: initApi((0, _cookieStorage2.default)()),\n memoryStorage: initApi((0, _memoryStorage2.default)())\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isAvailable = exports.configStorage = exports.WebStorage = exports.default = undefined;\n\nvar _webStorage = __webpack_require__(2);\n\nvar _webStorage2 = _interopRequireDefault(_webStorage);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// If you want to support all ES6 features, uncomment the next line\n// import 'babel-polyfill';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\n/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nvar storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nvar configStorage = {\n get: function get() {\n return storage.__storage__;\n },\n\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set: function set(storageType) {\n if (!Object.prototype.hasOwnProperty.call(_webStorage.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n exports.default = storage = new _webStorage2.default(storageType);\n }\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n var storageObj = _webStorage.proxy[storageType];\n var data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (_isAvailable.isAvailable[storageType]) {\n _webStorage.webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return _isAvailable.isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n _isAvailable.isAvailable.localStorage = isStorageAvailable('localStorage');\n _isAvailable.isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n _isAvailable.isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n _webStorage.webStorageSettings.isAvailable = _isAvailable.isAvailable;\n // sets the default storage mechanism available\n Object.keys(_isAvailable.isAvailable).some(storageAvailable);\n}\n\ninit();\n\n// @public API\nexports.default = storage;\nexports.WebStorage = _webStorage2.default;\nexports.configStorage = configStorage;\nexports.isAvailable = _isAvailable.isAvailable;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// proxy-storage.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bd9e754be3231a1fcd0a","/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nexport function isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Adds or subtracts date portions to the given date and returns the new date.\n *\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nexport function alterDate(options = {}) {\n const opt = Object.assign({}, options);\n const d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nexport function setProperty(obj, name, value) {\n const descriptor = {\n configurable: false,\n enumerable: false,\n writable: false,\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined either empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nexport function checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nexport const isAvailable = {\n localStorage: false,\n sessionStorage: false,\n cookieStorage: false,\n memoryStorage: true, // fallback storage\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/is-available.js","import {proxy} from './proxy-mechanism';\nimport {setProperty, checkEmpty} from './utils';\nimport {isAvailable} from './is-available';\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nconst _instances = {};\n\n/**\n * @private\n *\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nconst _interceptors = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: [],\n};\n\n/**\n * @private\n *\n * Executes the interceptors for a WebStorage method and\n * allows the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command, ...args) {\n const key = args.shift();\n let value = args.shift();\n if (value && typeof value === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return _interceptors[command].reduce((val, action) => {\n const transformed = action(key, val, ...args);\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/**\n * @private\n *\n * Try to parse a value\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/**\n * @private\n *\n * Copies all existing keys in the WebStorage instance.\n *\n * @param {WebStorage} instance: the instance to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {void}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach((key) => {\n instance[key] = tryParse(storage[key]);\n });\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nconst webStorageSettings = {\n default: null,\n isAvailable,\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n console.warn(`${storageType} is not available. Falling back to ${webStorageSettings.default}`); // eslint-disable-line\n return webStorageSettings.default;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\nclass WebStorage {\n\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n constructor(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n // gets the requested storage mechanism\n const storage = proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n const cachedInstance = _instances[storageType];\n if (cachedInstance) {\n copyKeys(cachedInstance, storage);\n return cachedInstance;\n }\n setProperty(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n copyKeys(this, storage);\n _instances[storageType] = this;\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n setItem(key, value, options) {\n checkEmpty(key);\n const v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n // TODO: should add setTimeout for options.expires?\n // TODO: prevent adding cookies when the domain or path are not valid?\n proxy[this.__storage__].setItem(key, value, options);\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n getItem(key) {\n checkEmpty(key);\n let value = proxy[this.__storage__].getItem(key);\n if (value == null) {\n delete this[key];\n value = null;\n } else {\n value = tryParse(value);\n this[key] = value;\n }\n const v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n removeItem(key) {\n checkEmpty(key);\n executeInterceptors('removeItem', key);\n delete this[key];\n proxy[this.__storage__].removeItem(key);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n clear() {\n executeInterceptors('clear');\n Object.keys(this).forEach((key) => {\n delete this[key];\n }, this);\n proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n get length() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n static interceptors(command, action) {\n if (command in _interceptors && typeof action === 'function') {\n _interceptors[command].push(action);\n }\n }\n}\n\n// @public API\nexport {WebStorage as default, webStorageSettings, proxy};\n\n\n\n// WEBPACK FOOTER //\n// ./src/web-storage.js","/* eslint-disable no-invalid-this */\nimport {alterDate, isObject} from './utils';\n\n/**\n * @private\n *\n * Proxy for the default cookie storage associated with the current document.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nconst $cookie = {\n get: () => document.cookie,\n set: (value) => {\n document.cookie = value;\n },\n data: {}, // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Builds the expiration part for the cookie.\n *\n * @see utils.alterDate(options)\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nfunction buildExpirationString(date) {\n const expires = (date instanceof Date ?\n alterDate({date}) :\n alterDate(date)\n );\n return expires.toUTCString();\n}\n\n// @private\nconst buildStringFor = (key, data) => {\n if (!data[key]) return '';\n return `; ${key}=${data[key]}`;\n};\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n const nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document cookies\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nexport default function cookieStorage() {\n const api = {\n setItem(key, value, options) {\n options = Object.assign({path: '/'}, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = {path: options.path};\n const metadata = $cookie.data[key];\n if (isObject(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpirationString(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n const expires = buildStringFor('expires', metadata);\n const domain = buildStringFor('domain', metadata);\n const path = buildStringFor('path', metadata);\n const cookie = `${key}=${encodeURIComponent(value)}${expires}${domain}${path}`;\n $cookie.set(cookie);\n },\n\n getItem(key) {\n let value = null;\n const nameEQ = `${key}=`;\n const cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n removeItem(key) {\n const metadata = Object.assign({}, $cookie.data[key]);\n metadata.expires = {days: -1};\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n\n clear() {\n let key, indexEQ; // eslint-disable-line\n $cookie.get().split(';').forEach((cookie) => {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize() {\n $cookie.get().split(';').forEach((cookie) => {\n const index = cookie.indexOf('=');\n const key = cookie.substring(0, index).trim();\n const value = cookie.substring(index + 1).trim();\n // copies all existing elements in the storage\n if (key) api[key] = decodeURIComponent(value);\n });\n },\n };\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/cookie-storage.js","/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() { // eslint-disable-line\n try {\n const store = JSON.parse(window.self.name);\n if (store && typeof store === 'object') return store;\n } catch (e) {\n return {};\n }\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n const store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory store and\n * implements the Web Storage interface. It also adds a hack\n * to persist the store in session for the current browser-tab.\n *\n * @return {object}\n */\nexport default function memoryStorage() {\n const hashtable = getStoreFromWindow();\n const api = {\n setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem(key) {\n const value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear() {\n Object.keys(hashtable).forEach(key => delete hashtable[key]);\n setStoreToWindow(hashtable);\n },\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize() {\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n },\n };\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memory-storage.js","import cookieStorage from './cookie-storage';\nimport memoryStorage from './memory-storage';\nimport {setProperty} from './utils';\n\n/**\n * @private\n *\n * Adds the current elements in the storage object.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initApi(api) {\n if (!api.initialize) return api;\n // sets read-only and non-enumerable properties\n for (let prop in api) { // eslint-disable-line\n if (prop !== 'initialize') {\n setProperty(api, prop);\n }\n }\n api.initialize();\n // this method is removed after being invoked\n // because is not part of the Web Storage interface\n delete api.initialize;\n return api;\n}\n\n/**\n * @public\n *\n * Proxy for storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nexport const proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: initApi(cookieStorage()),\n memoryStorage: initApi(memoryStorage()),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-mechanism.js","/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nimport WebStorage, {proxy, webStorageSettings} from './web-storage';\nimport {isAvailable} from './is-available';\n\n// If you want to support all ES6 features, uncomment the next line\n// import 'babel-polyfill';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\nlet storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nconst configStorage = {\n get() {\n return storage.__storage__;\n },\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n storage = new WebStorage(storageType);\n },\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n const storageObj = proxy[storageType];\n const data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (isAvailable[storageType]) {\n webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n isAvailable.localStorage = isStorageAvailable('localStorage');\n isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n webStorageSettings.isAvailable = isAvailable;\n // sets the default storage mechanism available\n Object.keys(isAvailable).some(storageAvailable);\n}\n\ninit();\n\n// @public API\nexport {storage as default, WebStorage, configStorage, isAvailable};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-storage.js"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///proxy-storage.min.js","webpack:///webpack/bootstrap 4018682c947388ec0c6a","webpack:///./src/utils.js","webpack:///./src/is-available.js","webpack:///./src/web-storage.js","webpack:///./src/cookie-storage.js","webpack:///./src/memory-storage.js","webpack:///./src/proxy-mechanism.js","webpack:///./src/proxy-storage.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","isObject","toString","alterDate","options","arguments","length","undefined","opt","assign","date","Date","minutes","setMinutes","getMinutes","hours","setHours","getHours","days","setDate","getDate","months","setMonth","getMonth","years","setFullYear","getFullYear","setProperty","obj","descriptor","writable","checkEmpty","key","Error","isAvailable","localStorage","sessionStorage","cookieStorage","memoryStorage","_classCallCheck","instance","Constructor","TypeError","executeInterceptors","command","_len","args","Array","_key","shift","_typeof","JSON","parse","stringify","_interceptors","reduce","val","action","transformed","concat","tryParse","parsed","e","copyKeys","storage","keys","forEach","storageAvailable","storageType","webStorageSettings","console","warn","default","proxy","_createClass","defineProperties","target","props","protoProps","staticProps","Symbol","iterator","constructor","_proxyMechanism","_utils","_isAvailable","_instances","setItem","getItem","removeItem","clear","bannedKeys","WebStorage","cachedInstance","__storage__","test","v","_this","push","buildExpirationString","expires","toUTCString","buildMetadataFor","data","findCookie","cookie","nameEQ","trim","indexOf","api","path","$cookie","metadata","domain","encodeURIComponent","set","split","find","substring","decodeURIComponent","indexEQ","initialize","index","document","getStoreFromWindow","store","window","self","setStoreToWindow","hashtable","_interopRequireDefault","initApi","prop","_cookieStorage","_cookieStorage2","_memoryStorage","_memoryStorage2","isStorageAvailable","storageObj","_webStorage","configStorage","init","some","_webStorage2"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,aAAAD,IAEAD,EAAA,aAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA+DA,OAnCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAG,EAAA,SAAAK,GAA2C,MAAAA,IAG3CR,EAAAS,EAAA,SAAAf,EAAAgB,EAAAC,GACAX,EAAAY,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAX,EAAAkB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAK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4B2H,WR+zBPmD,EAAavE,QAClCvG,EQh0BwC2K,gBRi0BxC3K,EQj0BuDiE,YRi0BjCmD,EAAanD","file":"proxy-storage.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"proxyStorage\"] = factory();\n\telse\n\t\troot[\"proxyStorage\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 6);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isObject = isObject;\nexports.alterDate = alterDate;\nexports.setProperty = setProperty;\nexports.checkEmpty = checkEmpty;\n/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Adds or subtracts date portions to the given date and returns the new date.\n *\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nfunction alterDate() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var opt = Object.assign({}, options);\n var d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nfunction setProperty(obj, name, value) {\n var descriptor = {\n configurable: false,\n enumerable: false,\n writable: false\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nfunction checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nvar isAvailable = exports.isAvailable = {\n localStorage: false,\n sessionStorage: false,\n cookieStorage: false,\n memoryStorage: true };\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = exports.webStorageSettings = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _proxyMechanism = __webpack_require__(5);\n\nvar _utils = __webpack_require__(0);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nvar _instances = {};\n\n/**\n * @private\n *\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nvar _interceptors = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: []\n};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nvar bannedKeys = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Executes the interceptors for a WebStorage method and\n * allows the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var key = args.shift();\n var value = args.shift();\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return _interceptors[command].reduce(function (val, action) {\n var transformed = action.apply(undefined, [key, val].concat(args));\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/**\n * @private\n *\n * Try to parse a value\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n var parsed = void 0;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/**\n * @private\n *\n * Copies all existing keys in the WebStorage instance.\n *\n * @param {WebStorage} instance: the instance to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {void}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach(function (key) {\n instance[key] = tryParse(storage[key]);\n });\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nvar webStorageSettings = {\n default: null,\n isAvailable: _isAvailable.isAvailable\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n console.warn(storageType + ' is not available. Falling back to ' + webStorageSettings.default); // eslint-disable-line\n return webStorageSettings.default;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\n\nvar WebStorage = function () {\n\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n function WebStorage(storageType) {\n _classCallCheck(this, WebStorage);\n\n if (!Object.prototype.hasOwnProperty.call(_proxyMechanism.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n // gets the requested storage mechanism\n var storage = _proxyMechanism.proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n var cachedInstance = _instances[storageType];\n if (cachedInstance) {\n copyKeys(cachedInstance, storage);\n return cachedInstance;\n }\n (0, _utils.setProperty)(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n copyKeys(this, storage);\n _instances[storageType] = this;\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n\n _createClass(WebStorage, [{\n key: 'setItem',\n value: function setItem(key, value, options) {\n (0, _utils.checkEmpty)(key);\n var storageType = this.__storage__;\n if (storageType === 'cookieStorage' && bannedKeys.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n var v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n _proxyMechanism.proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && _proxyMechanism.proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'getItem',\n value: function getItem(key) {\n (0, _utils.checkEmpty)(key);\n var value = _proxyMechanism.proxy[this.__storage__].getItem(key);\n if (value == null) {\n delete this[key];\n value = null;\n } else {\n value = tryParse(value);\n this[key] = value;\n }\n var v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'removeItem',\n value: function removeItem(key, options) {\n (0, _utils.checkEmpty)(key);\n executeInterceptors('removeItem', key, options);\n delete this[key];\n _proxyMechanism.proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n var _this = this;\n\n executeInterceptors('clear');\n Object.keys(this).forEach(function (key) {\n delete _this[key];\n }, this);\n _proxyMechanism.proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n\n }, {\n key: 'length',\n get: function get() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n\n }], [{\n key: 'interceptors',\n value: function interceptors(command, action) {\n if (command in _interceptors && typeof action === 'function') {\n _interceptors[command].push(action);\n }\n }\n }]);\n\n return WebStorage;\n}();\n\n// @public API\n\n\nexports.default = WebStorage;\nexports.webStorageSettings = webStorageSettings;\nexports.proxy = _proxyMechanism.proxy;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cookieStorage;\n\nvar _utils = __webpack_require__(0);\n\n/**\n * @private\n *\n * Proxy for the default cookie storage associated with the current document.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nvar $cookie = {\n get: function get() {\n return document.cookie;\n },\n set: function set(value) {\n document.cookie = value;\n },\n data: {} };\n\n/**\n * @private\n *\n * Builds the expiration part for the cookie.\n *\n * @see utils.alterDate(options)\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\n/* eslint-disable no-invalid-this */\nfunction buildExpirationString(date) {\n var expires = date instanceof Date ? (0, _utils.alterDate)({ date: date }) : (0, _utils.alterDate)(date);\n return expires.toUTCString();\n}\n\n/**\n * @private\n *\n * Builds the string for the cookie's metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return '; ' + key + '=' + data[key];\n}\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n var nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document cookies\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nfunction cookieStorage() {\n var api = {\n setItem: function setItem(key, value, options) {\n options = Object.assign({ path: '/' }, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = { path: options.path };\n var metadata = $cookie.data[key];\n if ((0, _utils.isObject)(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpirationString(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n var expires = buildMetadataFor('expires', metadata);\n var domain = buildMetadataFor('domain', metadata);\n var path = buildMetadataFor('path', metadata);\n var cookie = key + '=' + encodeURIComponent(value) + expires + domain + path;\n $cookie.set(cookie);\n },\n getItem: function getItem(key) {\n var value = null;\n var nameEQ = key + '=';\n var cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n removeItem: function removeItem(key, options) {\n var metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = { days: -1 };\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n clear: function clear() {\n var key = void 0,\n indexEQ = void 0; // eslint-disable-line\n $cookie.get().split(';').forEach(function (cookie) {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n\n\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize: function initialize() {\n $cookie.get().split(';').forEach(function (cookie) {\n var index = cookie.indexOf('=');\n var key = cookie.substring(0, index).trim();\n var value = cookie.substring(index + 1).trim();\n // copies all existing elements in the storage\n if (key) api[key] = decodeURIComponent(value);\n });\n }\n };\n return api;\n}\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = memoryStorage;\n/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() {\n // eslint-disable-line\n try {\n var store = JSON.parse(window.self.name);\n if (store && (typeof store === 'undefined' ? 'undefined' : _typeof(store)) === 'object') return store;\n } catch (e) {\n return {};\n }\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n var store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory store and\n * implements the Web Storage interface. It also adds a hack\n * to persist the store in session for the current browser-tab.\n *\n * @return {object}\n */\nfunction memoryStorage() {\n var hashtable = getStoreFromWindow();\n var api = {\n setItem: function setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem: function getItem(key) {\n var value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem: function removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear: function clear() {\n Object.keys(hashtable).forEach(function (key) {\n return delete hashtable[key];\n });\n setStoreToWindow(hashtable);\n },\n\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize: function initialize() {\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n }\n };\n return api;\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.proxy = undefined;\n\nvar _cookieStorage = __webpack_require__(3);\n\nvar _cookieStorage2 = _interopRequireDefault(_cookieStorage);\n\nvar _memoryStorage = __webpack_require__(4);\n\nvar _memoryStorage2 = _interopRequireDefault(_memoryStorage);\n\nvar _utils = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n *\n * Adds the current elements in the storage object.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initApi(api) {\n if (!api.initialize) return api;\n // sets read-only and non-enumerable properties\n for (var prop in api) {\n // eslint-disable-line\n if (prop !== 'initialize') {\n (0, _utils.setProperty)(api, prop);\n }\n }\n api.initialize();\n // this method is removed after being invoked\n // because is not part of the Web Storage interface\n delete api.initialize;\n return api;\n}\n\n/**\n * @public\n *\n * Proxy for storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nvar proxy = exports.proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: initApi((0, _cookieStorage2.default)()),\n memoryStorage: initApi((0, _memoryStorage2.default)())\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isAvailable = exports.configStorage = exports.WebStorage = exports.default = undefined;\n\nvar _webStorage = __webpack_require__(2);\n\nvar _webStorage2 = _interopRequireDefault(_webStorage);\n\nvar _isAvailable = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// If you want to support all ES6 features, uncomment the next line\n// import 'babel-polyfill';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\n/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nvar storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nvar configStorage = {\n get: function get() {\n return storage.__storage__;\n },\n\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set: function set(storageType) {\n if (!Object.prototype.hasOwnProperty.call(_webStorage.proxy, storageType)) {\n throw new Error('Storage type \"' + storageType + '\" is not valid');\n }\n exports.default = storage = new _webStorage2.default(storageType);\n }\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n var storageObj = _webStorage.proxy[storageType];\n var data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (_isAvailable.isAvailable[storageType]) {\n _webStorage.webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return _isAvailable.isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n _isAvailable.isAvailable.localStorage = isStorageAvailable('localStorage');\n _isAvailable.isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n _isAvailable.isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n _webStorage.webStorageSettings.isAvailable = _isAvailable.isAvailable;\n // sets the default storage mechanism available\n Object.keys(_isAvailable.isAvailable).some(storageAvailable);\n}\n\ninit();\n\n// @public API\nexports.default = storage;\nexports.WebStorage = _webStorage2.default;\nexports.configStorage = configStorage;\nexports.isAvailable = _isAvailable.isAvailable;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// proxy-storage.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4018682c947388ec0c6a","/**\n * Determines whether a value is a plain object.\n *\n * @param {any} value: the object to test\n * @return {boolean}\n */\nexport function isObject(value) {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Adds or subtracts date portions to the given date and returns the new date.\n *\n * @see https://gist.github.com/jherax/bbc43e479a492cc9cbfc7ccc20c53cd2\n *\n * @param {object} options: It contains the date parts to add or remove, and can have the following properties:\n * - {Date} date: if provided, this date will be affected, otherwise the current date will be used.\n * - {number} minutes: minutes to add/subtract\n * - {number} hours: hours to add/subtract\n * - {number} days: days to add/subtract\n * - {number} months: months to add/subtract\n * - {number} years: years to add/subtract\n * @return {Date}\n */\nexport function alterDate(options = {}) {\n const opt = Object.assign({}, options);\n const d = opt.date instanceof Date ? opt.date : new Date();\n if (+opt.minutes) d.setMinutes(d.getMinutes() + opt.minutes);\n if (+opt.hours) d.setHours(d.getHours() + opt.hours);\n if (+opt.days) d.setDate(d.getDate() + opt.days);\n if (+opt.months) d.setMonth(d.getMonth() + opt.months);\n if (+opt.years) d.setFullYear(d.getFullYear() + opt.years);\n return d;\n}\n\n/**\n * Creates a non-enumerable read-only property.\n *\n * @param {object} obj: the object to add the property\n * @param {string} name: the name of the property\n * @param {any} value: the value of the property\n * @return {void}\n */\nexport function setProperty(obj, name, value) {\n const descriptor = {\n configurable: false,\n enumerable: false,\n writable: false,\n };\n if (typeof value !== 'undefined') {\n descriptor.value = value;\n }\n Object.defineProperty(obj, name, descriptor);\n}\n\n/**\n * Validates if the key is not empty.\n * (null, undefined or empty string)\n *\n * @param {string} key: keyname of an element in the storage mechanism\n * @return {void}\n */\nexport function checkEmpty(key) {\n if (key == null || key === '') {\n throw new Error('The key provided can not be empty');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * @public\n *\n * Used to determine which storage mechanisms are available.\n *\n * @type {object}\n */\nexport const isAvailable = {\n localStorage: false,\n sessionStorage: false,\n cookieStorage: false,\n memoryStorage: true, // fallback storage\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/is-available.js","import {proxy} from './proxy-mechanism';\nimport {setProperty, checkEmpty} from './utils';\nimport {isAvailable} from './is-available';\n\n/**\n * @private\n *\n * Keeps WebStorage instances by type as singletons.\n *\n * @type {object}\n */\nconst _instances = {};\n\n/**\n * @private\n *\n * Stores the interceptors for WebStorage methods.\n *\n * @type {object}\n */\nconst _interceptors = {\n setItem: [],\n getItem: [],\n removeItem: [],\n clear: [],\n};\n\n/**\n * @private\n *\n * Keys not allowed for cookies.\n *\n * @type {RegExp}\n */\nconst bannedKeys = /^(?:expires|max-age|path|domain|secure)$/i;\n\n/**\n * @private\n *\n * Executes the interceptors for a WebStorage method and\n * allows the transformation in chain of the value passed through.\n *\n * @param {string} command: name of the method to intercept\n * @return {any}\n */\nfunction executeInterceptors(command, ...args) {\n const key = args.shift();\n let value = args.shift();\n if (value && typeof value === 'object') {\n // clone the object to prevent mutations\n value = JSON.parse(JSON.stringify(value));\n }\n return _interceptors[command].reduce((val, action) => {\n const transformed = action(key, val, ...args);\n if (transformed == null) return val;\n return transformed;\n }, value);\n}\n\n/**\n * @private\n *\n * Try to parse a value\n *\n * @param {string} value: the value to parse\n * @return {any}\n */\nfunction tryParse(value) {\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (e) {\n parsed = value;\n }\n return parsed;\n}\n\n/**\n * @private\n *\n * Copies all existing keys in the WebStorage instance.\n *\n * @param {WebStorage} instance: the instance to where copy the keys\n * @param {object} storage: the storage mechanism\n * @return {void}\n */\nfunction copyKeys(instance, storage) {\n Object.keys(storage).forEach((key) => {\n instance[key] = tryParse(storage[key]);\n });\n}\n\n/**\n * @public\n *\n * Allows to validate if a storage mechanism is valid\n *\n * @type {object}\n */\nconst webStorageSettings = {\n default: null,\n isAvailable,\n};\n\n/**\n * @private\n *\n * Validates if the storage mechanism is available and can be used safely.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {string}\n */\nfunction storageAvailable(storageType) {\n if (webStorageSettings.isAvailable[storageType]) return storageType;\n console.warn(`${storageType} is not available. Falling back to ${webStorageSettings.default}`); // eslint-disable-line\n return webStorageSettings.default;\n}\n\n/**\n * @public\n *\n * Implementation of the Web Storage interface.\n * It saves and retrieves values as JSON.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {class}\n */\nclass WebStorage {\n\n /**\n * Creates an instance of WebStorage.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n *\n * @memberOf WebStorage\n */\n constructor(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n // gets the requested storage mechanism\n const storage = proxy[storageType];\n // if the storage is not available, sets the default\n storageType = storageAvailable(storageType);\n // keeps only one instance by storageType (singleton)\n const cachedInstance = _instances[storageType];\n if (cachedInstance) {\n copyKeys(cachedInstance, storage);\n return cachedInstance;\n }\n setProperty(this, '__storage__', storageType);\n // copies all existing keys in the storage mechanism\n copyKeys(this, storage);\n _instances[storageType] = this;\n }\n\n /**\n * Stores a value given a key name.\n *\n * @param {string} key: keyname of the storage\n * @param {any} value: data to save in the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n setItem(key, value, options) {\n checkEmpty(key);\n const storageType = this.__storage__;\n if (storageType === 'cookieStorage' && bannedKeys.test(key)) {\n throw new Error('The key is a reserved word, therefore not allowed');\n }\n const v = executeInterceptors('setItem', key, value, options);\n if (v !== undefined) value = v;\n this[key] = value;\n // prevents converting strings to JSON to avoid extra quotes\n if (typeof value !== 'string') value = JSON.stringify(value);\n proxy[storageType].setItem(key, value, options);\n // checks if the cookie was created, or delete it if the domain or path are not valid\n if (storageType === 'cookieStorage' && proxy[storageType].getItem(key) === null) {\n delete this[key];\n }\n }\n\n /**\n * Retrieves a value by its key name.\n *\n * @param {string} key: keyname of the storage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n getItem(key) {\n checkEmpty(key);\n let value = proxy[this.__storage__].getItem(key);\n if (value == null) {\n delete this[key];\n value = null;\n } else {\n value = tryParse(value);\n this[key] = value;\n }\n const v = executeInterceptors('getItem', key, value);\n if (v !== undefined) value = v;\n return value;\n }\n\n /**\n * Deletes a key from the storage.\n *\n * @param {string} key: keyname of the storage\n * @param {object} options: additional options for cookieStorage\n * @return {void}\n *\n * @memberOf WebStorage\n */\n removeItem(key, options) {\n checkEmpty(key);\n executeInterceptors('removeItem', key, options);\n delete this[key];\n proxy[this.__storage__].removeItem(key, options);\n }\n\n /**\n * Removes all keys from the storage.\n *\n * @return {void}\n *\n * @memberOf WebStorage\n */\n clear() {\n executeInterceptors('clear');\n Object.keys(this).forEach((key) => {\n delete this[key];\n }, this);\n proxy[this.__storage__].clear();\n }\n\n /**\n * Gets the number of data items stored in the Storage object.\n *\n * @readonly\n *\n * @memberOf WebStorage\n */\n get length() {\n return Object.keys(this).length;\n }\n\n /**\n * Adds an interceptor to a WebStorage method.\n *\n * @param {string} command: name of the API method to intercept\n * @param {function} action: callback executed when the API method is called\n * @return {void}\n *\n * @memberOf WebStorage\n */\n static interceptors(command, action) {\n if (command in _interceptors && typeof action === 'function') {\n _interceptors[command].push(action);\n }\n }\n}\n\n// @public API\nexport {WebStorage as default, webStorageSettings, proxy};\n\n\n\n// WEBPACK FOOTER //\n// ./src/web-storage.js","/* eslint-disable no-invalid-this */\nimport {alterDate, isObject} from './utils';\n\n/**\n * @private\n *\n * Proxy for the default cookie storage associated with the current document.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\n *\n * @type {object}\n */\nconst $cookie = {\n get: () => document.cookie,\n set: (value) => {\n document.cookie = value;\n },\n data: {}, // metadata associated to the cookies\n};\n\n/**\n * @private\n *\n * Builds the expiration part for the cookie.\n *\n * @see utils.alterDate(options)\n *\n * @param {Date|object} date: the expiration date\n * @return {string}\n */\nfunction buildExpirationString(date) {\n const expires = (date instanceof Date ?\n alterDate({date}) :\n alterDate(date)\n );\n return expires.toUTCString();\n}\n\n/**\n * @private\n *\n * Builds the string for the cookie's metadata.\n *\n * @param {string} key: name of the metadata\n * @param {object} data: metadata of the cookie\n * @return {string}\n */\nfunction buildMetadataFor(key, data) {\n if (!data[key]) return '';\n return `; ${key}=${data[key]}`;\n}\n\n/**\n * @private\n *\n * Finds an element in the array.\n *\n * @param {string} cookie: key=value\n * @return {boolean}\n */\nfunction findCookie(cookie) {\n const nameEQ = this.toString();\n // prevent leading spaces before the key\n return cookie.trim().indexOf(nameEQ) === 0;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from document cookies\n * and implements the Web Storage interface.\n *\n * @return {object}\n */\nexport default function cookieStorage() {\n const api = {\n setItem(key, value, options) {\n options = Object.assign({path: '/'}, options);\n // keep track of the metadata associated to the cookie\n $cookie.data[key] = {path: options.path};\n const metadata = $cookie.data[key];\n if (isObject(options.expires) || options.expires instanceof Date) {\n metadata.expires = buildExpirationString(options.expires);\n }\n if (options.domain && typeof options.domain === 'string') {\n metadata.domain = options.domain.trim();\n }\n const expires = buildMetadataFor('expires', metadata);\n const domain = buildMetadataFor('domain', metadata);\n const path = buildMetadataFor('path', metadata);\n const cookie = `${key}=${encodeURIComponent(value)}${expires}${domain}${path}`;\n $cookie.set(cookie);\n },\n\n getItem(key) {\n let value = null;\n const nameEQ = `${key}=`;\n const cookie = $cookie.get().split(';').find(findCookie, nameEQ);\n if (cookie) {\n // prevent leading spaces before the key name\n value = cookie.trim().substring(nameEQ.length, cookie.length);\n value = decodeURIComponent(value);\n }\n if (value === null) delete $cookie.data[key];\n return value;\n },\n\n removeItem(key, options) {\n const metadata = Object.assign({}, $cookie.data[key], options);\n metadata.expires = {days: -1};\n api.setItem(key, '', metadata);\n delete $cookie.data[key];\n },\n\n clear() {\n let key, indexEQ; // eslint-disable-line\n $cookie.get().split(';').forEach((cookie) => {\n indexEQ = cookie.indexOf('=');\n if (indexEQ > -1) {\n key = cookie.substring(0, indexEQ);\n // prevent leading spaces before the key\n api.removeItem(key.trim());\n }\n });\n },\n\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize() {\n $cookie.get().split(';').forEach((cookie) => {\n const index = cookie.indexOf('=');\n const key = cookie.substring(0, index).trim();\n const value = cookie.substring(index + 1).trim();\n // copies all existing elements in the storage\n if (key) api[key] = decodeURIComponent(value);\n });\n },\n };\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/cookie-storage.js","/**\n * @private\n *\n * Gets the hashtable-store from the current window.\n *\n * @return {object}\n */\nfunction getStoreFromWindow() { // eslint-disable-line\n try {\n const store = JSON.parse(window.self.name);\n if (store && typeof store === 'object') return store;\n } catch (e) {\n return {};\n }\n}\n\n/**\n * @private\n *\n * Saves the hashtable-store in the current window.\n *\n * @param {object} hashtable: {key,value} pairs stored in memoryStorage\n * @return {void}\n */\nfunction setStoreToWindow(hashtable) {\n const store = JSON.stringify(hashtable);\n window.self.name = store;\n}\n\n/**\n * @public\n *\n * Create, read, and delete elements from memory store and\n * implements the Web Storage interface. It also adds a hack\n * to persist the store in session for the current browser-tab.\n *\n * @return {object}\n */\nexport default function memoryStorage() {\n const hashtable = getStoreFromWindow();\n const api = {\n setItem(key, value) {\n hashtable[key] = value;\n setStoreToWindow(hashtable);\n },\n getItem(key) {\n const value = hashtable[key];\n return value === undefined ? null : value;\n },\n removeItem(key) {\n delete hashtable[key];\n setStoreToWindow(hashtable);\n },\n clear() {\n Object.keys(hashtable).forEach(key => delete hashtable[key]);\n setStoreToWindow(hashtable);\n },\n // this method will be removed after being invoked\n // because is not part of the Web Storage interface\n initialize() {\n // copies all existing elements in the storage\n Object.assign(api, hashtable);\n },\n };\n return api;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memory-storage.js","import cookieStorage from './cookie-storage';\nimport memoryStorage from './memory-storage';\nimport {setProperty} from './utils';\n\n/**\n * @private\n *\n * Adds the current elements in the storage object.\n *\n * @param {object} api: the storage mechanism to initialize\n * @return {object}\n */\nfunction initApi(api) {\n if (!api.initialize) return api;\n // sets read-only and non-enumerable properties\n for (let prop in api) { // eslint-disable-line\n if (prop !== 'initialize') {\n setProperty(api, prop);\n }\n }\n api.initialize();\n // this method is removed after being invoked\n // because is not part of the Web Storage interface\n delete api.initialize;\n return api;\n}\n\n/**\n * @public\n *\n * Proxy for storage mechanisms.\n * All members implement the Web Storage interface.\n *\n * @see\n * https://developer.mozilla.org/en-US/docs/Web/API/Storage\n *\n * @type {object}\n */\nexport const proxy = {\n localStorage: window.localStorage,\n sessionStorage: window.sessionStorage,\n cookieStorage: initApi(cookieStorage()),\n memoryStorage: initApi(memoryStorage()),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-mechanism.js","/**\n * This library uses an adapter that implements the Web Storage interface,\n * which is very useful to deal with the lack of compatibility between\n * document.cookie and localStorage and sessionStorage.\n *\n * It also provides a memoryStorage fallback that stores the data in memory\n * when all of above mechanisms are not available.\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/proxy-storage.git\n */\n\nimport WebStorage, {proxy, webStorageSettings} from './web-storage';\nimport {isAvailable} from './is-available';\n\n// If you want to support all ES6 features, uncomment the next line\n// import 'babel-polyfill';\n\n/**\n * @public\n *\n * Current storage mechanism.\n *\n * @type {object}\n */\nlet storage = null;\n\n/**\n * @public\n *\n * Get/Set the storage mechanism to use by default.\n *\n * @type {object}\n */\nconst configStorage = {\n get() {\n return storage.__storage__;\n },\n\n /**\n * Sets the storage mechanism to use by default.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {void}\n */\n set(storageType) {\n if (!Object.prototype.hasOwnProperty.call(proxy, storageType)) {\n throw new Error(`Storage type \"${storageType}\" is not valid`);\n }\n storage = new WebStorage(storageType);\n },\n};\n\n/**\n * @private\n *\n * Checks whether a storage mechanism is available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction isStorageAvailable(storageType) {\n const storageObj = proxy[storageType];\n const data = '__proxy-storage__';\n try {\n storageObj.setItem(data, data);\n storageObj.removeItem(data);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * @private\n *\n * Sets the first or default storage available.\n *\n * @param {string} storageType: it can be \"localStorage\", \"sessionStorage\", \"cookieStorage\", or \"memoryStorage\"\n * @return {boolean}\n */\nfunction storageAvailable(storageType) {\n if (isAvailable[storageType]) {\n webStorageSettings.default = storageType;\n configStorage.set(storageType);\n }\n return isAvailable[storageType];\n}\n\n/**\n * @private\n *\n * Initializes the module.\n *\n * @return {void}\n */\nfunction init() {\n isAvailable.localStorage = isStorageAvailable('localStorage');\n isAvailable.sessionStorage = isStorageAvailable('sessionStorage');\n isAvailable.cookieStorage = isStorageAvailable('cookieStorage');\n webStorageSettings.isAvailable = isAvailable;\n // sets the default storage mechanism available\n Object.keys(isAvailable).some(storageAvailable);\n}\n\ninit();\n\n// @public API\nexport {storage as default, WebStorage, configStorage, isAvailable};\n\n\n\n// WEBPACK FOOTER //\n// ./src/proxy-storage.js"],"sourceRoot":""}
\ No newline at end of file
diff --git a/package.json b/package.json
index 861f862..a6f14f1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "proxy-storage",
- "version": "2.1.1",
+ "version": "2.1.2",
"description": "Storage mechanism that implements the Web Storage interface",
"author": "David Rivera ",
"main": "dist/proxy-storage.js",
diff --git a/src/cookie-storage.js b/src/cookie-storage.js
index 5bdf695..63eac7f 100644
--- a/src/cookie-storage.js
+++ b/src/cookie-storage.js
@@ -37,11 +37,19 @@ function buildExpirationString(date) {
return expires.toUTCString();
}
-// @private
-const buildStringFor = (key, data) => {
+/**
+ * @private
+ *
+ * Builds the string for the cookie's metadata.
+ *
+ * @param {string} key: name of the metadata
+ * @param {object} data: metadata of the cookie
+ * @return {string}
+ */
+function buildMetadataFor(key, data) {
if (!data[key]) return '';
return `; ${key}=${data[key]}`;
-};
+}
/**
* @private
@@ -78,9 +86,9 @@ export default function cookieStorage() {
if (options.domain && typeof options.domain === 'string') {
metadata.domain = options.domain.trim();
}
- const expires = buildStringFor('expires', metadata);
- const domain = buildStringFor('domain', metadata);
- const path = buildStringFor('path', metadata);
+ const expires = buildMetadataFor('expires', metadata);
+ const domain = buildMetadataFor('domain', metadata);
+ const path = buildMetadataFor('path', metadata);
const cookie = `${key}=${encodeURIComponent(value)}${expires}${domain}${path}`;
$cookie.set(cookie);
},
@@ -98,8 +106,8 @@ export default function cookieStorage() {
return value;
},
- removeItem(key) {
- const metadata = Object.assign({}, $cookie.data[key]);
+ removeItem(key, options) {
+ const metadata = Object.assign({}, $cookie.data[key], options);
metadata.expires = {days: -1};
api.setItem(key, '', metadata);
delete $cookie.data[key];
diff --git a/src/utils.js b/src/utils.js
index a2e5a43..b46c12b 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -55,7 +55,7 @@ export function setProperty(obj, name, value) {
/**
* Validates if the key is not empty.
- * (null, undefined either empty string)
+ * (null, undefined or empty string)
*
* @param {string} key: keyname of an element in the storage mechanism
* @return {void}
diff --git a/src/web-storage.js b/src/web-storage.js
index 3c17ead..d5bd946 100644
--- a/src/web-storage.js
+++ b/src/web-storage.js
@@ -25,6 +25,15 @@ const _interceptors = {
clear: [],
};
+/**
+ * @private
+ *
+ * Keys not allowed for cookies.
+ *
+ * @type {RegExp}
+ */
+const bannedKeys = /^(?:expires|max-age|path|domain|secure)$/i;
+
/**
* @private
*
@@ -159,14 +168,20 @@ class WebStorage {
*/
setItem(key, value, options) {
checkEmpty(key);
+ const storageType = this.__storage__;
+ if (storageType === 'cookieStorage' && bannedKeys.test(key)) {
+ throw new Error('The key is a reserved word, therefore not allowed');
+ }
const v = executeInterceptors('setItem', key, value, options);
if (v !== undefined) value = v;
this[key] = value;
// prevents converting strings to JSON to avoid extra quotes
if (typeof value !== 'string') value = JSON.stringify(value);
- // TODO: should add setTimeout for options.expires?
- // TODO: prevent adding cookies when the domain or path are not valid?
- proxy[this.__storage__].setItem(key, value, options);
+ proxy[storageType].setItem(key, value, options);
+ // checks if the cookie was created, or delete it if the domain or path are not valid
+ if (storageType === 'cookieStorage' && proxy[storageType].getItem(key) === null) {
+ delete this[key];
+ }
}
/**
@@ -196,15 +211,16 @@ class WebStorage {
* Deletes a key from the storage.
*
* @param {string} key: keyname of the storage
+ * @param {object} options: additional options for cookieStorage
* @return {void}
*
* @memberOf WebStorage
*/
- removeItem(key) {
+ removeItem(key, options) {
checkEmpty(key);
- executeInterceptors('removeItem', key);
+ executeInterceptors('removeItem', key, options);
delete this[key];
- proxy[this.__storage__].removeItem(key);
+ proxy[this.__storage__].removeItem(key, options);
}
/**