├── .gitignore ├── static ├── authmagic-email-plugin │ ├── nohtml-template.html │ └── template.html └── authmagic-link-email-phone-bootstrap-theme │ ├── images │ └── email.png │ ├── styles │ └── main.css │ ├── check.html │ ├── profile.html │ ├── scripts │ ├── check.js │ ├── index.js │ ├── wait.js │ ├── profile.js │ └── polyfill.min.js │ ├── wait.html │ └── index.html ├── README.md ├── package.json └── authmagic.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Node 2 | node_modules 3 | npm-debug.log 4 | 5 | # IDE 6 | .idea 7 | 8 | # AuthMagic 9 | authmagic.json 10 | 11 | .DS_Store -------------------------------------------------------------------------------- /static/authmagic-email-plugin/nohtml-template.html: -------------------------------------------------------------------------------- 1 | Hello friend! Open this link to finish authorization: {{redirectUrl}}?ekey={{ekey | urlencode}} 2 | Or enter security code: {{securityKey}} -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/images/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authmagic/authmagic-getting-started-example/HEAD/static/authmagic-link-email-phone-bootstrap-theme/images/email.png -------------------------------------------------------------------------------- /static/authmagic-email-plugin/template.html: -------------------------------------------------------------------------------- 1 |

Hello friend!

2 |

Open this link to finish authorization: Click here

3 |

Or enter security code: {{securityKey}}

-------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/styles/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | height: 100vh; 3 | } 4 | 5 | .container { 6 | height: 100%; 7 | display: flex; 8 | align-items: center; 9 | justify-content: center; 10 | margin-top: -5%; 11 | } 12 | 13 | .center { 14 | margin: 0 auto; 15 | text-align: center; 16 | } 17 | 18 | h1 { 19 | text-align: center; 20 | width: 100%; 21 | } 22 | 23 | .loader { 24 | border: 8px solid #f3f3f3; 25 | border-top: 8px solid #3498db; 26 | border-radius: 50%; 27 | width: 60px; 28 | height: 60px; 29 | animation: spin 2s linear infinite; 30 | } 31 | 32 | @keyframes spin { 33 | 0% { transform: rotate(0deg); } 34 | 100% { transform: rotate(360deg); } 35 | } 36 | 37 | .email-example { 38 | max-width: 400px; 39 | } 40 | 41 | .full { 42 | width: 100%; 43 | } -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/check.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Check key - Authenticate 6 | 7 | 8 | 9 | 10 |
11 |
12 |

AuthMagic

13 |
We are checking your key, please wait..
14 |
15 |
16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/profile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Profile - AuthMagic 6 | 7 | 8 | 9 | 10 |
11 |
23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # authmagic-getting-started-example 4 | Example of authmagic application created with authmagic-timerange-stateless-core, authmagic-email-plugin and authmagic-link-email-phone-bootstrap-theme. 5 | Node's version higher or equal to 8.10.0 is required. 6 | 7 | ## How to create same example app 8 | ``` 9 | npm install -g authmagic-cli 10 | npm init -y 11 | authmagic init -e 12 | authmagic install 13 | authmagic 14 | ``` 15 | Note: make sure name in your package.json is not named as `authmagic` if you do not want to get an error `npm refusing to install as a dependency of itself`. 16 | 17 | ## Demo 18 | IMAGE ALT TEXT HERE 19 | -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/scripts/check.js: -------------------------------------------------------------------------------- 1 | function getParameterByName(name, url) { 2 | if (!url) url = window.location.href; 3 | name = name.replace(/[\[\]]/g, "\\$&"); 4 | var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 5 | results = regex.exec(url); 6 | if (!results) return null; 7 | if (!results[2]) return ''; 8 | return decodeURIComponent(results[2].replace(/\+/g, " ")); 9 | } 10 | 11 | async function check(ekey) { 12 | const response = await fetch('/token', { 13 | body: JSON.stringify({ekey}), 14 | mode: 'cors', 15 | method: 'post', 16 | headers: { 17 | 'content-type': 'application/json' 18 | }, 19 | }); 20 | if(response.status === 200) { 21 | const {token, refreshToken} = await response.json(); 22 | localStorage.setItem('token', token); 23 | localStorage.setItem('refreshToken', refreshToken); 24 | location.href = '/profile.html'; 25 | } else { 26 | document.getElementById('check').innerHTML = 'Key is invalid'; 27 | } 28 | } 29 | 30 | if(localStorage.getItem('token') && !getParameterByName('ekey')) { 31 | location.href = '/profile.html'; 32 | } else { 33 | const ekey = getParameterByName('ekey'); 34 | check(ekey); 35 | } -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/wait.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Open link - Authenticate 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |

AuthMagic

14 |
Open the link in the email or enter secutiry code:
15 |
16 | 17 |
18 | 19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "authmagic-getting-started-example", 3 | "version": "1.0.0", 4 | "description": "Example of authmagic application created with authmagic-timerange-stateless-core, authmagic-email-plugin and authmagic-link-email-phone-bootstrap-theme.", 5 | "main": "authmagic.js", 6 | "scripts": { 7 | "start": "authmagic" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/authmagic/authmagic-getting-started-example.git" 12 | }, 13 | "keywords": [], 14 | "author": "", 15 | "license": "UNLICENSED", 16 | "bugs": { 17 | "url": "https://github.com/authmagic/authmagic-getting-started-example/issues" 18 | }, 19 | "homepage": "https://github.com/authmagic/authmagic-getting-started-example#readme", 20 | "dependencies": { 21 | "authmagic": "0.0.7", 22 | "authmagic-email-plugin": "0.0.6", 23 | "authmagic-link-email-phone-bootstrap-theme": "0.0.8", 24 | "authmagic-timerange-stateless-core": "0.0.10" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /authmagic.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "core": { 3 | "name": "authmagic-timerange-stateless-core", 4 | "source": "../authmagic-timerange-stateless-core" 5 | }, 6 | "plugins": { 7 | "authmagic-email-plugin": { 8 | "name": "authmagic-email-plugin", 9 | "source": "../authmagic-email-plugin" 10 | } 11 | }, 12 | "params": { 13 | "authmagic-email-plugin": { 14 | "isTest": true, 15 | "mailer": { 16 | "auth": { 17 | "user": "", 18 | "pass": "" 19 | }, 20 | "host": "smtp.ethereal.email", 21 | "port": 587, 22 | "secure": false 23 | }, 24 | "from": "AuthMailer", 25 | "subject": "Your Magic Link" 26 | }, 27 | "authmagic-timerange-stateless-core": { 28 | "duration": 300, 29 | "key": "310531d085be5e9c", 30 | "sendKeyPlugin": "authmagic-email-plugin", 31 | "expiresIn": "20m", 32 | "refreshExpiresIn": "2d", 33 | "securityKeyRule": { 34 | length: 6, 35 | charset: "numeric", 36 | }, 37 | // for debugging and app validations 38 | // username: securityCode 39 | fixedSecurityCodes: { 40 | "oleksandrknyga@gmail.com": "123456" 41 | }, 42 | } 43 | }, 44 | "port": 3000, 45 | "theme": { 46 | "name": "authmagic-link-email-phone-bootstrap-theme", 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/scripts/index.js: -------------------------------------------------------------------------------- 1 | document.getElementById('redirect-url').value = 2 | getParameterByName('redirect') ? getParameterByName('redirect') : 3 | `${location.protocol}//${location.host}/check.html`; 4 | 5 | function getParameterByName(name, url) { 6 | if (!url) url = window.location.href; 7 | name = name.replace(/[\[\]]/g, "\\$&"); 8 | var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 9 | results = regex.exec(url); 10 | if (!results) return null; 11 | if (!results[2]) return ''; 12 | return decodeURIComponent(results[2].replace(/\+/g, " ")); 13 | } 14 | 15 | function getToken() { 16 | const emailElement = document.getElementById('email'); 17 | const redirectUrl = document.getElementById('redirect-url').value; 18 | const email = emailElement.value; 19 | const data = { 20 | user: email, 21 | params: {r: Math.random()}, 22 | redirectUrl, 23 | }; 24 | 25 | fetch('/key', { 26 | body: JSON.stringify(data), 27 | mode: 'cors', 28 | method: 'post', 29 | headers: { 30 | 'content-type': 'application/json' 31 | }, 32 | }).then(function(res) { 33 | return res.json(); 34 | }).then(function(resp) { 35 | const { eproof } = resp; 36 | location.href = `/wait.html?eproof=${eproof}&redirect=${redirectUrl}`; 37 | }) 38 | } 39 | 40 | document.getElementById('go').onclick = getToken; -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/scripts/wait.js: -------------------------------------------------------------------------------- 1 | function getParameterByName(name, url) { 2 | if (!url) url = window.location.href; 3 | name = name.replace(/[\[\]]/g, "\\$&"); 4 | var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 5 | results = regex.exec(url); 6 | if (!results) return null; 7 | if (!results[2]) return ''; 8 | return decodeURIComponent(results[2].replace(/\+/g, " ")); 9 | } 10 | 11 | async function getToken() { 12 | const codeElement = document.getElementById('code') 13 | const eproof = getParameterByName('eproof'); 14 | const securityKey = codeElement.value; 15 | const redirect = getParameterByName('redirect'); 16 | const res = await fetch('/token', { 17 | body: JSON.stringify({eproof, securityKey}), 18 | mode: 'cors', 19 | method: 'post', 20 | headers: { 21 | 'content-type': 'application/json' 22 | }, 23 | }); 24 | 25 | if (res.status === 200) { 26 | const { token, refreshToken } = await res.json(); 27 | localStorage.setItem('token', token); 28 | localStorage.setItem('refreshToken', refreshToken); 29 | location.href = redirect; 30 | } else { 31 | document.getElementById('code').className = codeElement.className.concat(` is-invalid`); 32 | document.getElementById('go').className = document.getElementById('go').className.concat(` btn-danger`); 33 | } 34 | } 35 | 36 | document.getElementById('go').onclick = getToken; -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Authenticate 6 | 7 | 8 | 9 | 10 |
11 |
12 |

AuthMagic

13 |
14 | 15 |
16 | 17 |
18 |
19 | 20 |
21 |
22 | Redirect URL 23 |
24 | 25 |
26 |
27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/scripts/profile.js: -------------------------------------------------------------------------------- 1 | function parseJwt(token) { 2 | var base64Url = token.split('.')[1]; 3 | var base64 = base64Url.replace('-', '+').replace('_', '/'); 4 | return JSON.parse(window.atob(base64)); 5 | }; 6 | 7 | async function validate() { 8 | const token = localStorage.getItem('token'); 9 | const res = await fetch('/token/status', { 10 | body: JSON.stringify({token}), 11 | mode: 'cors', 12 | method: 'post', 13 | headers: { 14 | 'content-type': 'application/json' 15 | }, 16 | }); 17 | if(res.status === 200) { 18 | renderInfo(); 19 | } 20 | } 21 | 22 | function renderInfo() { 23 | const token = localStorage.getItem('token'); 24 | const info = parseJwt(token); 25 | const infoList = ` 26 |
  • Email: ${info.u}
  • 27 |
  • Exp: ${info.exp}
  • 28 |
  • Iat: ${info.iat}
  • 29 | `; 30 | document.getElementById('info').innerHTML = infoList; 31 | } 32 | 33 | function logout() { 34 | localStorage.setItem('token', ''); 35 | location.href = '/'; 36 | } 37 | 38 | async function refreshToken() { 39 | const token = localStorage.getItem('token'); 40 | const refreshToken = localStorage.getItem('refreshToken'); 41 | const res = await fetch('/token', { 42 | body: JSON.stringify({token, refreshToken}), 43 | mode: 'cors', 44 | method: 'post', 45 | headers: { 46 | 'content-type': 'application/json' 47 | }, 48 | }); 49 | if(res.status === 200) { 50 | const {token, refreshToken} = await res.json(); 51 | localStorage.setItem('token', token); 52 | localStorage.setItem('refreshToken', refreshToken); 53 | validate(); 54 | } else { 55 | console.log('forbidden'); 56 | } 57 | } 58 | 59 | validate(); 60 | 61 | document.getElementById('logout').onclick = logout; 62 | document.getElementById('refresh').onclick = refreshToken; -------------------------------------------------------------------------------- /static/authmagic-link-email-phone-bootstrap-theme/scripts/polyfill.min.js: -------------------------------------------------------------------------------- 1 | !function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!u&&c)return c(o,!0);if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(n){var r=t[o][1][n];return s(r||n)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o2?arguments[2]:void 0,s=Math.min((void 0===f?u:i(f,u))-a,u-c),l=1;for(a0;)a in r?r[c]=r[a]:delete r[c],c+=l,a+=l;return r}},{114:114,118:118,119:119}],9:[function(t,n,r){"use strict";var e=t(119),i=t(114),o=t(118);n.exports=function fill(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),a=u>2?arguments[2]:void 0,f=void 0===a?r:i(a,r);f>c;)n[c++]=t;return n}},{114:114,118:118,119:119}],10:[function(t,n,r){var e=t(39);n.exports=function(t,n){var r=[];return e(t,!1,r.push,r,n),r}},{39:39}],11:[function(t,n,r){var e=t(117),i=t(118),o=t(114);n.exports=function(t){return function(n,r,u){var c,a=e(n),f=i(a.length),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}}},{114:114,117:117,118:118}],12:[function(t,n,r){var e=t(25),i=t(47),o=t(119),u=t(118),c=t(15);n.exports=function(t,n){var r=1==t,a=2==t,f=3==t,s=4==t,l=6==t,h=5==t||l,v=n||c;return function(n,c,p){for(var d,y,g=o(n),m=i(g),b=e(c,p,3),x=u(m.length),S=0,w=r?v(n,x):a?v(n,0):void 0;x>S;S++)if((h||S in m)&&(d=m[S],y=b(d,S,g),t))if(r)w[S]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return S;case 2:w.push(d)}else if(s)return!1;return l?-1:f||s?s:w}}},{118:118,119:119,15:15,25:25,47:47}],13:[function(t,n,r){var e=t(3),i=t(119),o=t(47),u=t(118);n.exports=function(t,n,r,c,a){e(n);var f=i(t),s=o(f),l=u(f.length),h=a?l-1:0,v=a?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=v;break}if(h+=v,a?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;a?h>=0:l>h;h+=v)h in s&&(c=n(c,s[h],h,f));return c}},{118:118,119:119,3:3,47:47}],14:[function(t,n,r){var e=t(51),i=t(49),o=t(128)("species");n.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},{128:128,49:49,51:51}],15:[function(t,n,r){var e=t(14);n.exports=function(t,n){return new(e(t))(n)}},{14:14}],16:[function(t,n,r){"use strict";var e=t(3),i=t(51),o=t(46),u=[].slice,c={},a=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(e(r.v,r.k,this);r&&r.r;)r=r.p},has:function has(t){return!!y(p(this,n),t)}}),h&&e(s.prototype,"size",{get:function(){return p(this,n)[d]}}),s},def:function(t,n,r){var e,i,o=y(t,n);return o?o.v=r:(t._l=o={i:i=v(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,n,r){f(t,n,function(t,r){this._t=p(t,n),this._k=r,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?s(0,r.k):"values"==n?s(0,r.v):s(0,[r.k,r.v]):(t._t=void 0,s(1))},r?"entries":"values",!r,!0),l(n)}}},{100:100,125:125,25:25,29:29,39:39,55:55,57:57,6:6,66:66,71:71,72:72,93:93}],20:[function(t,n,r){var e=t(17),i=t(10);n.exports=function(t){return function toJSON(){if(e(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},{10:10,17:17}],21:[function(t,n,r){"use strict";var e=t(93),i=t(66).getWeak,o=t(7),u=t(51),c=t(6),a=t(39),f=t(12),s=t(41),l=t(125),h=f(5),v=f(6),p=0,d=function(t){return t._l||(t._l=new y)},y=function(){this.a=[]},g=function(t,n){return h(t.a,function(t){return t[0]===n})};y.prototype={get:function(t){var n=g(this,t);if(n)return n[1]},has:function(t){return!!g(this,t)},set:function(t,n){var r=g(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=v(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},n.exports={getConstructor:function(t,n,r,o){var f=t(function(t,e){c(t,f,n,"_i"),t._t=n,t._i=p++,t._l=void 0,void 0!=e&&a(e,r,t[o],t)});return e(f.prototype,{delete:function(t){if(!u(t))return!1;var r=i(t);return!0===r?d(l(this,n)).delete(t):r&&s(r,this._i)&&delete r[this._i]},has:function has(t){if(!u(t))return!1;var r=i(t);return!0===r?d(l(this,n)).has(t):r&&s(r,this._i)}}),f},def:function(t,n,r){var e=i(o(n),!0);return!0===e?d(t).set(n,r):e[t._i]=r,t},ufstore:d}},{12:12,125:125,39:39,41:41,51:51,6:6,66:66,7:7,93:93}],22:[function(t,n,r){"use strict";var e=t(40),i=t(33),o=t(94),u=t(93),c=t(66),a=t(39),f=t(6),s=t(51),l=t(35),h=t(56),v=t(101),p=t(45);n.exports=function(t,n,r,d,y,g){var m=e[t],b=m,x=y?"set":"add",S=b&&b.prototype,w={},_=function(t){var n=S[t];o(S,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function has(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function get(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function add(t){return n.call(this,0===t?0:t),this}:function set(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof b&&(g||S.forEach&&!l(function(){(new b).entries().next()}))){var E=new b,O=E[x](g?{}:-0,1)!=E,P=l(function(){E.has(1)}),M=h(function(t){new b(t)}),F=!g&&l(function(){for(var t=new b,n=5;n--;)t[x](n,n);return!t.has(-0)});M||(b=n(function(n,r){f(n,b,t);var e=p(new m,n,b);return void 0!=r&&a(r,y,e[x],e),e}),b.prototype=S,S.constructor=b),(P||F)&&(_("delete"),_("has"),y&&_("get")),(F||O)&&_(x),g&&S.clear&&delete S.clear}else b=d.getConstructor(n,t,y,x),u(b.prototype,r),c.NEED=!0;return v(b,t),w[t]=b,i(i.G+i.W+i.F*(b!=m),w),g||d.setStrong(b,t,y),b}},{101:101,33:33,35:35,39:39,40:40,45:45,51:51,56:56,6:6,66:66,93:93,94:94}],23:[function(t,n,r){var e=n.exports={version:"2.5.0"};"number"==typeof __e&&(__e=e)},{}],24:[function(t,n,r){"use strict";var e=t(72),i=t(92);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{72:72,92:92}],25:[function(t,n,r){var e=t(3);n.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},{3:3}],26:[function(t,n,r){"use strict";var e=t(35),i=Date.prototype.getTime,o=Date.prototype.toISOString,u=function(t){return t>9?t:"0"+t};n.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function toISOString(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}:o},{35:35}],27:[function(t,n,r){"use strict";var e=t(7),i=t(120);n.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},{120:120,7:7}],28:[function(t,n,r){n.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],29:[function(t,n,r){n.exports=!t(35)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{35:35}],30:[function(t,n,r){var e=t(51),i=t(40).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{40:40,51:51}],31:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],32:[function(t,n,r){var e=t(81),i=t(78),o=t(82);n.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),a=o.f,f=0;c.length>f;)a.call(t,u=c[f++])&&n.push(u);return n}},{78:78,81:81,82:82}],33:[function(t,n,r){var e=t(40),i=t(23),o=t(42),u=t(94),c=t(25),a=function(t,n,r){var f,s,l,h,v=t&a.F,p=t&a.G,d=t&a.S,y=t&a.P,g=t&a.B,m=p?e:d?e[n]||(e[n]={}):(e[n]||{}).prototype,b=p?i:i[n]||(i[n]={}),x=b.prototype||(b.prototype={});p&&(r=n);for(f in r)s=!v&&m&&void 0!==m[f],l=(s?m:r)[f],h=g&&s?c(l,e):y&&"function"==typeof l?c(Function.call,l):l,m&&u(m,f,l,t&a.U),b[f]!=l&&o(b,f,h),y&&x[f]!=l&&(x[f]=l)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,n.exports=a},{23:23,25:25,40:40,42:42,94:94}],34:[function(t,n,r){var e=t(128)("match");n.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},{128:128}],35:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],36:[function(t,n,r){"use strict";var e=t(42),i=t(94),o=t(35),u=t(28),c=t(128);n.exports=function(t,n,r){var a=c(t),f=r(u,a,""[t]),s=f[0],l=f[1];o(function(){var n={};return n[a]=function(){return 7},7!=""[t](n)})&&(i(String.prototype,t,s),e(RegExp.prototype,a,2==n?function(t,n){return l.call(t,this,n)}:function(t){return l.call(t,this)}))}},{128:128,28:28,35:35,42:42,94:94}],37:[function(t,n,r){"use strict";var e=t(7);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{7:7}],38:[function(t,n,r){"use strict";function flattenIntoArray(t,n,r,a,f,s,l,h){for(var v,p,d=f,y=0,g=!!l&&u(l,h,3);y0)d=flattenIntoArray(t,n,v,o(v.length),d,s-1)-1;else{if(d>=9007199254740991)throw TypeError();t[d]=v}d++}y++}return d}var e=t(49),i=t(51),o=t(118),u=t(25),c=t(128)("isConcatSpreadable");n.exports=flattenIntoArray},{118:118,128:128,25:25,49:49,51:51}],39:[function(t,n,r){var e=t(25),i=t(53),o=t(48),u=t(7),c=t(118),a=t(129),f={},s={},r=n.exports=function(t,n,r,l,h){var v,p,d,y,g=h?function(){return t}:a(t),m=e(r,l,n?2:1),b=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(v=c(t.length);v>b;b++)if((y=n?m(u(p=t[b])[0],p[1]):m(t[b]))===f||y===s)return y}else for(d=g.call(t);!(p=d.next()).done;)if((y=i(d,m,p.value,n))===f||y===s)return y};r.BREAK=f,r.RETURN=s},{118:118,129:129,25:25,48:48,53:53,7:7}],40:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],41:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],42:[function(t,n,r){var e=t(72),i=t(92);n.exports=t(29)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{29:29,72:72,92:92}],43:[function(t,n,r){var e=t(40).document;n.exports=e&&e.documentElement},{40:40}],44:[function(t,n,r){n.exports=!t(29)&&!t(35)(function(){return 7!=Object.defineProperty(t(30)("div"),"a",{get:function(){return 7}}).a})},{29:29,30:30,35:35}],45:[function(t,n,r){var e=t(51),i=t(99).set;n.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},{51:51,99:99}],46:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],47:[function(t,n,r){var e=t(18);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{18:18}],48:[function(t,n,r){var e=t(58),i=t(128)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{128:128,58:58}],49:[function(t,n,r){var e=t(18);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{18:18}],50:[function(t,n,r){var e=t(51),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{51:51}],51:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],52:[function(t,n,r){var e=t(51),i=t(18),o=t(128)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{128:128,18:18,51:51}],53:[function(t,n,r){var e=t(7);n.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},{7:7}],54:[function(t,n,r){"use strict";var e=t(71),i=t(92),o=t(101),u={};t(42)(u,t(128)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{101:101,128:128,42:42,71:71,92:92}],55:[function(t,n,r){"use strict";var e=t(60),i=t(33),o=t(94),u=t(42),c=t(41),a=t(58),f=t(54),s=t(101),l=t(79),h=t(128)("iterator"),v=!([].keys&&"next"in[].keys()),p=function(){return this};n.exports=function(t,n,r,d,y,g,m){f(r,n,d);var b,x,S,w=function(t){if(!v&&t in P)return P[t];switch(t){case"keys":return function keys(){return new r(this,t)};case"values":return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}},_=n+" Iterator",E="values"==y,O=!1,P=t.prototype,M=P[h]||P["@@iterator"]||y&&P[y],F=M||w(y),I=y?E?w("entries"):F:void 0,A="Array"==n?P.entries||M:M;if(A&&(S=l(A.call(new t)))!==Object.prototype&&S.next&&(s(S,_,!0),e||c(S,h)||u(S,h,p)),E&&M&&"values"!==M.name&&(O=!0,F=function values(){return M.call(this)}),e&&!m||!v&&!O&&P[h]||u(P,h,F),a[n]=F,a[_]=p,y)if(b={values:E?F:w("values"),keys:g?F:w("keys"),entries:I},m)for(x in b)x in P||o(P,x,b[x]);else i(i.P+i.F*(v||O),n,b);return b}},{101:101,128:128,33:33,41:41,42:42,54:54,58:58,60:60,79:79,94:94}],56:[function(t,n,r){var e=t(128)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},{128:128}],57:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],58:[function(t,n,r){n.exports={}},{}],59:[function(t,n,r){var e=t(81),i=t(117);n.exports=function(t,n){for(var r,o=i(t),u=e(o),c=u.length,a=0;c>a;)if(o[r=u[a++]]===n)return r}},{117:117,81:81}],60:[function(t,n,r){n.exports=!1},{}],61:[function(t,n,r){var e=Math.expm1;n.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function expm1(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],62:[function(t,n,r){var e=t(65),i=Math.pow,o=i(2,-52),u=i(2,-23),c=i(2,127)*(2-u),a=i(2,-126),f=function(t){return t+1/o-1/o};n.exports=Math.fround||function fround(t){var n,r,i=Math.abs(t),s=e(t);return ic||r!=r?s*(1/0):s*r)}},{65:65}],63:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],64:[function(t,n,r){n.exports=Math.scale||function scale(t,n,r,e,i){return 0===arguments.length||t!=t||n!=n||r!=r||e!=e||i!=i?NaN:t===1/0||t===-1/0?t:(t-n)*(i-e)/(r-n)+e}},{}],65:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],66:[function(t,n,r){var e=t(124)("meta"),i=t(51),o=t(41),u=t(72).f,c=0,a=Object.isExtensible||function(){return!0},f=!t(35)(function(){return a(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!a(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!a(t))return!0;if(!n)return!1;s(t)}return t[e].w},v=function(t){return f&&p.NEED&&a(t)&&!o(t,e)&&s(t),t},p=n.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:v}},{124:124,35:35,41:41,51:51,72:72}],67:[function(t,n,r){var e=t(160),i=t(33),o=t(103)("metadata"),u=o.store||(o.store=new(t(266))),c=function(t,n,r){var i=u.get(t);if(!i){if(!r)return;u.set(t,i=new e)}var o=i.get(n);if(!o){if(!r)return;i.set(n,o=new e)}return o},a=function(t,n,r){var e=c(n,r,!1);return void 0!==e&&e.has(t)},f=function(t,n,r){var e=c(n,r,!1);return void 0===e?void 0:e.get(t)},s=function(t,n,r,e){c(r,e,!0).set(t,n)},l=function(t,n){var r=c(t,n,!1),e=[];return r&&r.forEach(function(t,n){e.push(n)}),e},h=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},v=function(t){i(i.S,"Reflect",t)};n.exports={store:u,map:c,has:a,get:f,set:s,keys:l,key:h,exp:v}},{103:103,160:160,266:266,33:33}],68:[function(t,n,r){var e=t(40),i=t(113).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,a="process"==t(18)(u);n.exports=function(){var t,n,r,f=function(){var e,i;for(a&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(a)r=function(){u.nextTick(f)};else if(o){var s=!0,l=document.createTextNode("");new o(f).observe(l,{characterData:!0}),r=function(){l.data=s=!s}}else if(c&&c.resolve){var h=c.resolve();r=function(){h.then(f)}}else r=function(){i.call(e,f)};return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},{113:113,18:18,40:40}],69:[function(t,n,r){"use strict";function PromiseCapability(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=t,r=e}),this.resolve=e(n),this.reject=e(r)}var e=t(3);n.exports.f=function(t){return new PromiseCapability(t)}},{3:3}],70:[function(t,n,r){"use strict";var e=t(81),i=t(78),o=t(82),u=t(119),c=t(47),a=Object.assign;n.exports=!a||t(35)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=a({},t)[r]||Object.keys(a({},n)).join("")!=e})?function assign(t,n){for(var r=u(t),a=arguments.length,f=1,s=i.f,l=o.f;a>f;)for(var h,v=c(arguments[f++]),p=s?e(v).concat(s(v)):e(v),d=p.length,y=0;d>y;)l.call(v,h=p[y++])&&(r[h]=v[h]);return r}:a},{119:119,35:35,47:47,78:78,81:81,82:82}],71:[function(t,n,r){var e=t(7),i=t(73),o=t(31),u=t(102)("IE_PROTO"),c=function(){},a=function(){var n,r=t(30)("iframe"),e=o.length;for(r.style.display="none",t(43).appendChild(r),r.src="javascript:",n=r.contentWindow.document,n.open(),n.write("