CrazySquirrel/EverCookie

View on GitHub
lib/EverCookie.js

Summary

Maintainability
A
0 mins
Test Coverage
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("EverCookie",[],e):"object"==typeof exports?exports.EverCookie=e():t.EverCookie=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=33)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!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},i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=function(){function t(e){n(this,t),this.regValidKey=new RegExp("([a-zA-Z0-9_-]{0,})","i"),this.hash=e||location.hostname}return i(t,[{key:"isSupported",value:function(){return"object"===("undefined"==typeof document?"undefined":o(document))&&"string"==typeof document.cookie}},{key:"setItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"/",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"https:"===location.protocol;try{if(void 0===i){var s=location.hostname.split(".");i=(s.length>2?".":"")+s.join(".")}if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)&&"string"==typeof r&&(""===r||this.regValidKey.test(r))&&"number"==typeof n&&n<365&&"string"==typeof o&&"string"==typeof i&&-1!==i.indexOf(location.hostname)&&"boolean"==typeof a&&a===("https:"===location.protocol)){var l=document.createElement("a");if(l.href="http://"+i+o,l.hostname===i||l.path===o){if(!t||this.isSupported()){var u=this.hash+"_"+e,c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3);var f=c.toUTCString();return r=encodeURIComponent(r),document.cookie=u+"="+r+(f?"; expires="+f:"")+(o?"; path="+o:"")+(i?"; domain="+i:"")+(a?"; secure":""),this.getItem(t,e)===decodeURIComponent(r)}return!1}return!1}return!1}catch(t){return!1}}},{key:"getItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){e=this.hash+"_"+e;for(var r=document.cookie.split(";"),n=0;n<r.length;n++){var o=r[n],i=o.trim().split("=",2);if(i[0]===e)return decodeURIComponent(i[1])}return!1}return!1}return!1}catch(t){return!1}}},{key:"removeItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{return!("boolean"!=typeof t||"string"!=typeof e||!this.regValidKey.test(e))&&(!(t&&!this.isSupported())&&(this.setItem(t,e,"",-86400),!1===this.getItem(t,e)))}catch(t){return!1}}},{key:"getKeys",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){for(var e=[],r=document.cookie.split(";"),n=0;n<r.length;n++){var o=r[n],i=o.trim().split("=",2);0===i[0].indexOf(this.hash)&&e.push(i[0].substr(this.hash.length+1))}return e}return[]}return[]}catch(t){return[]}}},{key:"clear",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){var e=this.getKeys(t);if(e)for(var r=0;r<e.length;r++){var n=e[r];this.removeItem(t,n)}return 0===this.getKeys(t).length}return!0}return!1}catch(t){return!1}}}]),t}();e.default=a},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!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},i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=function(){function t(e){n(this,t),this.regValidKey=new RegExp("([a-zA-Z0-9_-]{0,})","i"),this.hash=e||location.hostname,this.domStorage=document.getElementById(this.hash),this.domStorage||(this.domStorage=document.createElement("div"),this.domStorage.id=this.hash),document.body&&(document.body.appendChild(this.domStorage),this.domStorage=document.getElementById(this.hash),this.isSupported()&&(this.domStorage.style.behavior="url(#default#userData)"))}return i(t,[{key:"isSupported",value:function(){return"object"===o(this.domStorage)&&"object"===o(this.domStorage.parentNode)&&void 0!==this.domStorage.addBehavior}},{key:"setItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=arguments[2];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)&&"string"==typeof r&&(""===r||this.regValidKey.test(r))){if(!t||this.isSupported()){var n=this.hash+"_"+e;return this.domStorage.setAttribute(n,r),this.domStorage.save(this.hash),this.getItem(t,e)===r}return!1}return!1}catch(t){return!1}}},{key:"getItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e;this.domStorage.load(this.hash);var n=this.domStorage.getAttribute(r);return n||!1}return!1}return!1}catch(t){return!1}}},{key:"removeItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e;return this.domStorage.removeAttribute(r),this.domStorage.save(this.hash),!1===this.getItem(t,e)}return!1}return!1}catch(t){return!1}}},{key:"getKeys",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){for(var e=[],r=this.domStorage.XMLDocument.documentElement.attributes,n=0;n<r.length;n++){var o=r[n].name;0===o.indexOf(this.hash)&&e.push(o.substr(this.hash.length+1))}return e}return[]}return[]}catch(t){return[]}}},{key:"clear",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){var e=this.getKeys(t);if(e)for(var r=0;r<e.length;r++){var n=e[r];this.removeItem(t,n)}return 0===this.getKeys(t).length}return!0}return!1}catch(t){return!1}}}]),t}();e.default=a},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!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},i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=function(){function t(e){n(this,t),this.regValidKey=new RegExp("([a-zA-Z0-9_-]{0,})","i"),this.hash=e||location.hostname,window.globalStorage||(window.globalStorage={}),window.globalStorage[document.domain]||(window.globalStorage[document.domain]={}),this.globalStorage=window.globalStorage[document.domain]}return i(t,[{key:"isSupported",value:function(){return"object"===o(this.globalStorage)}},{key:"setItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=arguments[2];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)&&"string"==typeof r&&(""===r||this.regValidKey.test(r))){if(!t||this.isSupported()){var n=this.hash+"_"+e;return this.globalStorage[n]=r,this.getItem(t,e)===r}return!1}return!1}catch(t){return!1}}},{key:"getItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e,n=this.globalStorage[r];return n||!1}return!1}return!1}catch(t){return!1}}},{key:"removeItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e;return this.globalStorage[r]=!1,delete this.globalStorage[r],!1===this.getItem(t,e)}return!1}return!1}catch(t){return!1}}},{key:"getKeys",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){for(var e=[],r=Object.keys(this.globalStorage),n=0;n<r.length;n++){var o=r[n];0===o.indexOf(this.hash)&&e.push(o.substr(this.hash.length+1))}return e}return[]}return[]}catch(t){return[]}}},{key:"clear",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){var e=this.getKeys(t);if(e)for(var r=0;r<e.length;r++){var n=e[r];this.removeItem(t,n)}return 0===this.getKeys(t).length}return!0}return!1}catch(t){return!1}}}]),t}();e.default=a},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(e){n(this,t),this.regValidKey=new RegExp("([a-zA-Z0-9_-]{0,})","i"),this.hash=e||location.hostname}return o(t,[{key:"isSupported",value:function(){return void 0!==window.localStorage}},{key:"setItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=arguments[2];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)&&"string"==typeof r&&(""===r||this.regValidKey.test(r))){if(!t||this.isSupported()){var n=this.hash+"_"+e;return window.localStorage.setItem(n,r),this.getItem(t,e)===r}return!1}return!1}catch(t){return!1}}},{key:"getItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e,n=window.localStorage.getItem(r);return n||!1}return!1}return!1}catch(t){return!1}}},{key:"removeItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e;return window.localStorage.removeItem(r),!1===this.getItem(t,e)}return!1}return!1}catch(t){return!1}}},{key:"getKeys",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){for(var e=[],r=0;r<window.localStorage.length;r++)0===window.localStorage.key(r).indexOf(this.hash)&&e.push(window.localStorage.key(r).substr(this.hash.length+1));return e}return[]}return[]}catch(t){return[]}}},{key:"clear",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){var e=this.getKeys(t);if(e)for(var r=0;r<e.length;r++){var n=e[r];this.removeItem(t,n)}return 0===this.getKeys(t).length}return!0}return!1}catch(t){return!1}}}]),t}();e.default=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(e){n(this,t),this.regValidKey=new RegExp("([a-zA-Z0-9_-]{0,})","i"),this.hash=e||location.hostname}return o(t,[{key:"isSupported",value:function(){return void 0!==window.sessionStorage}},{key:"setItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=arguments[2];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)&&"string"==typeof r&&(""===r||this.regValidKey.test(r))){if(!t||this.isSupported()){var n=this.hash+"_"+e;return window.sessionStorage.setItem(n,r),this.getItem(t,e)===r}return!1}return!1}catch(t){return!1}}},{key:"getItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e,n=window.sessionStorage.getItem(r);return n||!1}return!1}return!1}catch(t){return!1}}},{key:"removeItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1];try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)){if(!t||this.isSupported()){var r=this.hash+"_"+e;return window.sessionStorage.removeItem(r),!1===this.getItem(t,e)}return!1}return!1}catch(t){return!1}}},{key:"getKeys",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){for(var e=[],r=0;r<window.sessionStorage.length;r++)0===window.sessionStorage.key(r).indexOf(this.hash)&&e.push(window.sessionStorage.key(r).substr(this.hash.length+1));return e}return[]}return[]}catch(t){return[]}}},{key:"clear",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];try{if("boolean"==typeof t){if(!t||this.isSupported()){var e=this.getKeys(t);if(e)for(var r=0;r<e.length;r++){var n=e[r];this.removeItem(t,n)}return 0===this.getKeys(t).length}return!0}return!1}catch(t){return!1}}}]),t}();e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(10),s=n(a),l=r(1),u=n(l),c=r(2),f=n(c),h=r(3),d=n(h),p=r(4),m=n(p),y=r(5),v=n(y),g=function(){function t(e){o(this,t),this.regValidKey=new RegExp("([a-zA-Z0-9_-]{0,})","i"),this.hash=e||location.hostname,this.stores=[],void 0!==u.default&&this.stores.push(new u.default(this.hash)),void 0!==d.default&&this.stores.push(new d.default(this.hash)),void 0!==m.default&&this.stores.push(new m.default(this.hash)),void 0!==v.default&&this.stores.push(new v.default(this.hash)),void 0!==f.default&&this.stores.push(new f.default(this.hash));for(var r=0;r<this.stores.length;r++)this.stores[r].isSupported()||this.stores.splice(r,1);this.stopRefresh=!1,this.isSupported()&&this.start()}return i(t,[{key:"isSupported",value:function(){return this.stores&&this.stores.length>0}},{key:"setItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=arguments[2],n=!0;this.stopRefresh=!0;try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e)&&"string"==typeof r&&(""===r||this.regValidKey.test(r)))if(!t||this.isSupported()){for(var o=[],i=0;i<this.stores.length;i++){var a=this.stores[i];o.push(a.setItem(!1,e,r))}n=o.length>0&&-1!==o.indexOf(!0)}else n=!1;else n=!1}catch(t){n=!1}return this.stopRefresh=!1,n}},{key:"getItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=!1;this.stopRefresh=!0;try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e))if(!t||this.isSupported()){for(var n=[],o=0;o<this.stores.length;o++){var i=this.stores[o],a=i.getItem(!1,e);a&&n.push(a)}for(var s={},l=0,u=0;u<n.length;u++){var c=n[u];s[c]||(s[c]=0),s[c]++,s[c]>l&&(l=s[c],r=c)}}else r=!1;else r=!1}catch(t){r=!1}return this.stopRefresh=!1,r}},{key:"removeItem",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments[1],r=!0;this.stopRefresh=!0;try{if("boolean"==typeof t&&"string"==typeof e&&this.regValidKey.test(e))if(!t||this.isSupported()){for(var n=0,o=0;o<this.stores.length;o++){var i=this.stores[o];n+=1*i.removeItem(!1,e)}r=n===this.stores.length}else r=!1;else r=!1}catch(t){r=!1}return this.stopRefresh=!1,r}},{key:"getKeys",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={};this.stopRefresh=!0;try{if("boolean"==typeof t)if(!t||this.isSupported())for(var r=0;r<this.stores.length;r++){var n=this.stores[r],o=n.getKeys(!1);if(o.length>0)for(var i=0;i<o.length;i++){var a=o[i];e[a]=!0}}else e={};else e={}}catch(t){e={}}return this.stopRefresh=!1,Object.keys(e)}},{key:"clear",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!0;this.stopRefresh=!0;try{if("boolean"==typeof t)if(!t||this.isSupported()){for(var r=0,n=0;n<this.stores.length;n++){var o=this.stores[n];r+=1*o.clear(!1)}e=r===this.stores.length}else e=!1;else e=!1}catch(t){e=!1}return this.stopRefresh=!1,e}},{key:"refresh",value:function(){if(!this.stopRefresh)for(var t=this.getKeys(!1),e=0;e<t.length;e++)for(var r=t[e],n=this.getItem(!1,r),o=0;o<this.stores.length;o++){var i=this.stores[o];n!==i.getItem(!1,r)&&i.setItem(!1,r,n.toString())}}},{key:"destroy",value:function(){return this.stop(),this.refresh=function(){return null},this.stores=[],!0}},{key:"start",value:function(){return this.refreshID=s.default.subscribe(this,this.refresh),!0}},{key:"stop",value:function(){return s.default.unsubscribe(this.refreshID),this.stopRefresh=!0,!0}}]),t}();e.default=g,t.exports=g},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function i(t){if(f===clearTimeout)return clearTimeout(t);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function a(){m&&d&&(m=!1,d.length?p=d.concat(p):y=-1,p.length&&s())}function s(){if(!m){var t=o(a);m=!0;for(var e=p.length;e;){for(d=p,p=[];++y<e;)d&&d[y].run();y=-1,e=p.length}d=null,m=!1,i(t)}}function l(t,e){this.fun=t,this.array=e}function u(){}var c,f,h=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(t){c=r}try{f="function"==typeof clearTimeout?clearTimeout:n}catch(t){f=n}}();var d,p=[],m=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];p.push(new l(t,e)),1!==p.length||m||o(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.prependListener=u,h.prependOnceListener=u,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e,r){(function(e){!function(r){function n(){}function o(t,e){return function(){t.apply(e,arguments)}}function i(t){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function a(t,e){for(;3===t._state;)t=t._value;if(0===t._state)return void t._deferreds.push(e);t._handled=!0,i._immediateFn(function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null===r)return void(1===t._state?s:l)(e.promise,t._value);var n;try{n=r(t._value)}catch(t){return void l(e.promise,t)}s(e.promise,n)})}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof i)return t._state=3,t._value=e,void u(t);if("function"==typeof r)return void f(o(r,e),t)}t._state=1,t._value=e,u(t)}catch(e){l(t,e)}}function l(t,e){t._state=2,t._value=e,u(t)}function u(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,r=t._deferreds.length;e<r;e++)a(t,t._deferreds[e]);t._deferreds=null}function c(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function f(t,e){var r=!1;try{t(function(t){r||(r=!0,s(e,t))},function(t){r||(r=!0,l(e,t))})}catch(t){if(r)return;r=!0,l(e,t)}}var h=setTimeout;i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var r=new this.constructor(n);return a(this,new c(t,e,r)),r},i.all=function(t){return new i(function(e,r){function n(t,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){n(t,e)},r)}o[t]=a,0==--i&&e(o)}catch(t){r(t)}}if(!t||void 0===t.length)throw new TypeError("Promise.all accepts an array");var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);for(var i=o.length,a=0;a<o.length;a++)n(a,o[a])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(t){return new i(function(e,r){r(t)})},i.race=function(t){return new i(function(e,r){for(var n=0,o=t.length;n<o;n++)t[n].then(e,r)})},i._immediateFn="function"==typeof e&&function(t){e(t)}||function(t){h(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==t&&t.exports?t.exports=i:r.Promise||(r.Promise=i)}(this)}).call(e,r(13).setImmediate)},function(t,e,r){(function(t,e){!function(t,r){"use strict";function n(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var n={callback:t,args:e};return u[l]=n,s(l),l++}function o(t){delete u[t]}function i(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(r,n)}}function a(t){if(c)setTimeout(a,0,t);else{var e=u[t];if(e){c=!0;try{i(e)}finally{o(t),c=!1}}}}if(!t.setImmediate){var s,l=1,u={},c=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?function(){s=function(t){e.nextTick(function(){a(t)})}}():function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?function(){var e="setImmediate$"+Math.random()+"$",r=function(r){r.source===t&&"string"==typeof r.data&&0===r.data.indexOf(e)&&a(+r.data.slice(e.length))};t.addEventListener?t.addEventListener("message",r,!1):t.attachEvent("onmessage",r),s=function(r){t.postMessage(e+r,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){a(t.data)},s=function(e){t.port2.postMessage(e)}}():f&&"onreadystatechange"in f.createElement("script")?function(){var t=f.documentElement;s=function(e){var r=f.createElement("script");r.onreadystatechange=function(){a(e),r.onreadystatechange=null,t.removeChild(r),r=null},t.appendChild(r)}}():function(){s=function(t){setTimeout(a,0,t)}}(),h.setImmediate=n,h.clearImmediate=o}}("undefined"==typeof self?void 0===t?this:t:self)}).call(e,r(0),r(7))},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("string"==typeof t&&"string"==typeof e){t=t.trim().split("."),e=e.trim().split(".");for(var r=0;r<t.length;r++){if(t[r]=t[r]||0,e[r]=e[r]||0,t[r]>e[r])return!1;if(t[r]<e[r])return!0}}return!1}Object.defineProperty(e,"__esModule",{value:!0});var a="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=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),l=r(11),u=n(l),c=r(12),f=n(c),h=u.default.version,d=function(){function t(){o(this,t),this.version=h,this.serialID=0,this.parallelStack={},this.serialStack={},this.stack=this.parallelStack,this.errorHandler=null,this.watch()}return s(t,[{key:"subscribe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f.default,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments[3];try{return this.parallelSubscribe({context:t,callback:e,params:r,ID:n})}catch(o){this._errorHandler(o);try{return f.default._AnimationFrame.parallelSubscribe({context:t,callback:e,params:r,ID:n})}catch(t){return this._errorHandler(t),!1}}}},{key:"parallelSubscribe",value:function(t){try{var e=this.prepareParams(t);return!!e&&(this.parallelStack[e.ID]={callback:e.callback,context:e.context,params:e.params},e.ID)}catch(e){this._errorHandler(e);try{return f.default._AnimationFrame.parallelSubscribe(t)}catch(t){return this._errorHandler(t),!1}}}},{key:"serialSubscribe",value:function(t){try{var e=this.prepareParams(t);return!!e&&(this.serialStack[e.ID]={callback:e.callback,context:e.context,params:e.params},e.ID)}catch(e){this._errorHandler(e);try{return f.default._AnimationFrame.serialSubscribe(t)}catch(t){return this._errorHandler(t),!1}}}},{key:"unsubscribe",value:function(t){try{return this.parallelUnsubscribe(t)}catch(e){this._errorHandler(e);try{return f.default._AnimationFrame.parallelUnsubscribe(t)}catch(t){return this._errorHandler(t),!1}}}},{key:"parallelUnsubscribe",value:function(t){try{return!("string"!=typeof t||!this.parallelStack[t])&&(this.parallelStack[t]=!1,delete this.parallelStack[t],!0)}catch(e){this._errorHandler(e);try{return f.default._AnimationFrame.parallelUnsubscribe(t)}catch(t){return this._errorHandler(t),!1}}}},{key:"serialUnsubscribe",value:function(t){try{return!("string"!=typeof t||!this.serialStack[t])&&(this.serialStack[t]=!1,delete this.serialStack[t],!0)}catch(e){this._errorHandler(e);try{return f.default._AnimationFrame.serialUnsubscribe(t)}catch(t){return this._errorHandler(t),!1}}}},{key:"getID",value:function(){return"x-"+(new Date).getTime()+"-"+Math.round(1e6*Math.random())}},{key:"prepareParams",value:function(t){return"object"===(void 0===t?"undefined":a(t))&&(t.context=t.context||f.default,t.callback=t.callback||function(){return null},t.params=t.params||[],t.ID=t.ID||this.getID(),!("object"!==a(t.context)||"function"!=typeof t.callback||"object"!==a(t.params)||!Array.isArray(t.params)||"string"!=typeof t.ID)&&t)}},{key:"watch",value:function(){try{try{this.parallelWatch()}catch(t){this._errorHandler(t)}try{this.serialWatch()}catch(t){this._errorHandler(t)}f.default.requestAnimationFrame(this.watch.bind(this))}catch(t){this._errorHandler(t)}}},{key:"parallelWatch",value:function(){try{if(this.parallelStack&&"object"===a(this.parallelStack)&&Object.keys(this.parallelStack).length>0)for(var t in this.parallelStack)if(this.parallelStack.hasOwnProperty(t))try{if(t&&"string"==typeof t){var e=this.parallelStack[t];e&&"object"===(void 0===e?"undefined":a(e))&&e.context&&e.callback&&e.params&&"object"===a(e.context)&&"function"==typeof e.callback&&Array.isArray(e.params)&&e.callback.apply(e.context,e.params)}}catch(t){this._errorHandler(t)}}catch(t){this._errorHandler(t)}}},{key:"serialWatch",value:function(){try{if(this.serialStack&&"object"===a(this.serialStack)){var t=Object.keys(this.serialStack);if(t&&t.length>0){this.serialID>=t.length&&(this.serialID=0);var e=t[this.serialID];if(this.serialID++,this.serialStack.hasOwnProperty(e)&&e&&"string"==typeof e){var r=this.serialStack[e];r&&"object"===(void 0===r?"undefined":a(r))&&r.context&&r.callback&&r.params&&"object"===a(r.context)&&"function"==typeof r.callback&&Array.isArray(r.params)&&r.callback.apply(r.context,r.params)}}}}catch(t){this._errorHandler(t)}}},{key:"_errorHandler",value:function(t){this.errorHandler&&this.errorHandler(t)}}]),t}();f.default.AnimationFrame&&f.default.AnimationFrame.version&&!i(f.default.AnimationFrame.version,h)||Object.defineProperty(f.default,"AnimationFrame",{configurable:!0,enumerable:!1,get:function(){return f.default._AnimationFrame=f.default._AnimationFrame||new d,f.default._AnimationFrame},set:function(t){if(f.default._AnimationFrame){if(!f.default._AnimationFrame.version||i(f.default._AnimationFrame.version,t.version)){if(f.default._oldAnimationFrame=f.default._AnimationFrame,f.default._oldAnimationFrame.parallelWatch=function(){},f.default._oldAnimationFrame.serialWatch=function(){},f.default._oldAnimationFrame.watch=function(){},f.default._oldAnimationFrame.subscribe=t.subscribe,f.default._oldAnimationFrame.parallelSubscribe=t.parallelSubscribe,f.default._oldAnimationFrame.serialSubscribe=t.serialSubscribe,f.default._oldAnimationFrame.parallelStack&&Object.preventExtensions(f.default._oldAnimationFrame.parallelStack),f.default._oldAnimationFrame.stack&&Object.preventExtensions(f.default._oldAnimationFrame.stack),f.default._oldAnimationFrame.serialStack&&Object.preventExtensions(f.default._oldAnimationFrame.serialStack),f.default._AnimationFrame=t,"object"===a(f.default._oldAnimationFrame.parallelStack))for(var e in f.default._oldAnimationFrame.parallelStack)f.default._oldAnimationFrame.parallelStack.hasOwnProperty(e)&&(f.default._AnimationFrame.parallelSubscribe({callback:f.default._oldAnimationFrame.parallelStack[e].callback,context:f.default._oldAnimationFrame.parallelStack[e].context,params:f.default._oldAnimationFrame.parallelStack[e].params,ID:e}),f.default._oldAnimationFrame.parallelUnsubscribe(e),delete f.default._oldAnimationFrame.parallelStack[e]);else if("object"===a(f.default._oldAnimationFrame.stack))for(var r in f.default._oldAnimationFrame.stack)f.default._oldAnimationFrame.stack.hasOwnProperty(r)&&(f.default._AnimationFrame.subscribe(f.default._oldAnimationFrame.stack[r].context,f.default._oldAnimationFrame.stack[r].callback,f.default._oldAnimationFrame.stack[r].params,f.default._oldAnimationFrame.stack[r].ID),f.default._oldAnimationFrame.unsubscribe(r),delete f.default._oldAnimationFrame.stack[r]);if("object"===a(f.default._oldAnimationFrame.serialStack))for(var n in f.default._oldAnimationFrame.serialStack)f.default._oldAnimationFrame.serialStack.hasOwnProperty(n)&&(f.default._AnimationFrame.serialSubscribe({callback:f.default._oldAnimationFrame.serialStack[n].callback,context:f.default._oldAnimationFrame.serialStack[n].context,params:f.default._oldAnimationFrame.serialStack[n].params,ID:n}),f.default._oldAnimationFrame.serialUnsubscribe(n),delete f.default._oldAnimationFrame.serialStack[n])}}else f.default._AnimationFrame=t}}),f.default.AnimationFrame=new d;var p=f.default.AnimationFrame;e.default=p,t.exports=p},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={name:"AnimationFrame",version:"1.0.52"};e.default=n,t.exports=n},function(t,e,r){"use strict";(function(t){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){function e(){}function r(){return i.apply(this instanceof e?this:t||s,o.concat(n.call(arguments)))}if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var n=Array.prototype.slice,o=n.call(arguments,1),i=this;return e.prototype=this.prototype,r.prototype=new e,r}Object.defineProperty(e,"__esModule",{value:!0});var i="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=function t(){n(this,t)},s=void 0;s="undefined"==typeof window?void 0!==t?t:new a:window,s.Promise||(s.Promise=r(8)),s.requestAnimationFrame=function(){return void 0!==s&&(s.requestAnimationFrame||s.webkitRequestAnimationFrame||s.mozRequestAnimationFrame||s.oRequestAnimationFrame||s.msRequestAnimationFrame)||function(t){s.setTimeout(t,1e3/60)}}(),Function.prototype.bind=Function.prototype.bind||o,Object.keys=Object.keys||function(){var t=!{toString:null}.propertyIsEnumerable("toString"),e=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=e.length;return function(n){if("object"!==(void 0===n?"undefined":i(n))&&("function"!=typeof n||null===n))throw new TypeError("Object.keys called on non-object");var o=[];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);if(t)for(var s=0;s<r;s++)Object.prototype.hasOwnProperty.call(n,e[s])&&o.push(e[s]);return o}}(),e.default=s}).call(e,r(0))},function(t,e,r){(function(t){function n(t,e){this._id=t,this._clearFn=e}var o=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;e.setTimeout=function(){return new n(i.call(setTimeout,o,arguments),clearTimeout)},e.setInterval=function(){return new n(i.call(setInterval,o,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(o,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r(9),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(e,r(0))},,,,,,,,,,,,,,,,,,,,function(t,e,r){t.exports=r(6)}])});