!function(e,t){"use strict";var n=function(e){e.listeners={};var t={addListener:function(t,n){e.listeners[t]||(e.listeners[t]=[]),e.listeners[t].push(n)},removeListener:function(t,n){if(e.listeners[t]){var o=e.listeners[t].indexOf(n);o!==-1&&e.listeners[t].splice(o,1)}},removeAllListeners:function(t){delete e.listeners[t]},emit:function(t,n){e.listeners[t]&&e.listeners[t].forEach(function(e){e(n)})}},n=Object.getOwnPropertyNames(t);return n.forEach(function(n){e[n]=t[n].bind(e)}),e},o=function(e){if("object"!=typeof e.document)throw new Error("Cookies.js requires a `window` with a `document` object");var o=function(e,t,n){return 1===arguments.length?o.get(e):o.set(e,t,n)};return o=n(o),o._document=e.document,o._cacheKeyPrefix="cookey.",o._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),o.defaults={path:"/",secure:!1},o.get=function(e){o._cachedDocumentCookie!==o._document.cookie&&o._renewCache();var n=o._cache[o._cacheKeyPrefix+e];return n===t?t:decodeURIComponent(n)},o.set=function(e,n,r){return r=o._getExtendedOptions(r),r.expires=o._getExpiresDate(n===t?-1:r.expires),o._document.cookie=o._generateCookieString(e,n,r),o.emit("set."+e,n),o},o.expire=function(e,n){return o.set(e,t,n)},o._getExtendedOptions=function(e){return{path:e&&e.path||o.defaults.path,domain:e&&e.domain||o.defaults.domain,expires:e&&e.expires||o.defaults.expires,secure:e&&e.secure!==t?e.secure:o.defaults.secure}},o._isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},o._getExpiresDate=function(e,t){if(t=t||new Date,"number"==typeof e?e=e===1/0?o._maxExpireDate:new Date(t.getTime()+1e3*e):"string"==typeof e&&(e=new Date(e)),e&&!o._isValidDate(e))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return e},o._generateCookieString=function(e,t,n){e=e.replace(/[^#$&+\^`|]/g,encodeURIComponent),e=e.replace(/\(/g,"%28").replace(/\)/g,"%29"),t=(t+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),n=n||{};var o=e+"="+t;return o+=n.path?";path="+n.path:"",o+=n.domain?";domain="+n.domain:"",o+=n.expires?";expires="+n.expires.toUTCString():"",o+=n.secure?";secure":""},o._getCacheFromString=function(e){for(var n={},r=e?e.split("; "):[],i=0;i