//>>built
define("dojox/storage/CookieStorageProvider",["dijit","dojo","dojox","dojo/require!dojox/storage/Provider,dojox/storage/manager,dojo/cookie"],function(h,c,f){c.provide("dojox.storage.CookieStorageProvider");c.require("dojox.storage.Provider");c.require("dojox.storage.manager");c.require("dojo.cookie");c.declare("dojox.storage.CookieStorageProvider",[f.storage.Provider],{store:null,cookieName:"dojoxStorageCookie",storageLife:730,initialize:function(){this.store=c.fromJson(c.cookie(this.cookieName))||
{};this.initialized=!0;f.storage.manager.loaded()},isAvailable:function(){return c.cookie.isSupported()},put:function(a,b,d,e){this._assertIsValidKey(a);e=e||this.DEFAULT_NAMESPACE;this._assertIsValidNamespace(e);fullKey=this.getFullKey(a,e);this.store[fullKey]=c.toJson(b);this._save();(b=c.toJson(this.store)===c.cookie(this.cookieName))||this.remove(a,e);d&&d(b?this.SUCCESS:this.FAILED,a,null,e)},get:function(a,b){this._assertIsValidKey(a);b=b||this.DEFAULT_NAMESPACE;this._assertIsValidNamespace(b);
a=this.getFullKey(a,b);return this.store[a]?c.fromJson(this.store[a]):null},getKeys:function(a){a=a||this.DEFAULT_NAMESPACE;this._assertIsValidNamespace(a);a="__"+a+"_";var b=[];for(d in this.store)if(this._beginsWith(d,a)){var d=d.substring(a.length);b.push(d)}return b},clear:function(a){a=a||this.DEFAULT_NAMESPACE;this._assertIsValidNamespace(a);a="__"+a+"_";for(var b in this.store)this._beginsWith(b,a)&&delete this.store[b];this._save()},remove:function(a,b){b=b||this.DEFAULT_NAMESPACE;this._assertIsValidNamespace(b);
this._assertIsValidKey(a);a=this.getFullKey(a,b);delete this.store[a];this._save()},getNamespaces:function(){var a=[this.DEFAULT_NAMESPACE],b={};b[this.DEFAULT_NAMESPACE]=!0;var d=/^__([^_]*)_/,e;for(e in this.store)if(1==d.test(e)){var g=e.match(d)[1];"undefined"==typeof b[g]&&(b[g]=!0,a.push(g))}return a},isPermanent:function(){return!0},getMaximumSize:function(){return 4},hasSettingsUI:function(){return!1},isValidKey:function(a){return null===a||void 0===a?!1:/^[0-9A-Za-z_-]*$/.test(a)},isValidNamespace:function(a){return null===
a||void 0===a?!1:/^[0-9A-Za-z-]*$/.test(a)},getFullKey:function(a,b){return"__"+b+"_"+a},_save:function(){c.cookie(this.cookieName,c.toJson(this.store),{expires:this.storageLife})},_beginsWith:function(a,b){return b.length>a.length?!1:a.substring(0,b.length)===b},_assertIsValidNamespace:function(a){if(!1===this.isValidNamespace(a))throw Error("Invalid namespace given: "+a);},_assertIsValidKey:function(a){if(!1===this.isValidKey(a))throw Error("Invalid key given: "+a);}});f.storage.manager.register("dojox.storage.CookieStorageProvider",
new f.storage.CookieStorageProvider)});