@reachfive/identity-ui 1.15.0 → 1.16.2
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 +29 -1
- package/cjs/identity-ui.js +8 -4
- package/es/identity-ui.js +8 -4
- package/package.json +2 -2
- package/umd/identity-ui.js +849 -709
- package/umd/identity-ui.min.js +1 -1
package/umd/identity-ui.js
CHANGED
|
@@ -3345,6 +3345,710 @@
|
|
|
3345
3345
|
});
|
|
3346
3346
|
var pick_1 = pick;
|
|
3347
3347
|
|
|
3348
|
+
/**
|
|
3349
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
|
3350
|
+
* or max array length checks.
|
|
3351
|
+
*
|
|
3352
|
+
* @private
|
|
3353
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
|
3354
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
3355
|
+
* @returns {Array} Returns the array of results.
|
|
3356
|
+
*/
|
|
3357
|
+
function baseTimes(n, iteratee) {
|
|
3358
|
+
var index = -1,
|
|
3359
|
+
result = Array(n);
|
|
3360
|
+
|
|
3361
|
+
while (++index < n) {
|
|
3362
|
+
result[index] = iteratee(index);
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3365
|
+
return result;
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
var _baseTimes = baseTimes;
|
|
3369
|
+
|
|
3370
|
+
/**
|
|
3371
|
+
* This method returns `false`.
|
|
3372
|
+
*
|
|
3373
|
+
* @static
|
|
3374
|
+
* @memberOf _
|
|
3375
|
+
* @since 4.13.0
|
|
3376
|
+
* @category Util
|
|
3377
|
+
* @returns {boolean} Returns `false`.
|
|
3378
|
+
* @example
|
|
3379
|
+
*
|
|
3380
|
+
* _.times(2, _.stubFalse);
|
|
3381
|
+
* // => [false, false]
|
|
3382
|
+
*/
|
|
3383
|
+
function stubFalse() {
|
|
3384
|
+
return false;
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
var stubFalse_1 = stubFalse;
|
|
3388
|
+
|
|
3389
|
+
var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
|
3390
|
+
/** Detect free variable `exports`. */
|
|
3391
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
3392
|
+
/** Detect free variable `module`. */
|
|
3393
|
+
|
|
3394
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
3395
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
3396
|
+
|
|
3397
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
3398
|
+
/** Built-in value references. */
|
|
3399
|
+
|
|
3400
|
+
var Buffer = moduleExports ? _root.Buffer : undefined;
|
|
3401
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3402
|
+
|
|
3403
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
3404
|
+
/**
|
|
3405
|
+
* Checks if `value` is a buffer.
|
|
3406
|
+
*
|
|
3407
|
+
* @static
|
|
3408
|
+
* @memberOf _
|
|
3409
|
+
* @since 4.3.0
|
|
3410
|
+
* @category Lang
|
|
3411
|
+
* @param {*} value The value to check.
|
|
3412
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
3413
|
+
* @example
|
|
3414
|
+
*
|
|
3415
|
+
* _.isBuffer(new Buffer(2));
|
|
3416
|
+
* // => true
|
|
3417
|
+
*
|
|
3418
|
+
* _.isBuffer(new Uint8Array(2));
|
|
3419
|
+
* // => false
|
|
3420
|
+
*/
|
|
3421
|
+
|
|
3422
|
+
var isBuffer = nativeIsBuffer || stubFalse_1;
|
|
3423
|
+
module.exports = isBuffer;
|
|
3424
|
+
});
|
|
3425
|
+
|
|
3426
|
+
/** `Object#toString` result references. */
|
|
3427
|
+
|
|
3428
|
+
var argsTag$1 = '[object Arguments]',
|
|
3429
|
+
arrayTag = '[object Array]',
|
|
3430
|
+
boolTag = '[object Boolean]',
|
|
3431
|
+
dateTag = '[object Date]',
|
|
3432
|
+
errorTag = '[object Error]',
|
|
3433
|
+
funcTag$1 = '[object Function]',
|
|
3434
|
+
mapTag = '[object Map]',
|
|
3435
|
+
numberTag = '[object Number]',
|
|
3436
|
+
objectTag = '[object Object]',
|
|
3437
|
+
regexpTag = '[object RegExp]',
|
|
3438
|
+
setTag = '[object Set]',
|
|
3439
|
+
stringTag = '[object String]',
|
|
3440
|
+
weakMapTag = '[object WeakMap]';
|
|
3441
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
3442
|
+
dataViewTag = '[object DataView]',
|
|
3443
|
+
float32Tag = '[object Float32Array]',
|
|
3444
|
+
float64Tag = '[object Float64Array]',
|
|
3445
|
+
int8Tag = '[object Int8Array]',
|
|
3446
|
+
int16Tag = '[object Int16Array]',
|
|
3447
|
+
int32Tag = '[object Int32Array]',
|
|
3448
|
+
uint8Tag = '[object Uint8Array]',
|
|
3449
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
3450
|
+
uint16Tag = '[object Uint16Array]',
|
|
3451
|
+
uint32Tag = '[object Uint32Array]';
|
|
3452
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
3453
|
+
|
|
3454
|
+
var typedArrayTags = {};
|
|
3455
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
3456
|
+
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
3457
|
+
/**
|
|
3458
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
3459
|
+
*
|
|
3460
|
+
* @private
|
|
3461
|
+
* @param {*} value The value to check.
|
|
3462
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
3463
|
+
*/
|
|
3464
|
+
|
|
3465
|
+
function baseIsTypedArray(value) {
|
|
3466
|
+
return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
var _baseIsTypedArray = baseIsTypedArray;
|
|
3470
|
+
|
|
3471
|
+
/**
|
|
3472
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
3473
|
+
*
|
|
3474
|
+
* @private
|
|
3475
|
+
* @param {Function} func The function to cap arguments for.
|
|
3476
|
+
* @returns {Function} Returns the new capped function.
|
|
3477
|
+
*/
|
|
3478
|
+
function baseUnary(func) {
|
|
3479
|
+
return function (value) {
|
|
3480
|
+
return func(value);
|
|
3481
|
+
};
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
var _baseUnary = baseUnary;
|
|
3485
|
+
|
|
3486
|
+
var _nodeUtil = createCommonjsModule(function (module, exports) {
|
|
3487
|
+
/** Detect free variable `exports`. */
|
|
3488
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
3489
|
+
/** Detect free variable `module`. */
|
|
3490
|
+
|
|
3491
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
3492
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
3493
|
+
|
|
3494
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
3495
|
+
/** Detect free variable `process` from Node.js. */
|
|
3496
|
+
|
|
3497
|
+
var freeProcess = moduleExports && _freeGlobal.process;
|
|
3498
|
+
/** Used to access faster Node.js helpers. */
|
|
3499
|
+
|
|
3500
|
+
var nodeUtil = function () {
|
|
3501
|
+
try {
|
|
3502
|
+
// Use `util.types` for Node.js 10+.
|
|
3503
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
3504
|
+
|
|
3505
|
+
if (types) {
|
|
3506
|
+
return types;
|
|
3507
|
+
} // Legacy `process.binding('util')` for Node.js < 10.
|
|
3508
|
+
|
|
3509
|
+
|
|
3510
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
3511
|
+
} catch (e) {}
|
|
3512
|
+
}();
|
|
3513
|
+
|
|
3514
|
+
module.exports = nodeUtil;
|
|
3515
|
+
});
|
|
3516
|
+
|
|
3517
|
+
/* Node.js helper references. */
|
|
3518
|
+
|
|
3519
|
+
var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
|
3520
|
+
/**
|
|
3521
|
+
* Checks if `value` is classified as a typed array.
|
|
3522
|
+
*
|
|
3523
|
+
* @static
|
|
3524
|
+
* @memberOf _
|
|
3525
|
+
* @since 3.0.0
|
|
3526
|
+
* @category Lang
|
|
3527
|
+
* @param {*} value The value to check.
|
|
3528
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
3529
|
+
* @example
|
|
3530
|
+
*
|
|
3531
|
+
* _.isTypedArray(new Uint8Array);
|
|
3532
|
+
* // => true
|
|
3533
|
+
*
|
|
3534
|
+
* _.isTypedArray([]);
|
|
3535
|
+
* // => false
|
|
3536
|
+
*/
|
|
3537
|
+
|
|
3538
|
+
var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
|
3539
|
+
var isTypedArray_1 = isTypedArray;
|
|
3540
|
+
|
|
3541
|
+
/** Used for built-in method references. */
|
|
3542
|
+
|
|
3543
|
+
var objectProto$7 = Object.prototype;
|
|
3544
|
+
/** Used to check objects for own properties. */
|
|
3545
|
+
|
|
3546
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
3547
|
+
/**
|
|
3548
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
|
3549
|
+
*
|
|
3550
|
+
* @private
|
|
3551
|
+
* @param {*} value The value to query.
|
|
3552
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
|
3553
|
+
* @returns {Array} Returns the array of property names.
|
|
3554
|
+
*/
|
|
3555
|
+
|
|
3556
|
+
function arrayLikeKeys(value, inherited) {
|
|
3557
|
+
var isArr = isArray_1(value),
|
|
3558
|
+
isArg = !isArr && isArguments_1(value),
|
|
3559
|
+
isBuff = !isArr && !isArg && isBuffer_1(value),
|
|
3560
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
|
3561
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
3562
|
+
result = skipIndexes ? _baseTimes(value.length, String) : [],
|
|
3563
|
+
length = result.length;
|
|
3564
|
+
|
|
3565
|
+
for (var key in value) {
|
|
3566
|
+
if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
3567
|
+
key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
3568
|
+
isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
3569
|
+
isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
|
|
3570
|
+
_isIndex(key, length)))) {
|
|
3571
|
+
result.push(key);
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
return result;
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
var _arrayLikeKeys = arrayLikeKeys;
|
|
3579
|
+
|
|
3580
|
+
/** Used for built-in method references. */
|
|
3581
|
+
var objectProto$8 = Object.prototype;
|
|
3582
|
+
/**
|
|
3583
|
+
* Checks if `value` is likely a prototype object.
|
|
3584
|
+
*
|
|
3585
|
+
* @private
|
|
3586
|
+
* @param {*} value The value to check.
|
|
3587
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
3588
|
+
*/
|
|
3589
|
+
|
|
3590
|
+
function isPrototype(value) {
|
|
3591
|
+
var Ctor = value && value.constructor,
|
|
3592
|
+
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$8;
|
|
3593
|
+
return value === proto;
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
var _isPrototype = isPrototype;
|
|
3597
|
+
|
|
3598
|
+
/**
|
|
3599
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
3600
|
+
*
|
|
3601
|
+
* @private
|
|
3602
|
+
* @param {Function} func The function to wrap.
|
|
3603
|
+
* @param {Function} transform The argument transform.
|
|
3604
|
+
* @returns {Function} Returns the new function.
|
|
3605
|
+
*/
|
|
3606
|
+
function overArg(func, transform) {
|
|
3607
|
+
return function (arg) {
|
|
3608
|
+
return func(transform(arg));
|
|
3609
|
+
};
|
|
3610
|
+
}
|
|
3611
|
+
|
|
3612
|
+
var _overArg = overArg;
|
|
3613
|
+
|
|
3614
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3615
|
+
|
|
3616
|
+
var nativeKeys = _overArg(Object.keys, Object);
|
|
3617
|
+
var _nativeKeys = nativeKeys;
|
|
3618
|
+
|
|
3619
|
+
/** Used for built-in method references. */
|
|
3620
|
+
|
|
3621
|
+
var objectProto$9 = Object.prototype;
|
|
3622
|
+
/** Used to check objects for own properties. */
|
|
3623
|
+
|
|
3624
|
+
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
3625
|
+
/**
|
|
3626
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
3627
|
+
*
|
|
3628
|
+
* @private
|
|
3629
|
+
* @param {Object} object The object to query.
|
|
3630
|
+
* @returns {Array} Returns the array of property names.
|
|
3631
|
+
*/
|
|
3632
|
+
|
|
3633
|
+
function baseKeys(object) {
|
|
3634
|
+
if (!_isPrototype(object)) {
|
|
3635
|
+
return _nativeKeys(object);
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3638
|
+
var result = [];
|
|
3639
|
+
|
|
3640
|
+
for (var key in Object(object)) {
|
|
3641
|
+
if (hasOwnProperty$7.call(object, key) && key != 'constructor') {
|
|
3642
|
+
result.push(key);
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
return result;
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3649
|
+
var _baseKeys = baseKeys;
|
|
3650
|
+
|
|
3651
|
+
/**
|
|
3652
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
3653
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
3654
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
3655
|
+
*
|
|
3656
|
+
* @static
|
|
3657
|
+
* @memberOf _
|
|
3658
|
+
* @since 4.0.0
|
|
3659
|
+
* @category Lang
|
|
3660
|
+
* @param {*} value The value to check.
|
|
3661
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
3662
|
+
* @example
|
|
3663
|
+
*
|
|
3664
|
+
* _.isArrayLike([1, 2, 3]);
|
|
3665
|
+
* // => true
|
|
3666
|
+
*
|
|
3667
|
+
* _.isArrayLike(document.body.children);
|
|
3668
|
+
* // => true
|
|
3669
|
+
*
|
|
3670
|
+
* _.isArrayLike('abc');
|
|
3671
|
+
* // => true
|
|
3672
|
+
*
|
|
3673
|
+
* _.isArrayLike(_.noop);
|
|
3674
|
+
* // => false
|
|
3675
|
+
*/
|
|
3676
|
+
|
|
3677
|
+
function isArrayLike(value) {
|
|
3678
|
+
return value != null && isLength_1(value.length) && !isFunction_1(value);
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
var isArrayLike_1 = isArrayLike;
|
|
3682
|
+
|
|
3683
|
+
/**
|
|
3684
|
+
* Creates an array of the own enumerable property names of `object`.
|
|
3685
|
+
*
|
|
3686
|
+
* **Note:** Non-object values are coerced to objects. See the
|
|
3687
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
3688
|
+
* for more details.
|
|
3689
|
+
*
|
|
3690
|
+
* @static
|
|
3691
|
+
* @since 0.1.0
|
|
3692
|
+
* @memberOf _
|
|
3693
|
+
* @category Object
|
|
3694
|
+
* @param {Object} object The object to query.
|
|
3695
|
+
* @returns {Array} Returns the array of property names.
|
|
3696
|
+
* @example
|
|
3697
|
+
*
|
|
3698
|
+
* function Foo() {
|
|
3699
|
+
* this.a = 1;
|
|
3700
|
+
* this.b = 2;
|
|
3701
|
+
* }
|
|
3702
|
+
*
|
|
3703
|
+
* Foo.prototype.c = 3;
|
|
3704
|
+
*
|
|
3705
|
+
* _.keys(new Foo);
|
|
3706
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
3707
|
+
*
|
|
3708
|
+
* _.keys('hi');
|
|
3709
|
+
* // => ['0', '1']
|
|
3710
|
+
*/
|
|
3711
|
+
|
|
3712
|
+
function keys(object) {
|
|
3713
|
+
return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
|
|
3714
|
+
}
|
|
3715
|
+
|
|
3716
|
+
var keys_1 = keys;
|
|
3717
|
+
|
|
3718
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
3719
|
+
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
|
3720
|
+
/**
|
|
3721
|
+
* Adds `value` to the array cache.
|
|
3722
|
+
*
|
|
3723
|
+
* @private
|
|
3724
|
+
* @name add
|
|
3725
|
+
* @memberOf SetCache
|
|
3726
|
+
* @alias push
|
|
3727
|
+
* @param {*} value The value to cache.
|
|
3728
|
+
* @returns {Object} Returns the cache instance.
|
|
3729
|
+
*/
|
|
3730
|
+
|
|
3731
|
+
function setCacheAdd(value) {
|
|
3732
|
+
this.__data__.set(value, HASH_UNDEFINED$2);
|
|
3733
|
+
|
|
3734
|
+
return this;
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3737
|
+
var _setCacheAdd = setCacheAdd;
|
|
3738
|
+
|
|
3739
|
+
/**
|
|
3740
|
+
* Checks if `value` is in the array cache.
|
|
3741
|
+
*
|
|
3742
|
+
* @private
|
|
3743
|
+
* @name has
|
|
3744
|
+
* @memberOf SetCache
|
|
3745
|
+
* @param {*} value The value to search for.
|
|
3746
|
+
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
3747
|
+
*/
|
|
3748
|
+
function setCacheHas(value) {
|
|
3749
|
+
return this.__data__.has(value);
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3752
|
+
var _setCacheHas = setCacheHas;
|
|
3753
|
+
|
|
3754
|
+
/**
|
|
3755
|
+
*
|
|
3756
|
+
* Creates an array cache object to store unique values.
|
|
3757
|
+
*
|
|
3758
|
+
* @private
|
|
3759
|
+
* @constructor
|
|
3760
|
+
* @param {Array} [values] The values to cache.
|
|
3761
|
+
*/
|
|
3762
|
+
|
|
3763
|
+
function SetCache(values) {
|
|
3764
|
+
var index = -1,
|
|
3765
|
+
length = values == null ? 0 : values.length;
|
|
3766
|
+
this.__data__ = new _MapCache();
|
|
3767
|
+
|
|
3768
|
+
while (++index < length) {
|
|
3769
|
+
this.add(values[index]);
|
|
3770
|
+
}
|
|
3771
|
+
} // Add methods to `SetCache`.
|
|
3772
|
+
|
|
3773
|
+
|
|
3774
|
+
SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
|
|
3775
|
+
SetCache.prototype.has = _setCacheHas;
|
|
3776
|
+
var _SetCache = SetCache;
|
|
3777
|
+
|
|
3778
|
+
/**
|
|
3779
|
+
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
3780
|
+
* support for iteratee shorthands.
|
|
3781
|
+
*
|
|
3782
|
+
* @private
|
|
3783
|
+
* @param {Array} array The array to inspect.
|
|
3784
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
3785
|
+
* @param {number} fromIndex The index to search from.
|
|
3786
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
3787
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
3788
|
+
*/
|
|
3789
|
+
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
3790
|
+
var length = array.length,
|
|
3791
|
+
index = fromIndex + (fromRight ? 1 : -1);
|
|
3792
|
+
|
|
3793
|
+
while (fromRight ? index-- : ++index < length) {
|
|
3794
|
+
if (predicate(array[index], index, array)) {
|
|
3795
|
+
return index;
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3799
|
+
return -1;
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
var _baseFindIndex = baseFindIndex;
|
|
3803
|
+
|
|
3804
|
+
/**
|
|
3805
|
+
* The base implementation of `_.isNaN` without support for number objects.
|
|
3806
|
+
*
|
|
3807
|
+
* @private
|
|
3808
|
+
* @param {*} value The value to check.
|
|
3809
|
+
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
3810
|
+
*/
|
|
3811
|
+
function baseIsNaN(value) {
|
|
3812
|
+
return value !== value;
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
var _baseIsNaN = baseIsNaN;
|
|
3816
|
+
|
|
3817
|
+
/**
|
|
3818
|
+
* A specialized version of `_.indexOf` which performs strict equality
|
|
3819
|
+
* comparisons of values, i.e. `===`.
|
|
3820
|
+
*
|
|
3821
|
+
* @private
|
|
3822
|
+
* @param {Array} array The array to inspect.
|
|
3823
|
+
* @param {*} value The value to search for.
|
|
3824
|
+
* @param {number} fromIndex The index to search from.
|
|
3825
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
3826
|
+
*/
|
|
3827
|
+
function strictIndexOf(array, value, fromIndex) {
|
|
3828
|
+
var index = fromIndex - 1,
|
|
3829
|
+
length = array.length;
|
|
3830
|
+
|
|
3831
|
+
while (++index < length) {
|
|
3832
|
+
if (array[index] === value) {
|
|
3833
|
+
return index;
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
return -1;
|
|
3838
|
+
}
|
|
3839
|
+
|
|
3840
|
+
var _strictIndexOf = strictIndexOf;
|
|
3841
|
+
|
|
3842
|
+
/**
|
|
3843
|
+
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
3844
|
+
*
|
|
3845
|
+
* @private
|
|
3846
|
+
* @param {Array} array The array to inspect.
|
|
3847
|
+
* @param {*} value The value to search for.
|
|
3848
|
+
* @param {number} fromIndex The index to search from.
|
|
3849
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
3850
|
+
*/
|
|
3851
|
+
|
|
3852
|
+
function baseIndexOf(array, value, fromIndex) {
|
|
3853
|
+
return value === value ? _strictIndexOf(array, value, fromIndex) : _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
3854
|
+
}
|
|
3855
|
+
|
|
3856
|
+
var _baseIndexOf = baseIndexOf;
|
|
3857
|
+
|
|
3858
|
+
/**
|
|
3859
|
+
* A specialized version of `_.includes` for arrays without support for
|
|
3860
|
+
* specifying an index to search from.
|
|
3861
|
+
*
|
|
3862
|
+
* @private
|
|
3863
|
+
* @param {Array} [array] The array to inspect.
|
|
3864
|
+
* @param {*} target The value to search for.
|
|
3865
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
3866
|
+
*/
|
|
3867
|
+
|
|
3868
|
+
function arrayIncludes(array, value) {
|
|
3869
|
+
var length = array == null ? 0 : array.length;
|
|
3870
|
+
return !!length && _baseIndexOf(array, value, 0) > -1;
|
|
3871
|
+
}
|
|
3872
|
+
|
|
3873
|
+
var _arrayIncludes = arrayIncludes;
|
|
3874
|
+
|
|
3875
|
+
/**
|
|
3876
|
+
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
3877
|
+
*
|
|
3878
|
+
* @private
|
|
3879
|
+
* @param {Array} [array] The array to inspect.
|
|
3880
|
+
* @param {*} target The value to search for.
|
|
3881
|
+
* @param {Function} comparator The comparator invoked per element.
|
|
3882
|
+
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
3883
|
+
*/
|
|
3884
|
+
function arrayIncludesWith(array, value, comparator) {
|
|
3885
|
+
var index = -1,
|
|
3886
|
+
length = array == null ? 0 : array.length;
|
|
3887
|
+
|
|
3888
|
+
while (++index < length) {
|
|
3889
|
+
if (comparator(value, array[index])) {
|
|
3890
|
+
return true;
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
|
|
3894
|
+
return false;
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
var _arrayIncludesWith = arrayIncludesWith;
|
|
3898
|
+
|
|
3899
|
+
/**
|
|
3900
|
+
* Checks if a `cache` value for `key` exists.
|
|
3901
|
+
*
|
|
3902
|
+
* @private
|
|
3903
|
+
* @param {Object} cache The cache to query.
|
|
3904
|
+
* @param {string} key The key of the entry to check.
|
|
3905
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
3906
|
+
*/
|
|
3907
|
+
function cacheHas(cache, key) {
|
|
3908
|
+
return cache.has(key);
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
var _cacheHas = cacheHas;
|
|
3912
|
+
|
|
3913
|
+
/** Used as the size to enable large array optimizations. */
|
|
3914
|
+
|
|
3915
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
3916
|
+
/**
|
|
3917
|
+
* The base implementation of methods like `_.difference` without support
|
|
3918
|
+
* for excluding multiple arrays or iteratee shorthands.
|
|
3919
|
+
*
|
|
3920
|
+
* @private
|
|
3921
|
+
* @param {Array} array The array to inspect.
|
|
3922
|
+
* @param {Array} values The values to exclude.
|
|
3923
|
+
* @param {Function} [iteratee] The iteratee invoked per element.
|
|
3924
|
+
* @param {Function} [comparator] The comparator invoked per element.
|
|
3925
|
+
* @returns {Array} Returns the new array of filtered values.
|
|
3926
|
+
*/
|
|
3927
|
+
|
|
3928
|
+
function baseDifference(array, values, iteratee, comparator) {
|
|
3929
|
+
var index = -1,
|
|
3930
|
+
includes = _arrayIncludes,
|
|
3931
|
+
isCommon = true,
|
|
3932
|
+
length = array.length,
|
|
3933
|
+
result = [],
|
|
3934
|
+
valuesLength = values.length;
|
|
3935
|
+
|
|
3936
|
+
if (!length) {
|
|
3937
|
+
return result;
|
|
3938
|
+
}
|
|
3939
|
+
|
|
3940
|
+
if (iteratee) {
|
|
3941
|
+
values = _arrayMap(values, _baseUnary(iteratee));
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3944
|
+
if (comparator) {
|
|
3945
|
+
includes = _arrayIncludesWith;
|
|
3946
|
+
isCommon = false;
|
|
3947
|
+
} else if (values.length >= LARGE_ARRAY_SIZE) {
|
|
3948
|
+
includes = _cacheHas;
|
|
3949
|
+
isCommon = false;
|
|
3950
|
+
values = new _SetCache(values);
|
|
3951
|
+
}
|
|
3952
|
+
|
|
3953
|
+
outer: while (++index < length) {
|
|
3954
|
+
var value = array[index],
|
|
3955
|
+
computed = iteratee == null ? value : iteratee(value);
|
|
3956
|
+
value = comparator || value !== 0 ? value : 0;
|
|
3957
|
+
|
|
3958
|
+
if (isCommon && computed === computed) {
|
|
3959
|
+
var valuesIndex = valuesLength;
|
|
3960
|
+
|
|
3961
|
+
while (valuesIndex--) {
|
|
3962
|
+
if (values[valuesIndex] === computed) {
|
|
3963
|
+
continue outer;
|
|
3964
|
+
}
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
result.push(value);
|
|
3968
|
+
} else if (!includes(values, computed, comparator)) {
|
|
3969
|
+
result.push(value);
|
|
3970
|
+
}
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3973
|
+
return result;
|
|
3974
|
+
}
|
|
3975
|
+
|
|
3976
|
+
var _baseDifference = baseDifference;
|
|
3977
|
+
|
|
3978
|
+
/**
|
|
3979
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
3980
|
+
*
|
|
3981
|
+
* @private
|
|
3982
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
3983
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
3984
|
+
* @returns {Function} Returns the new function.
|
|
3985
|
+
*/
|
|
3986
|
+
|
|
3987
|
+
function baseRest(func, start) {
|
|
3988
|
+
return _setToString(_overRest(func, start, identity_1), func + '');
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
var _baseRest = baseRest;
|
|
3992
|
+
|
|
3993
|
+
/**
|
|
3994
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
3995
|
+
* is an object.
|
|
3996
|
+
*
|
|
3997
|
+
* @static
|
|
3998
|
+
* @memberOf _
|
|
3999
|
+
* @since 4.0.0
|
|
4000
|
+
* @category Lang
|
|
4001
|
+
* @param {*} value The value to check.
|
|
4002
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
4003
|
+
* else `false`.
|
|
4004
|
+
* @example
|
|
4005
|
+
*
|
|
4006
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
4007
|
+
* // => true
|
|
4008
|
+
*
|
|
4009
|
+
* _.isArrayLikeObject(document.body.children);
|
|
4010
|
+
* // => true
|
|
4011
|
+
*
|
|
4012
|
+
* _.isArrayLikeObject('abc');
|
|
4013
|
+
* // => false
|
|
4014
|
+
*
|
|
4015
|
+
* _.isArrayLikeObject(_.noop);
|
|
4016
|
+
* // => false
|
|
4017
|
+
*/
|
|
4018
|
+
|
|
4019
|
+
function isArrayLikeObject(value) {
|
|
4020
|
+
return isObjectLike_1(value) && isArrayLike_1(value);
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
var isArrayLikeObject_1 = isArrayLikeObject;
|
|
4024
|
+
|
|
4025
|
+
/**
|
|
4026
|
+
* Creates an array of `array` values not included in the other given arrays
|
|
4027
|
+
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
4028
|
+
* for equality comparisons. The order and references of result values are
|
|
4029
|
+
* determined by the first array.
|
|
4030
|
+
*
|
|
4031
|
+
* **Note:** Unlike `_.pullAll`, this method returns a new array.
|
|
4032
|
+
*
|
|
4033
|
+
* @static
|
|
4034
|
+
* @memberOf _
|
|
4035
|
+
* @since 0.1.0
|
|
4036
|
+
* @category Array
|
|
4037
|
+
* @param {Array} array The array to inspect.
|
|
4038
|
+
* @param {...Array} [values] The values to exclude.
|
|
4039
|
+
* @returns {Array} Returns the new array of filtered values.
|
|
4040
|
+
* @see _.without, _.xor
|
|
4041
|
+
* @example
|
|
4042
|
+
*
|
|
4043
|
+
* _.difference([2, 1], [2, 3]);
|
|
4044
|
+
* // => [1]
|
|
4045
|
+
*/
|
|
4046
|
+
|
|
4047
|
+
var difference = _baseRest(function (array, values) {
|
|
4048
|
+
return isArrayLikeObject_1(array) ? _baseDifference(array, _baseFlatten(values, 1, isArrayLikeObject_1, true)) : [];
|
|
4049
|
+
});
|
|
4050
|
+
var difference_1 = difference;
|
|
4051
|
+
|
|
3348
4052
|
/**
|
|
3349
4053
|
* Checks if `value` is `undefined`.
|
|
3350
4054
|
*
|
|
@@ -3433,7 +4137,7 @@
|
|
|
3433
4137
|
|
|
3434
4138
|
/** Used as the size to enable large array optimizations. */
|
|
3435
4139
|
|
|
3436
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
4140
|
+
var LARGE_ARRAY_SIZE$1 = 200;
|
|
3437
4141
|
/**
|
|
3438
4142
|
* Sets the stack `key` to `value`.
|
|
3439
4143
|
*
|
|
@@ -3451,7 +4155,7 @@
|
|
|
3451
4155
|
if (data instanceof _ListCache) {
|
|
3452
4156
|
var pairs = data.__data__;
|
|
3453
4157
|
|
|
3454
|
-
if (!_Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
4158
|
+
if (!_Map || pairs.length < LARGE_ARRAY_SIZE$1 - 1) {
|
|
3455
4159
|
pairs.push([key, value]);
|
|
3456
4160
|
this.size = ++data.size;
|
|
3457
4161
|
return this;
|
|
@@ -3488,66 +4192,6 @@
|
|
|
3488
4192
|
Stack.prototype.set = _stackSet;
|
|
3489
4193
|
var _Stack = Stack;
|
|
3490
4194
|
|
|
3491
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
3492
|
-
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
|
3493
|
-
/**
|
|
3494
|
-
* Adds `value` to the array cache.
|
|
3495
|
-
*
|
|
3496
|
-
* @private
|
|
3497
|
-
* @name add
|
|
3498
|
-
* @memberOf SetCache
|
|
3499
|
-
* @alias push
|
|
3500
|
-
* @param {*} value The value to cache.
|
|
3501
|
-
* @returns {Object} Returns the cache instance.
|
|
3502
|
-
*/
|
|
3503
|
-
|
|
3504
|
-
function setCacheAdd(value) {
|
|
3505
|
-
this.__data__.set(value, HASH_UNDEFINED$2);
|
|
3506
|
-
|
|
3507
|
-
return this;
|
|
3508
|
-
}
|
|
3509
|
-
|
|
3510
|
-
var _setCacheAdd = setCacheAdd;
|
|
3511
|
-
|
|
3512
|
-
/**
|
|
3513
|
-
* Checks if `value` is in the array cache.
|
|
3514
|
-
*
|
|
3515
|
-
* @private
|
|
3516
|
-
* @name has
|
|
3517
|
-
* @memberOf SetCache
|
|
3518
|
-
* @param {*} value The value to search for.
|
|
3519
|
-
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
3520
|
-
*/
|
|
3521
|
-
function setCacheHas(value) {
|
|
3522
|
-
return this.__data__.has(value);
|
|
3523
|
-
}
|
|
3524
|
-
|
|
3525
|
-
var _setCacheHas = setCacheHas;
|
|
3526
|
-
|
|
3527
|
-
/**
|
|
3528
|
-
*
|
|
3529
|
-
* Creates an array cache object to store unique values.
|
|
3530
|
-
*
|
|
3531
|
-
* @private
|
|
3532
|
-
* @constructor
|
|
3533
|
-
* @param {Array} [values] The values to cache.
|
|
3534
|
-
*/
|
|
3535
|
-
|
|
3536
|
-
function SetCache(values) {
|
|
3537
|
-
var index = -1,
|
|
3538
|
-
length = values == null ? 0 : values.length;
|
|
3539
|
-
this.__data__ = new _MapCache();
|
|
3540
|
-
|
|
3541
|
-
while (++index < length) {
|
|
3542
|
-
this.add(values[index]);
|
|
3543
|
-
}
|
|
3544
|
-
} // Add methods to `SetCache`.
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
|
|
3548
|
-
SetCache.prototype.has = _setCacheHas;
|
|
3549
|
-
var _SetCache = SetCache;
|
|
3550
|
-
|
|
3551
4195
|
/**
|
|
3552
4196
|
* A specialized version of `_.some` for arrays without support for iteratee
|
|
3553
4197
|
* shorthands.
|
|
@@ -3573,20 +4217,6 @@
|
|
|
3573
4217
|
|
|
3574
4218
|
var _arraySome = arraySome;
|
|
3575
4219
|
|
|
3576
|
-
/**
|
|
3577
|
-
* Checks if a `cache` value for `key` exists.
|
|
3578
|
-
*
|
|
3579
|
-
* @private
|
|
3580
|
-
* @param {Object} cache The cache to query.
|
|
3581
|
-
* @param {string} key The key of the entry to check.
|
|
3582
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
3583
|
-
*/
|
|
3584
|
-
function cacheHas(cache, key) {
|
|
3585
|
-
return cache.has(key);
|
|
3586
|
-
}
|
|
3587
|
-
|
|
3588
|
-
var _cacheHas = cacheHas;
|
|
3589
|
-
|
|
3590
4220
|
/** Used to compose bitmasks for value comparisons. */
|
|
3591
4221
|
|
|
3592
4222
|
var COMPARE_PARTIAL_FLAG = 1,
|
|
@@ -3715,17 +4345,17 @@
|
|
|
3715
4345
|
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
3716
4346
|
/** `Object#toString` result references. */
|
|
3717
4347
|
|
|
3718
|
-
var boolTag = '[object Boolean]',
|
|
3719
|
-
dateTag = '[object Date]',
|
|
3720
|
-
errorTag = '[object Error]',
|
|
3721
|
-
mapTag = '[object Map]',
|
|
3722
|
-
numberTag = '[object Number]',
|
|
3723
|
-
regexpTag = '[object RegExp]',
|
|
3724
|
-
setTag = '[object Set]',
|
|
3725
|
-
stringTag = '[object String]',
|
|
4348
|
+
var boolTag$1 = '[object Boolean]',
|
|
4349
|
+
dateTag$1 = '[object Date]',
|
|
4350
|
+
errorTag$1 = '[object Error]',
|
|
4351
|
+
mapTag$1 = '[object Map]',
|
|
4352
|
+
numberTag$1 = '[object Number]',
|
|
4353
|
+
regexpTag$1 = '[object RegExp]',
|
|
4354
|
+
setTag$1 = '[object Set]',
|
|
4355
|
+
stringTag$1 = '[object String]',
|
|
3726
4356
|
symbolTag$1 = '[object Symbol]';
|
|
3727
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
3728
|
-
dataViewTag = '[object DataView]';
|
|
4357
|
+
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
4358
|
+
dataViewTag$1 = '[object DataView]';
|
|
3729
4359
|
/** Used to convert symbols to primitives and strings. */
|
|
3730
4360
|
|
|
3731
4361
|
var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
|
|
@@ -3750,7 +4380,7 @@
|
|
|
3750
4380
|
|
|
3751
4381
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
3752
4382
|
switch (tag) {
|
|
3753
|
-
case dataViewTag:
|
|
4383
|
+
case dataViewTag$1:
|
|
3754
4384
|
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
3755
4385
|
return false;
|
|
3756
4386
|
}
|
|
@@ -3758,34 +4388,34 @@
|
|
|
3758
4388
|
object = object.buffer;
|
|
3759
4389
|
other = other.buffer;
|
|
3760
4390
|
|
|
3761
|
-
case arrayBufferTag:
|
|
4391
|
+
case arrayBufferTag$1:
|
|
3762
4392
|
if (object.byteLength != other.byteLength || !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
|
|
3763
4393
|
return false;
|
|
3764
4394
|
}
|
|
3765
4395
|
|
|
3766
4396
|
return true;
|
|
3767
4397
|
|
|
3768
|
-
case boolTag:
|
|
3769
|
-
case dateTag:
|
|
3770
|
-
case numberTag:
|
|
4398
|
+
case boolTag$1:
|
|
4399
|
+
case dateTag$1:
|
|
4400
|
+
case numberTag$1:
|
|
3771
4401
|
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
3772
4402
|
// Invalid dates are coerced to `NaN`.
|
|
3773
4403
|
return eq_1(+object, +other);
|
|
3774
4404
|
|
|
3775
|
-
case errorTag:
|
|
4405
|
+
case errorTag$1:
|
|
3776
4406
|
return object.name == other.name && object.message == other.message;
|
|
3777
4407
|
|
|
3778
|
-
case regexpTag:
|
|
3779
|
-
case stringTag:
|
|
4408
|
+
case regexpTag$1:
|
|
4409
|
+
case stringTag$1:
|
|
3780
4410
|
// Coerce regexes to strings and treat strings, primitives and objects,
|
|
3781
4411
|
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
|
3782
4412
|
// for more details.
|
|
3783
4413
|
return object == other + '';
|
|
3784
4414
|
|
|
3785
|
-
case mapTag:
|
|
4415
|
+
case mapTag$1:
|
|
3786
4416
|
var convert = _mapToArray;
|
|
3787
4417
|
|
|
3788
|
-
case setTag:
|
|
4418
|
+
case setTag$1:
|
|
3789
4419
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1;
|
|
3790
4420
|
convert || (convert = _setToArray);
|
|
3791
4421
|
|
|
@@ -3892,10 +4522,10 @@
|
|
|
3892
4522
|
|
|
3893
4523
|
/** Used for built-in method references. */
|
|
3894
4524
|
|
|
3895
|
-
var objectProto$
|
|
4525
|
+
var objectProto$a = Object.prototype;
|
|
3896
4526
|
/** Built-in value references. */
|
|
3897
4527
|
|
|
3898
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
4528
|
+
var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
|
|
3899
4529
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3900
4530
|
|
|
3901
4531
|
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
@@ -3919,376 +4549,6 @@
|
|
|
3919
4549
|
};
|
|
3920
4550
|
var _getSymbols = getSymbols;
|
|
3921
4551
|
|
|
3922
|
-
/**
|
|
3923
|
-
* The base implementation of `_.times` without support for iteratee shorthands
|
|
3924
|
-
* or max array length checks.
|
|
3925
|
-
*
|
|
3926
|
-
* @private
|
|
3927
|
-
* @param {number} n The number of times to invoke `iteratee`.
|
|
3928
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
3929
|
-
* @returns {Array} Returns the array of results.
|
|
3930
|
-
*/
|
|
3931
|
-
function baseTimes(n, iteratee) {
|
|
3932
|
-
var index = -1,
|
|
3933
|
-
result = Array(n);
|
|
3934
|
-
|
|
3935
|
-
while (++index < n) {
|
|
3936
|
-
result[index] = iteratee(index);
|
|
3937
|
-
}
|
|
3938
|
-
|
|
3939
|
-
return result;
|
|
3940
|
-
}
|
|
3941
|
-
|
|
3942
|
-
var _baseTimes = baseTimes;
|
|
3943
|
-
|
|
3944
|
-
/**
|
|
3945
|
-
* This method returns `false`.
|
|
3946
|
-
*
|
|
3947
|
-
* @static
|
|
3948
|
-
* @memberOf _
|
|
3949
|
-
* @since 4.13.0
|
|
3950
|
-
* @category Util
|
|
3951
|
-
* @returns {boolean} Returns `false`.
|
|
3952
|
-
* @example
|
|
3953
|
-
*
|
|
3954
|
-
* _.times(2, _.stubFalse);
|
|
3955
|
-
* // => [false, false]
|
|
3956
|
-
*/
|
|
3957
|
-
function stubFalse() {
|
|
3958
|
-
return false;
|
|
3959
|
-
}
|
|
3960
|
-
|
|
3961
|
-
var stubFalse_1 = stubFalse;
|
|
3962
|
-
|
|
3963
|
-
var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
|
3964
|
-
/** Detect free variable `exports`. */
|
|
3965
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
3966
|
-
/** Detect free variable `module`. */
|
|
3967
|
-
|
|
3968
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
3969
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
3970
|
-
|
|
3971
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
3972
|
-
/** Built-in value references. */
|
|
3973
|
-
|
|
3974
|
-
var Buffer = moduleExports ? _root.Buffer : undefined;
|
|
3975
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3976
|
-
|
|
3977
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
3978
|
-
/**
|
|
3979
|
-
* Checks if `value` is a buffer.
|
|
3980
|
-
*
|
|
3981
|
-
* @static
|
|
3982
|
-
* @memberOf _
|
|
3983
|
-
* @since 4.3.0
|
|
3984
|
-
* @category Lang
|
|
3985
|
-
* @param {*} value The value to check.
|
|
3986
|
-
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
3987
|
-
* @example
|
|
3988
|
-
*
|
|
3989
|
-
* _.isBuffer(new Buffer(2));
|
|
3990
|
-
* // => true
|
|
3991
|
-
*
|
|
3992
|
-
* _.isBuffer(new Uint8Array(2));
|
|
3993
|
-
* // => false
|
|
3994
|
-
*/
|
|
3995
|
-
|
|
3996
|
-
var isBuffer = nativeIsBuffer || stubFalse_1;
|
|
3997
|
-
module.exports = isBuffer;
|
|
3998
|
-
});
|
|
3999
|
-
|
|
4000
|
-
/** `Object#toString` result references. */
|
|
4001
|
-
|
|
4002
|
-
var argsTag$1 = '[object Arguments]',
|
|
4003
|
-
arrayTag = '[object Array]',
|
|
4004
|
-
boolTag$1 = '[object Boolean]',
|
|
4005
|
-
dateTag$1 = '[object Date]',
|
|
4006
|
-
errorTag$1 = '[object Error]',
|
|
4007
|
-
funcTag$1 = '[object Function]',
|
|
4008
|
-
mapTag$1 = '[object Map]',
|
|
4009
|
-
numberTag$1 = '[object Number]',
|
|
4010
|
-
objectTag = '[object Object]',
|
|
4011
|
-
regexpTag$1 = '[object RegExp]',
|
|
4012
|
-
setTag$1 = '[object Set]',
|
|
4013
|
-
stringTag$1 = '[object String]',
|
|
4014
|
-
weakMapTag = '[object WeakMap]';
|
|
4015
|
-
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
4016
|
-
dataViewTag$1 = '[object DataView]',
|
|
4017
|
-
float32Tag = '[object Float32Array]',
|
|
4018
|
-
float64Tag = '[object Float64Array]',
|
|
4019
|
-
int8Tag = '[object Int8Array]',
|
|
4020
|
-
int16Tag = '[object Int16Array]',
|
|
4021
|
-
int32Tag = '[object Int32Array]',
|
|
4022
|
-
uint8Tag = '[object Uint8Array]',
|
|
4023
|
-
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
4024
|
-
uint16Tag = '[object Uint16Array]',
|
|
4025
|
-
uint32Tag = '[object Uint32Array]';
|
|
4026
|
-
/** Used to identify `toStringTag` values of typed arrays. */
|
|
4027
|
-
|
|
4028
|
-
var typedArrayTags = {};
|
|
4029
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
4030
|
-
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$1] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag] = false;
|
|
4031
|
-
/**
|
|
4032
|
-
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
4033
|
-
*
|
|
4034
|
-
* @private
|
|
4035
|
-
* @param {*} value The value to check.
|
|
4036
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
4037
|
-
*/
|
|
4038
|
-
|
|
4039
|
-
function baseIsTypedArray(value) {
|
|
4040
|
-
return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
|
4041
|
-
}
|
|
4042
|
-
|
|
4043
|
-
var _baseIsTypedArray = baseIsTypedArray;
|
|
4044
|
-
|
|
4045
|
-
/**
|
|
4046
|
-
* The base implementation of `_.unary` without support for storing metadata.
|
|
4047
|
-
*
|
|
4048
|
-
* @private
|
|
4049
|
-
* @param {Function} func The function to cap arguments for.
|
|
4050
|
-
* @returns {Function} Returns the new capped function.
|
|
4051
|
-
*/
|
|
4052
|
-
function baseUnary(func) {
|
|
4053
|
-
return function (value) {
|
|
4054
|
-
return func(value);
|
|
4055
|
-
};
|
|
4056
|
-
}
|
|
4057
|
-
|
|
4058
|
-
var _baseUnary = baseUnary;
|
|
4059
|
-
|
|
4060
|
-
var _nodeUtil = createCommonjsModule(function (module, exports) {
|
|
4061
|
-
/** Detect free variable `exports`. */
|
|
4062
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
4063
|
-
/** Detect free variable `module`. */
|
|
4064
|
-
|
|
4065
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
4066
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
4067
|
-
|
|
4068
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
4069
|
-
/** Detect free variable `process` from Node.js. */
|
|
4070
|
-
|
|
4071
|
-
var freeProcess = moduleExports && _freeGlobal.process;
|
|
4072
|
-
/** Used to access faster Node.js helpers. */
|
|
4073
|
-
|
|
4074
|
-
var nodeUtil = function () {
|
|
4075
|
-
try {
|
|
4076
|
-
// Use `util.types` for Node.js 10+.
|
|
4077
|
-
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
4078
|
-
|
|
4079
|
-
if (types) {
|
|
4080
|
-
return types;
|
|
4081
|
-
} // Legacy `process.binding('util')` for Node.js < 10.
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
4085
|
-
} catch (e) {}
|
|
4086
|
-
}();
|
|
4087
|
-
|
|
4088
|
-
module.exports = nodeUtil;
|
|
4089
|
-
});
|
|
4090
|
-
|
|
4091
|
-
/* Node.js helper references. */
|
|
4092
|
-
|
|
4093
|
-
var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
|
4094
|
-
/**
|
|
4095
|
-
* Checks if `value` is classified as a typed array.
|
|
4096
|
-
*
|
|
4097
|
-
* @static
|
|
4098
|
-
* @memberOf _
|
|
4099
|
-
* @since 3.0.0
|
|
4100
|
-
* @category Lang
|
|
4101
|
-
* @param {*} value The value to check.
|
|
4102
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
4103
|
-
* @example
|
|
4104
|
-
*
|
|
4105
|
-
* _.isTypedArray(new Uint8Array);
|
|
4106
|
-
* // => true
|
|
4107
|
-
*
|
|
4108
|
-
* _.isTypedArray([]);
|
|
4109
|
-
* // => false
|
|
4110
|
-
*/
|
|
4111
|
-
|
|
4112
|
-
var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
|
4113
|
-
var isTypedArray_1 = isTypedArray;
|
|
4114
|
-
|
|
4115
|
-
/** Used for built-in method references. */
|
|
4116
|
-
|
|
4117
|
-
var objectProto$8 = Object.prototype;
|
|
4118
|
-
/** Used to check objects for own properties. */
|
|
4119
|
-
|
|
4120
|
-
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
4121
|
-
/**
|
|
4122
|
-
* Creates an array of the enumerable property names of the array-like `value`.
|
|
4123
|
-
*
|
|
4124
|
-
* @private
|
|
4125
|
-
* @param {*} value The value to query.
|
|
4126
|
-
* @param {boolean} inherited Specify returning inherited property names.
|
|
4127
|
-
* @returns {Array} Returns the array of property names.
|
|
4128
|
-
*/
|
|
4129
|
-
|
|
4130
|
-
function arrayLikeKeys(value, inherited) {
|
|
4131
|
-
var isArr = isArray_1(value),
|
|
4132
|
-
isArg = !isArr && isArguments_1(value),
|
|
4133
|
-
isBuff = !isArr && !isArg && isBuffer_1(value),
|
|
4134
|
-
isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
|
4135
|
-
skipIndexes = isArr || isArg || isBuff || isType,
|
|
4136
|
-
result = skipIndexes ? _baseTimes(value.length, String) : [],
|
|
4137
|
-
length = result.length;
|
|
4138
|
-
|
|
4139
|
-
for (var key in value) {
|
|
4140
|
-
if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
4141
|
-
key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
4142
|
-
isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
4143
|
-
isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
|
|
4144
|
-
_isIndex(key, length)))) {
|
|
4145
|
-
result.push(key);
|
|
4146
|
-
}
|
|
4147
|
-
}
|
|
4148
|
-
|
|
4149
|
-
return result;
|
|
4150
|
-
}
|
|
4151
|
-
|
|
4152
|
-
var _arrayLikeKeys = arrayLikeKeys;
|
|
4153
|
-
|
|
4154
|
-
/** Used for built-in method references. */
|
|
4155
|
-
var objectProto$9 = Object.prototype;
|
|
4156
|
-
/**
|
|
4157
|
-
* Checks if `value` is likely a prototype object.
|
|
4158
|
-
*
|
|
4159
|
-
* @private
|
|
4160
|
-
* @param {*} value The value to check.
|
|
4161
|
-
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
4162
|
-
*/
|
|
4163
|
-
|
|
4164
|
-
function isPrototype(value) {
|
|
4165
|
-
var Ctor = value && value.constructor,
|
|
4166
|
-
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$9;
|
|
4167
|
-
return value === proto;
|
|
4168
|
-
}
|
|
4169
|
-
|
|
4170
|
-
var _isPrototype = isPrototype;
|
|
4171
|
-
|
|
4172
|
-
/**
|
|
4173
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
4174
|
-
*
|
|
4175
|
-
* @private
|
|
4176
|
-
* @param {Function} func The function to wrap.
|
|
4177
|
-
* @param {Function} transform The argument transform.
|
|
4178
|
-
* @returns {Function} Returns the new function.
|
|
4179
|
-
*/
|
|
4180
|
-
function overArg(func, transform) {
|
|
4181
|
-
return function (arg) {
|
|
4182
|
-
return func(transform(arg));
|
|
4183
|
-
};
|
|
4184
|
-
}
|
|
4185
|
-
|
|
4186
|
-
var _overArg = overArg;
|
|
4187
|
-
|
|
4188
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
4189
|
-
|
|
4190
|
-
var nativeKeys = _overArg(Object.keys, Object);
|
|
4191
|
-
var _nativeKeys = nativeKeys;
|
|
4192
|
-
|
|
4193
|
-
/** Used for built-in method references. */
|
|
4194
|
-
|
|
4195
|
-
var objectProto$a = Object.prototype;
|
|
4196
|
-
/** Used to check objects for own properties. */
|
|
4197
|
-
|
|
4198
|
-
var hasOwnProperty$7 = objectProto$a.hasOwnProperty;
|
|
4199
|
-
/**
|
|
4200
|
-
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
4201
|
-
*
|
|
4202
|
-
* @private
|
|
4203
|
-
* @param {Object} object The object to query.
|
|
4204
|
-
* @returns {Array} Returns the array of property names.
|
|
4205
|
-
*/
|
|
4206
|
-
|
|
4207
|
-
function baseKeys(object) {
|
|
4208
|
-
if (!_isPrototype(object)) {
|
|
4209
|
-
return _nativeKeys(object);
|
|
4210
|
-
}
|
|
4211
|
-
|
|
4212
|
-
var result = [];
|
|
4213
|
-
|
|
4214
|
-
for (var key in Object(object)) {
|
|
4215
|
-
if (hasOwnProperty$7.call(object, key) && key != 'constructor') {
|
|
4216
|
-
result.push(key);
|
|
4217
|
-
}
|
|
4218
|
-
}
|
|
4219
|
-
|
|
4220
|
-
return result;
|
|
4221
|
-
}
|
|
4222
|
-
|
|
4223
|
-
var _baseKeys = baseKeys;
|
|
4224
|
-
|
|
4225
|
-
/**
|
|
4226
|
-
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
4227
|
-
* not a function and has a `value.length` that's an integer greater than or
|
|
4228
|
-
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
4229
|
-
*
|
|
4230
|
-
* @static
|
|
4231
|
-
* @memberOf _
|
|
4232
|
-
* @since 4.0.0
|
|
4233
|
-
* @category Lang
|
|
4234
|
-
* @param {*} value The value to check.
|
|
4235
|
-
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
4236
|
-
* @example
|
|
4237
|
-
*
|
|
4238
|
-
* _.isArrayLike([1, 2, 3]);
|
|
4239
|
-
* // => true
|
|
4240
|
-
*
|
|
4241
|
-
* _.isArrayLike(document.body.children);
|
|
4242
|
-
* // => true
|
|
4243
|
-
*
|
|
4244
|
-
* _.isArrayLike('abc');
|
|
4245
|
-
* // => true
|
|
4246
|
-
*
|
|
4247
|
-
* _.isArrayLike(_.noop);
|
|
4248
|
-
* // => false
|
|
4249
|
-
*/
|
|
4250
|
-
|
|
4251
|
-
function isArrayLike(value) {
|
|
4252
|
-
return value != null && isLength_1(value.length) && !isFunction_1(value);
|
|
4253
|
-
}
|
|
4254
|
-
|
|
4255
|
-
var isArrayLike_1 = isArrayLike;
|
|
4256
|
-
|
|
4257
|
-
/**
|
|
4258
|
-
* Creates an array of the own enumerable property names of `object`.
|
|
4259
|
-
*
|
|
4260
|
-
* **Note:** Non-object values are coerced to objects. See the
|
|
4261
|
-
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
4262
|
-
* for more details.
|
|
4263
|
-
*
|
|
4264
|
-
* @static
|
|
4265
|
-
* @since 0.1.0
|
|
4266
|
-
* @memberOf _
|
|
4267
|
-
* @category Object
|
|
4268
|
-
* @param {Object} object The object to query.
|
|
4269
|
-
* @returns {Array} Returns the array of property names.
|
|
4270
|
-
* @example
|
|
4271
|
-
*
|
|
4272
|
-
* function Foo() {
|
|
4273
|
-
* this.a = 1;
|
|
4274
|
-
* this.b = 2;
|
|
4275
|
-
* }
|
|
4276
|
-
*
|
|
4277
|
-
* Foo.prototype.c = 3;
|
|
4278
|
-
*
|
|
4279
|
-
* _.keys(new Foo);
|
|
4280
|
-
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
4281
|
-
*
|
|
4282
|
-
* _.keys('hi');
|
|
4283
|
-
* // => ['0', '1']
|
|
4284
|
-
*/
|
|
4285
|
-
|
|
4286
|
-
function keys(object) {
|
|
4287
|
-
return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
|
|
4288
|
-
}
|
|
4289
|
-
|
|
4290
|
-
var keys_1 = keys;
|
|
4291
|
-
|
|
4292
4552
|
/**
|
|
4293
4553
|
* Creates an array of own enumerable property names and symbols of `object`.
|
|
4294
4554
|
*
|
|
@@ -5982,127 +6242,6 @@
|
|
|
5982
6242
|
});
|
|
5983
6243
|
var snakeCase_1 = snakeCase;
|
|
5984
6244
|
|
|
5985
|
-
/**
|
|
5986
|
-
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
5987
|
-
* support for iteratee shorthands.
|
|
5988
|
-
*
|
|
5989
|
-
* @private
|
|
5990
|
-
* @param {Array} array The array to inspect.
|
|
5991
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
5992
|
-
* @param {number} fromIndex The index to search from.
|
|
5993
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
5994
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
5995
|
-
*/
|
|
5996
|
-
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
5997
|
-
var length = array.length,
|
|
5998
|
-
index = fromIndex + (fromRight ? 1 : -1);
|
|
5999
|
-
|
|
6000
|
-
while (fromRight ? index-- : ++index < length) {
|
|
6001
|
-
if (predicate(array[index], index, array)) {
|
|
6002
|
-
return index;
|
|
6003
|
-
}
|
|
6004
|
-
}
|
|
6005
|
-
|
|
6006
|
-
return -1;
|
|
6007
|
-
}
|
|
6008
|
-
|
|
6009
|
-
var _baseFindIndex = baseFindIndex;
|
|
6010
|
-
|
|
6011
|
-
/**
|
|
6012
|
-
* The base implementation of `_.isNaN` without support for number objects.
|
|
6013
|
-
*
|
|
6014
|
-
* @private
|
|
6015
|
-
* @param {*} value The value to check.
|
|
6016
|
-
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
6017
|
-
*/
|
|
6018
|
-
function baseIsNaN(value) {
|
|
6019
|
-
return value !== value;
|
|
6020
|
-
}
|
|
6021
|
-
|
|
6022
|
-
var _baseIsNaN = baseIsNaN;
|
|
6023
|
-
|
|
6024
|
-
/**
|
|
6025
|
-
* A specialized version of `_.indexOf` which performs strict equality
|
|
6026
|
-
* comparisons of values, i.e. `===`.
|
|
6027
|
-
*
|
|
6028
|
-
* @private
|
|
6029
|
-
* @param {Array} array The array to inspect.
|
|
6030
|
-
* @param {*} value The value to search for.
|
|
6031
|
-
* @param {number} fromIndex The index to search from.
|
|
6032
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
6033
|
-
*/
|
|
6034
|
-
function strictIndexOf(array, value, fromIndex) {
|
|
6035
|
-
var index = fromIndex - 1,
|
|
6036
|
-
length = array.length;
|
|
6037
|
-
|
|
6038
|
-
while (++index < length) {
|
|
6039
|
-
if (array[index] === value) {
|
|
6040
|
-
return index;
|
|
6041
|
-
}
|
|
6042
|
-
}
|
|
6043
|
-
|
|
6044
|
-
return -1;
|
|
6045
|
-
}
|
|
6046
|
-
|
|
6047
|
-
var _strictIndexOf = strictIndexOf;
|
|
6048
|
-
|
|
6049
|
-
/**
|
|
6050
|
-
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
6051
|
-
*
|
|
6052
|
-
* @private
|
|
6053
|
-
* @param {Array} array The array to inspect.
|
|
6054
|
-
* @param {*} value The value to search for.
|
|
6055
|
-
* @param {number} fromIndex The index to search from.
|
|
6056
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
6057
|
-
*/
|
|
6058
|
-
|
|
6059
|
-
function baseIndexOf(array, value, fromIndex) {
|
|
6060
|
-
return value === value ? _strictIndexOf(array, value, fromIndex) : _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
6061
|
-
}
|
|
6062
|
-
|
|
6063
|
-
var _baseIndexOf = baseIndexOf;
|
|
6064
|
-
|
|
6065
|
-
/**
|
|
6066
|
-
* A specialized version of `_.includes` for arrays without support for
|
|
6067
|
-
* specifying an index to search from.
|
|
6068
|
-
*
|
|
6069
|
-
* @private
|
|
6070
|
-
* @param {Array} [array] The array to inspect.
|
|
6071
|
-
* @param {*} target The value to search for.
|
|
6072
|
-
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
6073
|
-
*/
|
|
6074
|
-
|
|
6075
|
-
function arrayIncludes(array, value) {
|
|
6076
|
-
var length = array == null ? 0 : array.length;
|
|
6077
|
-
return !!length && _baseIndexOf(array, value, 0) > -1;
|
|
6078
|
-
}
|
|
6079
|
-
|
|
6080
|
-
var _arrayIncludes = arrayIncludes;
|
|
6081
|
-
|
|
6082
|
-
/**
|
|
6083
|
-
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
6084
|
-
*
|
|
6085
|
-
* @private
|
|
6086
|
-
* @param {Array} [array] The array to inspect.
|
|
6087
|
-
* @param {*} target The value to search for.
|
|
6088
|
-
* @param {Function} comparator The comparator invoked per element.
|
|
6089
|
-
* @returns {boolean} Returns `true` if `target` is found, else `false`.
|
|
6090
|
-
*/
|
|
6091
|
-
function arrayIncludesWith(array, value, comparator) {
|
|
6092
|
-
var index = -1,
|
|
6093
|
-
length = array == null ? 0 : array.length;
|
|
6094
|
-
|
|
6095
|
-
while (++index < length) {
|
|
6096
|
-
if (comparator(value, array[index])) {
|
|
6097
|
-
return true;
|
|
6098
|
-
}
|
|
6099
|
-
}
|
|
6100
|
-
|
|
6101
|
-
return false;
|
|
6102
|
-
}
|
|
6103
|
-
|
|
6104
|
-
var _arrayIncludesWith = arrayIncludesWith;
|
|
6105
|
-
|
|
6106
6245
|
/**
|
|
6107
6246
|
* This method returns `undefined`.
|
|
6108
6247
|
*
|
|
@@ -6138,7 +6277,7 @@
|
|
|
6138
6277
|
|
|
6139
6278
|
/** Used as the size to enable large array optimizations. */
|
|
6140
6279
|
|
|
6141
|
-
var LARGE_ARRAY_SIZE$
|
|
6280
|
+
var LARGE_ARRAY_SIZE$2 = 200;
|
|
6142
6281
|
/**
|
|
6143
6282
|
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
|
|
6144
6283
|
*
|
|
@@ -6160,7 +6299,7 @@
|
|
|
6160
6299
|
if (comparator) {
|
|
6161
6300
|
isCommon = false;
|
|
6162
6301
|
includes = _arrayIncludesWith;
|
|
6163
|
-
} else if (length >= LARGE_ARRAY_SIZE$
|
|
6302
|
+
} else if (length >= LARGE_ARRAY_SIZE$2) {
|
|
6164
6303
|
var set = iteratee ? null : _createSet(array);
|
|
6165
6304
|
|
|
6166
6305
|
if (set) {
|
|
@@ -6259,95 +6398,6 @@
|
|
|
6259
6398
|
|
|
6260
6399
|
var isString_1 = isString;
|
|
6261
6400
|
|
|
6262
|
-
/** `Object#toString` result references. */
|
|
6263
|
-
|
|
6264
|
-
var mapTag$3 = '[object Map]',
|
|
6265
|
-
setTag$3 = '[object Set]';
|
|
6266
|
-
/** Used for built-in method references. */
|
|
6267
|
-
|
|
6268
|
-
var objectProto$e = Object.prototype;
|
|
6269
|
-
/** Used to check objects for own properties. */
|
|
6270
|
-
|
|
6271
|
-
var hasOwnProperty$b = objectProto$e.hasOwnProperty;
|
|
6272
|
-
/**
|
|
6273
|
-
* Checks if `value` is an empty object, collection, map, or set.
|
|
6274
|
-
*
|
|
6275
|
-
* Objects are considered empty if they have no own enumerable string keyed
|
|
6276
|
-
* properties.
|
|
6277
|
-
*
|
|
6278
|
-
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
6279
|
-
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
6280
|
-
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
6281
|
-
*
|
|
6282
|
-
* @static
|
|
6283
|
-
* @memberOf _
|
|
6284
|
-
* @since 0.1.0
|
|
6285
|
-
* @category Lang
|
|
6286
|
-
* @param {*} value The value to check.
|
|
6287
|
-
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
6288
|
-
* @example
|
|
6289
|
-
*
|
|
6290
|
-
* _.isEmpty(null);
|
|
6291
|
-
* // => true
|
|
6292
|
-
*
|
|
6293
|
-
* _.isEmpty(true);
|
|
6294
|
-
* // => true
|
|
6295
|
-
*
|
|
6296
|
-
* _.isEmpty(1);
|
|
6297
|
-
* // => true
|
|
6298
|
-
*
|
|
6299
|
-
* _.isEmpty([1, 2, 3]);
|
|
6300
|
-
* // => false
|
|
6301
|
-
*
|
|
6302
|
-
* _.isEmpty({ 'a': 1 });
|
|
6303
|
-
* // => false
|
|
6304
|
-
*/
|
|
6305
|
-
|
|
6306
|
-
function isEmpty(value) {
|
|
6307
|
-
if (value == null) {
|
|
6308
|
-
return true;
|
|
6309
|
-
}
|
|
6310
|
-
|
|
6311
|
-
if (isArrayLike_1(value) && (isArray_1(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer_1(value) || isTypedArray_1(value) || isArguments_1(value))) {
|
|
6312
|
-
return !value.length;
|
|
6313
|
-
}
|
|
6314
|
-
|
|
6315
|
-
var tag = _getTag(value);
|
|
6316
|
-
|
|
6317
|
-
if (tag == mapTag$3 || tag == setTag$3) {
|
|
6318
|
-
return !value.size;
|
|
6319
|
-
}
|
|
6320
|
-
|
|
6321
|
-
if (_isPrototype(value)) {
|
|
6322
|
-
return !_baseKeys(value).length;
|
|
6323
|
-
}
|
|
6324
|
-
|
|
6325
|
-
for (var key in value) {
|
|
6326
|
-
if (hasOwnProperty$b.call(value, key)) {
|
|
6327
|
-
return false;
|
|
6328
|
-
}
|
|
6329
|
-
}
|
|
6330
|
-
|
|
6331
|
-
return true;
|
|
6332
|
-
}
|
|
6333
|
-
|
|
6334
|
-
var isEmpty_1 = isEmpty;
|
|
6335
|
-
|
|
6336
|
-
/**
|
|
6337
|
-
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
6338
|
-
*
|
|
6339
|
-
* @private
|
|
6340
|
-
* @param {Function} func The function to apply a rest parameter to.
|
|
6341
|
-
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
6342
|
-
* @returns {Function} Returns the new function.
|
|
6343
|
-
*/
|
|
6344
|
-
|
|
6345
|
-
function baseRest(func, start) {
|
|
6346
|
-
return _setToString(_overRest(func, start, identity_1), func + '');
|
|
6347
|
-
}
|
|
6348
|
-
|
|
6349
|
-
var _baseRest = baseRest;
|
|
6350
|
-
|
|
6351
6401
|
/**
|
|
6352
6402
|
* This function is like `baseIndexOf` except that it accepts a comparator.
|
|
6353
6403
|
*
|
|
@@ -6500,6 +6550,80 @@
|
|
|
6500
6550
|
var pull = _baseRest(pullAll_1);
|
|
6501
6551
|
var pull_1 = pull;
|
|
6502
6552
|
|
|
6553
|
+
/** `Object#toString` result references. */
|
|
6554
|
+
|
|
6555
|
+
var mapTag$3 = '[object Map]',
|
|
6556
|
+
setTag$3 = '[object Set]';
|
|
6557
|
+
/** Used for built-in method references. */
|
|
6558
|
+
|
|
6559
|
+
var objectProto$e = Object.prototype;
|
|
6560
|
+
/** Used to check objects for own properties. */
|
|
6561
|
+
|
|
6562
|
+
var hasOwnProperty$b = objectProto$e.hasOwnProperty;
|
|
6563
|
+
/**
|
|
6564
|
+
* Checks if `value` is an empty object, collection, map, or set.
|
|
6565
|
+
*
|
|
6566
|
+
* Objects are considered empty if they have no own enumerable string keyed
|
|
6567
|
+
* properties.
|
|
6568
|
+
*
|
|
6569
|
+
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
6570
|
+
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
6571
|
+
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
6572
|
+
*
|
|
6573
|
+
* @static
|
|
6574
|
+
* @memberOf _
|
|
6575
|
+
* @since 0.1.0
|
|
6576
|
+
* @category Lang
|
|
6577
|
+
* @param {*} value The value to check.
|
|
6578
|
+
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
6579
|
+
* @example
|
|
6580
|
+
*
|
|
6581
|
+
* _.isEmpty(null);
|
|
6582
|
+
* // => true
|
|
6583
|
+
*
|
|
6584
|
+
* _.isEmpty(true);
|
|
6585
|
+
* // => true
|
|
6586
|
+
*
|
|
6587
|
+
* _.isEmpty(1);
|
|
6588
|
+
* // => true
|
|
6589
|
+
*
|
|
6590
|
+
* _.isEmpty([1, 2, 3]);
|
|
6591
|
+
* // => false
|
|
6592
|
+
*
|
|
6593
|
+
* _.isEmpty({ 'a': 1 });
|
|
6594
|
+
* // => false
|
|
6595
|
+
*/
|
|
6596
|
+
|
|
6597
|
+
function isEmpty(value) {
|
|
6598
|
+
if (value == null) {
|
|
6599
|
+
return true;
|
|
6600
|
+
}
|
|
6601
|
+
|
|
6602
|
+
if (isArrayLike_1(value) && (isArray_1(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer_1(value) || isTypedArray_1(value) || isArguments_1(value))) {
|
|
6603
|
+
return !value.length;
|
|
6604
|
+
}
|
|
6605
|
+
|
|
6606
|
+
var tag = _getTag(value);
|
|
6607
|
+
|
|
6608
|
+
if (tag == mapTag$3 || tag == setTag$3) {
|
|
6609
|
+
return !value.size;
|
|
6610
|
+
}
|
|
6611
|
+
|
|
6612
|
+
if (_isPrototype(value)) {
|
|
6613
|
+
return !_baseKeys(value).length;
|
|
6614
|
+
}
|
|
6615
|
+
|
|
6616
|
+
for (var key in value) {
|
|
6617
|
+
if (hasOwnProperty$b.call(value, key)) {
|
|
6618
|
+
return false;
|
|
6619
|
+
}
|
|
6620
|
+
}
|
|
6621
|
+
|
|
6622
|
+
return true;
|
|
6623
|
+
}
|
|
6624
|
+
|
|
6625
|
+
var isEmpty_1 = isEmpty;
|
|
6626
|
+
|
|
6503
6627
|
var commonjsGlobal$1=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global$1!=='undefined'?global$1:typeof self!=='undefined'?self:{};function createCommonjsModule$1(fn,module){return module={exports:{}},fn(module,module.exports),module.exports;}var check=function check(it){return it&&it.Math==Math&⁢};// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
6504
6628
|
var global_1=// eslint-disable-next-line no-undef
|
|
6505
6629
|
check((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))=='object'&&globalThis)||check((typeof window==="undefined"?"undefined":_typeof(window))=='object'&&window)||check((typeof self==="undefined"?"undefined":_typeof(self))=='object'&&self)||check(_typeof(commonjsGlobal$1)=='object'&&commonjsGlobal$1)||// eslint-disable-next-line no-new-func
|
|
@@ -8048,6 +8172,9 @@
|
|
|
8048
8172
|
*/function parseQueryString(queryString){var qs=queryString.split('&').reduce(function(acc,param){var _a;var _b=param.split('='),key=_b[0],_c=_b[1],value=_c===void 0?'':_c;if(key&&key.length){return _assign(_assign({},acc),(_a={},_a[key]=decodeURIComponent(value.replace(/\+/g,' ')),_a));}else {return acc;}},{});return camelCaseProperties(qs);}function toQueryString(obj,snakeCase){if(snakeCase===void 0){snakeCase=true;}var params=snakeCase?snakeCaseProperties(obj):obj;return map_1(pickBy_1(params,function(v){return v!==null&&v!==undefined;}),function(value,key){return value!==''?key+"="+encodeURIComponent(value):key;}).join('&');}var MFA;(function(MFA){function isPhoneCredential(credential){return credential.type==='sms';}MFA.isPhoneCredential=isPhoneCredential;function isEmailCredential(credential){return credential.type==='email';}MFA.isEmailCredential=isEmailCredential;})(MFA||(MFA={}));var ErrorResponse;(function(ErrorResponse){function isErrorResponse(thing){return thing&&thing.error;}ErrorResponse.isErrorResponse=isErrorResponse;})(ErrorResponse||(ErrorResponse={}));/**
|
|
8049
8173
|
* Resolve the actual oauth2 scope according to the authentication options.
|
|
8050
8174
|
*/function resolveScope(opts,defaultScopes){if(opts===void 0){opts={};}var fetchBasicProfile=isUndefined_1(opts.fetchBasicProfile)||opts.fetchBasicProfile;var scopes=isUndefined_1(opts.scope)?defaultScopes:opts.scope;return uniq_1(__spreadArrays(fetchBasicProfile?['openid','profile','email','phone']:[],opts.requireRefreshToken?['offline_access']:[],parseScope(scopes))).join(' ');}/**
|
|
8175
|
+
* Normalize the scope format (e.g. "openid email" => ["openid", "email"])
|
|
8176
|
+
* @param scope Scope entered by the user
|
|
8177
|
+
*/function parseScope(scope){if(isUndefined_1(scope))return [];if(isArray_1(scope))return scope;if(isString_1(scope))return scope.split(' ');throw new Error('Invalid scope format: string or array expected.');}/**
|
|
8051
8178
|
* Transform authentication options into authentication parameters
|
|
8052
8179
|
* @param opts
|
|
8053
8180
|
* Authentication options
|
|
@@ -8055,10 +8182,7 @@
|
|
|
8055
8182
|
* Indicates if the popup mode is allowed (depends on the type of authentication or context)
|
|
8056
8183
|
* @param defaultScopes
|
|
8057
8184
|
* Default scopes
|
|
8058
|
-
*/function computeAuthOptions(opts,_a,defaultScopes){if(opts===void 0){opts={};}var _b=(_a===void 0?{}:_a).acceptPopupMode,acceptPopupMode=_b===void 0?false:_b;var isPopup=opts.popupMode&&acceptPopupMode;var responseType=opts.redirectUri?'code':'token';var responseMode=opts.useWebMessage&&!isPopup?'web_message':undefined;var display=isPopup?'popup':responseMode!=='web_message'?'page':undefined;var prompt=responseMode==='web_message'?'none':opts.prompt;var scope=resolveScope(opts,defaultScopes);return _assign(_assign({responseType:responseType},pick_1(opts,['responseType','redirectUri','origin','state','nonce','providerScope','idTokenHint','loginHint','accessToken','persistent'])),{scope:scope,display:display,responseMode:responseMode,prompt:prompt});}
|
|
8059
|
-
* Normalize the scope format (e.g. "openid email" => ["openid", "email"])
|
|
8060
|
-
* @param scope Scope entered by the user
|
|
8061
|
-
*/function parseScope(scope){if(isUndefined_1(scope))return [];if(isArray_1(scope))return scope;if(isString_1(scope))return scope.split(' ');throw new Error('Invalid scope format: string or array expected.');}var byteLength_1=byteLength;var toByteArray_1=toByteArray;var fromByteArray_1=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i;}// Support decoding URL-safe base64 strings, as Node.js does.
|
|
8185
|
+
*/function computeAuthOptions(opts,_a,defaultScopes){if(opts===void 0){opts={};}var _b=(_a===void 0?{}:_a).acceptPopupMode,acceptPopupMode=_b===void 0?false:_b;var isPopup=opts.popupMode&&acceptPopupMode;var responseType=opts.redirectUri?'code':'token';var responseMode=opts.useWebMessage&&!isPopup?'web_message':undefined;var display=isPopup?'popup':responseMode!=='web_message'?'page':undefined;var prompt=responseMode==='web_message'?'none':opts.prompt;var scope=resolveScope(opts,defaultScopes);return _assign(_assign({responseType:responseType},pick_1(opts,['responseType','redirectUri','origin','state','nonce','providerScope','idTokenHint','loginHint','accessToken','persistent'])),{scope:scope,display:display,responseMode:responseMode,prompt:prompt});}var byteLength_1=byteLength;var toByteArray_1=toByteArray;var fromByteArray_1=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i;}// Support decoding URL-safe base64 strings, as Node.js does.
|
|
8062
8186
|
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
8063
8187
|
revLookup['-'.charCodeAt(0)]=62;revLookup['_'.charCodeAt(0)]=63;function getLens(b64){var len=b64.length;if(len%4>0){throw new Error('Invalid string. Length must be a multiple of 4');}// Trim off extra bytes after placeholder bytes are found
|
|
8064
8188
|
// See: https://github.com/beatgammit/base64-js/issues/42
|
|
@@ -8222,22 +8346,34 @@
|
|
|
8222
8346
|
*/function decodeBase64(str){// Cf: https://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings
|
|
8223
8347
|
return decodeURIComponent(Array.prototype.map.call(window.atob(str),function(c){return '%'+('00'+c.charCodeAt(0).toString(16)).slice(-2);}).join(''));}function parseJwtTokenPayload(token){var bodyPart=token.split('.')[1];return camelCaseProperties(JSON.parse(decodeBase64UrlSafe(bodyPart)));}/**
|
|
8224
8348
|
* Parse the id token, if present, and add the payload to the AuthResult
|
|
8225
|
-
*/function enrichAuthResult(response){if(response.idToken){try{var idTokenPayload=parseJwtTokenPayload(response.idToken);return _assign(_assign({},response),{idTokenPayload:idTokenPayload});}catch(e){logError('ID Token parsing error',e);}}return response;}var AuthResult;(function(AuthResult){function isAuthResult(thing){return thing&&(thing.accessToken||thing.idToken||thing.code);}AuthResult.isAuthResult=isAuthResult;})(AuthResult||(AuthResult={}));function popupSize(provider){switch(provider){case'amazon':return {width:715,height:525};case'facebook':return {width:650,height:400};case'google':return {width:560,height:630};case'kakaotalk':return {width:450,height:400};case'line':return {width:440,height:550};case'mailru':return {width:450,height:400};case'qq':return {width:450,height:400};case'twitter':return {width:800,height:440};case'vkontakte':return {width:655,height:430};case'yandex':return {width:655,height:700};default:return {width:400,height:550};}}function
|
|
8226
|
-
* Low level HTTP client
|
|
8227
|
-
*/function rawRequest(url,fetchOptions){return fetch(url,fetchOptions).then(function(response){if(response.status!==204){var dataP=response.json().then(camelCaseProperties);return response.ok?dataP:dataP.then(function(data){return Promise.reject(data);});}return undefined;});}function randomBase64String(){var randomValues=window.crypto.getRandomValues(new Uint8Array(32));return encodeToBase64(randomValues);}function computePkceParams(){var codeVerifier=randomBase64String();sessionStorage.setItem('verifier_key',codeVerifier);return computeCodeChallenge(codeVerifier).then(function(challenge){return {codeChallenge:challenge,codeChallengeMethod:'S256'};});}function computeCodeChallenge(verifier){var binaryChallenge=buffer_1.from(verifier,'utf-8');return new Promise(function(resolve){window.crypto.subtle.digest('SHA-256',binaryChallenge).then(function(hash){return resolve(encodeToBase64(hash));});});}var publicKeyCredentialType='public-key';function encodePublicKeyCredentialCreationOptions(serializedOptions){return _assign(_assign({},serializedOptions),{challenge:buffer_1.from(serializedOptions.challenge,'base64'),user:_assign(_assign({},serializedOptions.user),{id:buffer_1.from(serializedOptions.user.id,'base64')}),excludeCredentials:serializedOptions.excludeCredentials&&serializedOptions.excludeCredentials.map(function(excludeCredential){return _assign(_assign({},excludeCredential),{id:buffer_1.from(excludeCredential.id,'base64')});})});}function encodePublicKeyCredentialRequestOptions(serializedOptions){return _assign(_assign({},serializedOptions),{challenge:buffer_1.from(serializedOptions.challenge,'base64'),allowCredentials:serializedOptions.allowCredentials.map(function(allowCrendential){return _assign(_assign({},allowCrendential),{id:buffer_1.from(allowCrendential.id,'base64')});})});}function serializeRegistrationPublicKeyCredential(encodedPublicKey){var response=encodedPublicKey.response;return {id:encodedPublicKey.id,rawId:encodeToBase64(encodedPublicKey.rawId),type:encodedPublicKey.type,response:{clientDataJSON:encodeToBase64(response.clientDataJSON),attestationObject:encodeToBase64(response.attestationObject)}};}function serializeAuthenticationPublicKeyCredential(encodedPublicKey){var response=encodedPublicKey.response;return {id:encodedPublicKey.id,rawId:encodeToBase64(encodedPublicKey.rawId),type:encodedPublicKey.type,response:{authenticatorData:encodeToBase64(response.authenticatorData),clientDataJSON:encodeToBase64(response.clientDataJSON),signature:encodeToBase64(response.signature),userHandle:response.userHandle&&encodeToBase64(response.userHandle)}};}/**
|
|
8349
|
+
*/function enrichAuthResult(response){if(response.idToken){try{var idTokenPayload=parseJwtTokenPayload(response.idToken);return _assign(_assign({},response),{idTokenPayload:idTokenPayload});}catch(e){logError('ID Token parsing error',e);}}return response;}var AuthResult;(function(AuthResult){function isAuthResult(thing){return thing&&(thing.accessToken||thing.idToken||thing.code);}AuthResult.isAuthResult=isAuthResult;})(AuthResult||(AuthResult={}));function popupSize(provider){switch(provider){case'amazon':return {width:715,height:525};case'facebook':return {width:650,height:400};case'google':return {width:560,height:630};case'kakaotalk':return {width:450,height:400};case'line':return {width:440,height:550};case'mailru':return {width:450,height:400};case'qq':return {width:450,height:400};case'twitter':return {width:800,height:440};case'vkontakte':return {width:655,height:430};case'yandex':return {width:655,height:700};default:return {width:400,height:550};}}function randomBase64String(){var randomValues=window.crypto.getRandomValues(new Uint8Array(32));return encodeToBase64(randomValues);}function computePkceParams(){var codeVerifier=randomBase64String();sessionStorage.setItem('verifier_key',codeVerifier);return computeCodeChallenge(codeVerifier).then(function(challenge){return {codeChallenge:challenge,codeChallengeMethod:'S256'};});}function computeCodeChallenge(verifier){var binaryChallenge=buffer_1.from(verifier,'utf-8');return new Promise(function(resolve){window.crypto.subtle.digest('SHA-256',binaryChallenge).then(function(hash){return resolve(encodeToBase64(hash));});});}/**
|
|
8228
8350
|
* Identity Rest API Client
|
|
8229
|
-
*/var
|
|
8351
|
+
*/var OAuthClient=/** @class */function(){function OAuthClient(props){this.config=props.config;this.http=props.http;this.eventManager=props.eventManager;this.authorizeUrl=this.config.baseUrl+"/oauth/authorize";this.customTokenUrl=this.config.baseUrl+"/identity/v1/custom-token/login";this.logoutUrl=this.config.baseUrl+"/identity/v1/logout";this.passwordlessVerifyUrl=this.config.baseUrl+"/identity/v1/passwordless/verify";this.popupRelayUrl=this.config.baseUrl+"/popup/relay";this.tokenUrl=this.config.baseUrl+"/oauth/token";this.passwordlessVerifyAuthCodeUrl='/verify-auth-code';this.passwordLoginUrl='/password/login';this.passwordlessStartUrl='/passwordless/start';this.sessionInfoUrl='/sso/data';this.signupUrl='/signup';this.signupTokenUrl='/signup-token';}OAuthClient.prototype.checkSession=function(opts){var _this=this;if(opts===void 0){opts={};}if(!this.config.sso)return Promise.reject(new Error("Cannot call 'checkSession' if SSO is not enabled."));var authParams=this.authParams(_assign(_assign({},opts),{responseType:'code',useWebMessage:true}));return this.getPkceParams(authParams).then(function(maybeChallenge){var params=_assign(_assign({},authParams),maybeChallenge);var authorizationUrl=_this.getAuthorizationUrl(params);return _this.getWebMessage(authorizationUrl,_this.config.baseUrl,opts.redirectUri);});};OAuthClient.prototype.exchangeAuthorizationCodeWithPkce=function(params){var _this=this;return this.http.post(this.tokenUrl,{body:_assign({clientId:this.config.clientId,grantType:'authorization_code',codeVerifier:sessionStorage.getItem('verifier_key')},params)}).then(function(authResult){_this.eventManager.fireEvent('authenticated',authResult);return enrichAuthResult(authResult);});};OAuthClient.prototype.getSessionInfo=function(){return this.http.get(this.sessionInfoUrl,{query:{clientId:this.config.clientId},withCookies:true});};OAuthClient.prototype.loginFromSession=function(opts){var _this=this;if(opts===void 0){opts={};}if(!this.config.sso)return Promise.reject(new Error("Cannot call 'loginFromSession' if SSO is not enabled."));var authParams=this.authParams(_assign(_assign({},opts),{useWebMessage:false}));return this.getPkceParams(authParams).then(function(maybeChallenge){var params=_assign(_assign({},authParams),maybeChallenge);return _this.redirectThruAuthorization(params);});};OAuthClient.prototype.loginWithCredentials=function(params){var _this=this;if(navigator.credentials&&navigator.credentials.get){var request={password:true,mediation:params.mediation||'silent'};return navigator.credentials.get(request).then(function(credentials){if(!isUndefined_1(credentials)&&credentials instanceof PasswordCredential&&credentials.password){var loginParams={email:credentials.id,password:credentials.password,auth:params.auth};return _this.ropcPasswordLogin(loginParams);}return Promise.reject(new Error('Invalid credentials'));});}else {return Promise.reject(new Error('Unsupported Credentials Management API'));}};OAuthClient.prototype.loginWithCustomToken=function(params){var token=params.token,auth=params.auth;var queryString=toQueryString(_assign(_assign({},this.authParams(auth)),{token:token}));// Non existent endpoint URL
|
|
8352
|
+
window.location.assign(this.customTokenUrl+"?"+queryString);};OAuthClient.prototype.loginWithPassword=function(params){var _this=this;var _a=params.auth,auth=_a===void 0?{}:_a,rest=__rest(params,["auth"]);var loginPromise=window.cordova?this.ropcPasswordLogin(params).then(function(authResult){return _this.storeCredentialsInBrowser(params).then(function(){return enrichAuthResult(authResult);});}):this.http.post(this.passwordLoginUrl,{body:_assign({clientId:this.config.clientId,scope:resolveScope(auth,this.config.scope)},rest)}).then(function(tkn){return _this.storeCredentialsInBrowser(params).then(function(){return tkn;});}).then(function(tkn){return _this.loginCallback(tkn,auth);});return loginPromise["catch"](function(err){if(err.error){_this.eventManager.fireEvent('login_failed',err);}return Promise.reject(err);});};OAuthClient.prototype.loginWithSocialProvider=function(provider,opts){var _this=this;if(opts===void 0){opts={};}if(this.config.orchestrationToken){var params=_assign(_assign({},this.orchestratedFlowParams(this.config.orchestrationToken,_assign(_assign({},opts),{useWebMessage:false}))),{provider:provider});if('cordova'in window){return this.loginWithCordovaInAppBrowser(params);}else if(params.display==='popup'){return this.loginWithPopup(params);}else {return this.redirectThruAuthorization(params);}}else {var authParams_1=this.authParams(_assign(_assign({},opts),{useWebMessage:false}),{acceptPopupMode:true});return this.getPkceParams(authParams_1).then(function(maybeChallenge){var params=_assign(_assign(_assign({},authParams_1),{provider:provider}),maybeChallenge);if('cordova'in window){return _this.loginWithCordovaInAppBrowser(params);}else if(params.display==='popup'){return _this.loginWithPopup(params);}else {return _this.redirectThruAuthorization(params);}});}};OAuthClient.prototype.loginWithIdToken=function(provider,idToken,nonce,opts){if(opts===void 0){opts={};}var authParams=this.authParams(_assign({},opts));if(opts.useWebMessage){var queryString=toQueryString(_assign(_assign({},authParams),{provider:provider,idToken:idToken,nonce:nonce}));return this.getWebMessage(this.authorizeUrl+"?"+queryString,this.config.baseUrl,opts.redirectUri).then();}else {return this.redirectThruAuthorization(_assign(_assign({},authParams),{provider:provider,idToken:idToken,nonce:nonce}));}};OAuthClient.prototype.googleOneTap=function(opts,nonce){var _this=this;if(opts===void 0){opts={};}if(nonce===void 0){nonce=randomBase64String();}var binaryNonce=buffer_1.from(nonce,'utf-8');return window.crypto.subtle.digest('SHA-256',binaryNonce).then(function(hash){var googleIdConfiguration={client_id:_this.config.googleClientId,callback:function callback(response){return _this.loginWithIdToken("google",response.credential,nonce,opts);},nonce:encodeToBase64(hash),// Enable auto sign-in
|
|
8353
|
+
auto_select:true};window.google.accounts.id.initialize(googleIdConfiguration);// Activate Google One Tap
|
|
8354
|
+
window.google.accounts.id.prompt();});};OAuthClient.prototype.instantiateOneTap=function(opts){var _this=this;var _a,_b;if(opts===void 0){opts={};}if((_a=this.config)===null||_a===void 0?void 0:_a.googleClientId){var script=document.createElement("script");script.src="https://accounts.google.com/gsi/client";script.onload=function(){return _this.googleOneTap(opts);};script.async=true;script.defer=true;(_b=document.querySelector("body"))===null||_b===void 0?void 0:_b.appendChild(script);}else {logError('Google configuration missing.');}};OAuthClient.prototype.logout=function(opts){if(opts===void 0){opts={};}if(navigator.credentials&&navigator.credentials.preventSilentAccess&&opts.removeCredentials===true){navigator.credentials.preventSilentAccess();}window.location.assign(this.logoutUrl+"?"+toQueryString(opts));};OAuthClient.prototype.refreshTokens=function(params){var result=this.http.post(this.tokenUrl,{body:_assign({clientId:this.config.clientId,grantType:'refresh_token',refreshToken:params.refreshToken},pick_1(params,'scope'))});return result.then(enrichAuthResult);};OAuthClient.prototype.signup=function(params){var _this=this;var data=params.data,auth=params.auth,redirectUrl=params.redirectUrl,returnToAfterEmailConfirmation=params.returnToAfterEmailConfirmation,saveCredentials=params.saveCredentials,captchaToken=params.captchaToken;var clientId=this.config.clientId;var scope=resolveScope(auth,this.config.scope);var loginParams=_assign(_assign({},data.phoneNumber?{phoneNumber:data.phoneNumber}:{email:data.email||""}),{password:data.password,saveCredentials:saveCredentials,auth:auth});var resultPromise=window.cordova?this.http.post(this.signupTokenUrl,{body:_assign(_assign({clientId:clientId,redirectUrl:redirectUrl,scope:scope},pick_1(auth,'origin')),{data:data,returnToAfterEmailConfirmation:returnToAfterEmailConfirmation,captchaToken:captchaToken})}).then(function(authResult){_this.eventManager.fireEvent('authenticated',authResult);return _this.storeCredentialsInBrowser(loginParams).then(function(){return enrichAuthResult(authResult);});}):this.http.post(this.signupUrl,{body:{clientId:clientId,redirectUrl:redirectUrl,scope:scope,data:data,returnToAfterEmailConfirmation:returnToAfterEmailConfirmation,captchaToken:captchaToken}}).then(function(tkn){return _this.storeCredentialsInBrowser(loginParams).then(function(){return tkn;});}).then(function(tkn){return _this.loginCallback(tkn,auth);});return resultPromise["catch"](function(err){if(err.error){_this.eventManager.fireEvent('signup_failed',err);}return Promise.reject(err);});};OAuthClient.prototype.startPasswordless=function(params,auth){var _this=this;if(auth===void 0){auth={};}var passwordlessPayload='stepUp'in params?Promise.resolve(params):this.resolveSingleFactorPasswordlessParams(params,auth);return passwordlessPayload.then(function(payload){return _this.http.post(_this.passwordlessStartUrl,{body:payload});});};OAuthClient.prototype.verifyPasswordless=function(params,auth){var _this=this;if(auth===void 0){auth={};}return 'challengeId'in params?Promise.resolve(this.loginWithVerificationCode(params)):this.http.post(this.passwordlessVerifyAuthCodeUrl,{body:params})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);}).then(function(){return _this.loginWithVerificationCode(params,auth);});};OAuthClient.prototype.getAuthorizationUrl=function(queryString){return this.authorizeUrl+"?"+toQueryString(queryString);};OAuthClient.prototype.getWebMessage=function(src,origin,redirectUri){var _this=this;var iframe=document.createElement('iframe');// "wm" needed to make sure the randomized id is valid
|
|
8230
8355
|
var id="wm"+randomBase64String();iframe.setAttribute('width','0');iframe.setAttribute('height','0');iframe.setAttribute('style','display:none;');iframe.setAttribute('id',id);iframe.setAttribute('src',src);return new Promise(function(resolve,reject){var listener=function listener(event){// Verify the event's origin
|
|
8231
8356
|
if(event.origin!==origin)return;// Verify the event's syntax
|
|
8232
8357
|
var data=camelCaseProperties(event.data);if(data.type!=='authorization_response')return;// The iframe is no longer needed, clean it up ..
|
|
8233
8358
|
if(window.document.body.contains(iframe)){window.document.body.removeChild(iframe);}var result=data.response;if(AuthResult.isAuthResult(result)){if(result.code){resolve(_this.exchangeAuthorizationCodeWithPkce({code:result.code,redirectUri:redirectUri||window.location.origin}));}else {_this.eventManager.fireEvent('authenticated',data.response);resolve(enrichAuthResult(data.response));}}else if(ErrorResponse.isErrorResponse(result)){// The 'authentication_failed' event must not be triggered because it is not a real authentication failure.
|
|
8234
|
-
reject(result);}else {reject({error:'unexpected_error',errorDescription:'Unexpected error occurred'});}window.removeEventListener('message',listener,false);};window.addEventListener('message',listener,false);document.body.appendChild(iframe);});};
|
|
8359
|
+
reject(result);}else {reject({error:'unexpected_error',errorDescription:'Unexpected error occurred'});}window.removeEventListener('message',listener,false);};window.addEventListener('message',listener,false);document.body.appendChild(iframe);});};OAuthClient.prototype.loginWithPopup=function(opts){var _this=this;var responseType=opts.responseType,redirectUri=opts.redirectUri,provider=opts.provider;winchan.open({url:this.authorizeUrl+"?"+toQueryString(opts),relay_url:this.popupRelayUrl,window_features:this.computeProviderPopupOptions(provider)},function(err,result){if(err){logError(err);_this.eventManager.fireEvent('authentication_failed',{errorDescription:'Unexpected error occurred',error:'server_error'});return;}var r=camelCaseProperties(result);if(r.success){if(responseType==='code'){window.location.assign(redirectUri+"?code="+r.data.code);}else {_this.eventManager.fireEvent('authenticated',r.data);}}else {_this.eventManager.fireEvent('authentication_failed',r.data);}});return Promise.resolve();};OAuthClient.prototype.computeProviderPopupOptions=function(provider){try{var opts=popupSize(provider);var left=Math.max(0,(screen.width-opts.width)/2);var top_1=Math.max(0,(screen.height-opts.height)/2);var width=Math.min(screen.width,opts.width);var height=Math.min(screen.height,opts.height);return "menubar=0,toolbar=0,resizable=1,scrollbars=1,width="+width+",height="+height+",top="+top_1+",left="+left;}catch(e){return 'menubar=0,toolbar=0,resizable=1,scrollbars=1,width=960,height=680';}};OAuthClient.prototype.redirectThruAuthorization=function(queryString){var location=this.getAuthorizationUrl(queryString);window.location.assign(location);return Promise.resolve();};OAuthClient.prototype.loginWithVerificationCode=function(params,auth){if(auth===void 0){auth={};}var queryString=toQueryString(_assign(_assign({},this.authParams(auth)),params));window.location.assign(this.passwordlessVerifyUrl+"?"+queryString);};OAuthClient.prototype.ropcPasswordLogin=function(params){var _this=this;var auth=params.auth;return this.http.post(this.tokenUrl,{body:_assign({clientId:this.config.clientId,grantType:'password',username:this.hasLoggedWithEmail(params)?params.email:params.phoneNumber,password:params.password,scope:resolveScope(auth,this.config.scope)},pick_1(auth,'origin'))}).then(function(authResult){_this.eventManager.fireEvent('authenticated',authResult);return enrichAuthResult(authResult);});};OAuthClient.prototype.loginWithCordovaInAppBrowser=function(opts){return this.openInCordovaSystemBrowser(this.getAuthorizationUrl(_assign(_assign({},opts),{display:'page'})));};OAuthClient.prototype.openInCordovaSystemBrowser=function(url){return this.getAvailableBrowserTabPlugin().then(function(maybeBrowserTab){if(!window.cordova){return Promise.reject(new Error('Cordova environnement not detected.'));}if(maybeBrowserTab){maybeBrowserTab.openUrl(url,function(){},logError);return Promise.resolve();}if(window.cordova.InAppBrowser){var ref=window.cordova.platformId==='ios'?// Open a webview (to pass Apple validation tests)
|
|
8235
8360
|
window.cordova.InAppBrowser.open(url,'_blank'):// Open the system browser
|
|
8236
|
-
window.cordova.InAppBrowser.open(url,'_system');return Promise.resolve(ref);}return Promise.reject(new Error('Cordova plugin "InAppBrowser" is required.'));});};
|
|
8361
|
+
window.cordova.InAppBrowser.open(url,'_system');return Promise.resolve(ref);}return Promise.reject(new Error('Cordova plugin "InAppBrowser" is required.'));});};OAuthClient.prototype.getAvailableBrowserTabPlugin=function(){return new Promise(function(resolve,reject){var cordova=window.cordova;if(!cordova||!cordova.plugins||!cordova.plugins.browsertab)return resolve(undefined);var plugin=cordova.plugins.browsertab;plugin.isAvailable(function(isAvailable){return resolve(isAvailable?plugin:undefined);},reject);});};OAuthClient.prototype.storeCredentialsInBrowser=function(params){if(!params.saveCredentials)return Promise.resolve();if(navigator.credentials&&navigator.credentials.create&&navigator.credentials.store){var credentialParams={password:{password:params.password,id:this.hasLoggedWithEmail(params)?params.email:params.phoneNumber}};return navigator.credentials.create(credentialParams).then(function(credentials){return !isUndefined_1(credentials)&&credentials?navigator.credentials.store(credentials).then(function(){}):Promise.resolve();});}else {logError('Unsupported Credentials Management API');return Promise.resolve();}};// TODO: Make passwordless able to handle web_message
|
|
8237
8362
|
// Asana https://app.asana.com/0/982150578058310/1200173806808689/f
|
|
8238
|
-
ApiClient.prototype.startPasswordless=function(params,auth){var _this=this;if(auth===void 0){auth={};}var passwordlessPayload='stepUp'in params?Promise.resolve(params):this.resolveSingleFactorPasswordlessParams(params,auth);return passwordlessPayload.then(function(payload){return _this.http.post('/passwordless/start',{body:payload});});};ApiClient.prototype.resolveSingleFactorPasswordlessParams=function(params,auth){if(auth===void 0){auth={};}var authType=params.authType,email=params.email,phoneNumber=params.phoneNumber,captchaToken=params.captchaToken;var authParams=this.authParams(auth);return this.getPkceParams(authParams).then(function(maybeChallenge){return _assign(_assign(_assign({},authParams),{authType:authType,email:email,phoneNumber:phoneNumber,captchaToken:captchaToken}),maybeChallenge);});};ApiClient.prototype.loginWithVerificationCode=function(params,auth){if(auth===void 0){auth={};}var queryString=toQueryString(_assign(_assign({},this.authParams(auth)),params));window.location.assign(this.baseUrl+"/passwordless/verify?"+queryString);};ApiClient.prototype.verifyMfaPasswordless=function(params){var challengeId=params.challengeId,verificationCode=params.verificationCode,accessToken=params.accessToken;return this.http.post('/passwordless/verify',{body:{challengeId:challengeId,verificationCode:verificationCode},accessToken:accessToken});};ApiClient.prototype.verifyPasswordless=function(params,auth){var _this=this;if(auth===void 0){auth={};}return 'challengeId'in params?Promise.resolve(this.loginWithVerificationCode(params)):this.http.post('/verify-auth-code',{body:params})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);}).then(function(){return _this.loginWithVerificationCode(params,auth);});};ApiClient.prototype.signup=function(params){var _this=this;var data=params.data,auth=params.auth,redirectUrl=params.redirectUrl,returnToAfterEmailConfirmation=params.returnToAfterEmailConfirmation,saveCredentials=params.saveCredentials,captchaToken=params.captchaToken;var clientId=this.config.clientId;var scope=this.resolveScope(auth);var loginParams=_assign(_assign({},data.phoneNumber?{phoneNumber:data.phoneNumber}:{email:data.email||""}),{password:data.password,saveCredentials:saveCredentials,auth:auth});var resultPromise=window.cordova?this.http.post(this.baseUrl+"/signup-token",{body:_assign(_assign({clientId:clientId,redirectUrl:redirectUrl,scope:scope},pick_1(auth,'origin')),{data:data,returnToAfterEmailConfirmation:returnToAfterEmailConfirmation,captchaToken:captchaToken})}).then(function(authResult){_this.eventManager.fireEvent('authenticated',authResult);return _this.storeCredentialsInBrowser(loginParams).then(function(){return enrichAuthResult(authResult);});}):this.http.post('/signup',{body:{clientId:clientId,redirectUrl:redirectUrl,scope:scope,data:data,returnToAfterEmailConfirmation:returnToAfterEmailConfirmation,captchaToken:captchaToken}}).then(function(tkn){return _this.storeCredentialsInBrowser(loginParams).then(function(){return tkn;});}).then(function(tkn){return _this.loginCallback(tkn,auth);});return resultPromise["catch"](function(err){if(err.error){_this.eventManager.fireEvent('signup_failed',err);}return Promise.reject(err);});};ApiClient.prototype.sendEmailVerification=function(params){var accessToken=params.accessToken,data=__rest(params,["accessToken"]);return this.http.post('/send-email-verification',{body:_assign({},data),accessToken:accessToken});};ApiClient.prototype.sendPhoneNumberVerification=function(params){var accessToken=params.accessToken;return this.http.post('/send-phone-number-verification',{accessToken:accessToken});};ApiClient.prototype.requestPasswordReset=function(params){return this.http.post('/forgot-password',{body:_assign({clientId:this.config.clientId},params)});};ApiClient.prototype.updatePassword=function(params){var accessToken=params.accessToken,data=__rest(params,["accessToken"]);return this.http.post('/update-password',{body:_assign({clientId:this.config.clientId},data),accessToken:accessToken});};ApiClient.prototype.updateEmail=function(params){var accessToken=params.accessToken,email=params.email,redirectUrl=params.redirectUrl;return this.http.post('/update-email',{body:{email:email,redirectUrl:redirectUrl},accessToken:accessToken});};ApiClient.prototype.updatePhoneNumber=function(params){var accessToken=params.accessToken,data=__rest(params,["accessToken"]);return this.http.post('/update-phone-number',{body:data,accessToken:accessToken});};ApiClient.prototype.verifyPhoneNumber=function(_a){var _this=this;var accessToken=_a.accessToken,data=__rest(_a,["accessToken"]);var phoneNumber=data.phoneNumber;return this.http.post('/verify-phone-number',{body:data,accessToken:accessToken}).then(function(){return _this.eventManager.fireEvent('profile_updated',{phoneNumber:phoneNumber,phoneNumberVerified:true});});};ApiClient.prototype.unlink=function(_a){var accessToken=_a.accessToken,data=__rest(_a,["accessToken"]);return this.http.post('/unlink',{body:data,accessToken:accessToken});};ApiClient.prototype.refreshTokens=function(params){var result='refreshToken'in params?this.http.post(this.tokenUrl,{body:_assign({clientId:this.config.clientId,grantType:'refresh_token',refreshToken:params.refreshToken},pick_1(params,'scope'))}):this.http.post('/token/access-token',{body:{clientId:this.config.clientId,accessToken:params.accessToken}});return result.then(enrichAuthResult);};ApiClient.prototype.getUser=function(_a){var accessToken=_a.accessToken,fields=_a.fields;return this.http.get('/userinfo',{query:{fields:fields},accessToken:accessToken});};ApiClient.prototype.updateProfile=function(_a){var _this=this;var accessToken=_a.accessToken,redirectUrl=_a.redirectUrl,data=_a.data;return this.http.post('/update-profile',{body:_assign(_assign({},data),{redirectUrl:redirectUrl}),accessToken:accessToken}).then(function(){return _this.eventManager.fireEvent('profile_updated',data);});};ApiClient.prototype.loginWithCustomToken=function(_a){var token=_a.token,auth=_a.auth;var queryString=toQueryString(_assign(_assign({},this.authParams(auth)),{token:token}));window.location.assign(this.baseUrl+"/custom-token/login?"+queryString);};ApiClient.prototype.loginWithCredentials=function(params){var _this=this;if(navigator.credentials&&navigator.credentials.get){var request={password:true,mediation:params.mediation||'silent'};return navigator.credentials.get(request).then(function(credentials){if(!isUndefined_1(credentials)&&credentials instanceof PasswordCredential&&credentials.password){var loginParams={email:credentials.id,password:credentials.password,auth:params.auth};return _this.ropcPasswordLogin(loginParams);}return Promise.reject(new Error('Invalid credentials'));});}else {return Promise.reject(new Error('Unsupported Credentials Management API'));}};ApiClient.prototype.signupWithWebAuthn=function(params,auth){var _this=this;if(window.PublicKeyCredential){var body={origin:window.location.origin,clientId:this.config.clientId,friendlyName:params.friendlyName||window.navigator.platform,profile:params.profile,scope:this.resolveScope(auth),redirectUrl:params.redirectUrl,returnToAfterEmailConfirmation:params.returnToAfterEmailConfirmation};var registrationOptionsPromise=this.http.post('/webauthn/signup-options',{body:body});var credentialsPromise=registrationOptionsPromise.then(function(response){var publicKey=encodePublicKeyCredentialCreationOptions(response.options.publicKey);return navigator.credentials.create({publicKey:publicKey});});return Promise.all([registrationOptionsPromise,credentialsPromise]).then(function(_a){var registrationOptions=_a[0],credentials=_a[1];if(!credentials||credentials.type!==publicKeyCredentialType){return Promise.reject(new Error('Unable to register invalid public key credentials.'));}var serializedCredentials=serializeRegistrationPublicKeyCredential(credentials);return _this.http.post('/webauthn/signup',{body:{publicKeyCredential:serializedCredentials,webauthnId:registrationOptions.options.publicKey.user.id}}).then(function(tkn){return _this.loginCallback(tkn,auth);});})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);});}else {return Promise.reject(new Error('Unsupported WebAuthn API'));}};ApiClient.prototype.addNewWebAuthnDevice=function(accessToken,friendlyName){var _this=this;if(window.PublicKeyCredential){var body={origin:window.location.origin,friendlyName:friendlyName||window.navigator.platform};return this.http.post('/webauthn/registration-options',{body:body,accessToken:accessToken}).then(function(response){var publicKey=encodePublicKeyCredentialCreationOptions(response.options.publicKey);return navigator.credentials.create({publicKey:publicKey});}).then(function(credentials){if(!credentials||credentials.type!==publicKeyCredentialType){return Promise.reject(new Error('Unable to register invalid public key credentials.'));}var serializedCredentials=serializeRegistrationPublicKeyCredential(credentials);return _this.http.post('/webauthn/registration',{body:_assign({},serializedCredentials),accessToken:accessToken});})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);});}else {return Promise.reject(new Error('Unsupported WebAuthn API'));}};ApiClient.prototype.loginWithWebAuthn=function(params){var _this=this;if(window.PublicKeyCredential){var body={clientId:this.config.clientId,origin:window.location.origin,scope:this.resolveScope(params.auth),email:params.email,phoneNumber:params.phoneNumber};return this.http.post('/webauthn/authentication-options',{body:body}).then(function(response){var options=encodePublicKeyCredentialRequestOptions(response.publicKey);return navigator.credentials.get({publicKey:options});}).then(function(credentials){if(!credentials||credentials.type!==publicKeyCredentialType){return Promise.reject(new Error('Unable to authenticate with invalid public key credentials.'));}var serializedCredentials=serializeAuthenticationPublicKeyCredential(credentials);return _this.http.post('/webauthn/authentication',{body:_assign({},serializedCredentials)}).then(function(tkn){return _this.loginCallback(tkn,params.auth);});})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);});}else {return Promise.reject(new Error('Unsupported WebAuthn API'));}};ApiClient.prototype.listWebAuthnDevices=function(accessToken){return this.http.get('/webauthn/registration',{accessToken:accessToken});};ApiClient.prototype.removeWebAuthnDevice=function(accessToken,deviceId){return this.http.remove("/webauthn/registration/"+deviceId,{accessToken:accessToken});};ApiClient.prototype.startMfaPhoneNumberRegistration=function(params){var accessToken=params.accessToken,phoneNumber=params.phoneNumber;return this.http.post('/mfa/credentials/phone-numbers',{body:{phoneNumber:phoneNumber},accessToken:accessToken});};ApiClient.prototype.verifyMfaPhoneNumberRegistration=function(params){var accessToken=params.accessToken,verificationCode=params.verificationCode;return this.http.post('/mfa/credentials/phone-numbers/verify',{body:{verificationCode:verificationCode},accessToken:accessToken});};ApiClient.prototype.startMfaEmailRegistration=function(params){var accessToken=params.accessToken;return this.http.post('/mfa/credentials/emails',{accessToken:accessToken});};ApiClient.prototype.verifyMfaEmailRegistration=function(params){var accessToken=params.accessToken,verificationCode=params.verificationCode;return this.http.post('/mfa/credentials/emails/verify',{body:{verificationCode:verificationCode},accessToken:accessToken});};ApiClient.prototype.getMfaStepUpToken=function(params){var _this=this;var _a;var authParams=this.authParams((_a=params.options)!==null&&_a!==void 0?_a:{});return this.getPkceParams(authParams).then(function(challenge){return _this.http.post('/mfa/stepup',{body:_assign(_assign({},authParams),challenge),withCookies:params.accessToken===undefined,accessToken:params.accessToken});});};ApiClient.prototype.listMfaCredentials=function(accessToken){return this.http.get('/mfa/credentials',{accessToken:accessToken});};ApiClient.prototype.removeMfaPhoneNumber=function(params){var accessToken=params.accessToken,phoneNumber=params.phoneNumber;return this.http.remove('/mfa/credentials/phone-numbers',{body:{phoneNumber:phoneNumber},accessToken:accessToken});};ApiClient.prototype.removeMfaEmail=function(params){var accessToken=params.accessToken;return this.http.remove('/mfa/credentials/emails',{accessToken:accessToken});};ApiClient.prototype.getSessionInfo=function(){return this.http.get('/sso/data',{query:{clientId:this.config.clientId},withCookies:true});};ApiClient.prototype.getPkceParams=function(authParams){if(this.config.isPublic&&authParams.responseType==='code')return computePkceParams();else if(authParams.responseType==='token'&&this.config.pkceEnforced)return Promise.reject(new Error('Cannot use implicit flow when PKCE is enforced'));else return Promise.resolve({});};ApiClient.prototype.resolveScope=function(opts){if(opts===void 0){opts={};}return resolveScope(opts,this.config.scope);};ApiClient.prototype.authParams=function(opts,_a){var _b=(_a===void 0?{}:_a).acceptPopupMode,acceptPopupMode=_b===void 0?false:_b;var isConfidentialCodeWebMsg=!this.config.isPublic&&!!opts.useWebMessage&&(opts.responseType==='code'||opts.redirectUri);var overrideResponseType=isConfidentialCodeWebMsg?{responseType:'token',redirectUri:undefined}:{};return _assign({clientId:this.config.clientId},computeAuthOptions(_assign(_assign({},opts),overrideResponseType),{acceptPopupMode:acceptPopupMode},this.config.scope));};return ApiClient;}();function redirect(location){window.location.assign(location);return Promise.resolve();}function hasLoggedWithEmail(params){return params.email!==undefined;}function computeProviderPopupOptions(provider){try{var opts=popupSize(provider);var left=Math.max(0,(screen.width-opts.width)/2);var top_1=Math.max(0,(screen.height-opts.height)/2);var width=Math.min(screen.width,opts.width);var height=Math.min(screen.height,opts.height);return "menubar=0,toolbar=0,resizable=1,scrollbars=1,width="+width+",height="+height+",top="+top_1+",left="+left;}catch(e){return 'menubar=0,toolbar=0,resizable=1,scrollbars=1,width=960,height=680';}}var EventManager=/** @class */function(){function EventManager(){this.listeners={};}EventManager.prototype.fire=function(name,data){this.getListeners(name).forEach(function(listener){try{listener(data);}catch(e){logError(e);}});};EventManager.prototype.on=function(name,listener){this.getListeners(name).push(listener);};EventManager.prototype.off=function(name,listener){pull_1(this.getListeners(name),listener);};EventManager.prototype.getListeners=function(name){var listeners=this.listeners[name];if(!listeners){listeners=this.listeners[name]=[];}return listeners;};return EventManager;}();function createEventManager(){var eventManager=new EventManager();return {on:function on(eventName,listener){eventManager.on(eventName,listener);},off:function off(eventName,listener){eventManager.off(eventName,listener);},fireEvent:function fireEvent(eventName,data){if(eventName==='authenticated'){var ar=enrichAuthResult(data);eventManager.fire(eventName,ar);}else {eventManager.fire(eventName,data);}}};}function createUrlParser(eventManager){return {checkUrlFragment:function checkUrlFragment(url){var authResult=this.parseUrlFragment(url);if(AuthResult.isAuthResult(authResult)){eventManager.fireEvent('authenticated',authResult);return true;}else if(ErrorResponse.isErrorResponse(authResult)){eventManager.fireEvent('authentication_failed',authResult);return true;}return false;},parseUrlFragment:function parseUrlFragment(url){if(url===void 0){url='';}var separatorIndex=url.indexOf('#');if(separatorIndex>=0){var parsed=parseQueryString(url.substr(separatorIndex+1));var expiresIn=parsed.expiresIn?parseInt(parsed.expiresIn,10):undefined;if(AuthResult.isAuthResult(parsed)){return _assign(_assign({},parsed),{expiresIn:expiresIn});}return ErrorResponse.isErrorResponse(parsed)?parsed:undefined;}return undefined;}};}function checkParam(data,key){var value=data[key];if(value===undefined||value===null){throw new Error("The reach5 creation config has errors: "+key+" is not set");}}function createClient(creationConfig){checkParam(creationConfig,'domain');checkParam(creationConfig,'clientId');var domain=creationConfig.domain,clientId=creationConfig.clientId,language=creationConfig.language;var eventManager=createEventManager();var urlParser=createUrlParser(eventManager);var remoteSettings=rawRequest("https://"+domain+"/identity/v1/config?"+toQueryString({clientId:clientId,lang:language}));var apiClient=remoteSettings.then(function(remoteConfig){return new ApiClient({config:_assign(_assign({},creationConfig),remoteConfig),eventManager:eventManager,urlParser:urlParser});});function addNewWebAuthnDevice(accessToken,friendlyName){return apiClient.then(function(api){return api.addNewWebAuthnDevice(accessToken,friendlyName);});}function checkSession(options){if(options===void 0){options={};}return apiClient.then(function(api){return api.checkSession(options);});}function checkUrlFragment(url){if(url===void 0){url=window.location.href;}var authResponseDetected=urlParser.checkUrlFragment(url);if(authResponseDetected&&url===window.location.href){window.location.hash='';}return authResponseDetected;}function exchangeAuthorizationCodeWithPkce(params){return apiClient.then(function(api){return api.exchangeAuthorizationCodeWithPkce(params);});}function getSessionInfo(){return apiClient.then(function(api){return api.getSessionInfo();});}function getSignupData(signupToken){return apiClient.then(function(api){return api.getSignupData(signupToken);});}function getUser(params){return apiClient.then(function(api){return api.getUser(params);});}function listWebAuthnDevices(accessToken){return apiClient.then(function(api){return api.listWebAuthnDevices(accessToken);});}function loginFromSession(options){if(options===void 0){options={};}return apiClient.then(function(api){return api.loginFromSession(options);});}function loginWithCredentials(params){return apiClient.then(function(api){return api.loginWithCredentials(params);});}function loginWithCustomToken(params){return apiClient.then(function(api){return api.loginWithCustomToken(params);});}function loginWithPassword(params){return apiClient.then(function(api){return api.loginWithPassword(params);});}function loginWithSocialProvider(provider,options){if(options===void 0){options={};}return apiClient.then(function(api){return api.loginWithSocialProvider(provider,options);});}function loginWithWebAuthn(params){return apiClient.then(function(api){return api.loginWithWebAuthn(params);});}function logout(params){if(params===void 0){params={};}return apiClient.then(function(api){return api.logout(params);});}function off(eventName,listener){return eventManager.off(eventName,listener);}function on(eventName,listener){eventManager.on(eventName,listener);if(eventName==='authenticated'||eventName==='authentication_failed'){// This call must be asynchronous to ensure the listener cannot be called synchronously
|
|
8363
|
+
OAuthClient.prototype.resolveSingleFactorPasswordlessParams=function(params,auth){if(auth===void 0){auth={};}var authType=params.authType,email=params.email,phoneNumber=params.phoneNumber,captchaToken=params.captchaToken;if(this.config.orchestrationToken){var authParams=this.orchestratedFlowParams(this.config.orchestrationToken,auth);return Promise.resolve(_assign(_assign({},authParams),{authType:authType,email:email,phoneNumber:phoneNumber,captchaToken:captchaToken}));}else {var authParams_2=this.authParams(auth);return this.getPkceParams(authParams_2).then(function(maybeChallenge){return _assign(_assign(_assign({},authParams_2),{authType:authType,email:email,phoneNumber:phoneNumber,captchaToken:captchaToken}),maybeChallenge);});}};OAuthClient.prototype.hasLoggedWithEmail=function(params){return params.email!==undefined;};// TODO: Shared among the clients
|
|
8364
|
+
OAuthClient.prototype.loginCallback=function(tkn,auth){var _this=this;if(auth===void 0){auth={};}if(this.config.orchestrationToken){var authParams_3=_assign(_assign({},this.orchestratedFlowParams(this.config.orchestrationToken,auth)),pick_1(tkn,'tkn'));return Promise.resolve().then(function(_){return _this.redirectThruAuthorization(authParams_3);});}else {var authParams_4=this.authParams(auth);return this.getPkceParams(authParams_4).then(function(maybeChallenge){var params=_assign(_assign(_assign({},authParams_4),maybeChallenge),pick_1(tkn,'tkn'));if(auth.useWebMessage){return _this.getWebMessage(_this.getAuthorizationUrl(params),_this.config.baseUrl,auth.redirectUri);}else {return _this.redirectThruAuthorization(params);}});}};// In an orchestrated flow, only parameters from the original request are to be considered,
|
|
8365
|
+
// as well as parameters that depend on user action
|
|
8366
|
+
OAuthClient.prototype.orchestratedFlowParams=function(orchestrationToken,authOptions){if(authOptions===void 0){authOptions={};}var authParams=computeAuthOptions(authOptions);var correctedAuthParams=_assign({clientId:this.config.clientId,r5_request_token:orchestrationToken},pick_1(authParams,'responseType','redirectUri','clientId','persistent'));var uselessParams=difference_1(keys_1(authParams),keys_1(correctedAuthParams));if(uselessParams.length!==0)console.debug("Orchestrated flow: pruned parameters: "+uselessParams);return correctedAuthParams;};OAuthClient.prototype.authParams=function(opts,_a){var _b=(_a===void 0?{}:_a).acceptPopupMode,acceptPopupMode=_b===void 0?false:_b;var isConfidentialCodeWebMsg=!this.config.isPublic&&!!opts.useWebMessage&&(opts.responseType==='code'||opts.redirectUri);var overrideResponseType=isConfidentialCodeWebMsg?{responseType:'token',redirectUri:undefined}:{};return _assign({clientId:this.config.clientId},computeAuthOptions(_assign(_assign({},opts),overrideResponseType),{acceptPopupMode:acceptPopupMode},this.config.scope));};OAuthClient.prototype.getPkceParams=function(authParams){if(this.config.isPublic&&authParams.responseType==='code')return computePkceParams();else if(authParams.responseType==='token'&&this.config.pkceEnforced)return Promise.reject(new Error('Cannot use implicit flow when PKCE is enforced'));else return Promise.resolve({});};return OAuthClient;}();var EventManager=/** @class */function(){function EventManager(){this.listeners={};}EventManager.prototype.fire=function(name,data){this.getListeners(name).forEach(function(listener){try{listener(data);}catch(e){logError(e);}});};EventManager.prototype.on=function(name,listener){this.getListeners(name).push(listener);};EventManager.prototype.off=function(name,listener){pull_1(this.getListeners(name),listener);};EventManager.prototype.getListeners=function(name){var listeners=this.listeners[name];if(!listeners){listeners=this.listeners[name]=[];}return listeners;};return EventManager;}();function createEventManager(){var eventManager=new EventManager();return {on:function on(eventName,listener){eventManager.on(eventName,listener);},off:function off(eventName,listener){eventManager.off(eventName,listener);},fireEvent:function fireEvent(eventName,data){if(eventName==='authenticated'){var ar=enrichAuthResult(data);eventManager.fire(eventName,ar);}else {eventManager.fire(eventName,data);}}};}function createUrlParser(eventManager){return {checkUrlFragment:function checkUrlFragment(url){var authResult=this.parseUrlFragment(url);if(AuthResult.isAuthResult(authResult)){eventManager.fireEvent('authenticated',authResult);return true;}else if(ErrorResponse.isErrorResponse(authResult)){eventManager.fireEvent('authentication_failed',authResult);return true;}return false;},parseUrlFragment:function parseUrlFragment(url){if(url===void 0){url='';}var separatorIndex=url.indexOf('#');if(separatorIndex>=0){var parsed=parseQueryString(url.substr(separatorIndex+1));var expiresIn=parsed.expiresIn?parseInt(parsed.expiresIn,10):undefined;if(AuthResult.isAuthResult(parsed)){return _assign(_assign({},parsed),{expiresIn:expiresIn});}return ErrorResponse.isErrorResponse(parsed)?parsed:undefined;}return undefined;}};}function createHttpClient(config){function get(path,params){return request(path,_assign(_assign({},params),{method:'GET'}));}function remove(path,params){return request(path,_assign(_assign({},params),{method:'DELETE'}));}function post(path,params){return request(path,_assign(_assign({},params),{method:'POST'}));}function request(path,params){var _a=params.method,method=_a===void 0?'GET':_a,_b=params.query,query=_b===void 0?{}:_b,body=params.body,_c=params.accessToken,accessToken=_c===void 0?null:_c,_d=params.withCookies,withCookies=_d===void 0?false:_d;var fullPath=query&&!isEmpty_1(query)?path+"?"+toQueryString(query):path;var url=fullPath.startsWith('http')?fullPath:config.baseUrl+fullPath;var fetchOptions=_assign(_assign({method:method,headers:_assign(_assign(_assign({},accessToken&&{Authorization:'Bearer '+accessToken}),config.language&&{'Accept-Language':config.language}),body&&{'Content-Type':'application/json;charset=UTF-8'})},withCookies&&config.acceptCookies&&{credentials:'include'}),body&&{body:JSON.stringify(snakeCaseProperties(body))});return rawRequest(url,fetchOptions);}return {get:get,remove:remove,post:post,request:request};}/**
|
|
8367
|
+
* Low level HTTP client
|
|
8368
|
+
*/function rawRequest(url,fetchOptions){return fetch(url,fetchOptions).then(function(response){if(response.status!==204){var dataP=response.json().then(camelCaseProperties);return response.ok?dataP:dataP.then(function(data){return Promise.reject(data);});}return undefined;});}function initCordovaCallbackIfNecessary(urlParser){if(!window.cordova)return;if(window.handleOpenURL)return;window.handleOpenURL=function(url){var cordova=window.cordova;if(!cordova)return;var parsed=urlParser.checkUrlFragment(url);if(parsed&&cordova.plugins&&cordova.plugins.browsertab){cordova.plugins.browsertab.close();}};}/**
|
|
8369
|
+
* Identity Rest API Client
|
|
8370
|
+
*/var MfaClient=/** @class */function(){function MfaClient(props){this.http=props.http;this.oAuthClient=props.oAuthClient;this.credentialsUrl='/mfa/credentials';this.emailCredentialUrl=this.credentialsUrl+"/emails";this.emailCredentialVerifyUrl=this.emailCredentialUrl+"/verify";this.passwordlessVerifyUrl='/passwordless/verify';this.phoneNumberCredentialUrl=this.credentialsUrl+"/phone-numbers";this.phoneNumberCredentialVerifyUrl=this.phoneNumberCredentialUrl+"/verify";this.stepUpUrl='/mfa/stepup';}MfaClient.prototype.getMfaStepUpToken=function(params){var _this=this;var _a;var authParams=this.oAuthClient.authParams((_a=params.options)!==null&&_a!==void 0?_a:{});return this.oAuthClient.getPkceParams(authParams).then(function(challenge){return _this.http.post(_this.stepUpUrl,{body:_assign(_assign({},authParams),challenge),withCookies:params.accessToken===undefined,accessToken:params.accessToken});});};MfaClient.prototype.listMfaCredentials=function(accessToken){return this.http.get(this.credentialsUrl,{accessToken:accessToken});};MfaClient.prototype.removeMfaEmail=function(params){var accessToken=params.accessToken;return this.http.remove(this.emailCredentialUrl,{accessToken:accessToken});};MfaClient.prototype.removeMfaPhoneNumber=function(params){var accessToken=params.accessToken,phoneNumber=params.phoneNumber;return this.http.remove(this.phoneNumberCredentialUrl,{body:{phoneNumber:phoneNumber},accessToken:accessToken});};MfaClient.prototype.startMfaEmailRegistration=function(params){var accessToken=params.accessToken;return this.http.post(this.emailCredentialUrl,{accessToken:accessToken});};MfaClient.prototype.startMfaPhoneNumberRegistration=function(params){var accessToken=params.accessToken,phoneNumber=params.phoneNumber;return this.http.post(this.phoneNumberCredentialUrl,{body:{phoneNumber:phoneNumber},accessToken:accessToken});};MfaClient.prototype.verifyMfaEmailRegistration=function(params){var accessToken=params.accessToken,verificationCode=params.verificationCode;return this.http.post(this.emailCredentialVerifyUrl,{body:{verificationCode:verificationCode},accessToken:accessToken});};MfaClient.prototype.verifyMfaPasswordless=function(params){var challengeId=params.challengeId,verificationCode=params.verificationCode,accessToken=params.accessToken;return this.http.post(this.passwordlessVerifyUrl,{body:{challengeId:challengeId,verificationCode:verificationCode},accessToken:accessToken});};MfaClient.prototype.verifyMfaPhoneNumberRegistration=function(params){var accessToken=params.accessToken,verificationCode=params.verificationCode;return this.http.post(this.phoneNumberCredentialVerifyUrl,{body:{verificationCode:verificationCode},accessToken:accessToken});};return MfaClient;}();/**
|
|
8371
|
+
* Identity Rest API Client
|
|
8372
|
+
*/var ProfileClient=/** @class */function(){function ProfileClient(props){this.config=props.config;this.http=props.http;this.eventManager=props.eventManager;this.sendEmailVerificationUrl='/send-email-verification';this.sendPhoneNumberVerificationUrl='/send-phone-number-verification';this.signupDataUrl='/signup/data';this.unlinkUrl='/unlink';this.updateEmailUrl='/update-email';this.updatePasswordUrl='/update-password';this.updatePhoneNumberUrl='/update-phone-number';this.updateProfileUrl='/update-profile';this.userInfoUrl='/userinfo';this.verifyPhoneNumberUrl='/verify-phone-number';}ProfileClient.prototype.getSignupData=function(signupToken){return this.http.get(this.signupDataUrl,{query:{clientId:this.config.clientId,token:signupToken}});};ProfileClient.prototype.getUser=function(params){var accessToken=params.accessToken,fields=params.fields;return this.http.get(this.userInfoUrl,{query:{fields:fields},accessToken:accessToken});};ProfileClient.prototype.requestPasswordReset=function(params){return this.http.post('/forgot-password',{body:_assign({clientId:this.config.clientId},params)});};ProfileClient.prototype.sendEmailVerification=function(params){var accessToken=params.accessToken,data=__rest(params,["accessToken"]);return this.http.post(this.sendEmailVerificationUrl,{body:_assign({},data),accessToken:accessToken});};ProfileClient.prototype.sendPhoneNumberVerification=function(params){var accessToken=params.accessToken;return this.http.post(this.sendPhoneNumberVerificationUrl,{accessToken:accessToken});};ProfileClient.prototype.unlink=function(params){var accessToken=params.accessToken,data=__rest(params,["accessToken"]);return this.http.post(this.unlinkUrl,{body:data,accessToken:accessToken});};ProfileClient.prototype.updateEmail=function(params){var accessToken=params.accessToken,email=params.email,redirectUrl=params.redirectUrl;return this.http.post(this.updateEmailUrl,{body:{email:email,redirectUrl:redirectUrl},accessToken:accessToken});};ProfileClient.prototype.updatePhoneNumber=function(params){var accessToken=params.accessToken,data=__rest(params,["accessToken"]);return this.http.post(this.updatePhoneNumberUrl,{body:data,accessToken:accessToken});};ProfileClient.prototype.updateProfile=function(params){var _this=this;var accessToken=params.accessToken,redirectUrl=params.redirectUrl,data=params.data;return this.http.post(this.updateProfileUrl,{body:_assign(_assign({},data),{redirectUrl:redirectUrl}),accessToken:accessToken}).then(function(){return _this.eventManager.fireEvent('profile_updated',data);});};ProfileClient.prototype.updatePassword=function(params){var accessToken=params.accessToken,data=__rest(params,["accessToken"]);return this.http.post(this.updatePasswordUrl,{body:_assign({clientId:this.config.clientId},data),accessToken:accessToken});};ProfileClient.prototype.verifyPhoneNumber=function(params){var _this=this;var accessToken=params.accessToken,data=__rest(params,["accessToken"]);var phoneNumber=data.phoneNumber;return this.http.post(this.verifyPhoneNumberUrl,{body:data,accessToken:accessToken}).then(function(){return _this.eventManager.fireEvent('profile_updated',{phoneNumber:phoneNumber,phoneNumberVerified:true});});};return ProfileClient;}();var publicKeyCredentialType='public-key';function encodePublicKeyCredentialCreationOptions(serializedOptions){return _assign(_assign({},serializedOptions),{challenge:buffer_1.from(serializedOptions.challenge,'base64'),user:_assign(_assign({},serializedOptions.user),{id:buffer_1.from(serializedOptions.user.id,'base64')}),excludeCredentials:serializedOptions.excludeCredentials&&serializedOptions.excludeCredentials.map(function(excludeCredential){return _assign(_assign({},excludeCredential),{id:buffer_1.from(excludeCredential.id,'base64')});})});}function encodePublicKeyCredentialRequestOptions(serializedOptions){return _assign(_assign({},serializedOptions),{challenge:buffer_1.from(serializedOptions.challenge,'base64'),allowCredentials:serializedOptions.allowCredentials.map(function(allowCrendential){return _assign(_assign({},allowCrendential),{id:buffer_1.from(allowCrendential.id,'base64')});})});}function serializeRegistrationPublicKeyCredential(encodedPublicKey){var response=encodedPublicKey.response;return {id:encodedPublicKey.id,rawId:encodeToBase64(encodedPublicKey.rawId),type:encodedPublicKey.type,response:{clientDataJSON:encodeToBase64(response.clientDataJSON),attestationObject:encodeToBase64(response.attestationObject)}};}function serializeAuthenticationPublicKeyCredential(encodedPublicKey){var response=encodedPublicKey.response;return {id:encodedPublicKey.id,rawId:encodeToBase64(encodedPublicKey.rawId),type:encodedPublicKey.type,response:{authenticatorData:encodeToBase64(response.authenticatorData),clientDataJSON:encodeToBase64(response.clientDataJSON),signature:encodeToBase64(response.signature),userHandle:response.userHandle&&encodeToBase64(response.userHandle)}};}/**
|
|
8373
|
+
* Identity Rest API Client
|
|
8374
|
+
*/var WebAuthnClient=/** @class */function(){function WebAuthnClient(props){this.authenticationOptionsUrl='/webauthn/authentication-options';this.authenticationUrl='/webauthn/authentication';this.registrationOptionsUrl='/webauthn/registration-options';this.registrationUrl='/webauthn/registration';this.signupOptionsUrl='/webauthn/signup-options';this.signupUrl='/webauthn/signup';this.config=props.config;this.http=props.http;this.eventManager=props.eventManager;this.oAuthClient=props.oAuthClient;this.authenticationOptionsUrl='/webauthn/authentication-options';this.authenticationUrl='/webauthn/authentication';this.registrationOptionsUrl='/webauthn/registration-options';this.registrationUrl='/webauthn/registration';this.signupOptionsUrl='/webauthn/signup-options';this.signupUrl='/webauthn/signup';}WebAuthnClient.prototype.addNewWebAuthnDevice=function(accessToken,friendlyName){var _this=this;if(window.PublicKeyCredential){var body={origin:window.location.origin,friendlyName:friendlyName||window.navigator.platform};return this.http.post(this.registrationOptionsUrl,{body:body,accessToken:accessToken}).then(function(response){var publicKey=encodePublicKeyCredentialCreationOptions(response.options.publicKey);return navigator.credentials.create({publicKey:publicKey});}).then(function(credentials){if(!credentials||credentials.type!==publicKeyCredentialType){return Promise.reject(new Error('Unable to register invalid public key credentials.'));}var serializedCredentials=serializeRegistrationPublicKeyCredential(credentials);return _this.http.post(_this.registrationUrl,{body:_assign({},serializedCredentials),accessToken:accessToken});})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);});}else {return Promise.reject(new Error('Unsupported WebAuthn API'));}};WebAuthnClient.prototype.listWebAuthnDevices=function(accessToken){return this.http.get(this.registrationUrl,{accessToken:accessToken});};WebAuthnClient.prototype.loginWithWebAuthn=function(params){var _this=this;if(window.PublicKeyCredential){var body={clientId:this.config.clientId,origin:window.location.origin,scope:resolveScope(params.auth,this.config.scope),email:params.email,phoneNumber:params.phoneNumber};return this.http.post(this.authenticationOptionsUrl,{body:body}).then(function(response){var options=encodePublicKeyCredentialRequestOptions(response.publicKey);return navigator.credentials.get({publicKey:options});}).then(function(credentials){if(!credentials||credentials.type!==publicKeyCredentialType){return Promise.reject(new Error('Unable to authenticate with invalid public key credentials.'));}var serializedCredentials=serializeAuthenticationPublicKeyCredential(credentials);return _this.http.post(_this.authenticationUrl,{body:_assign({},serializedCredentials)}).then(function(tkn){return _this.oAuthClient.loginCallback(tkn,params.auth);});})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);});}else {return Promise.reject(new Error('Unsupported WebAuthn API'));}};WebAuthnClient.prototype.removeWebAuthnDevice=function(accessToken,deviceId){return this.http.remove(this.registrationUrl+"/"+deviceId,{accessToken:accessToken});};WebAuthnClient.prototype.signupWithWebAuthn=function(params,auth){var _this=this;if(window.PublicKeyCredential){var body={origin:window.location.origin,clientId:this.config.clientId,friendlyName:params.friendlyName||window.navigator.platform,profile:params.profile,scope:resolveScope(auth,this.config.scope),redirectUrl:params.redirectUrl,returnToAfterEmailConfirmation:params.returnToAfterEmailConfirmation};var registrationOptionsPromise=this.http.post(this.signupOptionsUrl,{body:body});var credentialsPromise=registrationOptionsPromise.then(function(response){var publicKey=encodePublicKeyCredentialCreationOptions(response.options.publicKey);return navigator.credentials.create({publicKey:publicKey});});return Promise.all([registrationOptionsPromise,credentialsPromise]).then(function(_a){var registrationOptions=_a[0],credentials=_a[1];if(!credentials||credentials.type!==publicKeyCredentialType){return Promise.reject(new Error('Unable to register invalid public key credentials.'));}var serializedCredentials=serializeRegistrationPublicKeyCredential(credentials);return _this.http.post(_this.signupUrl,{body:{publicKeyCredential:serializedCredentials,webauthnId:registrationOptions.options.publicKey.user.id}}).then(function(tkn){return _this.oAuthClient.loginCallback(tkn,auth);});})["catch"](function(err){if(err.error)_this.eventManager.fireEvent('login_failed',err);return Promise.reject(err);});}else {return Promise.reject(new Error('Unsupported WebAuthn API'));}};return WebAuthnClient;}();function checkParam(data,key){var value=data[key];if(value===undefined||value===null){throw new Error("The reach5 creation config has errors: "+key+" is not set");}}function createClient(creationConfig){checkParam(creationConfig,'domain');checkParam(creationConfig,'clientId');var domain=creationConfig.domain,clientId=creationConfig.clientId,language=creationConfig.language;var eventManager=createEventManager();var urlParser=createUrlParser(eventManager);initCordovaCallbackIfNecessary(urlParser);var baseUrl="https://"+domain;var baseIdentityUrl=baseUrl+"/identity/v1";var remoteSettings=rawRequest("https://"+domain+"/identity/v1/config?"+toQueryString({clientId:clientId,lang:language}));var apiClients=remoteSettings.then(function(remoteConfig){var language=remoteConfig.language,sso=remoteConfig.sso;var params=new URLSearchParams(window.location.search);var orchestrationToken=params.get('r5_request_token')||undefined;var config=_assign({clientId:clientId,baseUrl:baseUrl,orchestrationToken:orchestrationToken},remoteConfig);var http=createHttpClient({baseUrl:baseIdentityUrl,language:language,acceptCookies:sso});var oAuthClient=new OAuthClient({config:config,http:http,eventManager:eventManager});return {oAuth:oAuthClient,mfa:new MfaClient({http:http,oAuthClient:oAuthClient}),webAuthn:new WebAuthnClient({config:config,http:http,eventManager:eventManager,oAuthClient:oAuthClient}),profile:new ProfileClient({config:config,http:http,eventManager:eventManager})};});function addNewWebAuthnDevice(accessToken,friendlyName){return apiClients.then(function(clients){return clients.webAuthn.addNewWebAuthnDevice(accessToken,friendlyName);});}function checkSession(options){if(options===void 0){options={};}return apiClients.then(function(clients){return clients.oAuth.checkSession(options);});}function checkUrlFragment(url){if(url===void 0){url=window.location.href;}var authResponseDetected=urlParser.checkUrlFragment(url);if(authResponseDetected&&url===window.location.href){window.location.hash='';}return authResponseDetected;}function exchangeAuthorizationCodeWithPkce(params){return apiClients.then(function(clients){return clients.oAuth.exchangeAuthorizationCodeWithPkce(params);});}function getMfaStepUpToken(params){return apiClients.then(function(clients){return clients.mfa.getMfaStepUpToken(params);});}function getSessionInfo(){return apiClients.then(function(clients){return clients.oAuth.getSessionInfo();});}function getSignupData(signupToken){return apiClients.then(function(clients){return clients.profile.getSignupData(signupToken);});}function getUser(params){return apiClients.then(function(clients){return clients.profile.getUser(params);});}function listMfaCredentials(accessToken){return apiClients.then(function(clients){return clients.mfa.listMfaCredentials(accessToken);});}function listWebAuthnDevices(accessToken){return apiClients.then(function(clients){return clients.webAuthn.listWebAuthnDevices(accessToken);});}function loginFromSession(options){if(options===void 0){options={};}return apiClients.then(function(clients){return clients.oAuth.loginFromSession(options);});}function loginWithCredentials(params){return apiClients.then(function(clients){return clients.oAuth.loginWithCredentials(params);});}function loginWithCustomToken(params){return apiClients.then(function(clients){return clients.oAuth.loginWithCustomToken(params);});}function loginWithPassword(params){return apiClients.then(function(clients){return clients.oAuth.loginWithPassword(params);});}function instantiateOneTap(opts){if(opts===void 0){opts={};}return apiClients.then(function(clients){return clients.oAuth.instantiateOneTap(opts);});}function loginWithSocialProvider(provider,options){if(options===void 0){options={};}return apiClients.then(function(clients){return clients.oAuth.loginWithSocialProvider(provider,options);});}function loginWithWebAuthn(params){return apiClients.then(function(clients){return clients.webAuthn.loginWithWebAuthn(params);});}function logout(params){if(params===void 0){params={};}return apiClients.then(function(clients){return clients.oAuth.logout(params);});}function off(eventName,listener){return eventManager.off(eventName,listener);}function on(eventName,listener){eventManager.on(eventName,listener);if(eventName==='authenticated'||eventName==='authentication_failed'){// This call must be asynchronous to ensure the listener cannot be called synchronously
|
|
8239
8375
|
// (this type of behavior is generally unexpected for the developer)
|
|
8240
|
-
setTimeout(function(){return checkUrlFragment();},0);}}function refreshTokens(params){return
|
|
8376
|
+
setTimeout(function(){return checkUrlFragment();},0);}}function refreshTokens(params){return apiClients.then(function(clients){return clients.oAuth.refreshTokens(params);});}function removeMfaEmail(params){return apiClients.then(function(clients){return clients.mfa.removeMfaEmail(params);});}function removeMfaPhoneNumber(params){return apiClients.then(function(clients){return clients.mfa.removeMfaPhoneNumber(params);});}function removeWebAuthnDevice(accessToken,deviceId){return apiClients.then(function(clients){return clients.webAuthn.removeWebAuthnDevice(accessToken,deviceId);});}function requestPasswordReset(params){return apiClients.then(function(clients){return clients.profile.requestPasswordReset(params);});}function sendEmailVerification(params){return apiClients.then(function(clients){return clients.profile.sendEmailVerification(params);});}function sendPhoneNumberVerification(params){return apiClients.then(function(clients){return clients.profile.sendPhoneNumberVerification(params);});}function signup(params){return apiClients.then(function(clients){return clients.oAuth.signup(params);});}function signupWithWebAuthn(params,auth){return apiClients.then(function(clients){return clients.webAuthn.signupWithWebAuthn(params,auth);});}function startMfaEmailRegistration(params){return apiClients.then(function(clients){return clients.mfa.startMfaEmailRegistration(params);});}function startMfaPhoneNumberRegistration(params){return apiClients.then(function(clients){return clients.mfa.startMfaPhoneNumberRegistration(params);});}function startPasswordless(params,options){if(options===void 0){options={};}return apiClients.then(function(clients){return clients.oAuth.startPasswordless(params,options);});}function unlink(params){return apiClients.then(function(clients){return clients.profile.unlink(params);});}function updateEmail(params){return apiClients.then(function(clients){return clients.profile.updateEmail(params);});}function updatePassword(params){return apiClients.then(function(clients){return clients.profile.updatePassword(params);});}function updatePhoneNumber(params){return apiClients.then(function(clients){return clients.profile.updatePhoneNumber(params);});}function updateProfile(params){return apiClients.then(function(clients){return clients.profile.updateProfile(params);});}function verifyMfaEmailRegistration(params){return apiClients.then(function(clients){return clients.mfa.verifyMfaEmailRegistration(params);});}function verifyMfaPasswordless(params){return apiClients.then(function(clients){return clients.mfa.verifyMfaPasswordless(params);});}function verifyMfaPhoneNumberRegistration(params){return apiClients.then(function(clients){return clients.mfa.verifyMfaPhoneNumberRegistration(params);});}function verifyPasswordless(params,auth){return apiClients.then(function(clients){return clients.oAuth.verifyPasswordless(params,auth);});}function verifyPhoneNumber(params){return apiClients.then(function(clients){return clients.profile.verifyPhoneNumber(params);});}return {addNewWebAuthnDevice:addNewWebAuthnDevice,checkSession:checkSession,checkUrlFragment:checkUrlFragment,exchangeAuthorizationCodeWithPkce:exchangeAuthorizationCodeWithPkce,getMfaStepUpToken:getMfaStepUpToken,getSessionInfo:getSessionInfo,getSignupData:getSignupData,getUser:getUser,listMfaCredentials:listMfaCredentials,listWebAuthnDevices:listWebAuthnDevices,loginFromSession:loginFromSession,loginWithCredentials:loginWithCredentials,loginWithCustomToken:loginWithCustomToken,loginWithPassword:loginWithPassword,instantiateOneTap:instantiateOneTap,loginWithSocialProvider:loginWithSocialProvider,loginWithWebAuthn:loginWithWebAuthn,logout:logout,off:off,on:on,refreshTokens:refreshTokens,remoteSettings:remoteSettings,removeMfaEmail:removeMfaEmail,removeMfaPhoneNumber:removeMfaPhoneNumber,removeWebAuthnDevice:removeWebAuthnDevice,requestPasswordReset:requestPasswordReset,sendEmailVerification:sendEmailVerification,sendPhoneNumberVerification:sendPhoneNumberVerification,signup:signup,signupWithWebAuthn:signupWithWebAuthn,startMfaEmailRegistration:startMfaEmailRegistration,startMfaPhoneNumberRegistration:startMfaPhoneNumberRegistration,startPasswordless:startPasswordless,unlink:unlink,updateEmail:updateEmail,updatePassword:updatePassword,updatePhoneNumber:updatePhoneNumber,updateProfile:updateProfile,verifyMfaEmailRegistration:verifyMfaEmailRegistration,verifyMfaPasswordless:verifyMfaPasswordless,verifyMfaPhoneNumberRegistration:verifyMfaPhoneNumberRegistration,verifyPasswordless:verifyPasswordless,verifyPhoneNumber:verifyPhoneNumber};}
|
|
8241
8377
|
|
|
8242
8378
|
/*
|
|
8243
8379
|
object-assign
|
|
@@ -17891,7 +18027,7 @@
|
|
|
17891
18027
|
|
|
17892
18028
|
/** Used as the size to enable large array optimizations. */
|
|
17893
18029
|
|
|
17894
|
-
var LARGE_ARRAY_SIZE$
|
|
18030
|
+
var LARGE_ARRAY_SIZE$3 = 200;
|
|
17895
18031
|
/**
|
|
17896
18032
|
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
|
|
17897
18033
|
*
|
|
@@ -17913,7 +18049,7 @@
|
|
|
17913
18049
|
if (comparator) {
|
|
17914
18050
|
isCommon = false;
|
|
17915
18051
|
includes = arrayIncludesWith$1;
|
|
17916
|
-
} else if (length >= LARGE_ARRAY_SIZE$
|
|
18052
|
+
} else if (length >= LARGE_ARRAY_SIZE$3) {
|
|
17917
18053
|
var set = iteratee ? null : createSet$1(array);
|
|
17918
18054
|
|
|
17919
18055
|
if (set) {
|
|
@@ -18047,7 +18183,7 @@
|
|
|
18047
18183
|
* // => false
|
|
18048
18184
|
*/
|
|
18049
18185
|
|
|
18050
|
-
function isArrayLikeObject(value) {
|
|
18186
|
+
function isArrayLikeObject$1(value) {
|
|
18051
18187
|
return isObjectLike$1(value) && isArrayLike$1(value);
|
|
18052
18188
|
}
|
|
18053
18189
|
|
|
@@ -18069,7 +18205,7 @@
|
|
|
18069
18205
|
*/
|
|
18070
18206
|
|
|
18071
18207
|
var union = baseRest$1(function (arrays) {
|
|
18072
|
-
return baseUniq$1(baseFlatten$1(arrays, 1, isArrayLikeObject, true));
|
|
18208
|
+
return baseUniq$1(baseFlatten$1(arrays, 1, isArrayLikeObject$1, true));
|
|
18073
18209
|
});
|
|
18074
18210
|
|
|
18075
18211
|
/**
|
|
@@ -39544,11 +39680,12 @@
|
|
|
39544
39680
|
|
|
39545
39681
|
/* Returns whether a form value has been set with a valid value.
|
|
39546
39682
|
* If the user's input has been enriched as an object, raw input is expected
|
|
39547
|
-
* to be in a
|
|
39683
|
+
* to be in a raw property field (named 'raw' by default).
|
|
39548
39684
|
*/
|
|
39549
39685
|
|
|
39550
39686
|
function isValued(v) {
|
|
39551
|
-
var
|
|
39687
|
+
var rawProperty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'raw';
|
|
39688
|
+
var unwrap = isObject$2(v) ? v[rawProperty] : v;
|
|
39552
39689
|
return unwrap !== null && unwrap !== undefined && unwrap !== '' && !Number.isNaN(unwrap) && (Array.isArray(unwrap) ? unwrap.length > 0 : true);
|
|
39553
39690
|
}
|
|
39554
39691
|
function formatISO8601Date(year, month, day) {
|
|
@@ -40205,7 +40342,7 @@
|
|
|
40205
40342
|
|
|
40206
40343
|
/** Used as the size to enable large array optimizations. */
|
|
40207
40344
|
|
|
40208
|
-
var LARGE_ARRAY_SIZE$
|
|
40345
|
+
var LARGE_ARRAY_SIZE$4 = 200;
|
|
40209
40346
|
/**
|
|
40210
40347
|
* Sets the stack `key` to `value`.
|
|
40211
40348
|
*
|
|
@@ -40223,7 +40360,7 @@
|
|
|
40223
40360
|
if (data instanceof ListCache$1) {
|
|
40224
40361
|
var pairs = data.__data__;
|
|
40225
40362
|
|
|
40226
|
-
if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE$
|
|
40363
|
+
if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE$4 - 1) {
|
|
40227
40364
|
pairs.push([key, value]);
|
|
40228
40365
|
this.size = ++data.size;
|
|
40229
40366
|
return this;
|
|
@@ -44295,6 +44432,8 @@
|
|
|
44295
44432
|
return !isEmpty$1(x) ? x : null;
|
|
44296
44433
|
}
|
|
44297
44434
|
} : _ref$format,
|
|
44435
|
+
_ref$rawProperty = _ref.rawProperty,
|
|
44436
|
+
rawProperty = _ref$rawProperty === void 0 ? 'raw' : _ref$rawProperty,
|
|
44298
44437
|
component = _ref.component,
|
|
44299
44438
|
_ref$extendedParams = _ref.extendedParams,
|
|
44300
44439
|
extendedParams = _ref$extendedParams === void 0 ? {} : _ref$extendedParams;
|
|
@@ -44328,7 +44467,7 @@
|
|
|
44328
44467
|
},
|
|
44329
44468
|
initialize: function initialize(model) {
|
|
44330
44469
|
var modelValue = mapping.bind(model);
|
|
44331
|
-
var initValue = isValued(modelValue) ? modelValue : defaultValue;
|
|
44470
|
+
var initValue = isValued(modelValue, rawProperty) ? modelValue : defaultValue;
|
|
44332
44471
|
return {
|
|
44333
44472
|
value: format.bind(initValue),
|
|
44334
44473
|
isDirty: false
|
|
@@ -51447,7 +51586,7 @@
|
|
|
51447
51586
|
|
|
51448
51587
|
/** Used as the size to enable large array optimizations. */
|
|
51449
51588
|
|
|
51450
|
-
var LARGE_ARRAY_SIZE$
|
|
51589
|
+
var LARGE_ARRAY_SIZE$5 = 200;
|
|
51451
51590
|
/**
|
|
51452
51591
|
* The base implementation of methods like `_.difference` without support
|
|
51453
51592
|
* for excluding multiple arrays or iteratee shorthands.
|
|
@@ -51460,7 +51599,7 @@
|
|
|
51460
51599
|
* @returns {Array} Returns the new array of filtered values.
|
|
51461
51600
|
*/
|
|
51462
51601
|
|
|
51463
|
-
function baseDifference(array, values, iteratee, comparator) {
|
|
51602
|
+
function baseDifference$1(array, values, iteratee, comparator) {
|
|
51464
51603
|
var index = -1,
|
|
51465
51604
|
includes = arrayIncludes$2,
|
|
51466
51605
|
isCommon = true,
|
|
@@ -51479,7 +51618,7 @@
|
|
|
51479
51618
|
if (comparator) {
|
|
51480
51619
|
includes = arrayIncludesWith$1;
|
|
51481
51620
|
isCommon = false;
|
|
51482
|
-
} else if (values.length >= LARGE_ARRAY_SIZE$
|
|
51621
|
+
} else if (values.length >= LARGE_ARRAY_SIZE$5) {
|
|
51483
51622
|
includes = cacheHas$1;
|
|
51484
51623
|
isCommon = false;
|
|
51485
51624
|
values = new SetCache$1(values);
|
|
@@ -51530,8 +51669,8 @@
|
|
|
51530
51669
|
* // => [1]
|
|
51531
51670
|
*/
|
|
51532
51671
|
|
|
51533
|
-
var difference = baseRest$1(function (array, values) {
|
|
51534
|
-
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten$1(values, 1, isArrayLikeObject, true)) : [];
|
|
51672
|
+
var difference$1 = baseRest$1(function (array, values) {
|
|
51673
|
+
return isArrayLikeObject$1(array) ? baseDifference$1(array, baseFlatten$1(values, 1, isArrayLikeObject$1, true)) : [];
|
|
51535
51674
|
});
|
|
51536
51675
|
|
|
51537
51676
|
/**
|
|
@@ -51819,7 +51958,7 @@
|
|
|
51819
51958
|
*/
|
|
51820
51959
|
|
|
51821
51960
|
function castArrayLikeObject(value) {
|
|
51822
|
-
return isArrayLikeObject(value) ? value : [];
|
|
51961
|
+
return isArrayLikeObject$1(value) ? value : [];
|
|
51823
51962
|
}
|
|
51824
51963
|
|
|
51825
51964
|
/**
|
|
@@ -55037,6 +55176,7 @@
|
|
|
55037
55176
|
}
|
|
55038
55177
|
},
|
|
55039
55178
|
validator: config.required ? checked : empty,
|
|
55179
|
+
rawProperty: 'granted',
|
|
55040
55180
|
component: ConsentField
|
|
55041
55181
|
}));
|
|
55042
55182
|
}
|
|
@@ -56316,7 +56456,7 @@
|
|
|
56316
56456
|
|
|
56317
56457
|
return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement(Info, null, this.props.i18n('passwordless.sms.verification.intro')), /*#__PURE__*/react.createElement(VerificationCodeInputForm$1, {
|
|
56318
56458
|
handler: function handler(data) {
|
|
56319
|
-
return ReCaptcha.handle(data, _this4.props, _this4.
|
|
56459
|
+
return ReCaptcha.handle(data, _this4.props, _this4.handleSubmit, "verify_passwordless_sms");
|
|
56320
56460
|
}
|
|
56321
56461
|
}));
|
|
56322
56462
|
}
|
|
@@ -56608,7 +56748,7 @@
|
|
|
56608
56748
|
providers: config.socialProviders
|
|
56609
56749
|
}, options), {}, {
|
|
56610
56750
|
getAvailableProviders: function getAvailableProviders(identities) {
|
|
56611
|
-
return difference(options.providers || config.socialProviders, identities.map(function (i) {
|
|
56751
|
+
return difference$1(options.providers || config.socialProviders, identities.map(function (i) {
|
|
56612
56752
|
return i.provider;
|
|
56613
56753
|
}));
|
|
56614
56754
|
}
|