)}else this.storage.removeItem(this.namespace+".ids")},startTracking:function(){if(!this.canTrack())return!1;this.storage.removeItem(this.namespace+".tracking")},getNamespace:function(){return this.namespace},getIdsList:function(e){var t=[],i=this,n=function(e){for(var i in e){var n=e[i].i;-1===t.indexOf(n)&&t.push(n)}return t};if(!this.bIDB)return n(this.getIds());if(e)return n(this.getIds(e));var o=function(e,t){i.getIds().then(function(t){e(n(t))})}
;if(xv.indexedDb.getDbIsOpen()&&!xv.indexedDb.getDbIsUpdating())return new Promise(o);xv.indexedDb.tempStackAdd(function(){return new Promise(o)})},getIdsTimestampsList:function(e){var t={},i=function(e){for(var i in e)t[e[i].i]=e[i].t;return t};if(this.bIDB){if(e)return i(this.getIds(e));var n=this;return new Promise(function(e,i){void 0===n.getIds()&&i(!1),n.getIds().then(function(i){for(var n in i)t[i[n].i]=i[n].t;e(t)})})}return i(this.getIds())},getIds:function(e){if(!this.canTrack())return[];var t,i=this.namespace+".ids";if(!this.bIDB){if("string"!=typeof(t=this.storage.getItem(this.namespace+".ids")))return[];try{t=JSON.parse(t)}catch(n){return[]}return t}if(e){if("string"!=typeof(t=this.storage.getItem(this.namespace+".ids")))return[];try{t=JSON.parse(t)}catch(n){return[]}return t}if(xv.indexedDb.getStoreExist({store_name:i}))return xv.indexedDb.getDbIsOpen()&&!xv.indexedDb.getDbIsUpdating()?new Promise(function(e,t){xv.indexedDb.get(null,i).then(function(t){"string"==typeof t&&(t=JSON.parse(t)),e(t)})}):void xv.indexedDb.tempStackAdd(function(){return new Promise(function(e,t){xv.indexedDb.get(null,i).then(function(t){"string"!=typeof t&&e([]);try{t=JSON.parse(t)}catch(n){e([])}e(t)})})},i)},addId:function(e,t){if(this.isTracking()){var i=this,n=function(n){var o=!1;for(var s in n)if(n[s].i===e){n[s].t=(new Date).getTime(),o=!0;break}o?n.sort(function(e,t){return e.t===t.t?0:e.t>t.t?-1:1}):(n.unshift({i:e,t:(new Date).getTime()}),null!==i.max_elements&&n.length>i.max_elements&&(n=n.slice(0,i.max_elements-1))),i._write(n),"function"==typeof t&&t()};this.bIDB?this.getIds().then(function(e){n(e)}):n(this.getIds())}},addIds:function(e){if(this.isTracking()){var t=this,i=function(i){var n=!1;for(var o in i){var s=e.indexOf(i[o].i);if(-1!==s){delete e[s],i[o].t=(new Date).getTime(),n=!0;break}}if(n&&i.sort(function(e,t){return e.t===t.t?0:e.t>t.t?-1:1}),e.length>0){for(var a in e)i.unshift({i:e[a],t:(new Date).getTime()});null!==t.max_elements&&i.length>t.max_elements&&(i=i.slice(0,t.max_elements-1))}t._write(i)};this.bIDB?this.getIds().then(function(e){i(e)}):i(this.getIds())}},removeId:function(e,t,i){if(this.isTracking())if(this.bIDB){if(void 0===t||null===t||""===t