@widergy/react-social-auth 1.2.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/components/ActiveDirectory/index.js +89 -116
- package/dist/components/ActiveDirectory/utils.js +0 -4
- package/dist/components/Apple/components/LargeButton/index.js +21 -31
- package/dist/components/Apple/components/LargeButton/styles.module.scss +3 -3
- package/dist/components/Apple/components/SmallButton/index.js +16 -19
- package/dist/components/Apple/components/SmallButton/styles.module.scss +1 -0
- package/dist/components/Apple/index.js +39 -60
- package/dist/components/Apple/types.js +0 -2
- package/dist/components/Apple/utils.js +23 -31
- package/dist/components/Twitter/assets/twitter.svg +6 -1
- package/dist/components/Twitter/components/LargeButton/index.js +44 -0
- package/dist/components/Twitter/components/LargeButton/styles.module.scss +35 -0
- package/dist/components/Twitter/components/SmallButton/index.js +40 -0
- package/dist/components/Twitter/components/SmallButton/styles.module.scss +10 -0
- package/dist/components/Twitter/errors.js +16 -59
- package/dist/components/Twitter/index.js +61 -86
- package/dist/components/Twitter/types.js +14 -0
- package/dist/components/Twitter/utils.js +50 -77
- package/dist/index.js +6 -11
- package/dist/scss/variables/_colors.scss +1 -0
- package/package.json +1 -1
|
@@ -1,82 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = require("prop-types");
|
|
13
|
-
|
|
14
10
|
var _LargeButton = _interopRequireDefault(require("./components/LargeButton"));
|
|
15
|
-
|
|
16
11
|
var _SmallButton = _interopRequireDefault(require("./components/SmallButton"));
|
|
17
|
-
|
|
18
12
|
var _types = require("./types");
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
26
17
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
27
|
-
|
|
28
18
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
29
|
-
|
|
30
19
|
var SMALL_VARIANT = 'small';
|
|
31
|
-
|
|
32
20
|
var Apple = function Apple(_ref) {
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
var _ref$classes = _ref.classes,
|
|
22
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
23
|
+
Component = _ref.Component,
|
|
24
|
+
icon = _ref.icon,
|
|
25
|
+
_ref$label = _ref.label,
|
|
26
|
+
label = _ref$label === void 0 ? 'apple' : _ref$label,
|
|
27
|
+
onFailure = _ref.onFailure,
|
|
28
|
+
onSuccess = _ref.onSuccess,
|
|
29
|
+
uppercase = _ref.uppercase,
|
|
30
|
+
_ref$variant = _ref.variant,
|
|
31
|
+
variant = _ref$variant === void 0 ? SMALL_VARIANT : _ref$variant;
|
|
45
32
|
var handleLogin = /*#__PURE__*/function () {
|
|
46
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/
|
|
33
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
47
34
|
var data;
|
|
48
|
-
return
|
|
49
|
-
while (1) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
case 10:
|
|
68
|
-
case "end":
|
|
69
|
-
return _context.stop();
|
|
70
|
-
}
|
|
35
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
36
|
+
while (1) switch (_context.prev = _context.next) {
|
|
37
|
+
case 0:
|
|
38
|
+
_context.prev = 0;
|
|
39
|
+
_context.next = 3;
|
|
40
|
+
return window.AppleID.auth.signIn();
|
|
41
|
+
case 3:
|
|
42
|
+
data = _context.sent;
|
|
43
|
+
if (onSuccess) onSuccess(data);
|
|
44
|
+
_context.next = 10;
|
|
45
|
+
break;
|
|
46
|
+
case 7:
|
|
47
|
+
_context.prev = 7;
|
|
48
|
+
_context.t0 = _context["catch"](0);
|
|
49
|
+
if (onFailure) onFailure(_context.t0);
|
|
50
|
+
case 10:
|
|
51
|
+
case "end":
|
|
52
|
+
return _context.stop();
|
|
71
53
|
}
|
|
72
54
|
}, _callee, null, [[0, 7]]);
|
|
73
55
|
}));
|
|
74
|
-
|
|
75
56
|
return function handleLogin() {
|
|
76
57
|
return _ref2.apply(this, arguments);
|
|
77
58
|
};
|
|
78
59
|
}();
|
|
79
|
-
|
|
80
60
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, Component ? /*#__PURE__*/_react.default.createElement(Component, {
|
|
81
61
|
onClick: handleLogin
|
|
82
62
|
}) : variant === SMALL_VARIANT ? /*#__PURE__*/_react.default.createElement(_SmallButton.default, {
|
|
@@ -91,16 +71,15 @@ var Apple = function Apple(_ref) {
|
|
|
91
71
|
classes: classes
|
|
92
72
|
}));
|
|
93
73
|
};
|
|
94
|
-
|
|
95
74
|
Apple.propTypes = {
|
|
96
|
-
onSuccess: _propTypes.func.required,
|
|
97
|
-
onFailure: _propTypes.func.required,
|
|
98
75
|
classes: _types.classesType,
|
|
99
|
-
label: _propTypes.string,
|
|
100
|
-
variant: _propTypes.string,
|
|
101
76
|
Component: _propTypes.node,
|
|
102
77
|
icon: _propTypes.string,
|
|
103
|
-
|
|
78
|
+
label: _propTypes.string,
|
|
79
|
+
onSuccess: _propTypes.func,
|
|
80
|
+
onFailure: _propTypes.func,
|
|
81
|
+
uppercase: _propTypes.bool,
|
|
82
|
+
variant: _propTypes.string
|
|
104
83
|
};
|
|
105
84
|
var _default = Apple;
|
|
106
85
|
exports.default = _default;
|
|
@@ -1,49 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.initAppleAuth = void 0;
|
|
7
|
-
|
|
8
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
8
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
-
|
|
10
10
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
-
|
|
12
11
|
var initAppleAuth = /*#__PURE__*/function () {
|
|
13
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/
|
|
12
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(clientId, scope, redirectUrl) {
|
|
14
13
|
var head, script;
|
|
15
|
-
return
|
|
16
|
-
while (1) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
case 7:
|
|
37
|
-
case "end":
|
|
38
|
-
return _context.stop();
|
|
39
|
-
}
|
|
14
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16
|
+
case 0:
|
|
17
|
+
head = document.getElementsByTagName('head')[0];
|
|
18
|
+
script = document.createElement('script');
|
|
19
|
+
script.type = 'text/javascript';
|
|
20
|
+
script.src = 'https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js';
|
|
21
|
+
script.onload = function () {
|
|
22
|
+
return window.AppleID.auth.init({
|
|
23
|
+
clientId: clientId,
|
|
24
|
+
scope: scope,
|
|
25
|
+
usePopup: true,
|
|
26
|
+
redirectURI: redirectUrl
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
_context.next = 7;
|
|
30
|
+
return head.appendChild(script);
|
|
31
|
+
case 7:
|
|
32
|
+
case "end":
|
|
33
|
+
return _context.stop();
|
|
40
34
|
}
|
|
41
35
|
}, _callee);
|
|
42
36
|
}));
|
|
43
|
-
|
|
44
37
|
return function initAppleAuth(_x, _x2, _x3) {
|
|
45
38
|
return _ref.apply(this, arguments);
|
|
46
39
|
};
|
|
47
40
|
}();
|
|
48
|
-
|
|
49
41
|
exports.initAppleAuth = initAppleAuth;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" width="512px" height="512px" class=""><g><g>
|
|
3
|
+
<g>
|
|
4
|
+
<path d="M512,97.248c-19.04,8.352-39.328,13.888-60.48,16.576c21.76-12.992,38.368-33.408,46.176-58.016 c-20.288,12.096-42.688,20.64-66.56,25.408C411.872,60.704,384.416,48,354.464,48c-58.112,0-104.896,47.168-104.896,104.992 c0,8.32,0.704,16.32,2.432,23.936c-87.264-4.256-164.48-46.08-216.352-109.792c-9.056,15.712-14.368,33.696-14.368,53.056 c0,36.352,18.72,68.576,46.624,87.232c-16.864-0.32-33.408-5.216-47.424-12.928c0,0.32,0,0.736,0,1.152 c0,51.008,36.384,93.376,84.096,103.136c-8.544,2.336-17.856,3.456-27.52,3.456c-6.72,0-13.504-0.384-19.872-1.792 c13.6,41.568,52.192,72.128,98.08,73.12c-35.712,27.936-81.056,44.768-130.144,44.768c-8.608,0-16.864-0.384-25.12-1.44 C46.496,446.88,101.6,464,161.024,464c193.152,0,298.752-160,298.752-298.688c0-4.64-0.16-9.12-0.384-13.568 C480.224,136.96,497.728,118.496,512,97.248z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FFFFFF"/>
|
|
5
|
+
</g>
|
|
6
|
+
</g></g> </svg>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _energyUi = require("@widergy/energy-ui");
|
|
9
|
+
var _propTypes = require("prop-types");
|
|
10
|
+
var _twitter = _interopRequireDefault(require("../../assets/twitter.svg"));
|
|
11
|
+
var _types = require("../../types");
|
|
12
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
var LargeButton = function LargeButton(_ref) {
|
|
15
|
+
var onClick = _ref.onClick,
|
|
16
|
+
label = _ref.label,
|
|
17
|
+
_ref$classes = _ref.classes,
|
|
18
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
19
|
+
icon = _ref.icon;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
|
|
21
|
+
classNames: {
|
|
22
|
+
childrenContainer: _stylesModule.default.childrenContainer,
|
|
23
|
+
root: "".concat(_stylesModule.default.button, " ").concat(classes.root),
|
|
24
|
+
text: "".concat(_stylesModule.default.label, " ").concat(classes.label)
|
|
25
|
+
},
|
|
26
|
+
Icon: function Icon(_ref2) {
|
|
27
|
+
var className = _ref2.className;
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
29
|
+
src: icon || _twitter.default,
|
|
30
|
+
alt: "",
|
|
31
|
+
className: "".concat(_stylesModule.default.icon, " ").concat(classes.largeIcon, " ").concat(className)
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
onClick: onClick
|
|
35
|
+
}, label);
|
|
36
|
+
};
|
|
37
|
+
LargeButton.propTypes = {
|
|
38
|
+
classes: _types.classesType,
|
|
39
|
+
icon: _propTypes.string,
|
|
40
|
+
label: _propTypes.string,
|
|
41
|
+
onClick: _propTypes.func
|
|
42
|
+
};
|
|
43
|
+
var _default = LargeButton;
|
|
44
|
+
exports.default = _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@import '../../../../scss/variables/colors';
|
|
2
|
+
|
|
3
|
+
.button {
|
|
4
|
+
align-items: center;
|
|
5
|
+
background-color: $twitter;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
height: 40px;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
margin: 10px 0;
|
|
10
|
+
padding: 8px 12px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
background-color: $twitter;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.childrenContainer {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.icon {
|
|
23
|
+
height: 24px;
|
|
24
|
+
margin-right: 12px;
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 50%;
|
|
27
|
+
transform: translateY(-50%);
|
|
28
|
+
width: 24px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.label {
|
|
32
|
+
font-size: 0.875rem;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
margin: 0 auto -2px;
|
|
35
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _energyUi = require("@widergy/energy-ui");
|
|
9
|
+
var _propTypes = require("prop-types");
|
|
10
|
+
var _twitter = _interopRequireDefault(require("../../assets/twitter.svg"));
|
|
11
|
+
var _types = require("../../types");
|
|
12
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
var SmallButton = function SmallButton(_ref) {
|
|
15
|
+
var onClick = _ref.onClick,
|
|
16
|
+
_ref$classes = _ref.classes,
|
|
17
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
18
|
+
icon = _ref.icon;
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
|
|
20
|
+
classNames: {
|
|
21
|
+
root: "".concat(_stylesModule.default.button, " ").concat(classes.root)
|
|
22
|
+
},
|
|
23
|
+
Icon: function Icon(_ref2) {
|
|
24
|
+
var className = _ref2.className;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
26
|
+
src: icon || _twitter.default,
|
|
27
|
+
alt: "",
|
|
28
|
+
className: "".concat(classes.smallIcon, " ").concat(className)
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
onClick: onClick
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
SmallButton.propTypes = {
|
|
35
|
+
onClick: _propTypes.func,
|
|
36
|
+
classes: _types.classesType,
|
|
37
|
+
icon: _propTypes.string
|
|
38
|
+
};
|
|
39
|
+
var _default = SmallButton;
|
|
40
|
+
exports.default = _default;
|
|
@@ -1,44 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
7
|
+
exports.RequestTokenParseError = exports.RequestTokenError = exports.PopupClosedByUserError = exports.NoHashOrQueryParamsError = exports.GetAuthTokenFailure = void 0;
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
11
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
-
|
|
12
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
|
-
|
|
13
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
-
|
|
16
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
17
|
-
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
18
16
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
|
|
20
17
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
21
|
-
|
|
22
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
23
|
-
|
|
18
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
24
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
|
-
|
|
26
20
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
31
|
-
|
|
21
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
23
|
var RequestTokenError = /*#__PURE__*/function (_Error) {
|
|
33
24
|
_inherits(RequestTokenError, _Error);
|
|
34
|
-
|
|
35
25
|
var _super = _createSuper(RequestTokenError);
|
|
36
|
-
|
|
37
26
|
function RequestTokenError(error) {
|
|
38
27
|
var _this;
|
|
39
|
-
|
|
40
28
|
_classCallCheck(this, RequestTokenError);
|
|
41
|
-
|
|
42
29
|
_this = _super.call(this);
|
|
43
30
|
_this.message = 'Unable to retrieve OAuth Token';
|
|
44
31
|
_this.name = 'Fatal Error';
|
|
@@ -46,22 +33,15 @@ var RequestTokenError = /*#__PURE__*/function (_Error) {
|
|
|
46
33
|
_this.error = error;
|
|
47
34
|
return _this;
|
|
48
35
|
}
|
|
49
|
-
|
|
50
|
-
return RequestTokenError;
|
|
36
|
+
return _createClass(RequestTokenError);
|
|
51
37
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
52
|
-
|
|
53
38
|
exports.RequestTokenError = RequestTokenError;
|
|
54
|
-
|
|
55
39
|
var RequestTokenParseError = /*#__PURE__*/function (_Error2) {
|
|
56
40
|
_inherits(RequestTokenParseError, _Error2);
|
|
57
|
-
|
|
58
41
|
var _super2 = _createSuper(RequestTokenParseError);
|
|
59
|
-
|
|
60
42
|
function RequestTokenParseError(error) {
|
|
61
43
|
var _this2;
|
|
62
|
-
|
|
63
44
|
_classCallCheck(this, RequestTokenParseError);
|
|
64
|
-
|
|
65
45
|
_this2 = _super2.call(this);
|
|
66
46
|
_this2.message = 'Unable to parse JSON from response';
|
|
67
47
|
_this2.name = 'Fatal Error';
|
|
@@ -69,44 +49,30 @@ var RequestTokenParseError = /*#__PURE__*/function (_Error2) {
|
|
|
69
49
|
_this2.error = error;
|
|
70
50
|
return _this2;
|
|
71
51
|
}
|
|
72
|
-
|
|
73
|
-
return RequestTokenParseError;
|
|
52
|
+
return _createClass(RequestTokenParseError);
|
|
74
53
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
75
|
-
|
|
76
54
|
exports.RequestTokenParseError = RequestTokenParseError;
|
|
77
|
-
|
|
78
55
|
var PopupClosedByUserError = /*#__PURE__*/function (_Error3) {
|
|
79
56
|
_inherits(PopupClosedByUserError, _Error3);
|
|
80
|
-
|
|
81
57
|
var _super3 = _createSuper(PopupClosedByUserError);
|
|
82
|
-
|
|
83
58
|
function PopupClosedByUserError() {
|
|
84
59
|
var _this3;
|
|
85
|
-
|
|
86
60
|
_classCallCheck(this, PopupClosedByUserError);
|
|
87
|
-
|
|
88
61
|
_this3 = _super3.call(this);
|
|
89
62
|
_this3.message = 'Popup has been closed by user';
|
|
90
63
|
_this3.name = 'Info';
|
|
91
64
|
_this3.stack = '';
|
|
92
65
|
return _this3;
|
|
93
66
|
}
|
|
94
|
-
|
|
95
|
-
return PopupClosedByUserError;
|
|
67
|
+
return _createClass(PopupClosedByUserError);
|
|
96
68
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
97
|
-
|
|
98
69
|
exports.PopupClosedByUserError = PopupClosedByUserError;
|
|
99
|
-
|
|
100
70
|
var GetAuthTokenFailure = /*#__PURE__*/function (_Error4) {
|
|
101
71
|
_inherits(GetAuthTokenFailure, _Error4);
|
|
102
|
-
|
|
103
72
|
var _super4 = _createSuper(GetAuthTokenFailure);
|
|
104
|
-
|
|
105
73
|
function GetAuthTokenFailure(error, url, verifier, token) {
|
|
106
74
|
var _this4;
|
|
107
|
-
|
|
108
75
|
_classCallCheck(this, GetAuthTokenFailure);
|
|
109
|
-
|
|
110
76
|
_this4 = _super4.call(this);
|
|
111
77
|
_this4.message = "Unable to retrieve Authorization Token from ".concat(url, "\n OAuth Verifier: ").concat(verifier, " \n OAuth Token: ").concat(token, " ");
|
|
112
78
|
_this4.name = 'Fatal Error';
|
|
@@ -114,30 +80,21 @@ var GetAuthTokenFailure = /*#__PURE__*/function (_Error4) {
|
|
|
114
80
|
_this4.error = error;
|
|
115
81
|
return _this4;
|
|
116
82
|
}
|
|
117
|
-
|
|
118
|
-
return GetAuthTokenFailure;
|
|
83
|
+
return _createClass(GetAuthTokenFailure);
|
|
119
84
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
120
|
-
|
|
121
85
|
exports.GetAuthTokenFailure = GetAuthTokenFailure;
|
|
122
|
-
|
|
123
86
|
var NoHashOrQueryParamsError = /*#__PURE__*/function (_Error5) {
|
|
124
87
|
_inherits(NoHashOrQueryParamsError, _Error5);
|
|
125
|
-
|
|
126
88
|
var _super5 = _createSuper(NoHashOrQueryParamsError);
|
|
127
|
-
|
|
128
89
|
function NoHashOrQueryParamsError() {
|
|
129
90
|
var _this5;
|
|
130
|
-
|
|
131
91
|
_classCallCheck(this, NoHashOrQueryParamsError);
|
|
132
|
-
|
|
133
92
|
_this5 = _super5.call(this);
|
|
134
93
|
_this5.message = "OAuth redirect has occurred but no query or hash parameters were found.\n They were either not set during the redirect, or were removed\u2014typically by a\n routing library\u2014before Twitter react component could read it.";
|
|
135
94
|
_this5.name = 'Fatal Error';
|
|
136
95
|
_this5.stack = '';
|
|
137
96
|
return _this5;
|
|
138
97
|
}
|
|
139
|
-
|
|
140
|
-
return NoHashOrQueryParamsError;
|
|
98
|
+
return _createClass(NoHashOrQueryParamsError);
|
|
141
99
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
142
|
-
|
|
143
100
|
exports.NoHashOrQueryParamsError = NoHashOrQueryParamsError;
|