UNPKG

migme-beachball

Version:
2 lines 36.9 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MIGME=t():e.MIGME=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(16),o=(r(i),n(9)),s=r(o),u=n(10),a=r(u),c=n(8),l=r(c),f=n(7),p=r(f),h=n(4),d=r(h),y=n(11),v=r(y),g=n(6),m=r(g),b=n(12),w=n(1),_=r(w),x={init:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.client_id,n=void 0===t?"":t,r=e.redirect_uri,i=void 0===r?"":r,o=e.version,s=void 0===o?"":o,u=e.access_token,a=void 0===u?"":u,c=e.scope,f=void 0===c?"":c,h=e.baseUrl,y=void 0===h?"https://api.mig.me":h,v=e.storage_key,g=void 0===v?"migme-session":v;Object.assign(_.default,{client_id:n,redirect_uri:i,version:s,access_token:a,scope:f,baseUrl:y,storage_key:g}),(0,l.default)().then(d.default),(0,p.default)().then(d.default).then(b.trim).catch(function(){})},api:m.default,login:s.default,logout:a.default,getLoginStatus:l.default,setScope:v.default,asyncInit:function(){"undefined"!=typeof window&&"function"==typeof window.migmeAsyncInit&&window.migmeAsyncInit()}};x.asyncInit(),t.default=x,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t){},function(e,t,n){var r,i,o;!function(n,s){i=[t,e],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))}(this,function(e,t){"use strict";var r=void 0;if("undefined"==typeof window){var i=n(17).LocalStorage;r=new i("./uls-scratch")}else r="undefined"==typeof window.localStorage||"undefined"==typeof window.sessionStorage?n(19):window.localStorage;t.exports=r})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(i,o){try{var s=t[i](o),u=s.value}catch(a){return void n(a)}return s.done?void e(u):Promise.resolve(u).then(function(e){return r("next",e)},function(e){return r("throw",e)})}return r("next")})}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),s=r(o),u=n(1),a=r(u);t.default=function(){var e=i(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=3;break}return a.default.access_token=e.access_token,t.abrupt("return",s.default.setItem(a.default.storage_key,JSON.stringify(e)));case 3:return t.abrupt("return",null);case 4:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.exports=t.default},function(e,t){function n(){c=!1,s.length?a=s.concat(a):l=-1,a.length&&r()}function r(){if(!c){var e=setTimeout(n);c=!0;for(var t=a.length;t;){for(s=a,a=[];++l<t;)s&&s[l].run();l=-1,t=a.length}s=null,c=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function o(){}var s,u=e.exports={},a=[],c=!1,l=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new i(e,t)),1!==a.length||c||setTimeout(r,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=o,u.addListener=o,u.once=o,u.off=o,u.removeListener=o,u.removeAllListeners=o,u.emit=o,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];return"/"!==e.charAt(0)&&(e="/"+e),t.headers=t.headers||{},Object.assign(t.headers,{authorization:"Bearer "+s.default.access_token}),n&&Object.assign(t.headers,{"content-type":"application/json"}),u.fetch(s.default.baseUrl+e,t)};var o=n(1),s=i(o),u="undefined"==typeof window?r:window;e.exports=t.default}).call(t,function(){return this}())},function(e,t){"use strict";function n(){return new Promise(function(e){var t=window.location.hash.substring(1),n=JSON.parse(t);e(n.res)})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(i,o){try{var s=t[i](o),u=s.value}catch(a){return void n(a)}return s.done?void e(u):Promise.resolve(u).then(function(e){return r("next",e)},function(e){return r("throw",e)})}return r("next")})}}function o(e){if(!e||"undefined"==typeof document)return null;var t=document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"),n=decodeURIComponent(t);return n?{session_id:n}:null}Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),u=r(s),a=n(1),c=r(a);t.default=i(regeneratorRuntime.mark(function l(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=u.default.getItem(c.default.storage_key),t.abrupt("return",JSON.parse(e)||o("eid"));case 2:case"end":return t.stop()}},l,this)})),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(i,o){try{var s=t[i](o),u=s.value}catch(a){return void n(a)}return s.done?void e(u):Promise.resolve(u).then(function(e){return r("next",e)},function(e){return r("throw",e)})}return r("next")})}}function o(e){return window.open(e)}function s(e){return new Promise(function(t,n){var r,i=function o(r){if(r.source===e){var i;if(r.data.err)n(r.data.err);else{if(!r.data.res)return;t(r.data.res)}(i=window,c.off).call(i,"message",o)}};(r=window,c.on).call(r,"message",i)})}Object.defineProperty(t,"__esModule",{value:!0});var u=n(20),a=r(u),c=n(13),l=n(1),f=r(l),p=n(4),h=r(p),d="{+baseUrl}/login-page/{?"+["callback","callback_type","client_id","redirect_uri","scope"]+"}",y={popup:function(){var e=Object.assign({callback_type:"popup"},f.default),t=a.default.parse(d).expand(e),n=o(t);return s(n)},redirect:function(){var e=Object.assign({callback_type:"redirect"},f.default),t=a.default.parse(d).expand(e);window.location.href=t}};t.default=function(){var e=i(regeneratorRuntime.mark(function t(){for(var e=arguments.length<=0||void 0===arguments[0]?"popup":arguments[0],n=arguments.length,r=Array(n>1?n-1:0),i=1;n>i;i++)r[i-1]=arguments[i];var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=y[e],t.abrupt("return",o.apply(void 0,r).then(function(e){return(0,h.default)(e),e}));case 2:case"end":return t.stop()}},t,this)}));return function(t,n){return e.apply(this,arguments)}}(),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(i,o){try{var s=t[i](o),u=s.value}catch(a){return void n(a)}return s.done?void e(u):Promise.resolve(u).then(function(e){return r("next",e)},function(e){return r("throw",e)})}return r("next")})}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),s=r(o),u=n(1),a=r(u);t.default=i(regeneratorRuntime.mark(function c(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.default.access_token="",e.abrupt("return",s.default.removeItem(a.default.storage_key));case 2:case"end":return e.stop()}},c,this)})),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0];if("string"==typeof e)return o.default.scope=e,o.default.scope;throw new Error("Scope must be a string")};var i=n(1),o=r(i);e.exports=t.default},function(e,t){"use strict";function n(){var e=window.location,t=e.href.length-e.hash.length,n=e.href.substring(0,t);window.history.replaceState(null,null,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.trim=n},function(e,t){"use strict";function n(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=Object.assign({detail:t},n),i=new CustomEvent(e,r);this.dispatchEvent(i)}function r(e,t){return n.call(this,e,t,{bubbles:!0})}function i(e,t){this.addEventListener(e,t)}function o(e,t){this.removeEventListener(e,t)}function s(){}function u(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?s:arguments[1];return new Promise(function(r){var s=function u(i){return o.call(t,e,u),r(i),n(i)};i.call(t,e,s)})}Object.defineProperty(t,"__esModule",{value:!0}),t.dispatch=n,t.bubble=r,t.on=i,t.off=o,t.once=u},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,u,a,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:u=Array.prototype.slice.call(arguments,1),n.apply(this,u)}else if(o(n))for(u=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,a=0;i>a;a++)c[a].apply(this,u);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,s,u;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(u=s;u-- >0;)if(n[u]===t||n[u].listener&&n[u].listener===t){i=u;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){n(23),e.exports=self.fetch.bind(self)},function(e,t,n){(function(e){(function(){var r,i,o,s,u,a,c,l,f,p=function(e,t){function n(){this.constructor=e}for(var r in t)h.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},h={}.hasOwnProperty;c=n(18),a=n(2),u=n(14),l=function(e){var t,n,r,i,o;for(i=a.readdirSync(e),o=[],n=0,r=i.length;r>n;n++)t=i[n],o.push(f(c.join(e,t)));return o},f=function(e){return a.statSync(e).isDirectory()?(l(e),a.rmdirSync(e)):a.unlinkSync(e)},o=function(e){function t(e){this.message=null!=e?e:"Unknown error.",null!=Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}return p(t,e),t.prototype.toString=function(){return this.name+": "+this.message},t}(Error),s=function(){function e(e,t,n,r,i){this.key=e,this.oldValue=t,this.newValue=n,this.url=r,this.storageArea=null!=i?i:"localStorage"}return e}(),i=function(t){function n(t,r){return this.location=t,this.quota=null!=r?r:5242880,this instanceof n?(this.length=0,this.bytesInUse=0,this.keys=[],this.metaKeyMap=i(),this.eventUrl="pid:"+e.pid,this._init(),void(this.QUOTA_EXCEEDED_ERR=o)):new n(this.location,this.quota)}var r,i;return p(n,t),r=function(){function e(t,n){return this.key=t,this.index=n,this instanceof e?void 0:new e(this.key,this.index)}return e}(),i=function(){var e;return e=function(){},e.prototype=Object.create(null),new e},n.prototype._init=function(){var e,t,n,i,o,s,u,c;if(a.existsSync(this.location)&&!a.statSync(this.location).isDirectory())throw new Error("A file exists at the location '"+this.location+"' when trying to create/open localStorage");if(this.bytesInUse=0,this.length=0,!a.existsSync(this.location))return void a.mkdirSync(this.location);for(u=a.readdirSync(this.location),e=s=0,c=u.length;c>s;e=++s)t=u[e],o=decodeURIComponent(t),this.keys.push(o),i=new r(t,e),this.metaKeyMap[o]=i,n=this.getStat(t),null!=(null!=n?n.size:void 0)&&(i.size=n.size,this.bytesInUse+=n.size);return this.length=u.length},n.prototype.setItem=function(e,t){var n,i,l,f,p,h,d,y,v,g;if(p=u.EventEmitter.listenerCount(this,"storage"),y=null,p&&(y=this.getItem(e)),e=e.toString(),n=encodeURIComponent(e),f=c.join(this.location,n),v=t.toString(),g=v.length,h=this.metaKeyMap[e],l=!!h,d=l?h.size:0,this.bytesInUse-d+g>this.quota)throw new o;return a.writeFileSync(f,v,"utf8"),l||(h=new r(n,this.keys.push(e)-1),h.size=g,this.metaKeyMap[e]=h,this.length+=1,this.bytesInUse+=g),p?(i=new s(e,y,t,this.eventUrl),this.emit("storage",i)):void 0},n.prototype.getItem=function(e){var t,n;return e=e.toString(),n=this.metaKeyMap[e],n?(t=c.join(this.location,n.key),a.readFileSync(t,"utf8")):null},n.prototype.getStat=function(e){var t;return e=e.toString(),t=c.join(this.location,encodeURIComponent(e)),a.existsSync(t)?a.statSync(t):null},n.prototype.removeItem=function(e){var t,n,r,i,o,a,l,p,h;if(e=e.toString(),a=this.metaKeyMap[e]){r=u.EventEmitter.listenerCount(this,"storage"),l=null,r&&(l=this.getItem(e)),delete this.metaKeyMap[e],this.length-=1,this.bytesInUse-=a.size,n=c.join(this.location,a.key),this.keys.splice(a.index,1),h=this.metaKeyMap;for(i in h)p=h[i],o=this.metaKeyMap[i],o.index>a.index&&(o.index-=1);if(f(n),r)return t=new s(e,l,null,this.eventUrl),this.emit("storage",t)}},n.prototype.key=function(e){return this.keys[e]},n.prototype.clear=function(){var e;return l(this.location),this.metaKeyMap=i(),this.keys=[],this.length=0,this.bytesInUse=0,u.EventEmitter.listenerCount(this,"storage")?(e=new s(null,null,null,this.eventUrl),this.emit("storage",e)):void 0},n.prototype.getBytesInUse=function(){return this.bytesInUse},n.prototype._deleteLocation=function(){return f(this.location),this.metaKeyMap={},this.keys=[],this.length=0,this.bytesInUse=0},n}(u.EventEmitter),r=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return p(t,e),t.prototype.setItem=function(e,n){var r;return r=JSON.stringify(n),t.__super__.setItem.call(this,e,r)},t.prototype.getItem=function(e){return JSON.parse(t.__super__.getItem.call(this,e))},t}(i),t.LocalStorage=i,t.JSONStorage=r,t.QUOTA_EXCEEDED_ERR=o}).call(this)}).call(t,n(5))},function(e,t,n){var r=r||{};!function(){"use strict";function e(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var i="win32"===r.platform,o=n(22);if(i){var s=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,u=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,a=function(e){var t=s.exec(e),n=(t[1]||"")+(t[2]||""),r=t[3]||"",i=u.exec(r),o=i[1],a=i[2],c=i[3];return[n,o,a,c]},c=function(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")};t.resolve=function(){function n(e){return!!e}for(var i="",u="",a=!1,l=arguments.length-1;l>=-1;l--){var f;if(l>=0?f=arguments[l]:i?(f=r.env["="+i],f&&f.substr(0,3).toLowerCase()===i.toLowerCase()+"\\"||(f=i+"\\")):f=r.cwd(),!o.isString(f))throw new TypeError("Arguments to path.resolve must be strings");if(f){var p=s.exec(f),h=p[1]||"",d=h&&":"!==h.charAt(1),y=t.isAbsolute(f),v=p[3];if((!h||!i||h.toLowerCase()===i.toLowerCase())&&(i||(i=h),a||(u=v+"\\"+u,a=y),i&&a))break}}return d&&(i=c(i)),u=e(u.split(/[\\\/]+/).filter(n),!a).join("\\"),i+(a?"\\":"")+u||"."},t.normalize=function(n){var r=s.exec(n),i=r[1]||"",o=i&&":"!==i.charAt(1),u=t.isAbsolute(n),a=r[3],l=/[\\\/]$/.test(a);return i&&":"===i.charAt(1)&&(i=i[0].toLowerCase()+i.substr(1)),a=e(a.split(/[\\\/]+/).filter(function(e){return!!e}),!u).join("\\"),a||u||(a="."),a&&l&&(a+="\\"),o&&(i=c(i)),i+(u?"\\":"")+a},t.isAbsolute=function(e){var t=s.exec(e),n=t[1]||"",r=!!n&&":"!==n.charAt(1);return!!t[2]||r},t.join=function(){function e(e){if(!o.isString(e))throw new TypeError("Arguments to path.join must be strings");return e}var n=Array.prototype.filter.call(arguments,e),r=n.join("\\");return/^[\\\/]{2}[^\\\/]/.test(n[0])||(r=r.replace(/^[\\\/]{2,}/,"\\")),t.normalize(r)},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n+1)}e=t.resolve(e),n=t.resolve(n);for(var i=e.toLowerCase(),o=n.toLowerCase(),s=r(n.split("\\")),u=r(i.split("\\")),a=r(o.split("\\")),c=Math.min(u.length,a.length),l=c,f=0;c>f;f++)if(u[f]!==a[f]){l=f;break}if(0==l)return n;for(var p=[],f=l;f<u.length;f++)p.push("..");return p=p.concat(s.slice(l)),p.join("\\")},t.sep="\\",t.delimiter=";"}else{var l=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return l.exec(e).slice(1)};t.resolve=function(){for(var t="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:r.cwd();if(!o.isString(s))throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,n="/"===s.charAt(0))}return t=e(t.split("/").filter(function(e){return!!e}),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(n){for(var r=t.isAbsolute(n),i="/"===n[n.length-1],o=n.split("/"),s=[],u=0;u<o.length;u++)o[u]&&s.push(o[u]);return n=e(s,!r).join("/"),n||r||(n="."),n&&i&&(n+="/"),(r?"/":"")+n},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){for(var e="",n=0;n<arguments.length;n++){var r=arguments[n];if(!o.isString(r))throw new TypeError("Arguments to path.join must be strings");r&&(e+=e?"/"+r:r)}return t.normalize(e)},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),s=Math.min(i.length,o.length),u=s,a=0;s>a;a++)if(i[a]!==o[a]){u=a;break}for(var c=[],a=u;a<i.length;a++)c.push("..");return c=c.concat(o.slice(u)),c.join("/")},t.sep="/",t.delimiter=":"}t.dirname=function(e){var t=a(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=a(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return a(e)[3]},t.exists=o.deprecate(function(e,t){n(2).exists(e,t)},"path.exists is now called `fs.exists`."),t.existsSync=o.deprecate(function(e){return n(2).existsSync(e)},"path.existsSync is now called `fs.existsSync`."),i?t._makeLong=function(e){if(!o.isString(e))return e;if(!e)return"";var n=t.resolve(e);return/^[a-zA-Z]\:\\/.test(n)?"\\\\?\\"+n:/^\\\\[^?.]/.test(n)?"\\\\?\\UNC\\"+n.substring(2):e}:t._makeLong=function(e){return e}}()},function(e,t,n){var r,i,o;!function(n,s){i=[t],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))}(this,function(e){"use strict";"undefined"!=typeof window.localStorage&&"undefined"!=typeof window.sessionStorage||function(){var e=function(e){function t(e,t,n){var r,i;n?(r=new Date,r.setTime(r.getTime()+24*n*60*60*1e3),i="; expires="+r.toGMTString()):i="",document.cookie=e+"="+t+i+"; path=/"}function n(e){var t,n,r=e+"=",i=document.cookie.split(";");for(t=0;t<i.length;t++){for(n=i[t];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(r))return n.substring(r.length,n.length)}return null}function r(n){n=JSON.stringify(n),"session"==e?window.name=n:t("localStorage",n,365)}function i(){"session"==e?window.name="":t("localStorage","",365)}function o(){var t="session"==e?window.name:n("localStorage");return t?JSON.parse(t):{}}var s=o();return{length:0,clear:function(){s={},this.length=0,i()},getItem:function(e){return void 0===s[e]?null:s[e]},key:function(e){var t=0;for(var n in s){if(t==e)return n;t++}return null},removeItem:function(e){delete s[e],this.length--,r(s)},setItem:function(e,t){s[e]=t+"",this.length++,r(s)}}};"undefined"==typeof window.localStorage&&(window.localStorage=new e("local")),"undefined"==typeof window.sessionStorage&&(window.sessionStorage=new e("session"))}()})},function(e,t,n){!function(t,n){e.exports=n()}(this,function(){function e(){}return e.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e)),e}).join("")},e.prototype.encodeValue=function(e,t,n){return t="+"===e||"#"===e?this.encodeReserved(t):encodeURIComponent(t),n?encodeURIComponent(n)+"="+t:t},e.prototype.isDefined=function(e){return void 0!==e&&null!==e},e.prototype.isKeyOperator=function(e){return";"===e||"&"===e||"?"===e},e.prototype.getValues=function(e,t,n,r){var i=e[n],o=[];if(this.isDefined(i)&&""!==i)if("string"==typeof i||"number"==typeof i||"boolean"==typeof i)i=i.toString(),r&&"*"!==r&&(i=i.substring(0,parseInt(r,10))),o.push(this.encodeValue(t,i,this.isKeyOperator(t)?n:null));else if("*"===r)Array.isArray(i)?i.filter(this.isDefined).forEach(function(e){o.push(this.encodeValue(t,e,this.isKeyOperator(t)?n:null))},this):Object.keys(i).forEach(function(e){this.isDefined(i[e])&&o.push(this.encodeValue(t,i[e],e))},this);else{var s=[];Array.isArray(i)?i.filter(this.isDefined).forEach(function(e){s.push(this.encodeValue(t,e))},this):Object.keys(i).forEach(function(e){this.isDefined(i[e])&&(s.push(encodeURIComponent(e)),s.push(this.encodeValue(t,i[e].toString())))},this),this.isKeyOperator(t)?o.push(encodeURIComponent(n)+"="+s.join(",")):0!==s.length&&o.push(s.join(","))}else";"===t?o.push(encodeURIComponent(n)):""!==i||"&"!==t&&"?"!==t?""===i&&o.push(""):o.push(encodeURIComponent(n)+"=");return o},e.prototype.parse=function(e){var t=this,n=["+","#",".","/",";","?","&"];return{expand:function(r){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(e,i,o){if(i){var s=null,u=[];if(-1!==n.indexOf(i.charAt(0))&&(s=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(e){var n=/([^:\*]*)(?::(\d+)|(\*))?/.exec(e);u.push.apply(u,t.getValues(r,s,n[1],n[2]||n[3]))}),s&&"+"!==s){var a=",";return"?"===s?a="&":"#"!==s&&(a=s),(0!==u.length?s:"")+u.join(a)}return u.join(",")}return t.encodeReserved(o)})}}},new e})},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){(function(e,r){function i(e,n){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&t._extend(r,n),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),a(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function u(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function a(e,n,r){if(e.customInspect&&n&&j(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return b(i)||(i=a(e,i,r)),i}var o=c(e,n);if(o)return o;var s=Object.keys(n),y=u(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),O(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(n);if(0===s.length){if(j(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(x(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return e.stylize(Date.prototype.toString.call(n),"date");if(O(n))return l(n)}var g="",m=!1,w=["{","}"];if(d(n)&&(m=!0,w=["[","]"]),j(n)){var _=n.name?": "+n.name:"";g=" [Function"+_+"]"}if(x(n)&&(g=" "+RegExp.prototype.toString.call(n)),S(n)&&(g=" "+Date.prototype.toUTCString.call(n)),O(n)&&(g=" "+l(n)),0===s.length&&(!m||0==n.length))return w[0]+g+w[1];if(0>r)return x(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var E;return E=m?f(e,n,r,y,s):s.map(function(t){return p(e,n,r,y,t,m)}),e.seen.pop(),h(E,g,w)}function c(e,t){if(_(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i){for(var o=[],s=0,u=t.length;u>s;++s)L(t,String(s))?o.push(p(e,t,n,r,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,n,r,i,!0))}),o}function p(e,t,n,r,i,o){var s,u,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),L(r,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=v(n)?a(e,c.value,null):a(e,c.value,n-1),u.indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return u;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function h(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function v(e){return null===e}function g(e){return null==e}function m(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function _(e){return void 0===e}function x(e){return E(e)&&"[object RegExp]"===A(e)}function E(e){return"object"==typeof e&&null!==e}function S(e){return E(e)&&"[object Date]"===A(e)}function O(e){return E(e)&&("[object Error]"===A(e)||e instanceof Error)}function j(e){return"function"==typeof e}function k(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function A(e){return Object.prototype.toString.call(e)}function I(e){return 10>e?"0"+e.toString(10):e.toString(10)}function U(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),P[e.getMonth()],t].join(" ")}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var R=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,s=String(e).replace(R,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),u=r[n];o>n;u=r[++n])s+=v(u)||!E(u)?" "+u:" "+i(u);return s},t.deprecate=function(n,i){function o(){if(!s){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),s=!0}return n.apply(this,arguments)}if(_(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var s=!1;return o};var T,M={};t.debuglog=function(e){if(_(T)&&(T=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!M[e])if(new RegExp("\\b"+e+"\\b","i").test(T)){var n=r.pid;M[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else M[e]=function(){};return M[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=y,t.isNull=v,t.isNullOrUndefined=g,t.isNumber=m,t.isString=b,t.isSymbol=w,t.isUndefined=_,t.isRegExp=x,t.isObject=E,t.isDate=S,t.isError=O,t.isFunction=j,t.isPrimitive=k,t.isBuffer=n(21);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",U(),t.format.apply(t,arguments))},t.inherits=n(15),t._extend=function(e,t){if(!t||!E(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,function(){return this}(),n(5))},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){this.map={},e instanceof r?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function o(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader;return t.readAsArrayBuffer(e),o(t)}function u(e){ var t=new FileReader;return t.readAsText(e),o(t)}function a(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},d.blob?(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=i(this);return e?e:Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function c(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}function l(e,t){t=t||{};var n=t.body;if(l.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=c(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function p(e){var t=new r,n=e.getAllResponseHeaders().trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),i=n.join(":").trim();t.append(r,i)}),t}function h(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof r?t.headers:new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){r.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];i||(i=[],this.map[e]=i),i.push(r)},r.prototype.delete=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,r){this.map[t(e)]=[n(r)]},r.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)};var d={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this)},a.call(l.prototype),a.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];h.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=l,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,r){function i(){return"responseURL"in s?s.responseURL:/^X-Request-URL:/m.test(s.getAllResponseHeaders())?s.getResponseHeader("X-Request-URL"):void 0}var o;o=l.prototype.isPrototypeOf(e)&&!t?e:new l(e,t);var s=new XMLHttpRequest;s.onload=function(){var e=1223===s.status?204:s.status;if(100>e||e>599)return void r(new TypeError("Network request failed"));var t={status:e,statusText:s.statusText,headers:p(s),url:i()},o="response"in s?s.response:s.responseText;n(new h(o,t))},s.onerror=function(){r(new TypeError("Network request failed"))},s.open(o.method,o.url,!0),"include"===o.credentials&&(s.withCredentials=!0),"responseType"in s&&d.blob&&(s.responseType="blob"),o.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),s.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}])});