This repository has been archived by the owner on May 16, 2024. It is now read-only.
forked from marcuswestin/store.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.tests.min.js
3 lines (3 loc) · 41.8 KB
/
store.tests.min.js
1
2
3
/* store.js - Copyright (c) 2010-2017 Marcus Westin */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.store=t()}}(function(){var define,module,exports;return function t(e,n,r){function o(i,u){if(!n[i]){if(!e[i]){var a="function"==typeof require&&require;if(!u&&a)return a(i,!0);if(s)return s(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[i]={exports:{}};e[i][0].call(f.exports,function(t){var n=e[i][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[i].exports}for(var s="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,e,n){"use strict";var r=t("../src/store-engine"),o=t("../storages/all"),s=[t("../plugins/json2")];e.exports=r.createStore(o,s)},{"../plugins/json2":17,"../src/store-engine":29,"../storages/all":31}],2:[function(t,e,n){"use strict";var r=t("../tests/tests");r.runTests()},{"../tests/tests":43}],3:[function(t,e,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function i(t){if(p===clearTimeout)return clearTimeout(t);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function u(){v&&h&&(v=!1,h.length?g=h.concat(g):m=-1,g.length&&a())}function a(){if(!v){var t=s(u);v=!0;for(var e=g.length;e;){for(h=g,g=[];++m<e;)h&&h[m].run();m=-1,e=g.length}h=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var l,p,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(t){l=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(t){p=o}}();var h,g=[],v=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];g.push(new c(t,e)),1!==g.length||v||s(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],4:[function(t,e,n){(function(t){function n(t){return function(e){var n=e.replace(/</g,"<").replace(/>/g,">");return'<span style="color:'+t+'">'+n+"</span>"}}function r(t){var e=o[t];return function(t){return e[0]+t+e[1]}}var o=e.exports={grey:["[90m","[39m"],green:["[32m","[39m"],yellow:["[33m","[39m"],red:["[31m","[39m"]},s="undefined"!=typeof t.window;for(var i in o)o.hasOwnProperty(i)&&(o[i]=s?n(i):r(i))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(t,e,n){(function(n){function r(t){o(m,t),x.t0=new Date,x._runNextTest()}function o(t,e,n,r){t||(t={});for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var i in s)s.hasOwnProperty(i)&&(t[i]=s[i])}return t}function s(){return x.skipGroupStack[x.skipGroupStack.length-1]}function i(t,e){s()?x.tests.push({name:x.currentGroup+" - "+t,shouldSkip:!0}):x.tests.push({name:x.currentGroup+" - "+t,fn:e})}function u(t,e,n,r){if(!t){var o=Array.prototype.slice.call(arguments,1).join(" "),s="assert failed"+(o?": "+o:"");throw a(h.red(s)),new Error(s)}}function a(){if(w){m.outputEl||(m.outputEl=document.createElement("div"),o(m.outputEl.style,{fontFamily:"monaco,sans-serif",fontSize:"12px",padding:"10px",background:"black",color:"white"}),document.body.appendChild(m.outputEl));for(var t=Array.prototype.slice.call(arguments,0),e=0;e<t.length;e++)void 0===t[e]&&(t[e]="undefined"),"string"!=typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=t[e].replace(/\n/g,"<br/>");m.outputEl.appendChild(document.createElement("div")).innerHTML=t.join(" "),x.hasFailedTest||(document.documentElement.scrollTop=document.body.scrollTop=99999999)}else f.apply(this,arguments)}function c(){var t=0;console.log=function(){var e=Array.prototype.slice.call(arguments);e.unshift(h.grey(t+" console.log():")),t+=1,a.apply(this,e)}}function f(){f.consoleLog.apply(console,arguments)}function l(){for(var t in v)"_old"!=t&&v.hasOwnProperty(t)&&(this[t]=v._old[t])}function p(t){d(),m.onDone?m.onDone(t):g.process&&g.process.exit&&n.exit(t)}function d(){for(var t=x.tests.length,e=x.failedTests.length,n=t-e,r=[],o=0;o<x.tests.length;o++){var s=x.tests[o];s.skipped||s.result||r.push({name:s.name||"",result:!!s.result,message:s.message||"",duration:s.duration||0})}g.global_test_results={total:t,failed:e,passed:n,duration:x.duration,tests:r}}var h=t("./color");e.exports={runTests:r,test:i,assert:u,print:a,noConflict:l,hijackConsoleLog:c};i.group=function(t,e){var n=x.currentGroup;x.currentGroup=(x.currentGroup?x.currentGroup+" - ":"")+t,x.skipGroupStack.push(s()),e(),x.skipGroupStack.pop(),x.currentGroup=n},i.skip=function(t){if(x.current)x.skipCurrentTest=!0;else{if(!x.currentGroup)throw new Error('test.skip() called outside of test and group. ("'+t+'")');x.skipGroupStack[x.skipGroupStack.length-1]=!0}};var g=function(){return this}();g.console||(console={},c()),f.consoleLog=console.log;var v={_old:{},assert:u,test:i,print:a},m={failFast:!1,outputEl:null,maxDuration:750};for(var b in v)"_old"!=b&&v.hasOwnProperty(b)&&(v._old[b]=g[b],g[b]=v[b]);var y=function(t){setTimeout(t,0)},w="undefined"!=typeof g.window;if(w){window.addEventListener&&window.addEventListener("error",function(t){x._onTestDone(t.error?t.error:t)},!1);var _=window.onerror||function(){};window.onError=function(t,e,n){return x._onTestDone(new Error(t+" ("+e+":"+n+")")),_.apply(this,arguments)}}else n.on("uncaughtException",function(t){x._onTestDone(t.error?t.error:t)});var x={currentGroup:"",skipGroupStack:[],tests:[],failedTests:[],skippedTests:[],current:null,testIndex:-1,t0:null,_runNextTest:function(){return x.testIndex+=1,x.testIndex==x.tests.length?void x._finish():(x.current=x.tests[x.testIndex],x.current.shouldSkip?(x.current.skipped=!0,a(h.grey("Skip: "+x.current.name)),void x._runNextTest()):(a(h.grey("Run: "+x.current.name)),x.current.t0=new Date,x.failTimeout=setTimeout(function(){x._onTestDone("Test timed out")},m.maxDuration),void x._runTest(x.current.fn)))},_runTest:function(t){try{if(1==x.current.fn.length)x.current.fn(function(t){x._onTestDone(t)});else{var e=x.current.fn();e?e.then(x._onTestDone,x._onTestDone):x._onTestDone()}}catch(n){x._onTestDone(n)}},_onTestDone:function(t){if(!x.current)return a(h.red("Error during tests setup:"),"\n",this._errorMessage(t)),void p(1);clearTimeout(x.failTimeout);var e=new Date-x.current.t0;if(x.skipCurrentTest)x.current.skipped=!0;else if(t){u(!x.current.result);var n=this._errorMessage(t);if(x.current.result=!1,x.current.message=n,x.current.duration=e,a(h.red("Fail "+e+"ms"),"\n",n),x.hasFailedTest=!0,m.failFast)return void x._finish()}else{x.current.result=!0,x.current.duration=e;var r=e<50?h.green:e<350?h.yellow:h.red;a(h.green("Pass"),r(e+"ms"))}x.skipCurrentTest=!1,y(x._runNextTest)},_errorMessage:function(t){return t?t.stack?t.stack:t.message?t.message:t.toString():null},_finish:function(){x.duration=(new Date).getTime()-x.t0;for(var t=x.tests.length-x.testIndex,e=0;e<x.tests.length;e++){var n=x.tests[e];n.skipped?x.skippedTests.push(n):n.result||x.failedTests.push(n)}t&&a(h.yellow("Exited without running "+t+" tests")),x.failedTests.length&&a(h.red(x.failedTests.length+" tests failed")),x.skippedTests.length&&a(h.yellow(x.skippedTests.length+" tests skipped")),x.failedTests.length?p(1):0==x.tests.length?(a(h.yellow("No tests")),p(1)):(a(h.green("All done!"),x.tests.length,"tests passed."),p(0))}}}).call(this,t("_process"))},{"./color":4,_process:3}],6:[function(t,e,n){"use strict";e.exports={compression:t("./compression_test"),defaults:t("./defaults_test"),dump:t("./dump_test"),events:t("./events_test"),observe:t("./observe_test"),expire:t("./expire_test"),json2:t("./json2_test"),operations:t("./operations_test"),update:t("./update_test"),"v1-backcompat":t("./v1-backcompat_test")}},{"./compression_test":8,"./defaults_test":10,"./dump_test":12,"./events_test":14,"./expire_test":16,"./json2_test":18,"./observe_test":22,"./operations_test":24,"./update_test":26,"./v1-backcompat_test":28}],7:[function(t,e,n){"use strict";function r(){function t(t,e){var n=t(e);if(!n)return n;var r=o.decompress(n);return null==r?n:this._deserialize(r)}function e(t,e,n){var r=o.compress(this._serialize(n));t(e,r)}return{get:t,set:e}}var o=t("./lib/lz-string");e.exports=r},{"./lib/lz-string":20}],8:[function(t,e,n){"use strict";function r(t){test("string compression size",function(){var e="foo",n=t._serialize(e);t.set("foo",e),assert(t.raw.get("foo").length<n.length,"compressed string should be smaller than uncompressed"),assert(s(t.get("foo"),e),"value should be equal")}),test("object compression",function(){var e={one:{two:3}},n=t._serialize(e);t.set("foo",e),assert(t.raw.get("foo").length<n.length,"compressed object should be smaller than uncompressed"),assert(s(t.get("foo"),e),"should deep equal original object"),t.remove("foo")}),test("decompress uncopmressed data",function(){t.raw.set("foo","baz"),assert("baz"==t.get("foo"),"value should be baz"),t.remove("foo")}),test("decompress non-existing data",function(){assert(void 0==t.get("bar"),"value should be undefined"),t.remove("bar")})}var o=t("../tests/util"),s=o.deepEqual;e.exports={plugin:t("./compression"),setup:r}},{"../tests/util":44,"./compression":7}],9:[function(t,e,n){"use strict";function r(){function t(t,e){n=e}function e(t,e){var r=t();return void 0!==r?r:n[e]}var n={};return{defaults:t,get:e}}e.exports=r},{}],10:[function(t,e,n){"use strict";function r(t){test("defaults",function(){t.defaults({foo:"bar"}),assert("bar"==t.get("foo")),t.set("foo","bar2"),assert("bar2"==t.get("foo")),t.remove("foo"),assert("bar"==t.get("foo"))})}e.exports={plugin:t("./defaults"),setup:r}},{"./defaults":9}],11:[function(t,e,n){"use strict";function r(){function t(t){var e={};return this.each(function(t,n){e[n]=t}),e}return{dump:t}}e.exports=r},{}],12:[function(t,e,n){"use strict";function r(t){test("dump",function(){var e={foo:"bar",cat:{mat:!0},hat:"bat"};s(e,function(e,n){t.set(n,e)}),assert(u(t.dump(),e)),t.clearAll(),assert(u(t.dump(),{}))})}var o=t("../src/util"),s=o.each,i=t("../tests/util"),u=i.deepEqual;e.exports={plugin:t("./dump"),setup:r}},{"../src/util":30,"../tests/util":44,"./dump":11}],13:[function(t,e,n){"use strict";function r(){function t(t,e,n){return c.on(e,i(this,n))}function e(t,e){c.off(e)}function n(t,e,n){c.once(e,i(this,n))}function r(t,e,n){var r=this.get(e);t(),c.fire(e,n,r)}function s(t,e){var n=this.get(e);t(),c.fire(e,void 0,n)}function a(t){var e={};this.each(function(t,n){e[n]=t}),t(),u(e,function(t,e){c.fire(e,void 0,t)})}var c=o();return{watch:t,unwatch:e,once:n,set:r,remove:s,clearAll:a}}function o(){return a(f,{_id:0,_subSignals:{},_subCallbacks:{}})}var s=t("../src/util"),i=s.bind,u=s.each,a=s.create,c=s.slice;e.exports=r;var f={_id:null,_subCallbacks:null,_subSignals:null,on:function(t,e){return this._subCallbacks[t]||(this._subCallbacks[t]={}),this._id+=1,this._subCallbacks[t][this._id]=e,this._subSignals[this._id]=t,this._id},off:function(t){var e=this._subSignals[t];delete this._subCallbacks[e][t],delete this._subSignals[t]},once:function(t,e){var n=this.on(t,i(this,function(){e.apply(this,arguments),this.off(n)}))},fire:function(t){var e=c(arguments,1);u(this._subCallbacks[t],function(t){t.apply(this,e)})}}},{"../src/util":30}],14:[function(t,e,n){"use strict";function r(t){function e(e,n,r){function o(t,e){s.count+=1,assert(s.values[s.count]==t),assert(s.values[s.count-1]==e)}var s={values:[n],count:0,add:function(t){this.values.push(t)},check:function(){assert(s.count+1==s.values.length)},unwatch:function(){t.unwatch(i)}},i=r?t.once(e,o):t.watch(e,o);return s}test("events",function(){t.set("foo","bar");var n=e("expectNone",void 0);t.watch("foo",function(){});var r=e("foo","bar"),o=e("foo","bar",!0);t.watch("foo",function(){}),r.add("bar2"),o.add("bar2"),t.set("foo","bar2"),r.add(void 0),t.remove("foo"),r.add("bar3"),t.set("foo","bar3");var s=e("foo","bar3");r.add(void 0),s.add(void 0),t.clearAll(),t.clearAll(),r.unwatch(),s.add("bar4"),t.set("foo","bar4"),r.check(),o.check(),s.check(),n.check(),s.unwatch()})}e.exports={plugin:t("./events"),setup:r}},{"./events":13}],15:[function(t,e,n){"use strict";function r(){function t(t,e,n,r){return this.hasNamespace(o)||u.set(e,r),t()}function e(t,e){return this.hasNamespace(o)||i.call(this,e),t()}function n(t,e){return this.hasNamespace(o)||u.remove(e),t()}function r(t,e){return u.get(e)}function s(t){var e=[];this.each(function(t,n){e.push(n)});for(var n=0;n<e.length;n++)i.call(this,e[n])}function i(t){var e=u.get(t,Number.MAX_VALUE);e<=(new Date).getTime()&&(this.raw.remove(t),u.remove(t))}var u=this.createStore(this.storage,null,this._namespacePrefix+o);return{set:t,get:e,remove:n,getExpiration:r,removeExpiredKeys:s}}var o="expire_mixin";e.exports=r},{}],16:[function(t,e,n){"use strict";function r(t){test("expire",function(e){function n(t,e){r(e,function(r){return!!r||(t>0?(setTimeout(function(){n(t-1,2*e)},0),!1):assert(!1))})}function r(n,r){var o=(new Date).getTime()+n;t.set("foo","bar",o),r("bar"==t.get("foo"))&&setTimeout(function(){r((new Date).getTime()>o)&&r(void 0==t.get("foo"))&&(t.set("foo","bar"),setTimeout(function(){r("bar"==t.get("foo"))&&e()},5))},n)}n(5,10)}),test("remove expired keys",function(){var e="expired";t.set(e,"bar",(new Date).getTime()-1e3),assert(t.getExpiration(e)>0),t.removeExpiredKeys(),assert(!t.getExpiration(e))})}e.exports={plugin:t("./expire"),setup:r}},{"./expire":15}],17:[function(t,e,n){"use strict";function r(){return t("./lib/json2"),{}}e.exports=r},{"./lib/json2":19}],18:[function(t,e,n){"use strict";function r(t){test("serialization with json2",function(){t.set("foo",{bar:"cat"}),assert("cat"===t.get("foo").bar)})}e.exports={plugin:t("./json2"),setup:r}},{"./json2":17}],19:[function(require,module,exports){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};"object"!==("undefined"==typeof JSON?"undefined":_typeof(JSON))&&(JSON={}),function(){function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var n,r,o,s,i,u=gap,a=e[t];switch(a&&"object"===("undefined"==typeof a?"undefined":_typeof(a))&&"function"==typeof a.toJSON&&(a=a.toJSON(t)),"function"==typeof rep&&(a=rep.call(e,t,a)),"undefined"==typeof a?"undefined":_typeof(a)){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";if(gap+=indent,i=[],"[object Array]"===Object.prototype.toString.apply(a)){for(s=a.length,n=0;n<s;n+=1)i[n]=str(n,a)||"null";return o=0===i.length?"[]":gap?"[\n"+gap+i.join(",\n"+gap)+"\n"+u+"]":"["+i.join(",")+"]",gap=u,o}if(rep&&"object"===("undefined"==typeof rep?"undefined":_typeof(rep)))for(s=rep.length,n=0;n<s;n+=1)"string"==typeof rep[n]&&(r=rep[n],o=str(r,a),o&&i.push(quote(r)+(gap?": ":":")+o));else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(o=str(r,a),o&&i.push(quote(r)+(gap?": ":":")+o));return o=0===i.length?"{}":gap?"{\n"+gap+i.join(",\n"+gap)+"\n"+u+"}":"{"+i.join(",")+"}",gap=u,o}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e,e&&"function"!=typeof e&&("object"!==("undefined"==typeof e?"undefined":_typeof(e))||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var n,r,o=t[e];if(o&&"object"===("undefined"==typeof o?"undefined":_typeof(o)))for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(t,e,o)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},{}],20:[function(t,e,n){"use strict";var r=function(){function t(t,e){if(!o[t]){o[t]={};for(var n=0;n<t.length;n++)o[t][t.charAt(n)]=n}return o[t][e]}var e=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={},s={compressToBase64:function(t){if(null==t)return"";var e=s._compress(t,6,function(t){return n.charAt(t)});switch(e.length%4){default:case 0:return e;case 1:return e+"===";case 2:return e+"==";case 3:return e+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:s._decompress(e.length,32,function(r){return t(n,e.charAt(r))})},compressToUTF16:function(t){return null==t?"":s._compress(t,15,function(t){return e(t+32)})+" "},decompressFromUTF16:function(t){return null==t?"":""==t?null:s._decompress(t.length,16384,function(e){return t.charCodeAt(e)-32})},compressToUint8Array:function(t){for(var e=s.compress(t),n=new Uint8Array(2*e.length),r=0,o=e.length;r<o;r++){var i=e.charCodeAt(r);n[2*r]=i>>>8,n[2*r+1]=i%256}return n},decompressFromUint8Array:function(t){if(null===t||void 0===t)return s.decompress(t);for(var n=new Array(t.length/2),r=0,o=n.length;r<o;r++)n[r]=256*t[2*r]+t[2*r+1];var i=[];return n.forEach(function(t){i.push(e(t))}),s.decompress(i.join(""))},compressToEncodedURIComponent:function(t){return null==t?"":s._compress(t,6,function(t){return r.charAt(t)})},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),s._decompress(e.length,32,function(n){return t(r,e.charAt(n))}))},compress:function(t){return s._compress(t,16,function(t){return e(t)})},_compress:function(t,e,n){if(null==t)return"";var r,o,s,i={},u={},a="",c="",f="",l=2,p=3,d=2,h=[],g=0,v=0;for(s=0;s<t.length;s+=1)if(a=t.charAt(s),Object.prototype.hasOwnProperty.call(i,a)||(i[a]=p++,u[a]=!0),c=f+a,Object.prototype.hasOwnProperty.call(i,c))f=c;else{if(Object.prototype.hasOwnProperty.call(u,f)){if(f.charCodeAt(0)<256){for(r=0;r<d;r++)g<<=1,v==e-1?(v=0,h.push(n(g)),g=0):v++;for(o=f.charCodeAt(0),r=0;r<8;r++)g=g<<1|1&o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o>>=1}else{for(o=1,r=0;r<d;r++)g=g<<1|o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o=0;for(o=f.charCodeAt(0),r=0;r<16;r++)g=g<<1|1&o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o>>=1}l--,0==l&&(l=Math.pow(2,d),d++),delete u[f]}else for(o=i[f],r=0;r<d;r++)g=g<<1|1&o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o>>=1;l--,0==l&&(l=Math.pow(2,d),d++),i[c]=p++,f=String(a)}if(""!==f){if(Object.prototype.hasOwnProperty.call(u,f)){if(f.charCodeAt(0)<256){for(r=0;r<d;r++)g<<=1,v==e-1?(v=0,h.push(n(g)),g=0):v++;for(o=f.charCodeAt(0),r=0;r<8;r++)g=g<<1|1&o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o>>=1}else{for(o=1,r=0;r<d;r++)g=g<<1|o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o=0;for(o=f.charCodeAt(0),r=0;r<16;r++)g=g<<1|1&o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o>>=1}l--,0==l&&(l=Math.pow(2,d),d++),delete u[f]}else for(o=i[f],r=0;r<d;r++)g=g<<1|1&o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o>>=1;l--,0==l&&(l=Math.pow(2,d),d++)}for(o=2,r=0;r<d;r++)g=g<<1|1&o,v==e-1?(v=0,h.push(n(g)),g=0):v++,o>>=1;for(;;){if(g<<=1,v==e-1){h.push(n(g));break}v++}return h.join("")},decompress:function(t){return null==t?"":""==t?null:s._decompress(t.length,32768,function(e){return t.charCodeAt(e)})},_decompress:function(t,n,r){var o,s,i,u,a,c,f,l,p=[],d=4,h=4,g=3,v="",m=[],b={val:r(0),position:n,index:1};for(s=0;s<3;s+=1)p[s]=s;for(u=0,c=Math.pow(2,2),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;switch(o=u){case 0:for(u=0,c=Math.pow(2,8),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;l=e(u);break;case 1:for(u=0,c=Math.pow(2,16),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;l=e(u);break;case 2:return""}for(p[3]=l,i=l,m.push(l);;){if(b.index>t)return"";for(u=0,c=Math.pow(2,g),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;switch(l=u){case 0:for(u=0,c=Math.pow(2,8),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;p[h++]=e(u),l=h-1,d--;break;case 1:for(u=0,c=Math.pow(2,16),f=1;f!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),u|=(a>0?1:0)*f,f<<=1;p[h++]=e(u),l=h-1,d--;break;case 2:return m.join("")}if(0==d&&(d=Math.pow(2,g),g++),p[l])v=p[l];else{if(l!==h)return null;v=i+i.charAt(0)}m.push(v),p[h++]=i+v.charAt(0),d--,i=v,0==d&&(d=Math.pow(2,g),g++)}}};return s}();"function"==typeof define&&define.amd?define(function(){return r}):"undefined"!=typeof e&&null!=e&&(e.exports=r)},{}],21:[function(t,e,n){"use strict";function r(){function t(t,e,n){var r=this.watch(e,n);return n(this.get(e)),r}function e(t,e){this.unwatch(e)}return{observe:t,unobserve:e}}var o=t("./events");e.exports=[o,r]},{"./events":13}],22:[function(t,e,n){"use strict";function r(t){test("observe",function(){t.clearAll();var e=-1,n=[void 0],r=t.observe("foo",function(t,r){e+=1,assert(n[e]==t),assert(n[e-1]==r)});t.unobserve(r),n.push("bar"),t.set("foo","bar"),t.observe("foo",function(t,r){e+=1,assert(n[e]==t),assert(n[e-1]==r)}),n.push("bar2"),t.set("foo","bar2"),assert(e+1==n.length)})}e.exports={plugin:t("./observe"),setup:r}},{"./observe":21}],23:[function(t,e,n){"use strict";function r(){function t(t,e,n,r,o,s){return a.call(this,"push",arguments)}function e(t,e){return a.call(this,"pop",arguments)}function n(t,e){return a.call(this,"shift",arguments)}function r(t,e,n,r,o,s){return a.call(this,"unshift",arguments)}function s(t,e,n,r,s,a){var c=i(arguments,2);return this.update(e,{},function(t){if("object"!=("undefined"==typeof t?"undefined":o(t)))throw new Error('store.assign called for non-object value with key "'+e+'"');return c.unshift(t),u.apply(Object,c)})}function a(t,e){var n,r=e[1],o=i(e,2);return this.update(r,[],function(e){n=Array.prototype[t].apply(e,o)}),n}return{push:t,pop:e,shift:n,unshift:r,assign:s}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=t("../src/util"),i=s.slice,u=s.assign,a=t("./update");e.exports=[a,r]},{"../src/util":30,"./update":25}],24:[function(t,e,n){"use strict";function r(t){function e(e,n,r){var o="test-"+e;t.set(o,n),n=n||[];var i=n[e],u=t[e];s(r,function(e){var r=i.apply(n,e),s=u.apply(t,[o].concat(e));assert(a(r,s));var c=t.get(o);assert(a(n,c))})}test("push",function(){e("push",[],[[],["a"],["b","c"],[null],[[],{}]])}),test("unshift",function(){e("unshift",void 0,[[],["a"],["b","c"],[null],[[],{}]])}),test("pop",function(){var t=["a","b","c",null,[[],{}]],n=i(t,function(){return[]}).concat([]);e("pop",t,n)}),test("shift",function(){var t=["a","b","c",null,[[],{}]],n=i(t,function(){return[]}).concat([]);e("shift",t,n)}),test("assign",function(){t.clearAll();var e={bar:"cat",mat:{hat:"bat",arr:[1,2,3]}};t.assign("foo",e),assert(a(t.get("foo"),e));var n={bar:"cat2",mat:{hat:"bat2"},newProp:"newProp"};t.assign("foo",n),s(n,function(t,n){e[n]=t}),assert(a(t.get("foo"),e))})}var o=t("../src/util"),s=o.each,i=o.map,u=t("../tests/util"),a=u.deepEqual;e.exports={plugin:t("./operations"),setup:r}},{"../src/util":30,"../tests/util":44,"./operations":23}],25:[function(t,e,n){"use strict";function r(){function t(t,e,n,r){3==arguments.length&&(r=n,n=void 0);var o=this.get(e,n),s=r(o);this.set(e,void 0!=s?s:o)}return{update:t}}e.exports=r},{}],26:[function(t,e,n){"use strict";function r(t){test("update",function(){t.set("foo",{cat:"mat"}),assert("mat"==t.get("foo").cat),t.update("foo",function(t){t.cat="mat2"}),assert("mat2"==t.get("foo").cat)}),test("update return value",function(){t.clearAll(),t.update("foo",function(t){return assert(void 0==t),{cat:"mat4"}}),assert("mat4"==t.get("foo").cat)}),test("update default value",function(){t.clearAll(),t.update("foo2",{},function(t){t.bar="cat"}),assert("cat"==t.get("foo2").bar)}),test("update default value + return",function(){t.clearAll(),t.update("foo2",[],function(t){return{bar2:"cat2"}}),assert("object"==o(t.get("foo2"))),assert(void 0==t.get("foo2").bar),assert("cat2"==t.get("foo2").bar2)})}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports={plugin:t("./update"),setup:r}},{"./update":25}],27:[function(t,e,n){"use strict";function r(){return this.disabled=!this.enabled,{has:o,transact:s,clear:i,forEach:u,getAll:a,serialize:c,deserialize:f}}function o(t,e){return void 0!==this.get(e)}function s(t,e,n,r){null==r&&(r=n,n=null),null==n&&(n={});var o=this.get(e,n),s=r(o);this.set(e,void 0===s?o:s)}function i(t){return this.clearAll.call(this)}function u(t,e){return this.each.call(this,function(t,n){e(n,t)})}function a(t){return this.dump.call(this)}function c(t,e){return JSON.stringify(e)}function f(t,e){if("string"==typeof e)try{return JSON.parse(e)}catch(n){return e||void 0}}var l=t("./dump"),p=t("./json2");e.exports=[l,p,r]},{"./dump":11,"./json2":17}],28:[function(t,e,n){"use strict";function r(t){test("backwards compatability with v1",function(){t.clear(),assert("boolean"==typeof t.disabled),assert("boolean"==typeof t.enabled),assert("string"==typeof t.version),assert("function"==typeof t.set),assert("function"==typeof t.get),assert("function"==typeof t.has),assert("function"==typeof t.remove),assert("function"==typeof t.clear),assert("function"==typeof t.transact),assert("function"==typeof t.getAll),assert("function"==typeof t.forEach),assert("function"==typeof t.serialize),assert("function"==typeof t.deserialize),t.transact("foosact",function(t){assert("object"==("undefined"==typeof t?"undefined":o(t)),"new key is not an object at beginning of transaction"),t.foo="foo"}),t.transact("foosact",function(t){assert("foo"==t.foo,"first transaction did not register"),t.bar="bar"}),assert("foo"==t.getAll().foosact.foo);var e=!1;t.forEach(function(t,n){e=!0,assert("foosact"==t),assert("foo"==n.foo)}),assert(e),assert("{}"==t.serialize({})),assert("bar"==t.get("foosact").bar,"second transaction did not register")})}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports={plugin:t("./v1-backcompat"),setup:r}},{"./v1-backcompat":27}],29:[function(t,e,n){"use strict";function r(){var t="undefined"==typeof console?null:console;if(t){var e=t.warn?t.warn:t.log;e.apply(t,arguments)}}function o(t,e,n){n||(n=""),t&&!l(t)&&(t=[t]),e&&!l(e)&&(e=[e]);var o=n?"__storejs_"+n+"_":"",s=n?new RegExp("^"+o):null,g=/^[a-zA-Z0-9_\-]*$/;if(!g.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var v={_namespacePrefix:o,_namespaceRegexp:s,_testStorage:function(t){try{var e="__storejs__test__";t.write(e,e);var n=t.read(e)===e;return t.remove(e),n}catch(r){return!1}},_assignPluginFnProp:function(t,e){var n=this[e];this[e]=function(){function e(){if(n)return a(arguments,function(t,e){r[e]=t}),n.apply(o,r)}var r=i(arguments,0),o=this,s=[e].concat(r);return t.apply(o,s)}},_serialize:function(t){return JSON.stringify(t)},_deserialize:function(t,e){if(!t)return e;var n="";try{n=JSON.parse(t)}catch(r){n=t}return void 0!==n?n:e},_addStorage:function(t){this.enabled||this._testStorage(t)&&(this.storage=t,this.enabled=!0)},_addPlugin:function(t){var e=this;if(l(t))return void a(t,function(t){e._addPlugin(t)});var n=u(this.plugins,function(e){return t===e});if(!n){if(this.plugins.push(t),!p(t))throw new Error("Plugins must be function values that return objects");var r=t.call(this);if(!d(r))throw new Error("Plugins must return an object of function properties");a(r,function(n,r){if(!p(n))throw new Error("Bad plugin property: "+r+" from plugin "+t.name+". Plugins should only return functions.");e._assignPluginFnProp(n,r)})}},addStorage:function(t){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(t)}},m=f(v,h,{plugins:[]});return m.raw={},a(m,function(t,e){p(t)&&(m.raw[e]=c(m,t))}),a(t,function(t){m._addStorage(t)}),a(e,function(t){m._addPlugin(t)}),m}var s=t("./util"),i=s.slice,u=s.pluck,a=s.each,c=s.bind,f=s.create,l=s.isList,p=s.isFunction,d=s.isObject;e.exports={createStore:o};var h={version:"2.0.12",enabled:!1,get:function(t,e){var n=this.storage.read(this._namespacePrefix+t);return this._deserialize(n,e)},set:function(t,e){return void 0===e?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each(function(n,r){t.call(e,e._deserialize(n),(r||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return o.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return o(this.storage,this.plugins,t)}}},{"./util":30}],30:[function(t,e,n){(function(t){"use strict";function n(){return Object.assign?Object.assign:function(t,e,n,r){for(var o=1;o<arguments.length;o++)u(Object(arguments[o]),function(e,n){t[n]=e});return t}}function r(){if(Object.create)return function(t,e,n,r){var o=i(arguments,1);return d.apply(this,[Object.create(t)].concat(o))};var t=function(){};return function(e,n,r,o){var s=i(arguments,1);return t.prototype=e,d.apply(this,[new t].concat(s))}}function o(){return String.prototype.trim?function(t){return String.prototype.trim.call(t)}:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function s(t,e){return function(){
return e.apply(t,Array.prototype.slice.call(arguments,0))}}function i(t,e){return Array.prototype.slice.call(t,e||0)}function u(t,e){c(t,function(t,n){return e(t,n),!1})}function a(t,e){var n=f(t)?[]:{};return c(t,function(t,r){return n[r]=e(t,r),!1}),n}function c(t,e){if(f(t)){for(var n=0;n<t.length;n++)if(e(t[n],n))return t[n]}else for(var r in t)if(t.hasOwnProperty(r)&&e(t[r],r))return t[r]}function f(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length}function l(t){return t&&"[object Function]"==={}.toString.call(t)}function p(t){return t&&"[object Object]"==={}.toString.call(t)}var d=n(),h=r(),g=o(),v="undefined"!=typeof window?window:t;e.exports={assign:d,create:h,trim:g,bind:s,slice:i,each:u,map:a,pluck:c,isList:f,isFunction:l,isObject:p,Global:v}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],31:[function(t,e,n){"use strict";e.exports=[t("./localStorage"),t("./oldFF-globalStorage"),t("./oldIE-userDataStorage"),t("./cookieStorage"),t("./sessionStorage"),t("./memoryStorage")]},{"./cookieStorage":32,"./localStorage":33,"./memoryStorage":34,"./oldFF-globalStorage":35,"./oldIE-userDataStorage":36,"./sessionStorage":37}],32:[function(t,e,n){"use strict";function r(t){if(!t||!a(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(p.cookie.replace(new RegExp(e),"$1"))}function o(t){for(var e=p.cookie.split(/; ?/g),n=e.length-1;n>=0;n--)if(l(e[n])){var r=e[n].split("="),o=unescape(r[0]),s=unescape(r[1]);t(s,o)}}function s(t,e){t&&(p.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function i(t){t&&a(t)&&(p.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function u(){o(function(t,e){i(e)})}function a(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(p.cookie)}var c=t("../src/util"),f=c.Global,l=c.trim;e.exports={name:"cookieStorage",read:r,write:s,each:o,remove:i,clearAll:u};var p=f.document},{"../src/util":30}],33:[function(t,e,n){"use strict";function r(){return f.localStorage}function o(t){return r().getItem(t)}function s(t,e){return r().setItem(t,e)}function i(t){for(var e=r().length-1;e>=0;e--){var n=r().key(e);t(o(n),n)}}function u(t){return r().removeItem(t)}function a(){return r().clear()}var c=t("../src/util"),f=c.Global;e.exports={name:"localStorage",read:o,write:s,each:i,remove:u,clearAll:a}},{"../src/util":30}],34:[function(t,e,n){"use strict";function r(t){return a[t]}function o(t,e){a[t]=e}function s(t){for(var e in a)a.hasOwnProperty(e)&&t(a[e],e)}function i(t){delete a[t]}function u(t){a={}}e.exports={name:"memoryStorage",read:r,write:o,each:s,remove:i,clearAll:u};var a={}},{}],35:[function(t,e,n){"use strict";function r(t){return f[t]}function o(t,e){f[t]=e}function s(t){for(var e=f.length-1;e>=0;e--){var n=f.key(e);t(f[n],n)}}function i(t){return f.removeItem(t)}function u(){s(function(t,e){delete f[t]})}var a=t("../src/util"),c=a.Global;e.exports={name:"oldFF-globalStorage",read:r,write:o,each:s,remove:i,clearAll:u};var f=c.globalStorage},{"../src/util":30}],36:[function(t,e,n){"use strict";function r(t,e){if(!g){var n=a(t);h(function(t){t.setAttribute(n,e),t.save(p)})}}function o(t){if(!g){var e=a(t),n=null;return h(function(t){n=t.getAttribute(e)}),n}}function s(t){h(function(e){for(var n=e.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var o=n[r];t(e.getAttribute(o.name),o.name)}})}function i(t){var e=a(t);h(function(t){t.removeAttribute(e),t.save(p)})}function u(){h(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(p);for(var n=e.length-1;n>=0;n--)t.removeAttribute(e[n].name);t.save(p)})}function a(t){return t.replace(/^\d/,"___$&").replace(v,"___")}function c(){if(!d||!d.documentElement||!d.documentElement.addBehavior)return null;var t,e,n,r="script";try{e=new ActiveXObject("htmlfile"),e.open(),e.write("<"+r+">document.w=window</"+r+'><iframe src="/favicon.ico"></iframe>'),e.close(),t=e.w.frames[0].document,n=t.createElement("div")}catch(o){n=d.createElement("div"),t=d.body}return function(e){var r=[].slice.call(arguments,0);r.unshift(n),t.appendChild(n),n.addBehavior("#default#userData"),n.load(p),e.apply(this,r),t.removeChild(n)}}var f=t("../src/util"),l=f.Global;e.exports={name:"oldIE-userDataStorage",write:r,read:o,each:s,remove:i,clearAll:u};var p="storejs",d=l.document,h=c(),g=(l.navigator?l.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./),v=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g")},{"../src/util":30}],37:[function(t,e,n){"use strict";function r(){return f.sessionStorage}function o(t){return r().getItem(t)}function s(t,e){return r().setItem(t,e)}function i(t){for(var e=r().length-1;e>=0;e--){var n=r().key(e);t(o(n),n)}}function u(t){return r().removeItem(t)}function a(){return r().clear()}var c=t("../src/util"),f=c.Global;e.exports={name:"sessionStorage",read:o,write:s,each:i,remove:u,clearAll:a}},{"../src/util":30}],38:[function(t,e,n){"use strict";test.group("bugs",function(){test('gh-215: "Expire plugin doesn\'t factor custom namespaces"',function(){t("./gh-215")}),test('gh-235: "Expire and Events plugins conflict with each other"',function(){t("./gh-235")}),test('gh-236: "No supported storage has been added"',function(){t("./gh-236")}),test('gh-239: "No supported storage has been added! Add one"',function(){t("./gh-239")})})},{"./gh-215":39,"./gh-235":40,"./gh-236":41,"./gh-239":42}],39:[function(t,e,n){"use strict";var r=t("../../src/store-engine"),o=[t("../../storages/memoryStorage")],s=[t("../../plugins/expire")],i=r.createStore(o,s,""),u=i.namespace("store2"),a=i.namespace("store3"),c=10*Math.floor((new Date).getTime()/10),f=c+1001,l=null,p=c+3003,d="foo",h="bar";i.set(d,h,f),u.set(d,h,l),a.set(d,h,p),assert(i.getExpiration(d)==f),assert(u.getExpiration(d)==l),assert(a.getExpiration(d)==p)},{"../../plugins/expire":15,"../../src/store-engine":29,"../../storages/memoryStorage":34}],40:[function(t,e,n){"use strict";var r=t("../../src/store-engine"),o=r.createStore([t("../../storages/localStorage"),t("../../storages/memoryStorage")],[t("../../plugins/expire"),t("../../plugins/events")]);o.set("foo","bar",(new Date).getTime()-1),o.set("foo","bar"),o.set("foo","bar")},{"../../plugins/events":13,"../../plugins/expire":15,"../../src/store-engine":29,"../../storages/localStorage":33,"../../storages/memoryStorage":34}],41:[function(t,e,n){"use strict";var r=t("../..");r.get("token")},{"../..":1}],42:[function(t,e,n){"use strict";t("../..")},{"../..":1}],43:[function(t,e,n){"use strict";function r(){s(),p(d,function(t){test.group(t.name,function(){o(t)||test.skip("disabled"),test("Storage tests",function(){var e=f([t]);i(e)}),p(h,function(e,n){var r=e.plugin;test.group("plugin: "+n,function(){var n=f([t],[r]);e.setup(n)})})})}),t("./bugs/all"),a.runTests({failFast:!1})}function o(t){if(!t)return print("Skip unsupported storage:",t.name),!1;var e=f([t]);return!!e.enabled||(print("Skip disabled storage:",t.name),!1)}function s(t){test("Addon super_fn args",function(){function t(){return{set:function(t,e,n,o,s){assert("keyappended"==e),assert("val"==n),assert("overridden-customArg1"==o),assert("customArg2"==s),r++}}}function e(){return{set:function(t,e,n){t(e+"appended",n,"overridden-customArg1"),r++}}}var n=f(d.memoryStorage,[t,e]),r=0;n.set("key","val","customArg1","customArg2"),assert(2==r)})}function i(t){assert(t.enabled&&t.enabled,"store should be enabled"),t.clearAll(),t.get("unsetValue"),t.set("foo","bar"),assert("bar"==t.get("foo"),"stored key 'foo' not equal to stored value 'bar'"),t.remove("foo"),assert(void 0===t.get("foo"),"removed key 'foo' not undefined"),assert(void 0===t.get("foo"),"key 'foo' exists when it shouldn't"),assert("value"==t.set("foo","value"),"store#set returns the stored value"),assert(void 0!==t.get("foo"),"key 'foo' doesn't exist when it should"),t.set("foo","bar1"),t.set("foo","bar2"),assert("bar2"==t.get("foo"),"key 'foo' is not equal to second value set 'bar2'"),t.set("foo","bar"),t.set("bar","foo"),t.remove("foo"),assert(void 0===t.get("foo"),"key 'foo' exists when it shouldn't"),assert("foo"==t.get("bar"),"removing key 'foo' also removed key 'bar'"),t.set("foo","bar"),t.set("bar","foo"),t.clearAll(),assert(void 0===t.get("foo")&&void 0===t.get("bar"),"keys foo and bar not cleared after store cleared"),assert(123==t.get("defaultVal",123),"store.get should return default value"),t.set("foo",{name:"marcus",arr:[1,2,3]}),assert("object"==u(t.get("foo")),"type of stored object 'foo' is not 'object'"),assert(t.get("foo")instanceof Object,"stored object 'foo' is not an instance of Object"),assert("marcus"==t.get("foo").name,"property 'name' of stored object 'foo' is not 'marcus'"),assert(t.get("foo").arr instanceof Array,"Array property 'arr' of stored object 'foo' is not an instance of Array"),assert(3==t.get("foo").arr.length,"The length of Array property 'arr' stored on object 'foo' is not 3"),t.remove("circularReference");var e={},n={one:e};e.two=n;var r=!1;try{t.set("circularReference",e)}catch(o){r=!0}assert(r,"storing object with circular reference did not throw"),assert(!t.get("circularReference"),"attempting to store object with circular reference which should have faile affected store state");var s={"int":42,bool:!0,"float":3.141592653,string:"Don't Panic",odd_string:"{ZYX'} abc:;::)))"};for(var i in s)t.storage.write(i,s[i]),assert(t.get(i)==s[i],i+" was not correctly promoted to valid JSON"),t.remove(i);t.clearAll();var a=0;t.each(function(){a+=1}),assert(0===a)}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=t("tinytest");a.hijackConsoleLog();var c=t("../src/store-engine"),f=c.createStore,l=t("../src/util"),p=l.each,d=t("../storages/all"),h=t("../plugins/all_tests");e.exports={output:null,outputError:null,runTests:r,failed:!1}},{"../plugins/all_tests":6,"../src/store-engine":29,"../src/util":30,"../storages/all":31,"./bugs/all":38,tinytest:5}],44:[function(t,e,n){"use strict";function r(t,e){if(("undefined"==typeof t?"undefined":o(t))!=("undefined"==typeof e?"undefined":o(e)))return!1;if("object"!=("undefined"==typeof t?"undefined":o(t)))return t===e;var n;for(n in t)if(!r(t[n],e[n]))return!1;for(n in e)if(!r(e[n],t[n]))return!1;return!0}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.exports={deepEqual:r}},{}]},{},[2])(2)});