{"version":3,"file":"Cleanup.js","names":["defineDs","Cleanup","keys","Object","localStorage","now","Date","getTime","ttl","i","length","key","substring","item","JSON","parse","getItem","timestamp","regex","RegExp","id","test","location","search","console","warn","removeItem","e"],"sources":["Shared/Framework/Mithril/Scripts/Helpers/Cleanup.js"],"sourcesContent":["defineDs('Shared/Framework/Mithril/Scripts/Helpers/Cleanup',\r\n function () {\r\n\r\n // Functions:\r\n var Cleanup = function () {\r\n try {\r\n var keys = Object.keys(localStorage);\r\n var now = (new Date()).getTime();\r\n var ttl = 86400 * 1000;\r\n\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n\r\n if (key.substring(0, 5) === 'Model') {\r\n var item = JSON.parse(localStorage.getItem(key));\r\n\r\n if (now - item.timestamp > ttl) {\r\n var regex = new RegExp(item.id);\r\n\r\n if (!regex.test(location.search)) {\r\n console.warn('Deleting from localStorage: ' + key);\r\n\r\n localStorage.removeItem(key);\r\n }\r\n }\r\n }\r\n }\r\n } catch (e) { }\r\n\r\n };\r\n\r\n // Public functions:\r\n return Cleanup;\r\n\r\n });\r\n"],"mappings":"AAAAA,QAAQ,CAAC,kDAAkD,EACzD,YAAY;EAEV;EACA,IAAIC,OAAO,GAAG,SAAAA,CAAA,EAAY;IACxB,IAAI;MACF,IAAIC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACE,YAAY,CAAC;MACpC,IAAIC,GAAG,GAAI,IAAIC,IAAI,CAAC,CAAC,CAAEC,OAAO,CAAC,CAAC;MAChC,IAAIC,GAAG,GAAG,KAAK,GAAG,IAAI;MAEtB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGP,IAAI,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;QACpC,IAAIE,GAAG,GAAGT,IAAI,CAACO,CAAC,CAAC;QAEjB,IAAIE,GAAG,CAACC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,EAAE;UACnC,IAAIC,IAAI,GAAGC,IAAI,CAACC,KAAK,CAACX,YAAY,CAACY,OAAO,CAACL,GAAG,CAAC,CAAC;UAEhD,IAAIN,GAAG,GAAGQ,IAAI,CAACI,SAAS,GAAGT,GAAG,EAAE;YAC9B,IAAIU,KAAK,GAAG,IAAIC,MAAM,CAACN,IAAI,CAACO,EAAE,CAAC;YAE/B,IAAI,CAACF,KAAK,CAACG,IAAI,CAACC,QAAQ,CAACC,MAAM,CAAC,EAAE;cAChCC,OAAO,CAACC,IAAI,CAAC,8BAA8B,GAAGd,GAAG,CAAC;cAElDP,YAAY,CAACsB,UAAU,CAACf,GAAG,CAAC;YAC9B;UACF;QACF;MACF;IACF,CAAC,CAAC,OAAOgB,CAAC,EAAE,CAAE;EAEhB,CAAC;;EAED;EACA,OAAO1B,OAAO;AAEhB,CAAC,CAAC","ignoreList":[]}