mazey 3.6.6 → 3.6.7

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/lib/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * mazey v3.6.6
2
+ * mazey v3.6.7
3
3
  * (c) 2018-2023 Mazey Chu
4
4
  * Released under the MIT License.
5
5
  */
@@ -1121,7 +1121,7 @@ var isConstructor = !construct || fails(function () {
1121
1121
  }) ? isConstructorLegacy : isConstructorModern;
1122
1122
 
1123
1123
  var SPECIES$6 = wellKnownSymbol('species');
1124
- var $Array$2 = Array;
1124
+ var $Array$3 = Array;
1125
1125
 
1126
1126
  // a part of `ArraySpeciesCreate` abstract operation
1127
1127
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
@@ -1130,12 +1130,12 @@ var arraySpeciesConstructor = function (originalArray) {
1130
1130
  if (isArray(originalArray)) {
1131
1131
  C = originalArray.constructor;
1132
1132
  // cross-realm fallback
1133
- if (isConstructor(C) && (C === $Array$2 || isArray(C.prototype))) C = undefined;
1133
+ if (isConstructor(C) && (C === $Array$3 || isArray(C.prototype))) C = undefined;
1134
1134
  else if (isObject(C)) {
1135
1135
  C = C[SPECIES$6];
1136
1136
  if (C === null) C = undefined;
1137
1137
  }
1138
- } return C === undefined ? $Array$2 : C;
1138
+ } return C === undefined ? $Array$3 : C;
1139
1139
  };
1140
1140
 
1141
1141
  // `ArraySpeciesCreate` abstract operation
@@ -1397,7 +1397,7 @@ var NativeRegExp = global_1.RegExp;
1397
1397
  var RegExpPrototype$2 = NativeRegExp.prototype;
1398
1398
  var SyntaxError = global_1.SyntaxError;
1399
1399
  var exec$1 = functionUncurryThis(RegExpPrototype$2.exec);
1400
- var charAt$5 = functionUncurryThis(''.charAt);
1400
+ var charAt$6 = functionUncurryThis(''.charAt);
1401
1401
  var replace$3 = functionUncurryThis(''.replace);
1402
1402
  var stringIndexOf$2 = functionUncurryThis(''.indexOf);
1403
1403
  var stringSlice$7 = functionUncurryThis(''.slice);
@@ -1426,9 +1426,9 @@ var handleDotAll = function (string) {
1426
1426
  var brackets = false;
1427
1427
  var chr;
1428
1428
  for (; index <= length; index++) {
1429
- chr = charAt$5(string, index);
1429
+ chr = charAt$6(string, index);
1430
1430
  if (chr === '\\') {
1431
- result += chr + charAt$5(string, ++index);
1431
+ result += chr + charAt$6(string, ++index);
1432
1432
  continue;
1433
1433
  }
1434
1434
  if (!brackets && chr === '.') {
@@ -1455,9 +1455,9 @@ var handleNCG = function (string) {
1455
1455
  var groupname = '';
1456
1456
  var chr;
1457
1457
  for (; index <= length; index++) {
1458
- chr = charAt$5(string, index);
1458
+ chr = charAt$6(string, index);
1459
1459
  if (chr === '\\') {
1460
- chr = chr + charAt$5(string, ++index);
1460
+ chr = chr + charAt$6(string, ++index);
1461
1461
  } else if (chr === ']') {
1462
1462
  brackets = false;
1463
1463
  } else if (!brackets) switch (true) {
@@ -1570,14 +1570,14 @@ setSpecies('RegExp');
1570
1570
 
1571
1571
 
1572
1572
 
1573
- var getInternalState = internalState.get;
1573
+ var getInternalState$1 = internalState.get;
1574
1574
 
1575
1575
 
1576
1576
 
1577
1577
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
1578
1578
  var nativeExec = RegExp.prototype.exec;
1579
1579
  var patchedExec = nativeExec;
1580
- var charAt$4 = functionUncurryThis(''.charAt);
1580
+ var charAt$5 = functionUncurryThis(''.charAt);
1581
1581
  var indexOf = functionUncurryThis(''.indexOf);
1582
1582
  var replace$2 = functionUncurryThis(''.replace);
1583
1583
  var stringSlice$6 = functionUncurryThis(''.slice);
@@ -1600,7 +1600,7 @@ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || rege
1600
1600
  if (PATCH) {
1601
1601
  patchedExec = function exec(string) {
1602
1602
  var re = this;
1603
- var state = getInternalState(re);
1603
+ var state = getInternalState$1(re);
1604
1604
  var str = toString_1(string);
1605
1605
  var raw = state.raw;
1606
1606
  var result, reCopy, lastIndex, match, i, object, group;
@@ -1627,7 +1627,7 @@ if (PATCH) {
1627
1627
 
1628
1628
  strCopy = stringSlice$6(str, re.lastIndex);
1629
1629
  // Support anchored sticky behavior.
1630
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
1630
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$5(str, re.lastIndex - 1) !== '\n')) {
1631
1631
  source = '(?: ' + source + ')';
1632
1632
  strCopy = ' ' + strCopy;
1633
1633
  charsAdded++;
@@ -1684,7 +1684,7 @@ _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
1684
1684
  exec: regexpExec
1685
1685
  });
1686
1686
 
1687
- var PROPER_FUNCTION_NAME = functionName.PROPER;
1687
+ var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
1688
1688
 
1689
1689
 
1690
1690
 
@@ -1697,7 +1697,7 @@ var nativeToString = RegExpPrototype$1[TO_STRING];
1697
1697
 
1698
1698
  var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
1699
1699
  // FF44- RegExp#toString has a wrong name
1700
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING;
1700
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name != TO_STRING;
1701
1701
 
1702
1702
  // `RegExp.prototype.toString` method
1703
1703
  // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
@@ -1791,7 +1791,7 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1791
1791
  if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
1792
1792
  };
1793
1793
 
1794
- var charAt$3 = functionUncurryThis(''.charAt);
1794
+ var charAt$4 = functionUncurryThis(''.charAt);
1795
1795
  var charCodeAt$1 = functionUncurryThis(''.charCodeAt);
1796
1796
  var stringSlice$5 = functionUncurryThis(''.slice);
1797
1797
 
@@ -1806,7 +1806,7 @@ var createMethod$3 = function (CONVERT_TO_STRING) {
1806
1806
  return first < 0xD800 || first > 0xDBFF || position + 1 === size
1807
1807
  || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
1808
1808
  ? CONVERT_TO_STRING
1809
- ? charAt$3(S, position)
1809
+ ? charAt$4(S, position)
1810
1810
  : first
1811
1811
  : CONVERT_TO_STRING
1812
1812
  ? stringSlice$5(S, position, position + 2)
@@ -1823,12 +1823,12 @@ var stringMultibyte = {
1823
1823
  charAt: createMethod$3(true)
1824
1824
  };
1825
1825
 
1826
- var charAt$2 = stringMultibyte.charAt;
1826
+ var charAt$3 = stringMultibyte.charAt;
1827
1827
 
1828
1828
  // `AdvanceStringIndex` abstract operation
1829
1829
  // https://tc39.es/ecma262/#sec-advancestringindex
1830
1830
  var advanceStringIndex = function (S, index, unicode) {
1831
- return index + (unicode ? charAt$2(S, index).length : 1);
1831
+ return index + (unicode ? charAt$3(S, index).length : 1);
1832
1832
  };
1833
1833
 
1834
1834
  var $TypeError$a = TypeError;
@@ -1929,7 +1929,7 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBind
1929
1929
  });
1930
1930
 
1931
1931
  var floor$1 = Math.floor;
1932
- var charAt$1 = functionUncurryThis(''.charAt);
1932
+ var charAt$2 = functionUncurryThis(''.charAt);
1933
1933
  var replace$1 = functionUncurryThis(''.replace);
1934
1934
  var stringSlice$4 = functionUncurryThis(''.slice);
1935
1935
  // eslint-disable-next-line redos/no-vulnerable -- safe
@@ -1948,7 +1948,7 @@ var getSubstitution = function (matched, str, position, captures, namedCaptures,
1948
1948
  }
1949
1949
  return replace$1(replacement, symbols, function (match, ch) {
1950
1950
  var capture;
1951
- switch (charAt$1(ch, 0)) {
1951
+ switch (charAt$2(ch, 0)) {
1952
1952
  case '$': return '$';
1953
1953
  case '&': return matched;
1954
1954
  case '`': return stringSlice$4(str, 0, position);
@@ -1962,7 +1962,7 @@ var getSubstitution = function (matched, str, position, captures, namedCaptures,
1962
1962
  if (n > m) {
1963
1963
  var f = floor$1(n / 10);
1964
1964
  if (f === 0) return match;
1965
- if (f <= m) return captures[f - 1] === undefined ? charAt$1(ch, 1) : captures[f - 1] + charAt$1(ch, 1);
1965
+ if (f <= m) return captures[f - 1] === undefined ? charAt$2(ch, 1) : captures[f - 1] + charAt$2(ch, 1);
1966
1966
  return match;
1967
1967
  }
1968
1968
  capture = captures[n - 1];
@@ -2197,7 +2197,7 @@ var arraySlice = functionUncurryThis([].slice);
2197
2197
  var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
2198
2198
 
2199
2199
  var SPECIES$2 = wellKnownSymbol('species');
2200
- var $Array$1 = Array;
2200
+ var $Array$2 = Array;
2201
2201
  var max$2 = Math.max;
2202
2202
 
2203
2203
  // `Array.prototype.slice` method
@@ -2214,17 +2214,17 @@ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
2214
2214
  if (isArray(O)) {
2215
2215
  Constructor = O.constructor;
2216
2216
  // cross-realm fallback
2217
- if (isConstructor(Constructor) && (Constructor === $Array$1 || isArray(Constructor.prototype))) {
2217
+ if (isConstructor(Constructor) && (Constructor === $Array$2 || isArray(Constructor.prototype))) {
2218
2218
  Constructor = undefined;
2219
2219
  } else if (isObject(Constructor)) {
2220
2220
  Constructor = Constructor[SPECIES$2];
2221
2221
  if (Constructor === null) Constructor = undefined;
2222
2222
  }
2223
- if (Constructor === $Array$1 || Constructor === undefined) {
2223
+ if (Constructor === $Array$2 || Constructor === undefined) {
2224
2224
  return arraySlice(O, k, fin);
2225
2225
  }
2226
2226
  }
2227
- result = new (Constructor === undefined ? $Array$1 : Constructor)(max$2(fin - k, 0));
2227
+ result = new (Constructor === undefined ? $Array$2 : Constructor)(max$2(fin - k, 0));
2228
2228
  for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
2229
2229
  result.length = n;
2230
2230
  return result;
@@ -2405,20 +2405,20 @@ var stringTrim = {
2405
2405
  var trim$1 = stringTrim.trim;
2406
2406
 
2407
2407
 
2408
- var charAt = functionUncurryThis(''.charAt);
2408
+ var charAt$1 = functionUncurryThis(''.charAt);
2409
2409
  var $parseFloat = global_1.parseFloat;
2410
2410
  var Symbol$1 = global_1.Symbol;
2411
- var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
2411
+ var ITERATOR$5 = Symbol$1 && Symbol$1.iterator;
2412
2412
  var FORCED$2 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
2413
2413
  // MS Edge 18- broken with boxed symbols
2414
- || (ITERATOR$3 && !fails(function () { $parseFloat(Object(ITERATOR$3)); }));
2414
+ || (ITERATOR$5 && !fails(function () { $parseFloat(Object(ITERATOR$5)); }));
2415
2415
 
2416
2416
  // `parseFloat` method
2417
2417
  // https://tc39.es/ecma262/#sec-parsefloat-string
2418
2418
  var numberParseFloat = FORCED$2 ? function parseFloat(string) {
2419
2419
  var trimmedString = trim$1(toString_1(string));
2420
2420
  var result = $parseFloat(trimmedString);
2421
- return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
2421
+ return result === 0 && charAt$1(trimmedString, 0) == '-' ? -0 : result;
2422
2422
  } : $parseFloat;
2423
2423
 
2424
2424
  // `parseFloat` method
@@ -2445,14 +2445,14 @@ var speciesConstructor = function (O, defaultConstructor) {
2445
2445
  return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
2446
2446
  };
2447
2447
 
2448
- var $Array = Array;
2448
+ var $Array$1 = Array;
2449
2449
  var max$1 = Math.max;
2450
2450
 
2451
2451
  var arraySliceSimple = function (O, start, end) {
2452
2452
  var length = lengthOfArrayLike(O);
2453
2453
  var k = toAbsoluteIndex(start, length);
2454
2454
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
2455
- var result = $Array(max$1(fin - k, 0));
2455
+ var result = $Array$1(max$1(fin - k, 0));
2456
2456
  for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
2457
2457
  result.length = n;
2458
2458
  return result;
@@ -3090,7 +3090,7 @@ var FORCED_PROMISE_CONSTRUCTOR$4 = promiseConstructorDetection.CONSTRUCTOR;
3090
3090
  var NATIVE_PROMISE_REJECTION_EVENT = promiseConstructorDetection.REJECTION_EVENT;
3091
3091
  var NATIVE_PROMISE_SUBCLASSING = promiseConstructorDetection.SUBCLASSING;
3092
3092
  var getInternalPromiseState = internalState.getterFor(PROMISE);
3093
- var setInternalState = internalState.set;
3093
+ var setInternalState$1 = internalState.set;
3094
3094
  var NativePromisePrototype$1 = promiseNativeConstructor && promiseNativeConstructor.prototype;
3095
3095
  var PromiseConstructor = promiseNativeConstructor;
3096
3096
  var PromisePrototype = NativePromisePrototype$1;
@@ -3274,7 +3274,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
3274
3274
 
3275
3275
  // eslint-disable-next-line no-unused-vars -- required for `.length`
3276
3276
  Internal = function Promise(executor) {
3277
- setInternalState(this, {
3277
+ setInternalState$1(this, {
3278
3278
  type: PROMISE,
3279
3279
  done: false,
3280
3280
  notified: false,
@@ -3351,18 +3351,18 @@ setSpecies(PROMISE);
3351
3351
 
3352
3352
  var iterators = {};
3353
3353
 
3354
- var ITERATOR$2 = wellKnownSymbol('iterator');
3354
+ var ITERATOR$4 = wellKnownSymbol('iterator');
3355
3355
  var ArrayPrototype = Array.prototype;
3356
3356
 
3357
3357
  // check on default Array iterator
3358
3358
  var isArrayIteratorMethod = function (it) {
3359
- return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$2] === it);
3359
+ return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$4] === it);
3360
3360
  };
3361
3361
 
3362
- var ITERATOR$1 = wellKnownSymbol('iterator');
3362
+ var ITERATOR$3 = wellKnownSymbol('iterator');
3363
3363
 
3364
3364
  var getIteratorMethod = function (it) {
3365
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$1)
3365
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$3)
3366
3366
  || getMethod(it, '@@iterator')
3367
3367
  || iterators[classof(it)];
3368
3368
  };
@@ -3453,7 +3453,7 @@ var iterate = function (iterable, unboundFunction, options) {
3453
3453
  } return new Result(false);
3454
3454
  };
3455
3455
 
3456
- var ITERATOR = wellKnownSymbol('iterator');
3456
+ var ITERATOR$2 = wellKnownSymbol('iterator');
3457
3457
  var SAFE_CLOSING = false;
3458
3458
 
3459
3459
  try {
@@ -3466,7 +3466,7 @@ try {
3466
3466
  SAFE_CLOSING = true;
3467
3467
  }
3468
3468
  };
3469
- iteratorWithReturn[ITERATOR] = function () {
3469
+ iteratorWithReturn[ITERATOR$2] = function () {
3470
3470
  return this;
3471
3471
  };
3472
3472
  // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
@@ -3478,7 +3478,7 @@ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
3478
3478
  var ITERATION_SUPPORT = false;
3479
3479
  try {
3480
3480
  var object = {};
3481
- object[ITERATOR] = function () {
3481
+ object[ITERATOR$2] = function () {
3482
3482
  return {
3483
3483
  next: function () {
3484
3484
  return { done: ITERATION_SUPPORT = true };
@@ -3973,6 +3973,236 @@ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
3973
3973
  }
3974
3974
  });
3975
3975
 
3976
+ // call something on iterator step with safe closing on error
3977
+ var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
3978
+ try {
3979
+ return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
3980
+ } catch (error) {
3981
+ iteratorClose(iterator, 'throw', error);
3982
+ }
3983
+ };
3984
+
3985
+ var $Array = Array;
3986
+
3987
+ // `Array.from` method implementation
3988
+ // https://tc39.es/ecma262/#sec-array.from
3989
+ var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
3990
+ var O = toObject(arrayLike);
3991
+ var IS_CONSTRUCTOR = isConstructor(this);
3992
+ var argumentsLength = arguments.length;
3993
+ var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
3994
+ var mapping = mapfn !== undefined;
3995
+ if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
3996
+ var iteratorMethod = getIteratorMethod(O);
3997
+ var index = 0;
3998
+ var length, result, step, iterator, next, value;
3999
+ // if the target is not iterable or it's an array with the default iterator - use a simple case
4000
+ if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
4001
+ iterator = getIterator(O, iteratorMethod);
4002
+ next = iterator.next;
4003
+ result = IS_CONSTRUCTOR ? new this() : [];
4004
+ for (;!(step = functionCall(next, iterator)).done; index++) {
4005
+ value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
4006
+ createProperty(result, index, value);
4007
+ }
4008
+ } else {
4009
+ length = lengthOfArrayLike(O);
4010
+ result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
4011
+ for (;length > index; index++) {
4012
+ value = mapping ? mapfn(O[index], index) : O[index];
4013
+ createProperty(result, index, value);
4014
+ }
4015
+ }
4016
+ result.length = index;
4017
+ return result;
4018
+ };
4019
+
4020
+ var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
4021
+ // eslint-disable-next-line es/no-array-from -- required for testing
4022
+ Array.from(iterable);
4023
+ });
4024
+
4025
+ // `Array.from` method
4026
+ // https://tc39.es/ecma262/#sec-array.from
4027
+ _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
4028
+ from: arrayFrom
4029
+ });
4030
+
4031
+ var ITERATOR$1 = wellKnownSymbol('iterator');
4032
+ var BUGGY_SAFARI_ITERATORS$1 = false;
4033
+
4034
+ // `%IteratorPrototype%` object
4035
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
4036
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
4037
+
4038
+ /* eslint-disable es/no-array-prototype-keys -- safe */
4039
+ if ([].keys) {
4040
+ arrayIterator = [].keys();
4041
+ // Safari 8 has buggy iterators w/o `next`
4042
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
4043
+ else {
4044
+ PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
4045
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
4046
+ }
4047
+ }
4048
+
4049
+ var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails(function () {
4050
+ var test = {};
4051
+ // FF44- legacy iterators case
4052
+ return IteratorPrototype$2[ITERATOR$1].call(test) !== test;
4053
+ });
4054
+
4055
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
4056
+
4057
+ // `%IteratorPrototype%[@@iterator]()` method
4058
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
4059
+ if (!isCallable(IteratorPrototype$2[ITERATOR$1])) {
4060
+ defineBuiltIn(IteratorPrototype$2, ITERATOR$1, function () {
4061
+ return this;
4062
+ });
4063
+ }
4064
+
4065
+ var iteratorsCore = {
4066
+ IteratorPrototype: IteratorPrototype$2,
4067
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
4068
+ };
4069
+
4070
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
4071
+
4072
+
4073
+
4074
+
4075
+
4076
+ var returnThis$1 = function () { return this; };
4077
+
4078
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
4079
+ var TO_STRING_TAG = NAME + ' Iterator';
4080
+ IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
4081
+ setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
4082
+ iterators[TO_STRING_TAG] = returnThis$1;
4083
+ return IteratorConstructor;
4084
+ };
4085
+
4086
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
4087
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
4088
+ var IteratorPrototype = iteratorsCore.IteratorPrototype;
4089
+ var BUGGY_SAFARI_ITERATORS = iteratorsCore.BUGGY_SAFARI_ITERATORS;
4090
+ var ITERATOR = wellKnownSymbol('iterator');
4091
+ var KEYS = 'keys';
4092
+ var VALUES = 'values';
4093
+ var ENTRIES = 'entries';
4094
+
4095
+ var returnThis = function () { return this; };
4096
+
4097
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
4098
+ iteratorCreateConstructor(IteratorConstructor, NAME, next);
4099
+
4100
+ var getIterationMethod = function (KIND) {
4101
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
4102
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
4103
+ switch (KIND) {
4104
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
4105
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
4106
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
4107
+ } return function () { return new IteratorConstructor(this); };
4108
+ };
4109
+
4110
+ var TO_STRING_TAG = NAME + ' Iterator';
4111
+ var INCORRECT_VALUES_NAME = false;
4112
+ var IterablePrototype = Iterable.prototype;
4113
+ var nativeIterator = IterablePrototype[ITERATOR]
4114
+ || IterablePrototype['@@iterator']
4115
+ || DEFAULT && IterablePrototype[DEFAULT];
4116
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
4117
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
4118
+ var CurrentIteratorPrototype, methods, KEY;
4119
+
4120
+ // fix native
4121
+ if (anyNativeIterator) {
4122
+ CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
4123
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
4124
+ if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
4125
+ if (objectSetPrototypeOf) {
4126
+ objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
4127
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
4128
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
4129
+ }
4130
+ }
4131
+ // Set @@toStringTag to native iterators
4132
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
4133
+ }
4134
+ }
4135
+
4136
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
4137
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
4138
+ if (CONFIGURABLE_FUNCTION_NAME) {
4139
+ createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
4140
+ } else {
4141
+ INCORRECT_VALUES_NAME = true;
4142
+ defaultIterator = function values() { return functionCall(nativeIterator, this); };
4143
+ }
4144
+ }
4145
+
4146
+ // export additional methods
4147
+ if (DEFAULT) {
4148
+ methods = {
4149
+ values: getIterationMethod(VALUES),
4150
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
4151
+ entries: getIterationMethod(ENTRIES)
4152
+ };
4153
+ if (FORCED) for (KEY in methods) {
4154
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
4155
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
4156
+ }
4157
+ } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
4158
+ }
4159
+
4160
+ // define iterator
4161
+ if (IterablePrototype[ITERATOR] !== defaultIterator) {
4162
+ defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
4163
+ }
4164
+ iterators[NAME] = defaultIterator;
4165
+
4166
+ return methods;
4167
+ };
4168
+
4169
+ // `CreateIterResultObject` abstract operation
4170
+ // https://tc39.es/ecma262/#sec-createiterresultobject
4171
+ var createIterResultObject = function (value, done) {
4172
+ return { value: value, done: done };
4173
+ };
4174
+
4175
+ var charAt = stringMultibyte.charAt;
4176
+
4177
+
4178
+
4179
+
4180
+
4181
+ var STRING_ITERATOR = 'String Iterator';
4182
+ var setInternalState = internalState.set;
4183
+ var getInternalState = internalState.getterFor(STRING_ITERATOR);
4184
+
4185
+ // `String.prototype[@@iterator]` method
4186
+ // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
4187
+ iteratorDefine(String, 'String', function (iterated) {
4188
+ setInternalState(this, {
4189
+ type: STRING_ITERATOR,
4190
+ string: toString_1(iterated),
4191
+ index: 0
4192
+ });
4193
+ // `%StringIteratorPrototype%.next` method
4194
+ // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
4195
+ }, function next() {
4196
+ var state = getInternalState(this);
4197
+ var string = state.string;
4198
+ var index = state.index;
4199
+ var point;
4200
+ if (index >= string.length) return createIterResultObject(undefined, true);
4201
+ point = charAt(string, index);
4202
+ state.index += point.length;
4203
+ return createIterResultObject(point, false);
4204
+ });
4205
+
3976
4206
  /*! *****************************************************************************
3977
4207
  Copyright (c) Microsoft Corporation.
3978
4208
 
@@ -6604,5 +6834,64 @@ function getUrlFileType(url) {
6604
6834
  // }
6605
6835
  return ret;
6606
6836
  }
6837
+ /**
6838
+ * Sets the width and height of all images on the page based on their `src` attribute.
6839
+ * The `src` attribute should contain `width` and/or `height` values in the format "width=100" or "height=100".
6840
+ * If jQuery is available, this function uses jQuery to select the images. Otherwise, it uses pure JavaScript.
6841
+ *
6842
+ *
6843
+ * @example
6844
+ * ```
6845
+ * // Example images with `src` attributes containing `width` and/or `height` values
6846
+ * const img1 = document.createElement('img');
6847
+ * img1.setAttribute('src', 'https://example.com/example.png?width=2233&height=111');
6848
+ * document.body.appendChild(img1);
6849
+ *
6850
+ * const img2 = document.createElement('img');
6851
+ * img2.setAttribute('src', 'https://example.com/example.png?width=100%&height=auto');
6852
+ * document.body.appendChild(img2);
6853
+ * ```
6854
+ *
6855
+ * @returns {boolean} - Returns `true` if images were found and their dimensions were set, otherwise `false`.
6856
+ */
6857
+ function setImgWidHeiBySrc() {
6858
+ // Use jQuery if available, otherwise fall back to pure JavaScript
6859
+ var $ = window.jQuery || window.$;
6860
+ if ($) {
6861
+ // Use jQuery to select all images on the page
6862
+ $('img').each(function () {
6863
+ var $this = $(this);
6864
+ if (!$this) return;
6865
+ // Get the `src` attribute of the image
6866
+ var src = $this.attr('src');
6867
+ if (!src) return;
6868
+ // Use regular expressions to extract the `width` and `height` values from the `src` attribute
6869
+ var width = src.match(/width=([0-9]+[a-z%]*)/);
6870
+ var height = src.match(/height=([0-9]+[a-z%]*)/);
6871
+ // Set the width and height of the image using jQuery's `width()` and `height()` methods
6872
+ if (width && width[1]) $this.width(width[1]);
6873
+ if (height && height[1]) $this.height(height[1]);
6874
+ });
6875
+ return true;
6876
+ } else {
6877
+ // Use pure JavaScript to select all images on the page
6878
+ var images = document.getElementsByTagName('img');
6879
+ if (images.length > 0) {
6880
+ // Loop through each image and set its width and height based on the `src` attribute
6881
+ Array.from(images).forEach(function (img) {
6882
+ // Get the `src` attribute of the image
6883
+ var src = img.getAttribute('src');
6884
+ // Use regular expressions to extract the `width` and `height` values from the `src` attribute
6885
+ var width = src ? src.match(/width=([0-9]+[a-z%]*)/) : null;
6886
+ var height = src ? src.match(/height=([0-9]+[a-z%]*)/) : null;
6887
+ // Set the width and height of the image using the `style.width` and `style.height` properties
6888
+ if (width && width[1]) img.style.width = width[1];
6889
+ if (height && height[1]) img.style.height = height[1];
6890
+ });
6891
+ return true;
6892
+ }
6893
+ }
6894
+ return false;
6895
+ }
6607
6896
 
6608
- export { addClass, addEvent, addStyle, calLongestCommonSubsequence, calLongestCommonSubstring, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, cutCHSString, debounce, deepCopyObject, doFn, floatFixed, floatToPercent, formatDate, genCustomConsole, genHashCode, generateRndNum, generateUniqueNum, getBrowserInfo, getCookie, getDefineListeners, getDomain, getFileSize, getFriendlyInterval, getHashQueryParam, getLocalStorage, getPerformance, getQueryParam, getSessionStorage, getUrlFileType, getUrlParam, hasClass, inRate, invokeEvent, isJSONString, isJsonString, isNonEmptyArray, isNumber, isSafePWAEnv, isSupportWebp, isValidData, isValidEmail, isValidPhoneNumber, isValidUrl, loadCSS, loadScript, mNow, mTrim, newLine, removeClass, removeEvent, setCookie, setLocalStorage, setSessionStorage, throttle, truncateZHString, updateQueryParam, windowLoaded, zAxiosIsValidRes };
6897
+ export { addClass, addEvent, addStyle, calLongestCommonSubsequence, calLongestCommonSubstring, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, cutCHSString, debounce, deepCopyObject, doFn, floatFixed, floatToPercent, formatDate, genCustomConsole, genHashCode, generateRndNum, generateUniqueNum, getBrowserInfo, getCookie, getDefineListeners, getDomain, getFileSize, getFriendlyInterval, getHashQueryParam, getLocalStorage, getPerformance, getQueryParam, getSessionStorage, getUrlFileType, getUrlParam, hasClass, inRate, invokeEvent, isJSONString, isJsonString, isNonEmptyArray, isNumber, isSafePWAEnv, isSupportWebp, isValidData, isValidEmail, isValidPhoneNumber, isValidUrl, loadCSS, loadScript, mNow, mTrim, newLine, removeClass, removeEvent, setCookie, setImgWidHeiBySrc, setLocalStorage, setSessionStorage, throttle, truncateZHString, updateQueryParam, windowLoaded, zAxiosIsValidRes };