text: (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vuex-storage-share"]=t():e["vuex-storage-share"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({8875:function(e,t,r){var n,i,o;(function(r,c){i=[],n=c,o="function"===typeof n?n.apply(t,i):n,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(l){var r,n,i,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,u=o.exec(l.stack)||c.exec(l.stack),s=u&&u[1]||!1,a=u&&u[2]||!1,f=document.location.href.replace(document.location.hash,""),p=document.getElementsByTagName("script");s===f&&(r=document.documentElement.outerHTML,n=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=r.replace(n,"$1").trim());for(var d=0;d<p.length;d++){if("interactive"===p[d].readyState)return p[d];if(p[d].src===s)return p[d];if(s===f&&p[d].innerHTML&&p[d].innerHTML.trim()===i)return p[d]}return null}}return e}))},fb15:function(e,t,r){"use strict";if(r.r(t),"undefined"!==typeof window){var n=window.document.currentScript,i=r("8875");n=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var o=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(r.p=o[1])}const c={},u=function(e,t){return"object"!==typeof t&&(t={}),"object"===typeof e&&(t=Object.assign(e,t)),"string"===typeof e&&(t.storagePrefix=e),t=Object.assign({expires_in:3600,storagePrefix:"VUEX_STORAGE/",predicate:()=>!0},t),c[t.storagePrefix]||(c[t.storagePrefix]=new s(t)),c[t.storagePrefix]},s=function(e){if(this.initStatus=!1,this.storagePrefix=e.storagePrefix,this.expires_in=e.expires_in,this.uniqueId=`${Date.now()}-${Math.random()}`,Array.isArray(e.predicate)){const t=e.predicate;t.length&&(e.predicate=e=>t.includes(e.type)),t.length||(e.predicate=e=>!0)}let t=!1;this.subscriber=r=>{if(!this.initStatus){const n=n=>{if(console.log(n),!n.key||!this.initStatus||0!==n.key.indexOf(this.storagePrefix))return;let i=n.newValue,o=null,c=null;try{i=JSON.parse(i),c=i.payload,o=i.type}catch(n){}const u=i&&i.uniqueId;if(u!==this.uniqueId&&o){"function"===typeof e.storageListener&&e.storageListener.call(this,{type:o,payload:c});try{t=!0,r.commit(o,c)}finally{t=!1}}};window.addEventListener("storage",n,!1)}Object.keys(window.localStorage).forEach(t=>{if(0!==t.indexOf(this.storagePrefix))return;if(t=t.substring(this.storagePrefix.length),!e.predicate({type:t}))return;const n=this.get(t);try{r.commit(n.type,n.payload)}catch(i){}}),this.initStatus=!0,r.subscribe((r,n)=>{t||e.predicate(r,n)&&this.set(r.type,r.payload)})}};s.prototype.set=function(e,t){const r=this.storagePrefix+e;try{t=JSON.stringify({type:e,payload:t,uniqueId:this.uniqueId})}catch(n){}window.localStorage.setItem(r,t)},s.prototype.get=function(e){e=this.storagePrefix+e;let t=window.localStorage.getItem(e);try{t=JSON.parse(t)}catch(r){}return t},s.prototype.remove=function(e){e=this.storagePrefix+e;try{window.localStorage.removeItem(e)}catch(t){}},s.prototype.clear=function(){Object.keys(window.localStorage).forEach(e=>{0===e.indexOf(this.storagePrefix)&&(e=e.substring(this.storagePrefix.length),this.remove(e))})};var a=u;t["default"]=a}})}));
  //# sourceMappingURL=vuex-storage-share.umd.min.js.map