@mxenabled/connect-widget 2.16.2 → 2.17.1
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/dist/index.es.js +1243 -392
- package/dist/index.es.js.map +1 -1
- package/dist/lastBuild.txt +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1872,7 +1872,7 @@ var errors = process.env.NODE_ENV !== "production" ? [
|
|
|
1872
1872
|
function die(error, ...args) {
|
|
1873
1873
|
if (process.env.NODE_ENV !== "production") {
|
|
1874
1874
|
const e = errors[error];
|
|
1875
|
-
const msg =
|
|
1875
|
+
const msg = isFunction$4(e) ? e.apply(null, args) : e;
|
|
1876
1876
|
throw new Error(`[Immer] ${msg}`);
|
|
1877
1877
|
}
|
|
1878
1878
|
throw new Error(
|
|
@@ -1881,31 +1881,44 @@ function die(error, ...args) {
|
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
1883
|
// src/utils/common.ts
|
|
1884
|
-
var
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1884
|
+
var O$2 = Object;
|
|
1885
|
+
var getPrototypeOf$1 = O$2.getPrototypeOf;
|
|
1886
|
+
var CONSTRUCTOR = "constructor";
|
|
1887
|
+
var PROTOTYPE = "prototype";
|
|
1888
|
+
var CONFIGURABLE = "configurable";
|
|
1889
|
+
var ENUMERABLE = "enumerable";
|
|
1890
|
+
var WRITABLE = "writable";
|
|
1891
|
+
var VALUE = "value";
|
|
1892
|
+
var isDraft = (value) => !!value && !!value[DRAFT_STATE];
|
|
1888
1893
|
function isDraftable(value) {
|
|
1889
1894
|
if (!value)
|
|
1890
1895
|
return false;
|
|
1891
|
-
return isPlainObject$7(value) ||
|
|
1896
|
+
return isPlainObject$7(value) || isArray$j(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap$2(value) || isSet$2(value);
|
|
1892
1897
|
}
|
|
1893
|
-
var objectCtorString$1 =
|
|
1898
|
+
var objectCtorString$1 = O$2[PROTOTYPE][CONSTRUCTOR].toString();
|
|
1899
|
+
var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
|
|
1894
1900
|
function isPlainObject$7(value) {
|
|
1895
|
-
if (!value ||
|
|
1901
|
+
if (!value || !isObjectish(value))
|
|
1896
1902
|
return false;
|
|
1897
1903
|
const proto = getPrototypeOf$1(value);
|
|
1898
|
-
if (proto === null)
|
|
1904
|
+
if (proto === null || proto === O$2[PROTOTYPE])
|
|
1899
1905
|
return true;
|
|
1900
|
-
|
|
1901
|
-
const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
1906
|
+
const Ctor = O$2.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];
|
|
1902
1907
|
if (Ctor === Object)
|
|
1903
1908
|
return true;
|
|
1904
|
-
|
|
1909
|
+
if (!isFunction$4(Ctor))
|
|
1910
|
+
return false;
|
|
1911
|
+
let ctorString = cachedCtorStrings.get(Ctor);
|
|
1912
|
+
if (ctorString === void 0) {
|
|
1913
|
+
ctorString = Function.toString.call(Ctor);
|
|
1914
|
+
cachedCtorStrings.set(Ctor, ctorString);
|
|
1915
|
+
}
|
|
1916
|
+
return ctorString === objectCtorString$1;
|
|
1905
1917
|
}
|
|
1906
|
-
function each$1(obj, iter) {
|
|
1918
|
+
function each$1(obj, iter, strict = true) {
|
|
1907
1919
|
if (getArchtype(obj) === 0 /* Object */) {
|
|
1908
|
-
Reflect.ownKeys(obj).
|
|
1920
|
+
const keys = strict ? Reflect.ownKeys(obj) : O$2.keys(obj);
|
|
1921
|
+
keys.forEach((key) => {
|
|
1909
1922
|
iter(key, obj[key], obj);
|
|
1910
1923
|
});
|
|
1911
1924
|
} else {
|
|
@@ -1914,20 +1927,21 @@ function each$1(obj, iter) {
|
|
|
1914
1927
|
}
|
|
1915
1928
|
function getArchtype(thing) {
|
|
1916
1929
|
const state = thing[DRAFT_STATE];
|
|
1917
|
-
return state ? state.type_ :
|
|
1930
|
+
return state ? state.type_ : isArray$j(thing) ? 1 /* Array */ : isMap$2(thing) ? 2 /* Map */ : isSet$2(thing) ? 3 /* Set */ : 0 /* Object */;
|
|
1918
1931
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1932
|
+
var has$2 = (thing, prop, type = getArchtype(thing)) => type === 2 /* Map */ ? thing.has(prop) : O$2[PROTOTYPE].hasOwnProperty.call(thing, prop);
|
|
1933
|
+
var get$2 = (thing, prop, type = getArchtype(thing)) => (
|
|
1934
|
+
// @ts-ignore
|
|
1935
|
+
type === 2 /* Map */ ? thing.get(prop) : thing[prop]
|
|
1936
|
+
);
|
|
1937
|
+
var set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {
|
|
1938
|
+
if (type === 2 /* Map */)
|
|
1925
1939
|
thing.set(propOrOldValue, value);
|
|
1926
|
-
else if (
|
|
1940
|
+
else if (type === 3 /* Set */) {
|
|
1927
1941
|
thing.add(value);
|
|
1928
1942
|
} else
|
|
1929
1943
|
thing[propOrOldValue] = value;
|
|
1930
|
-
}
|
|
1944
|
+
};
|
|
1931
1945
|
function is(x, y) {
|
|
1932
1946
|
if (x === y) {
|
|
1933
1947
|
return x !== 0 || 1 / x === 1 / y;
|
|
@@ -1935,15 +1949,18 @@ function is(x, y) {
|
|
|
1935
1949
|
return x !== x && y !== y;
|
|
1936
1950
|
}
|
|
1937
1951
|
}
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
function
|
|
1945
|
-
|
|
1952
|
+
var isArray$j = Array.isArray;
|
|
1953
|
+
var isMap$2 = (target) => target instanceof Map;
|
|
1954
|
+
var isSet$2 = (target) => target instanceof Set;
|
|
1955
|
+
var isObjectish = (target) => typeof target === "object";
|
|
1956
|
+
var isFunction$4 = (target) => typeof target === "function";
|
|
1957
|
+
var isBoolean$1 = (target) => typeof target === "boolean";
|
|
1958
|
+
function isArrayIndex(value) {
|
|
1959
|
+
const n = +value;
|
|
1960
|
+
return Number.isInteger(n) && String(n) === value;
|
|
1946
1961
|
}
|
|
1962
|
+
var latest = (state) => state.copy_ || state.base_;
|
|
1963
|
+
var getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;
|
|
1947
1964
|
function shallowCopy(base, strict) {
|
|
1948
1965
|
if (isMap$2(base)) {
|
|
1949
1966
|
return new Map(base);
|
|
@@ -1951,63 +1968,77 @@ function shallowCopy(base, strict) {
|
|
|
1951
1968
|
if (isSet$2(base)) {
|
|
1952
1969
|
return new Set(base);
|
|
1953
1970
|
}
|
|
1954
|
-
if (
|
|
1955
|
-
return Array.
|
|
1971
|
+
if (isArray$j(base))
|
|
1972
|
+
return Array[PROTOTYPE].slice.call(base);
|
|
1956
1973
|
const isPlain = isPlainObject$7(base);
|
|
1957
1974
|
if (strict === true || strict === "class_only" && !isPlain) {
|
|
1958
|
-
const descriptors =
|
|
1975
|
+
const descriptors = O$2.getOwnPropertyDescriptors(base);
|
|
1959
1976
|
delete descriptors[DRAFT_STATE];
|
|
1960
1977
|
let keys = Reflect.ownKeys(descriptors);
|
|
1961
1978
|
for (let i = 0; i < keys.length; i++) {
|
|
1962
1979
|
const key = keys[i];
|
|
1963
1980
|
const desc = descriptors[key];
|
|
1964
|
-
if (desc
|
|
1965
|
-
desc
|
|
1966
|
-
desc
|
|
1981
|
+
if (desc[WRITABLE] === false) {
|
|
1982
|
+
desc[WRITABLE] = true;
|
|
1983
|
+
desc[CONFIGURABLE] = true;
|
|
1967
1984
|
}
|
|
1968
1985
|
if (desc.get || desc.set)
|
|
1969
1986
|
descriptors[key] = {
|
|
1970
|
-
|
|
1971
|
-
|
|
1987
|
+
[CONFIGURABLE]: true,
|
|
1988
|
+
[WRITABLE]: true,
|
|
1972
1989
|
// could live with !!desc.set as well here...
|
|
1973
|
-
|
|
1974
|
-
|
|
1990
|
+
[ENUMERABLE]: desc[ENUMERABLE],
|
|
1991
|
+
[VALUE]: base[key]
|
|
1975
1992
|
};
|
|
1976
1993
|
}
|
|
1977
|
-
return
|
|
1994
|
+
return O$2.create(getPrototypeOf$1(base), descriptors);
|
|
1978
1995
|
} else {
|
|
1979
1996
|
const proto = getPrototypeOf$1(base);
|
|
1980
1997
|
if (proto !== null && isPlain) {
|
|
1981
1998
|
return { ...base };
|
|
1982
1999
|
}
|
|
1983
|
-
const obj =
|
|
1984
|
-
return
|
|
2000
|
+
const obj = O$2.create(proto);
|
|
2001
|
+
return O$2.assign(obj, base);
|
|
1985
2002
|
}
|
|
1986
2003
|
}
|
|
1987
2004
|
function freeze$1(obj, deep = false) {
|
|
1988
2005
|
if (isFrozen$1(obj) || isDraft(obj) || !isDraftable(obj))
|
|
1989
2006
|
return obj;
|
|
1990
2007
|
if (getArchtype(obj) > 1) {
|
|
1991
|
-
|
|
1992
|
-
set:
|
|
1993
|
-
add:
|
|
1994
|
-
clear:
|
|
1995
|
-
delete:
|
|
2008
|
+
O$2.defineProperties(obj, {
|
|
2009
|
+
set: dontMutateMethodOverride,
|
|
2010
|
+
add: dontMutateMethodOverride,
|
|
2011
|
+
clear: dontMutateMethodOverride,
|
|
2012
|
+
delete: dontMutateMethodOverride
|
|
1996
2013
|
});
|
|
1997
2014
|
}
|
|
1998
|
-
|
|
2015
|
+
O$2.freeze(obj);
|
|
1999
2016
|
if (deep)
|
|
2000
|
-
|
|
2017
|
+
each$1(
|
|
2018
|
+
obj,
|
|
2019
|
+
(_key, value) => {
|
|
2020
|
+
freeze$1(value, true);
|
|
2021
|
+
},
|
|
2022
|
+
false
|
|
2023
|
+
);
|
|
2001
2024
|
return obj;
|
|
2002
2025
|
}
|
|
2003
2026
|
function dontMutateFrozenCollections() {
|
|
2004
2027
|
die(2);
|
|
2005
2028
|
}
|
|
2029
|
+
var dontMutateMethodOverride = {
|
|
2030
|
+
[VALUE]: dontMutateFrozenCollections
|
|
2031
|
+
};
|
|
2006
2032
|
function isFrozen$1(obj) {
|
|
2007
|
-
|
|
2033
|
+
if (obj === null || !isObjectish(obj))
|
|
2034
|
+
return true;
|
|
2035
|
+
return O$2.isFrozen(obj);
|
|
2008
2036
|
}
|
|
2009
2037
|
|
|
2010
2038
|
// src/utils/plugins.ts
|
|
2039
|
+
var PluginMapSet = "MapSet";
|
|
2040
|
+
var PluginPatches = "Patches";
|
|
2041
|
+
var PluginArrayMethods = "ArrayMethods";
|
|
2011
2042
|
var plugins = {};
|
|
2012
2043
|
function getPlugin(pluginKey) {
|
|
2013
2044
|
const plugin = plugins[pluginKey];
|
|
@@ -2016,26 +2047,27 @@ function getPlugin(pluginKey) {
|
|
|
2016
2047
|
}
|
|
2017
2048
|
return plugin;
|
|
2018
2049
|
}
|
|
2050
|
+
var isPluginLoaded = (pluginKey) => !!plugins[pluginKey];
|
|
2019
2051
|
|
|
2020
2052
|
// src/core/scope.ts
|
|
2021
2053
|
var currentScope;
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
}
|
|
2054
|
+
var getCurrentScope = () => currentScope;
|
|
2055
|
+
var createScope = (parent_, immer_) => ({
|
|
2056
|
+
drafts_: [],
|
|
2057
|
+
parent_,
|
|
2058
|
+
immer_,
|
|
2059
|
+
// Whenever the modified draft contains a draft from another scope, we
|
|
2060
|
+
// need to prevent auto-freezing so the unowned draft can be finalized.
|
|
2061
|
+
canAutoFreeze_: true,
|
|
2062
|
+
unfinalizedDrafts_: 0,
|
|
2063
|
+
handledSet_: /* @__PURE__ */ new Set(),
|
|
2064
|
+
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
2065
|
+
mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0,
|
|
2066
|
+
arrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0
|
|
2067
|
+
});
|
|
2036
2068
|
function usePatchesInScope(scope, patchListener) {
|
|
2037
2069
|
if (patchListener) {
|
|
2038
|
-
getPlugin(
|
|
2070
|
+
scope.patchPlugin_ = getPlugin(PluginPatches);
|
|
2039
2071
|
scope.patches_ = [];
|
|
2040
2072
|
scope.inversePatches_ = [];
|
|
2041
2073
|
scope.patchListener_ = patchListener;
|
|
@@ -2051,9 +2083,7 @@ function leaveScope(scope) {
|
|
|
2051
2083
|
currentScope = scope.parent_;
|
|
2052
2084
|
}
|
|
2053
2085
|
}
|
|
2054
|
-
|
|
2055
|
-
return currentScope = createScope(currentScope, immer2);
|
|
2056
|
-
}
|
|
2086
|
+
var enterScope = (immer2) => currentScope = createScope(currentScope, immer2);
|
|
2057
2087
|
function revokeDraft(draft) {
|
|
2058
2088
|
const state = draft[DRAFT_STATE];
|
|
2059
2089
|
if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)
|
|
@@ -2074,105 +2104,172 @@ function processResult(result, scope) {
|
|
|
2074
2104
|
}
|
|
2075
2105
|
if (isDraftable(result)) {
|
|
2076
2106
|
result = finalize(scope, result);
|
|
2077
|
-
if (!scope.parent_)
|
|
2078
|
-
maybeFreeze(scope, result);
|
|
2079
2107
|
}
|
|
2080
|
-
|
|
2081
|
-
|
|
2108
|
+
const { patchPlugin_ } = scope;
|
|
2109
|
+
if (patchPlugin_) {
|
|
2110
|
+
patchPlugin_.generateReplacementPatches_(
|
|
2082
2111
|
baseDraft[DRAFT_STATE].base_,
|
|
2083
2112
|
result,
|
|
2084
|
-
scope
|
|
2085
|
-
scope.inversePatches_
|
|
2113
|
+
scope
|
|
2086
2114
|
);
|
|
2087
2115
|
}
|
|
2088
2116
|
} else {
|
|
2089
|
-
result = finalize(scope, baseDraft
|
|
2117
|
+
result = finalize(scope, baseDraft);
|
|
2090
2118
|
}
|
|
2119
|
+
maybeFreeze(scope, result, true);
|
|
2091
2120
|
revokeScope(scope);
|
|
2092
2121
|
if (scope.patches_) {
|
|
2093
2122
|
scope.patchListener_(scope.patches_, scope.inversePatches_);
|
|
2094
2123
|
}
|
|
2095
2124
|
return result !== NOTHING ? result : void 0;
|
|
2096
2125
|
}
|
|
2097
|
-
function finalize(rootScope, value
|
|
2126
|
+
function finalize(rootScope, value) {
|
|
2098
2127
|
if (isFrozen$1(value))
|
|
2099
2128
|
return value;
|
|
2100
2129
|
const state = value[DRAFT_STATE];
|
|
2101
2130
|
if (!state) {
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
(key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)
|
|
2105
|
-
);
|
|
2106
|
-
return value;
|
|
2131
|
+
const finalValue = handleValue(value, rootScope.handledSet_, rootScope);
|
|
2132
|
+
return finalValue;
|
|
2107
2133
|
}
|
|
2108
|
-
if (state
|
|
2134
|
+
if (!isSameScope(state, rootScope)) {
|
|
2109
2135
|
return value;
|
|
2136
|
+
}
|
|
2110
2137
|
if (!state.modified_) {
|
|
2111
|
-
maybeFreeze(rootScope, state.base_, true);
|
|
2112
2138
|
return state.base_;
|
|
2113
2139
|
}
|
|
2114
2140
|
if (!state.finalized_) {
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
resultEach = new Set(result);
|
|
2122
|
-
result.clear();
|
|
2123
|
-
isSet2 = true;
|
|
2124
|
-
}
|
|
2125
|
-
each$1(
|
|
2126
|
-
resultEach,
|
|
2127
|
-
(key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)
|
|
2128
|
-
);
|
|
2129
|
-
maybeFreeze(rootScope, result, false);
|
|
2130
|
-
if (path && rootScope.patches_) {
|
|
2131
|
-
getPlugin("Patches").generatePatches_(
|
|
2132
|
-
state,
|
|
2133
|
-
path,
|
|
2134
|
-
rootScope.patches_,
|
|
2135
|
-
rootScope.inversePatches_
|
|
2136
|
-
);
|
|
2141
|
+
const { callbacks_ } = state;
|
|
2142
|
+
if (callbacks_) {
|
|
2143
|
+
while (callbacks_.length > 0) {
|
|
2144
|
+
const callback = callbacks_.pop();
|
|
2145
|
+
callback(rootScope);
|
|
2146
|
+
}
|
|
2137
2147
|
}
|
|
2148
|
+
generatePatchesAndFinalize(state, rootScope);
|
|
2138
2149
|
}
|
|
2139
2150
|
return state.copy_;
|
|
2140
2151
|
}
|
|
2141
|
-
function
|
|
2142
|
-
if (
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
+
function maybeFreeze(scope, value, deep = false) {
|
|
2153
|
+
if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {
|
|
2154
|
+
freeze$1(value, deep);
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
function markStateFinalized(state) {
|
|
2158
|
+
state.finalized_ = true;
|
|
2159
|
+
state.scope_.unfinalizedDrafts_--;
|
|
2160
|
+
}
|
|
2161
|
+
var isSameScope = (state, rootScope) => state.scope_ === rootScope;
|
|
2162
|
+
var EMPTY_LOCATIONS_RESULT = [];
|
|
2163
|
+
function updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {
|
|
2164
|
+
const parentCopy = latest(parent);
|
|
2165
|
+
const parentType = parent.type_;
|
|
2166
|
+
if (originalKey !== void 0) {
|
|
2167
|
+
const currentValue = get$2(parentCopy, originalKey, parentType);
|
|
2168
|
+
if (currentValue === draftValue) {
|
|
2169
|
+
set(parentCopy, originalKey, finalizedValue, parentType);
|
|
2152
2170
|
return;
|
|
2153
|
-
|
|
2154
|
-
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
if (!parent.draftLocations_) {
|
|
2174
|
+
const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();
|
|
2175
|
+
each$1(parentCopy, (key, value) => {
|
|
2176
|
+
if (isDraft(value)) {
|
|
2177
|
+
const keys = draftLocations.get(value) || [];
|
|
2178
|
+
keys.push(key);
|
|
2179
|
+
draftLocations.set(value, keys);
|
|
2180
|
+
}
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;
|
|
2184
|
+
for (const location of locations) {
|
|
2185
|
+
set(parentCopy, location, finalizedValue, parentType);
|
|
2155
2186
|
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2187
|
+
}
|
|
2188
|
+
function registerChildFinalizationCallback(parent, child, key) {
|
|
2189
|
+
parent.callbacks_.push(function childCleanup(rootScope) {
|
|
2190
|
+
const state = child;
|
|
2191
|
+
if (!state || !isSameScope(state, rootScope)) {
|
|
2158
2192
|
return;
|
|
2159
2193
|
}
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2194
|
+
rootScope.mapSetPlugin_?.fixSetContents(state);
|
|
2195
|
+
const finalizedValue = getFinalValue(state);
|
|
2196
|
+
updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);
|
|
2197
|
+
generatePatchesAndFinalize(state, rootScope);
|
|
2198
|
+
});
|
|
2199
|
+
}
|
|
2200
|
+
function generatePatchesAndFinalize(state, rootScope) {
|
|
2201
|
+
const shouldFinalize = state.modified_ && !state.finalized_ && (state.type_ === 3 /* Set */ || state.type_ === 1 /* Array */ && state.allIndicesReassigned_ || (state.assigned_?.size ?? 0) > 0);
|
|
2202
|
+
if (shouldFinalize) {
|
|
2203
|
+
const { patchPlugin_ } = rootScope;
|
|
2204
|
+
if (patchPlugin_) {
|
|
2205
|
+
const basePath = patchPlugin_.getPath(state);
|
|
2206
|
+
if (basePath) {
|
|
2207
|
+
patchPlugin_.generatePatches_(state, basePath, rootScope);
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
markStateFinalized(state);
|
|
2163
2211
|
}
|
|
2164
2212
|
}
|
|
2165
|
-
function
|
|
2166
|
-
|
|
2167
|
-
|
|
2213
|
+
function handleCrossReference(target, key, value) {
|
|
2214
|
+
const { scope_ } = target;
|
|
2215
|
+
if (isDraft(value)) {
|
|
2216
|
+
const state = value[DRAFT_STATE];
|
|
2217
|
+
if (isSameScope(state, scope_)) {
|
|
2218
|
+
state.callbacks_.push(function crossReferenceCleanup() {
|
|
2219
|
+
prepareCopy(target);
|
|
2220
|
+
const finalizedValue = getFinalValue(state);
|
|
2221
|
+
updateDraftInParent(target, value, finalizedValue, key);
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
} else if (isDraftable(value)) {
|
|
2225
|
+
target.callbacks_.push(function nestedDraftCleanup() {
|
|
2226
|
+
const targetCopy = latest(target);
|
|
2227
|
+
if (target.type_ === 3 /* Set */) {
|
|
2228
|
+
if (targetCopy.has(value)) {
|
|
2229
|
+
handleValue(value, scope_.handledSet_, scope_);
|
|
2230
|
+
}
|
|
2231
|
+
} else {
|
|
2232
|
+
if (get$2(targetCopy, key, target.type_) === value) {
|
|
2233
|
+
if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) {
|
|
2234
|
+
handleValue(
|
|
2235
|
+
get$2(target.copy_, key, target.type_),
|
|
2236
|
+
scope_.handledSet_,
|
|
2237
|
+
scope_
|
|
2238
|
+
);
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
});
|
|
2168
2243
|
}
|
|
2169
2244
|
}
|
|
2245
|
+
function handleValue(target, handledSet, rootScope) {
|
|
2246
|
+
if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
|
|
2247
|
+
return target;
|
|
2248
|
+
}
|
|
2249
|
+
if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen$1(target)) {
|
|
2250
|
+
return target;
|
|
2251
|
+
}
|
|
2252
|
+
handledSet.add(target);
|
|
2253
|
+
each$1(target, (key, value) => {
|
|
2254
|
+
if (isDraft(value)) {
|
|
2255
|
+
const state = value[DRAFT_STATE];
|
|
2256
|
+
if (isSameScope(state, rootScope)) {
|
|
2257
|
+
const updatedValue = getFinalValue(state);
|
|
2258
|
+
set(target, key, updatedValue, target.type_);
|
|
2259
|
+
markStateFinalized(state);
|
|
2260
|
+
}
|
|
2261
|
+
} else if (isDraftable(value)) {
|
|
2262
|
+
handleValue(value, handledSet, rootScope);
|
|
2263
|
+
}
|
|
2264
|
+
});
|
|
2265
|
+
return target;
|
|
2266
|
+
}
|
|
2170
2267
|
|
|
2171
2268
|
// src/core/proxy.ts
|
|
2172
2269
|
function createProxyProxy(base, parent) {
|
|
2173
|
-
const
|
|
2270
|
+
const baseIsArray = isArray$j(base);
|
|
2174
2271
|
const state = {
|
|
2175
|
-
type_:
|
|
2272
|
+
type_: baseIsArray ? 1 /* Array */ : 0 /* Object */,
|
|
2176
2273
|
// Track which produce call this is associated with.
|
|
2177
2274
|
scope_: parent ? parent.scope_ : getCurrentScope(),
|
|
2178
2275
|
// True for both shallow and deep changes.
|
|
@@ -2180,7 +2277,8 @@ function createProxyProxy(base, parent) {
|
|
|
2180
2277
|
// Used during finalization.
|
|
2181
2278
|
finalized_: false,
|
|
2182
2279
|
// Track which properties have been assigned (true) or deleted (false).
|
|
2183
|
-
|
|
2280
|
+
// actually instantiated in `prepareCopy()`
|
|
2281
|
+
assigned_: void 0,
|
|
2184
2282
|
// The parent draft state.
|
|
2185
2283
|
parent_: parent,
|
|
2186
2284
|
// The base state.
|
|
@@ -2192,34 +2290,50 @@ function createProxyProxy(base, parent) {
|
|
|
2192
2290
|
copy_: null,
|
|
2193
2291
|
// Called by the `produce` function.
|
|
2194
2292
|
revoke_: null,
|
|
2195
|
-
isManual_: false
|
|
2293
|
+
isManual_: false,
|
|
2294
|
+
// `callbacks` actually gets assigned in `createProxy`
|
|
2295
|
+
callbacks_: void 0
|
|
2196
2296
|
};
|
|
2197
2297
|
let target = state;
|
|
2198
2298
|
let traps = objectTraps;
|
|
2199
|
-
if (
|
|
2299
|
+
if (baseIsArray) {
|
|
2200
2300
|
target = [state];
|
|
2201
2301
|
traps = arrayTraps;
|
|
2202
2302
|
}
|
|
2203
2303
|
const { revoke, proxy } = Proxy.revocable(target, traps);
|
|
2204
2304
|
state.draft_ = proxy;
|
|
2205
2305
|
state.revoke_ = revoke;
|
|
2206
|
-
return proxy;
|
|
2306
|
+
return [proxy, state];
|
|
2207
2307
|
}
|
|
2208
2308
|
var objectTraps = {
|
|
2209
2309
|
get(state, prop) {
|
|
2210
2310
|
if (prop === DRAFT_STATE)
|
|
2211
2311
|
return state;
|
|
2312
|
+
let arrayPlugin = state.scope_.arrayMethodsPlugin_;
|
|
2313
|
+
const isArrayWithStringProp = state.type_ === 1 /* Array */ && typeof prop === "string";
|
|
2314
|
+
if (isArrayWithStringProp) {
|
|
2315
|
+
if (arrayPlugin?.isArrayOperationMethod(prop)) {
|
|
2316
|
+
return arrayPlugin.createMethodInterceptor(state, prop);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2212
2319
|
const source = latest(state);
|
|
2213
|
-
if (!has$2(source, prop)) {
|
|
2320
|
+
if (!has$2(source, prop, state.type_)) {
|
|
2214
2321
|
return readPropFromProto(state, source, prop);
|
|
2215
2322
|
}
|
|
2216
2323
|
const value = source[prop];
|
|
2217
2324
|
if (state.finalized_ || !isDraftable(value)) {
|
|
2218
2325
|
return value;
|
|
2219
2326
|
}
|
|
2327
|
+
if (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod(
|
|
2328
|
+
state.operationMethod
|
|
2329
|
+
) && isArrayIndex(prop)) {
|
|
2330
|
+
return value;
|
|
2331
|
+
}
|
|
2220
2332
|
if (value === peek$1(state.base_, prop)) {
|
|
2221
2333
|
prepareCopy(state);
|
|
2222
|
-
|
|
2334
|
+
const childKey = state.type_ === 1 /* Array */ ? +prop : prop;
|
|
2335
|
+
const childDraft = createProxy(state.scope_, value, state, childKey);
|
|
2336
|
+
return state.copy_[childKey] = childDraft;
|
|
2223
2337
|
}
|
|
2224
2338
|
return value;
|
|
2225
2339
|
},
|
|
@@ -2240,10 +2354,10 @@ var objectTraps = {
|
|
|
2240
2354
|
const currentState = current2?.[DRAFT_STATE];
|
|
2241
2355
|
if (currentState && currentState.base_ === value) {
|
|
2242
2356
|
state.copy_[prop] = value;
|
|
2243
|
-
state.assigned_
|
|
2357
|
+
state.assigned_.set(prop, false);
|
|
2244
2358
|
return true;
|
|
2245
2359
|
}
|
|
2246
|
-
if (is(value, current2) && (value !== void 0 || has$2(state.base_, prop)))
|
|
2360
|
+
if (is(value, current2) && (value !== void 0 || has$2(state.base_, prop, state.type_)))
|
|
2247
2361
|
return true;
|
|
2248
2362
|
prepareCopy(state);
|
|
2249
2363
|
markChanged(state);
|
|
@@ -2253,16 +2367,17 @@ var objectTraps = {
|
|
|
2253
2367
|
Number.isNaN(value) && Number.isNaN(state.copy_[prop]))
|
|
2254
2368
|
return true;
|
|
2255
2369
|
state.copy_[prop] = value;
|
|
2256
|
-
state.assigned_
|
|
2370
|
+
state.assigned_.set(prop, true);
|
|
2371
|
+
handleCrossReference(state, prop, value);
|
|
2257
2372
|
return true;
|
|
2258
2373
|
},
|
|
2259
2374
|
deleteProperty(state, prop) {
|
|
2375
|
+
prepareCopy(state);
|
|
2260
2376
|
if (peek$1(state.base_, prop) !== void 0 || prop in state.base_) {
|
|
2261
|
-
state.assigned_
|
|
2262
|
-
prepareCopy(state);
|
|
2377
|
+
state.assigned_.set(prop, false);
|
|
2263
2378
|
markChanged(state);
|
|
2264
2379
|
} else {
|
|
2265
|
-
|
|
2380
|
+
state.assigned_.delete(prop);
|
|
2266
2381
|
}
|
|
2267
2382
|
if (state.copy_) {
|
|
2268
2383
|
delete state.copy_[prop];
|
|
@@ -2277,10 +2392,10 @@ var objectTraps = {
|
|
|
2277
2392
|
if (!desc)
|
|
2278
2393
|
return desc;
|
|
2279
2394
|
return {
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2395
|
+
[WRITABLE]: true,
|
|
2396
|
+
[CONFIGURABLE]: state.type_ !== 1 /* Array */ || prop !== "length",
|
|
2397
|
+
[ENUMERABLE]: desc[ENUMERABLE],
|
|
2398
|
+
[VALUE]: owner[prop]
|
|
2284
2399
|
};
|
|
2285
2400
|
},
|
|
2286
2401
|
defineProperty() {
|
|
@@ -2294,12 +2409,14 @@ var objectTraps = {
|
|
|
2294
2409
|
}
|
|
2295
2410
|
};
|
|
2296
2411
|
var arrayTraps = {};
|
|
2297
|
-
|
|
2412
|
+
for (let key in objectTraps) {
|
|
2413
|
+
let fn = objectTraps[key];
|
|
2298
2414
|
arrayTraps[key] = function() {
|
|
2299
|
-
|
|
2300
|
-
|
|
2415
|
+
const args = arguments;
|
|
2416
|
+
args[0] = args[0][0];
|
|
2417
|
+
return fn.apply(this, args);
|
|
2301
2418
|
};
|
|
2302
|
-
}
|
|
2419
|
+
}
|
|
2303
2420
|
arrayTraps.deleteProperty = function(state, prop) {
|
|
2304
2421
|
if (process.env.NODE_ENV !== "production" && isNaN(parseInt(prop)))
|
|
2305
2422
|
die(13);
|
|
@@ -2317,7 +2434,7 @@ function peek$1(draft, prop) {
|
|
|
2317
2434
|
}
|
|
2318
2435
|
function readPropFromProto(state, source, prop) {
|
|
2319
2436
|
const desc = getDescriptorFromProto(source, prop);
|
|
2320
|
-
return desc ?
|
|
2437
|
+
return desc ? VALUE in desc ? desc[VALUE] : (
|
|
2321
2438
|
// This is a very special case, if the prop is a getter defined by the
|
|
2322
2439
|
// prototype, we should invoke it with the draft as context!
|
|
2323
2440
|
desc.get?.call(state.draft_)
|
|
@@ -2345,6 +2462,7 @@ function markChanged(state) {
|
|
|
2345
2462
|
}
|
|
2346
2463
|
function prepareCopy(state) {
|
|
2347
2464
|
if (!state.copy_) {
|
|
2465
|
+
state.assigned_ = /* @__PURE__ */ new Map();
|
|
2348
2466
|
state.copy_ = shallowCopy(
|
|
2349
2467
|
state.base_,
|
|
2350
2468
|
state.scope_.immer_.useStrictShallowCopy_
|
|
@@ -2357,6 +2475,7 @@ var Immer2 = class {
|
|
|
2357
2475
|
constructor(config) {
|
|
2358
2476
|
this.autoFreeze_ = true;
|
|
2359
2477
|
this.useStrictShallowCopy_ = false;
|
|
2478
|
+
this.useStrictIteration_ = false;
|
|
2360
2479
|
/**
|
|
2361
2480
|
* The `produce` function takes a value and a "recipe function" (whose
|
|
2362
2481
|
* return value often depends on the base state). The recipe function is
|
|
@@ -2377,7 +2496,7 @@ var Immer2 = class {
|
|
|
2377
2496
|
* @returns {any} a new state, or the initial state if nothing was modified
|
|
2378
2497
|
*/
|
|
2379
2498
|
this.produce = (base, recipe, patchListener) => {
|
|
2380
|
-
if (
|
|
2499
|
+
if (isFunction$4(base) && !isFunction$4(recipe)) {
|
|
2381
2500
|
const defaultBase = recipe;
|
|
2382
2501
|
recipe = base;
|
|
2383
2502
|
const self = this;
|
|
@@ -2385,14 +2504,14 @@ var Immer2 = class {
|
|
|
2385
2504
|
return self.produce(base2, (draft) => recipe.call(this, draft, ...args));
|
|
2386
2505
|
};
|
|
2387
2506
|
}
|
|
2388
|
-
if (
|
|
2507
|
+
if (!isFunction$4(recipe))
|
|
2389
2508
|
die(6);
|
|
2390
|
-
if (patchListener !== void 0 &&
|
|
2509
|
+
if (patchListener !== void 0 && !isFunction$4(patchListener))
|
|
2391
2510
|
die(7);
|
|
2392
2511
|
let result;
|
|
2393
2512
|
if (isDraftable(base)) {
|
|
2394
2513
|
const scope = enterScope(this);
|
|
2395
|
-
const proxy = createProxy(base, void 0);
|
|
2514
|
+
const proxy = createProxy(scope, base, void 0);
|
|
2396
2515
|
let hasError = true;
|
|
2397
2516
|
try {
|
|
2398
2517
|
result = recipe(proxy);
|
|
@@ -2405,7 +2524,7 @@ var Immer2 = class {
|
|
|
2405
2524
|
}
|
|
2406
2525
|
usePatchesInScope(scope, patchListener);
|
|
2407
2526
|
return processResult(result, scope);
|
|
2408
|
-
} else if (!base ||
|
|
2527
|
+
} else if (!base || !isObjectish(base)) {
|
|
2409
2528
|
result = recipe(base);
|
|
2410
2529
|
if (result === void 0)
|
|
2411
2530
|
result = base;
|
|
@@ -2416,7 +2535,10 @@ var Immer2 = class {
|
|
|
2416
2535
|
if (patchListener) {
|
|
2417
2536
|
const p = [];
|
|
2418
2537
|
const ip = [];
|
|
2419
|
-
getPlugin(
|
|
2538
|
+
getPlugin(PluginPatches).generateReplacementPatches_(base, result, {
|
|
2539
|
+
patches_: p,
|
|
2540
|
+
inversePatches_: ip
|
|
2541
|
+
});
|
|
2420
2542
|
patchListener(p, ip);
|
|
2421
2543
|
}
|
|
2422
2544
|
return result;
|
|
@@ -2424,7 +2546,7 @@ var Immer2 = class {
|
|
|
2424
2546
|
die(1, base);
|
|
2425
2547
|
};
|
|
2426
2548
|
this.produceWithPatches = (base, recipe) => {
|
|
2427
|
-
if (
|
|
2549
|
+
if (isFunction$4(base)) {
|
|
2428
2550
|
return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));
|
|
2429
2551
|
}
|
|
2430
2552
|
let patches, inversePatches;
|
|
@@ -2434,10 +2556,12 @@ var Immer2 = class {
|
|
|
2434
2556
|
});
|
|
2435
2557
|
return [result, patches, inversePatches];
|
|
2436
2558
|
};
|
|
2437
|
-
if (
|
|
2559
|
+
if (isBoolean$1(config?.autoFreeze))
|
|
2438
2560
|
this.setAutoFreeze(config.autoFreeze);
|
|
2439
|
-
if (
|
|
2561
|
+
if (isBoolean$1(config?.useStrictShallowCopy))
|
|
2440
2562
|
this.setUseStrictShallowCopy(config.useStrictShallowCopy);
|
|
2563
|
+
if (isBoolean$1(config?.useStrictIteration))
|
|
2564
|
+
this.setUseStrictIteration(config.useStrictIteration);
|
|
2441
2565
|
}
|
|
2442
2566
|
createDraft(base) {
|
|
2443
2567
|
if (!isDraftable(base))
|
|
@@ -2445,7 +2569,7 @@ var Immer2 = class {
|
|
|
2445
2569
|
if (isDraft(base))
|
|
2446
2570
|
base = current(base);
|
|
2447
2571
|
const scope = enterScope(this);
|
|
2448
|
-
const proxy = createProxy(base, void 0);
|
|
2572
|
+
const proxy = createProxy(scope, base, void 0);
|
|
2449
2573
|
proxy[DRAFT_STATE].isManual_ = true;
|
|
2450
2574
|
leaveScope(scope);
|
|
2451
2575
|
return proxy;
|
|
@@ -2474,6 +2598,18 @@ var Immer2 = class {
|
|
|
2474
2598
|
setUseStrictShallowCopy(value) {
|
|
2475
2599
|
this.useStrictShallowCopy_ = value;
|
|
2476
2600
|
}
|
|
2601
|
+
/**
|
|
2602
|
+
* Pass false to use faster iteration that skips non-enumerable properties
|
|
2603
|
+
* but still handles symbols for compatibility.
|
|
2604
|
+
*
|
|
2605
|
+
* By default, strict iteration is enabled (includes all own properties).
|
|
2606
|
+
*/
|
|
2607
|
+
setUseStrictIteration(value) {
|
|
2608
|
+
this.useStrictIteration_ = value;
|
|
2609
|
+
}
|
|
2610
|
+
shouldUseStrictIteration() {
|
|
2611
|
+
return this.useStrictIteration_;
|
|
2612
|
+
}
|
|
2477
2613
|
applyPatches(base, patches) {
|
|
2478
2614
|
let i;
|
|
2479
2615
|
for (i = patches.length - 1; i >= 0; i--) {
|
|
@@ -2486,7 +2622,7 @@ var Immer2 = class {
|
|
|
2486
2622
|
if (i > -1) {
|
|
2487
2623
|
patches = patches.slice(i + 1);
|
|
2488
2624
|
}
|
|
2489
|
-
const applyPatchesImpl = getPlugin(
|
|
2625
|
+
const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;
|
|
2490
2626
|
if (isDraft(base)) {
|
|
2491
2627
|
return applyPatchesImpl(base, patches);
|
|
2492
2628
|
}
|
|
@@ -2496,10 +2632,23 @@ var Immer2 = class {
|
|
|
2496
2632
|
);
|
|
2497
2633
|
}
|
|
2498
2634
|
};
|
|
2499
|
-
function createProxy(value, parent) {
|
|
2500
|
-
const draft = isMap$2(value) ? getPlugin(
|
|
2501
|
-
const scope = parent
|
|
2635
|
+
function createProxy(rootScope, value, parent, key) {
|
|
2636
|
+
const [draft, state] = isMap$2(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet$2(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);
|
|
2637
|
+
const scope = parent?.scope_ ?? getCurrentScope();
|
|
2502
2638
|
scope.drafts_.push(draft);
|
|
2639
|
+
state.callbacks_ = parent?.callbacks_ ?? [];
|
|
2640
|
+
state.key_ = key;
|
|
2641
|
+
if (parent && key !== void 0) {
|
|
2642
|
+
registerChildFinalizationCallback(parent, state, key);
|
|
2643
|
+
} else {
|
|
2644
|
+
state.callbacks_.push(function rootDraftCleanup(rootScope2) {
|
|
2645
|
+
rootScope2.mapSetPlugin_?.fixSetContents(state);
|
|
2646
|
+
const { patchPlugin_ } = rootScope2;
|
|
2647
|
+
if (state.modified_ && patchPlugin_) {
|
|
2648
|
+
patchPlugin_.generatePatches_(state, [], rootScope2);
|
|
2649
|
+
}
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2503
2652
|
return draft;
|
|
2504
2653
|
}
|
|
2505
2654
|
|
|
@@ -2514,17 +2663,23 @@ function currentImpl(value) {
|
|
|
2514
2663
|
return value;
|
|
2515
2664
|
const state = value[DRAFT_STATE];
|
|
2516
2665
|
let copy;
|
|
2666
|
+
let strict = true;
|
|
2517
2667
|
if (state) {
|
|
2518
2668
|
if (!state.modified_)
|
|
2519
2669
|
return state.base_;
|
|
2520
2670
|
state.finalized_ = true;
|
|
2521
2671
|
copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
|
|
2672
|
+
strict = state.scope_.immer_.shouldUseStrictIteration();
|
|
2522
2673
|
} else {
|
|
2523
2674
|
copy = shallowCopy(value, true);
|
|
2524
2675
|
}
|
|
2525
|
-
each$1(
|
|
2526
|
-
|
|
2527
|
-
|
|
2676
|
+
each$1(
|
|
2677
|
+
copy,
|
|
2678
|
+
(key, childValue) => {
|
|
2679
|
+
set(copy, key, currentImpl(childValue));
|
|
2680
|
+
},
|
|
2681
|
+
strict
|
|
2682
|
+
);
|
|
2528
2683
|
if (state) {
|
|
2529
2684
|
state.finalized_ = false;
|
|
2530
2685
|
}
|
|
@@ -2869,6 +3024,8 @@ var thunk = createThunkMiddleware();
|
|
|
2869
3024
|
var withExtraArgument = createThunkMiddleware;
|
|
2870
3025
|
|
|
2871
3026
|
// src/index.ts
|
|
3027
|
+
|
|
3028
|
+
// src/devtoolsExtension.ts
|
|
2872
3029
|
var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
|
|
2873
3030
|
if (arguments.length === 0) return void 0;
|
|
2874
3031
|
if (typeof arguments[0] === "object") return compose$4;
|
|
@@ -2935,6 +3092,8 @@ function createActionCreatorInvariantMiddleware(options = {}) {
|
|
|
2935
3092
|
return next(action);
|
|
2936
3093
|
};
|
|
2937
3094
|
}
|
|
3095
|
+
|
|
3096
|
+
// src/utils.ts
|
|
2938
3097
|
function getTimeMeasureUtils(maxDelay, fnName) {
|
|
2939
3098
|
let elapsed = 0;
|
|
2940
3099
|
return {
|
|
@@ -2987,27 +3146,36 @@ function getOrInsertComputed(map, key, compute) {
|
|
|
2987
3146
|
function isImmutableDefault(value) {
|
|
2988
3147
|
return typeof value !== "object" || value == null || Object.isFrozen(value);
|
|
2989
3148
|
}
|
|
2990
|
-
function trackForMutations(isImmutable,
|
|
2991
|
-
const trackedProperties = trackProperties(isImmutable,
|
|
3149
|
+
function trackForMutations(isImmutable, ignoredPaths, obj) {
|
|
3150
|
+
const trackedProperties = trackProperties(isImmutable, ignoredPaths, obj);
|
|
2992
3151
|
return {
|
|
2993
3152
|
detectMutations() {
|
|
2994
|
-
return detectMutations(isImmutable,
|
|
3153
|
+
return detectMutations(isImmutable, ignoredPaths, trackedProperties, obj);
|
|
2995
3154
|
}
|
|
2996
3155
|
};
|
|
2997
3156
|
}
|
|
2998
|
-
function trackProperties(isImmutable,
|
|
3157
|
+
function trackProperties(isImmutable, ignoredPaths = [], obj, path = "", checkedObjects = /* @__PURE__ */ new Set()) {
|
|
2999
3158
|
const tracked = {
|
|
3000
3159
|
value: obj
|
|
3001
3160
|
};
|
|
3002
3161
|
if (!isImmutable(obj) && !checkedObjects.has(obj)) {
|
|
3003
3162
|
checkedObjects.add(obj);
|
|
3004
3163
|
tracked.children = {};
|
|
3164
|
+
const hasIgnoredPaths = ignoredPaths.length > 0;
|
|
3005
3165
|
for (const key in obj) {
|
|
3006
|
-
const
|
|
3007
|
-
if (
|
|
3008
|
-
|
|
3166
|
+
const nestedPath = path ? path + "." + key : key;
|
|
3167
|
+
if (hasIgnoredPaths) {
|
|
3168
|
+
const hasMatches = ignoredPaths.some((ignored) => {
|
|
3169
|
+
if (ignored instanceof RegExp) {
|
|
3170
|
+
return ignored.test(nestedPath);
|
|
3171
|
+
}
|
|
3172
|
+
return nestedPath === ignored;
|
|
3173
|
+
});
|
|
3174
|
+
if (hasMatches) {
|
|
3175
|
+
continue;
|
|
3176
|
+
}
|
|
3009
3177
|
}
|
|
3010
|
-
tracked.children[key] = trackProperties(isImmutable,
|
|
3178
|
+
tracked.children[key] = trackProperties(isImmutable, ignoredPaths, obj[key], nestedPath);
|
|
3011
3179
|
}
|
|
3012
3180
|
}
|
|
3013
3181
|
return tracked;
|
|
@@ -3115,6 +3283,8 @@ function createImmutableStateInvariantMiddleware(options = {}) {
|
|
|
3115
3283
|
};
|
|
3116
3284
|
}
|
|
3117
3285
|
}
|
|
3286
|
+
|
|
3287
|
+
// src/serializableStateInvariantMiddleware.ts
|
|
3118
3288
|
function isPlain(val) {
|
|
3119
3289
|
const type = typeof val;
|
|
3120
3290
|
return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject$8(val);
|
|
@@ -4481,9 +4651,9 @@ var stubFalse_1 = stubFalse;
|
|
|
4481
4651
|
|
|
4482
4652
|
isBuffer$4.exports;
|
|
4483
4653
|
|
|
4484
|
-
(function (module, exports) {
|
|
4654
|
+
(function (module, exports$1) {
|
|
4485
4655
|
var root = _root, stubFalse = stubFalse_1;
|
|
4486
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
4656
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
4487
4657
|
var freeModule = freeExports && 'object' == "object" && module && !module.nodeType && module;
|
|
4488
4658
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
4489
4659
|
var Buffer = moduleExports ? root.Buffer : void 0;
|
|
@@ -4531,9 +4701,9 @@ var _nodeUtil = {exports: {}};
|
|
|
4531
4701
|
|
|
4532
4702
|
_nodeUtil.exports;
|
|
4533
4703
|
|
|
4534
|
-
(function (module, exports) {
|
|
4704
|
+
(function (module, exports$1) {
|
|
4535
4705
|
var freeGlobal = _freeGlobal;
|
|
4536
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
4706
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
4537
4707
|
var freeModule = freeExports && 'object' == "object" && module && !module.nodeType && module;
|
|
4538
4708
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
4539
4709
|
var freeProcess = moduleExports && freeGlobal.process;
|
|
@@ -5099,39 +5269,23 @@ function baseFindIndex$2(array, predicate, fromIndex, fromRight) {
|
|
|
5099
5269
|
}
|
|
5100
5270
|
var _baseFindIndex = baseFindIndex$2;
|
|
5101
5271
|
|
|
5102
|
-
var
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
var reWhitespace = /\s/;
|
|
5109
|
-
function trimmedEndIndex(string) {
|
|
5110
|
-
var index = string.length;
|
|
5111
|
-
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
5112
|
-
}
|
|
5113
|
-
return index;
|
|
5114
|
-
}
|
|
5115
|
-
_trimmedEndIndex = trimmedEndIndex;
|
|
5116
|
-
return _trimmedEndIndex;
|
|
5272
|
+
var reWhitespace = /\s/;
|
|
5273
|
+
function trimmedEndIndex$1(string) {
|
|
5274
|
+
var index = string.length;
|
|
5275
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
5276
|
+
}
|
|
5277
|
+
return index;
|
|
5117
5278
|
}
|
|
5279
|
+
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
5118
5280
|
|
|
5119
|
-
var
|
|
5120
|
-
var
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
if (hasRequired_baseTrim) return _baseTrim;
|
|
5124
|
-
hasRequired_baseTrim = 1;
|
|
5125
|
-
var trimmedEndIndex = require_trimmedEndIndex();
|
|
5126
|
-
var reTrimStart = /^\s+/;
|
|
5127
|
-
function baseTrim(string) {
|
|
5128
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
5129
|
-
}
|
|
5130
|
-
_baseTrim = baseTrim;
|
|
5131
|
-
return _baseTrim;
|
|
5281
|
+
var trimmedEndIndex = _trimmedEndIndex;
|
|
5282
|
+
var reTrimStart = /^\s+/;
|
|
5283
|
+
function baseTrim$1(string) {
|
|
5284
|
+
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
5132
5285
|
}
|
|
5286
|
+
var _baseTrim = baseTrim$1;
|
|
5133
5287
|
|
|
5134
|
-
var baseTrim =
|
|
5288
|
+
var baseTrim = _baseTrim, isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
|
|
5135
5289
|
var NAN = 0 / 0;
|
|
5136
5290
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
5137
5291
|
var reIsBinary = /^0b[01]+$/i;
|
|
@@ -6469,8 +6623,8 @@ const PropTypes$1 = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
|
6469
6623
|
|
|
6470
6624
|
var _mapping = {};
|
|
6471
6625
|
|
|
6472
|
-
(function (exports) {
|
|
6473
|
-
exports.aliasToReal = {
|
|
6626
|
+
(function (exports$1) {
|
|
6627
|
+
exports$1.aliasToReal = {
|
|
6474
6628
|
// Lodash aliases.
|
|
6475
6629
|
"each": "forEach",
|
|
6476
6630
|
"eachRight": "forEachRight",
|
|
@@ -6535,7 +6689,7 @@ var _mapping = {};
|
|
|
6535
6689
|
"whereEq": "isMatch",
|
|
6536
6690
|
"zipObj": "zipObject"
|
|
6537
6691
|
};
|
|
6538
|
-
exports.aryMethod = {
|
|
6692
|
+
exports$1.aryMethod = {
|
|
6539
6693
|
"1": [
|
|
6540
6694
|
"assignAll",
|
|
6541
6695
|
"assignInAll",
|
|
@@ -6770,12 +6924,12 @@ var _mapping = {};
|
|
|
6770
6924
|
"updateWith"
|
|
6771
6925
|
]
|
|
6772
6926
|
};
|
|
6773
|
-
exports.aryRearg = {
|
|
6927
|
+
exports$1.aryRearg = {
|
|
6774
6928
|
"2": [1, 0],
|
|
6775
6929
|
"3": [2, 0, 1],
|
|
6776
6930
|
"4": [3, 2, 0, 1]
|
|
6777
6931
|
};
|
|
6778
|
-
exports.iterateeAry = {
|
|
6932
|
+
exports$1.iterateeAry = {
|
|
6779
6933
|
"dropRightWhile": 1,
|
|
6780
6934
|
"dropWhile": 1,
|
|
6781
6935
|
"every": 1,
|
|
@@ -6813,11 +6967,11 @@ var _mapping = {};
|
|
|
6813
6967
|
"times": 1,
|
|
6814
6968
|
"transform": 2
|
|
6815
6969
|
};
|
|
6816
|
-
exports.iterateeRearg = {
|
|
6970
|
+
exports$1.iterateeRearg = {
|
|
6817
6971
|
"mapKeys": [1],
|
|
6818
6972
|
"reduceRight": [1, 0]
|
|
6819
6973
|
};
|
|
6820
|
-
exports.methodRearg = {
|
|
6974
|
+
exports$1.methodRearg = {
|
|
6821
6975
|
"assignInAllWith": [1, 0],
|
|
6822
6976
|
"assignInWith": [1, 2, 0],
|
|
6823
6977
|
"assignAllWith": [1, 0],
|
|
@@ -6848,7 +7002,7 @@ var _mapping = {};
|
|
|
6848
7002
|
"xorWith": [1, 2, 0],
|
|
6849
7003
|
"zipWith": [1, 2, 0]
|
|
6850
7004
|
};
|
|
6851
|
-
exports.methodSpread = {
|
|
7005
|
+
exports$1.methodSpread = {
|
|
6852
7006
|
"assignAll": { "start": 0 },
|
|
6853
7007
|
"assignAllWith": { "start": 0 },
|
|
6854
7008
|
"assignInAll": { "start": 0 },
|
|
@@ -6864,7 +7018,7 @@ var _mapping = {};
|
|
|
6864
7018
|
"without": { "start": 1 },
|
|
6865
7019
|
"zipAll": { "start": 0 }
|
|
6866
7020
|
};
|
|
6867
|
-
exports.mutate = {
|
|
7021
|
+
exports$1.mutate = {
|
|
6868
7022
|
"array": {
|
|
6869
7023
|
"fill": true,
|
|
6870
7024
|
"pull": true,
|
|
@@ -6901,8 +7055,8 @@ var _mapping = {};
|
|
|
6901
7055
|
"updateWith": true
|
|
6902
7056
|
}
|
|
6903
7057
|
};
|
|
6904
|
-
exports.realToAlias = function() {
|
|
6905
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty, object = exports.aliasToReal, result = {};
|
|
7058
|
+
exports$1.realToAlias = function() {
|
|
7059
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty, object = exports$1.aliasToReal, result = {};
|
|
6906
7060
|
for (var key in object) {
|
|
6907
7061
|
var value = object[key];
|
|
6908
7062
|
if (hasOwnProperty.call(result, value)) {
|
|
@@ -6913,7 +7067,7 @@ var _mapping = {};
|
|
|
6913
7067
|
}
|
|
6914
7068
|
return result;
|
|
6915
7069
|
}();
|
|
6916
|
-
exports.remap = {
|
|
7070
|
+
exports$1.remap = {
|
|
6917
7071
|
"assignAll": "assign",
|
|
6918
7072
|
"assignAllWith": "assignWith",
|
|
6919
7073
|
"assignInAll": "assignIn",
|
|
@@ -6947,7 +7101,7 @@ var _mapping = {};
|
|
|
6947
7101
|
"trimCharsStart": "trimStart",
|
|
6948
7102
|
"zipAll": "zip"
|
|
6949
7103
|
};
|
|
6950
|
-
exports.skipFixed = {
|
|
7104
|
+
exports$1.skipFixed = {
|
|
6951
7105
|
"castArray": true,
|
|
6952
7106
|
"flow": true,
|
|
6953
7107
|
"flowRight": true,
|
|
@@ -6956,7 +7110,7 @@ var _mapping = {};
|
|
|
6956
7110
|
"rearg": true,
|
|
6957
7111
|
"runInContext": true
|
|
6958
7112
|
};
|
|
6959
|
-
exports.skipRearg = {
|
|
7113
|
+
exports$1.skipRearg = {
|
|
6960
7114
|
"add": true,
|
|
6961
7115
|
"assign": true,
|
|
6962
7116
|
"assignIn": true,
|
|
@@ -8069,9 +8223,9 @@ var _cloneBuffer = {exports: {}};
|
|
|
8069
8223
|
|
|
8070
8224
|
_cloneBuffer.exports;
|
|
8071
8225
|
|
|
8072
|
-
(function (module, exports) {
|
|
8226
|
+
(function (module, exports$1) {
|
|
8073
8227
|
var root = _root;
|
|
8074
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
8228
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
8075
8229
|
var freeModule = freeExports && 'object' == "object" && module && !module.nodeType && module;
|
|
8076
8230
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
8077
8231
|
var Buffer = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
|
|
@@ -8613,7 +8767,7 @@ var hasRequiredTrim;
|
|
|
8613
8767
|
function requireTrim () {
|
|
8614
8768
|
if (hasRequiredTrim) return trim_1;
|
|
8615
8769
|
hasRequiredTrim = 1;
|
|
8616
|
-
var baseToString = _baseToString, baseTrim =
|
|
8770
|
+
var baseToString = _baseToString, baseTrim = _baseTrim, castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
|
|
8617
8771
|
function trim(string, chars, guard) {
|
|
8618
8772
|
string = toString(string);
|
|
8619
8773
|
if (string && (guard || chars === void 0)) {
|
|
@@ -9984,116 +10138,166 @@ const app = (state = defaultState, action) => {
|
|
|
9984
10138
|
};
|
|
9985
10139
|
|
|
9986
10140
|
const BROWSER_ALIASES_MAP = {
|
|
10141
|
+
AmazonBot: "amazonbot",
|
|
9987
10142
|
"Amazon Silk": "amazon_silk",
|
|
9988
10143
|
"Android Browser": "android",
|
|
10144
|
+
BaiduSpider: "baiduspider",
|
|
9989
10145
|
Bada: "bada",
|
|
10146
|
+
BingCrawler: "bingcrawler",
|
|
9990
10147
|
BlackBerry: "blackberry",
|
|
10148
|
+
"ChatGPT-User": "chatgpt_user",
|
|
9991
10149
|
Chrome: "chrome",
|
|
10150
|
+
ClaudeBot: "claudebot",
|
|
9992
10151
|
Chromium: "chromium",
|
|
10152
|
+
Diffbot: "diffbot",
|
|
10153
|
+
DuckDuckBot: "duckduckbot",
|
|
9993
10154
|
Electron: "electron",
|
|
9994
10155
|
Epiphany: "epiphany",
|
|
10156
|
+
FacebookExternalHit: "facebookexternalhit",
|
|
9995
10157
|
Firefox: "firefox",
|
|
9996
10158
|
Focus: "focus",
|
|
9997
10159
|
Generic: "generic",
|
|
9998
10160
|
"Google Search": "google_search",
|
|
9999
10161
|
Googlebot: "googlebot",
|
|
10162
|
+
GPTBot: "gptbot",
|
|
10000
10163
|
"Internet Explorer": "ie",
|
|
10164
|
+
InternetArchiveCrawler: "internetarchivecrawler",
|
|
10001
10165
|
"K-Meleon": "k_meleon",
|
|
10166
|
+
LibreWolf: "librewolf",
|
|
10002
10167
|
Maxthon: "maxthon",
|
|
10168
|
+
"Meta-ExternalAds": "meta_externalads",
|
|
10169
|
+
"Meta-ExternalAgent": "meta_externalagent",
|
|
10170
|
+
"Meta-ExternalFetcher": "meta_externalfetcher",
|
|
10171
|
+
"Meta-WebIndexer": "meta_webindexer",
|
|
10003
10172
|
"Microsoft Edge": "edge",
|
|
10004
10173
|
"MZ Browser": "mz",
|
|
10005
10174
|
"NAVER Whale Browser": "naver",
|
|
10175
|
+
"OAI-SearchBot": "oai_searchbot",
|
|
10176
|
+
Omgilibot: "omgilibot",
|
|
10006
10177
|
Opera: "opera",
|
|
10007
10178
|
"Opera Coast": "opera_coast",
|
|
10008
10179
|
"Pale Moon": "pale_moon",
|
|
10180
|
+
PerplexityBot: "perplexitybot",
|
|
10181
|
+
"Perplexity-User": "perplexity_user",
|
|
10009
10182
|
PhantomJS: "phantomjs",
|
|
10183
|
+
PingdomBot: "pingdombot",
|
|
10010
10184
|
Puffin: "puffin",
|
|
10011
|
-
QupZilla: "qupzilla",
|
|
10012
10185
|
QQ: "qq",
|
|
10013
10186
|
QQLite: "qqlite",
|
|
10187
|
+
QupZilla: "qupzilla",
|
|
10188
|
+
Roku: "roku",
|
|
10014
10189
|
Safari: "safari",
|
|
10015
10190
|
Sailfish: "sailfish",
|
|
10016
10191
|
"Samsung Internet for Android": "samsung_internet",
|
|
10017
10192
|
SeaMonkey: "seamonkey",
|
|
10018
10193
|
Sleipnir: "sleipnir",
|
|
10194
|
+
"Sogou Browser": "sogou",
|
|
10019
10195
|
Swing: "swing",
|
|
10020
10196
|
Tizen: "tizen",
|
|
10021
10197
|
"UC Browser": "uc",
|
|
10022
10198
|
Vivaldi: "vivaldi",
|
|
10023
10199
|
"WebOS Browser": "webos",
|
|
10024
10200
|
WeChat: "wechat",
|
|
10201
|
+
YahooSlurp: "yahooslurp",
|
|
10025
10202
|
"Yandex Browser": "yandex",
|
|
10026
|
-
|
|
10203
|
+
YandexBot: "yandexbot",
|
|
10204
|
+
YouBot: "youbot"
|
|
10027
10205
|
};
|
|
10028
10206
|
const BROWSER_MAP = {
|
|
10207
|
+
amazonbot: "AmazonBot",
|
|
10029
10208
|
amazon_silk: "Amazon Silk",
|
|
10030
10209
|
android: "Android Browser",
|
|
10210
|
+
baiduspider: "BaiduSpider",
|
|
10031
10211
|
bada: "Bada",
|
|
10212
|
+
bingcrawler: "BingCrawler",
|
|
10032
10213
|
blackberry: "BlackBerry",
|
|
10214
|
+
chatgpt_user: "ChatGPT-User",
|
|
10033
10215
|
chrome: "Chrome",
|
|
10216
|
+
claudebot: "ClaudeBot",
|
|
10034
10217
|
chromium: "Chromium",
|
|
10218
|
+
diffbot: "Diffbot",
|
|
10219
|
+
duckduckbot: "DuckDuckBot",
|
|
10220
|
+
edge: "Microsoft Edge",
|
|
10035
10221
|
electron: "Electron",
|
|
10036
10222
|
epiphany: "Epiphany",
|
|
10223
|
+
facebookexternalhit: "FacebookExternalHit",
|
|
10037
10224
|
firefox: "Firefox",
|
|
10038
10225
|
focus: "Focus",
|
|
10039
10226
|
generic: "Generic",
|
|
10040
|
-
googlebot: "Googlebot",
|
|
10041
10227
|
google_search: "Google Search",
|
|
10228
|
+
googlebot: "Googlebot",
|
|
10229
|
+
gptbot: "GPTBot",
|
|
10042
10230
|
ie: "Internet Explorer",
|
|
10231
|
+
internetarchivecrawler: "InternetArchiveCrawler",
|
|
10043
10232
|
k_meleon: "K-Meleon",
|
|
10233
|
+
librewolf: "LibreWolf",
|
|
10044
10234
|
maxthon: "Maxthon",
|
|
10045
|
-
|
|
10235
|
+
meta_externalads: "Meta-ExternalAds",
|
|
10236
|
+
meta_externalagent: "Meta-ExternalAgent",
|
|
10237
|
+
meta_externalfetcher: "Meta-ExternalFetcher",
|
|
10238
|
+
meta_webindexer: "Meta-WebIndexer",
|
|
10046
10239
|
mz: "MZ Browser",
|
|
10047
10240
|
naver: "NAVER Whale Browser",
|
|
10241
|
+
oai_searchbot: "OAI-SearchBot",
|
|
10242
|
+
omgilibot: "Omgilibot",
|
|
10048
10243
|
opera: "Opera",
|
|
10049
10244
|
opera_coast: "Opera Coast",
|
|
10050
10245
|
pale_moon: "Pale Moon",
|
|
10246
|
+
perplexitybot: "PerplexityBot",
|
|
10247
|
+
perplexity_user: "Perplexity-User",
|
|
10051
10248
|
phantomjs: "PhantomJS",
|
|
10249
|
+
pingdombot: "PingdomBot",
|
|
10052
10250
|
puffin: "Puffin",
|
|
10053
|
-
qupzilla: "QupZilla",
|
|
10054
10251
|
qq: "QQ Browser",
|
|
10055
10252
|
qqlite: "QQ Browser Lite",
|
|
10253
|
+
qupzilla: "QupZilla",
|
|
10254
|
+
roku: "Roku",
|
|
10056
10255
|
safari: "Safari",
|
|
10057
10256
|
sailfish: "Sailfish",
|
|
10058
10257
|
samsung_internet: "Samsung Internet for Android",
|
|
10059
10258
|
seamonkey: "SeaMonkey",
|
|
10060
10259
|
sleipnir: "Sleipnir",
|
|
10260
|
+
sogou: "Sogou Browser",
|
|
10061
10261
|
swing: "Swing",
|
|
10062
10262
|
tizen: "Tizen",
|
|
10063
10263
|
uc: "UC Browser",
|
|
10064
10264
|
vivaldi: "Vivaldi",
|
|
10065
10265
|
webos: "WebOS Browser",
|
|
10066
10266
|
wechat: "WeChat",
|
|
10067
|
-
|
|
10267
|
+
yahooslurp: "YahooSlurp",
|
|
10268
|
+
yandex: "Yandex Browser",
|
|
10269
|
+
yandexbot: "YandexBot",
|
|
10270
|
+
youbot: "YouBot"
|
|
10068
10271
|
};
|
|
10069
10272
|
const PLATFORMS_MAP = {
|
|
10070
|
-
|
|
10071
|
-
mobile: "mobile",
|
|
10273
|
+
bot: "bot",
|
|
10072
10274
|
desktop: "desktop",
|
|
10073
|
-
|
|
10074
|
-
|
|
10275
|
+
mobile: "mobile",
|
|
10276
|
+
tablet: "tablet",
|
|
10277
|
+
tv: "tv"
|
|
10075
10278
|
};
|
|
10076
10279
|
const OS_MAP = {
|
|
10077
|
-
WindowsPhone: "Windows Phone",
|
|
10078
|
-
Windows: "Windows",
|
|
10079
|
-
MacOS: "macOS",
|
|
10080
|
-
iOS: "iOS",
|
|
10081
10280
|
Android: "Android",
|
|
10082
|
-
WebOS: "WebOS",
|
|
10083
|
-
BlackBerry: "BlackBerry",
|
|
10084
10281
|
Bada: "Bada",
|
|
10085
|
-
|
|
10086
|
-
Linux: "Linux",
|
|
10282
|
+
BlackBerry: "BlackBerry",
|
|
10087
10283
|
ChromeOS: "Chrome OS",
|
|
10284
|
+
HarmonyOS: "HarmonyOS",
|
|
10285
|
+
iOS: "iOS",
|
|
10286
|
+
Linux: "Linux",
|
|
10287
|
+
MacOS: "macOS",
|
|
10088
10288
|
PlayStation4: "PlayStation 4",
|
|
10089
|
-
Roku: "Roku"
|
|
10289
|
+
Roku: "Roku",
|
|
10290
|
+
Tizen: "Tizen",
|
|
10291
|
+
WebOS: "WebOS",
|
|
10292
|
+
Windows: "Windows",
|
|
10293
|
+
WindowsPhone: "Windows Phone"
|
|
10090
10294
|
};
|
|
10091
10295
|
const ENGINE_MAP = {
|
|
10092
|
-
EdgeHTML: "EdgeHTML",
|
|
10093
10296
|
Blink: "Blink",
|
|
10094
|
-
|
|
10095
|
-
Presto: "Presto",
|
|
10297
|
+
EdgeHTML: "EdgeHTML",
|
|
10096
10298
|
Gecko: "Gecko",
|
|
10299
|
+
Presto: "Presto",
|
|
10300
|
+
Trident: "Trident",
|
|
10097
10301
|
WebKit: "WebKit"
|
|
10098
10302
|
};
|
|
10099
10303
|
|
|
@@ -10170,6 +10374,11 @@ class Utils {
|
|
|
10170
10374
|
* 10.13 - High Sierra
|
|
10171
10375
|
* 10.14 - Mojave
|
|
10172
10376
|
* 10.15 - Catalina
|
|
10377
|
+
* 11 - Big Sur
|
|
10378
|
+
* 12 - Monterey
|
|
10379
|
+
* 13 - Ventura
|
|
10380
|
+
* 14 - Sonoma
|
|
10381
|
+
* 15 - Sequoia
|
|
10173
10382
|
*
|
|
10174
10383
|
* @example
|
|
10175
10384
|
* getMacOSVersionName("10.14") // 'Mojave'
|
|
@@ -10180,30 +10389,47 @@ class Utils {
|
|
|
10180
10389
|
static getMacOSVersionName(version) {
|
|
10181
10390
|
const v = version.split(".").splice(0, 2).map((s) => parseInt(s, 10) || 0);
|
|
10182
10391
|
v.push(0);
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10392
|
+
const major = v[0];
|
|
10393
|
+
const minor = v[1];
|
|
10394
|
+
if (major === 10) {
|
|
10395
|
+
switch (minor) {
|
|
10396
|
+
case 5:
|
|
10397
|
+
return "Leopard";
|
|
10398
|
+
case 6:
|
|
10399
|
+
return "Snow Leopard";
|
|
10400
|
+
case 7:
|
|
10401
|
+
return "Lion";
|
|
10402
|
+
case 8:
|
|
10403
|
+
return "Mountain Lion";
|
|
10404
|
+
case 9:
|
|
10405
|
+
return "Mavericks";
|
|
10406
|
+
case 10:
|
|
10407
|
+
return "Yosemite";
|
|
10408
|
+
case 11:
|
|
10409
|
+
return "El Capitan";
|
|
10410
|
+
case 12:
|
|
10411
|
+
return "Sierra";
|
|
10412
|
+
case 13:
|
|
10413
|
+
return "High Sierra";
|
|
10414
|
+
case 14:
|
|
10415
|
+
return "Mojave";
|
|
10416
|
+
case 15:
|
|
10417
|
+
return "Catalina";
|
|
10418
|
+
default:
|
|
10419
|
+
return void 0;
|
|
10420
|
+
}
|
|
10421
|
+
}
|
|
10422
|
+
switch (major) {
|
|
10197
10423
|
case 11:
|
|
10198
|
-
return "
|
|
10424
|
+
return "Big Sur";
|
|
10199
10425
|
case 12:
|
|
10200
|
-
return "
|
|
10426
|
+
return "Monterey";
|
|
10201
10427
|
case 13:
|
|
10202
|
-
return "
|
|
10428
|
+
return "Ventura";
|
|
10203
10429
|
case 14:
|
|
10204
|
-
return "
|
|
10430
|
+
return "Sonoma";
|
|
10205
10431
|
case 15:
|
|
10206
|
-
return "
|
|
10432
|
+
return "Sequoia";
|
|
10207
10433
|
default:
|
|
10208
10434
|
return void 0;
|
|
10209
10435
|
}
|
|
@@ -10402,6 +10628,188 @@ class Utils {
|
|
|
10402
10628
|
|
|
10403
10629
|
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
|
10404
10630
|
const browsersList = [
|
|
10631
|
+
/* GPTBot */
|
|
10632
|
+
{
|
|
10633
|
+
test: [/gptbot/i],
|
|
10634
|
+
describe(ua) {
|
|
10635
|
+
const browser = {
|
|
10636
|
+
name: "GPTBot"
|
|
10637
|
+
};
|
|
10638
|
+
const version = Utils.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10639
|
+
if (version) {
|
|
10640
|
+
browser.version = version;
|
|
10641
|
+
}
|
|
10642
|
+
return browser;
|
|
10643
|
+
}
|
|
10644
|
+
},
|
|
10645
|
+
/* ChatGPT-User */
|
|
10646
|
+
{
|
|
10647
|
+
test: [/chatgpt-user/i],
|
|
10648
|
+
describe(ua) {
|
|
10649
|
+
const browser = {
|
|
10650
|
+
name: "ChatGPT-User"
|
|
10651
|
+
};
|
|
10652
|
+
const version = Utils.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10653
|
+
if (version) {
|
|
10654
|
+
browser.version = version;
|
|
10655
|
+
}
|
|
10656
|
+
return browser;
|
|
10657
|
+
}
|
|
10658
|
+
},
|
|
10659
|
+
/* OAI-SearchBot */
|
|
10660
|
+
{
|
|
10661
|
+
test: [/oai-searchbot/i],
|
|
10662
|
+
describe(ua) {
|
|
10663
|
+
const browser = {
|
|
10664
|
+
name: "OAI-SearchBot"
|
|
10665
|
+
};
|
|
10666
|
+
const version = Utils.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10667
|
+
if (version) {
|
|
10668
|
+
browser.version = version;
|
|
10669
|
+
}
|
|
10670
|
+
return browser;
|
|
10671
|
+
}
|
|
10672
|
+
},
|
|
10673
|
+
/* ClaudeBot */
|
|
10674
|
+
{
|
|
10675
|
+
test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
|
|
10676
|
+
describe(ua) {
|
|
10677
|
+
const browser = {
|
|
10678
|
+
name: "ClaudeBot"
|
|
10679
|
+
};
|
|
10680
|
+
const version = Utils.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10681
|
+
if (version) {
|
|
10682
|
+
browser.version = version;
|
|
10683
|
+
}
|
|
10684
|
+
return browser;
|
|
10685
|
+
}
|
|
10686
|
+
},
|
|
10687
|
+
/* Omgilibot */
|
|
10688
|
+
{
|
|
10689
|
+
test: [/omgilibot/i, /webzio-extended/i],
|
|
10690
|
+
describe(ua) {
|
|
10691
|
+
const browser = {
|
|
10692
|
+
name: "Omgilibot"
|
|
10693
|
+
};
|
|
10694
|
+
const version = Utils.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10695
|
+
if (version) {
|
|
10696
|
+
browser.version = version;
|
|
10697
|
+
}
|
|
10698
|
+
return browser;
|
|
10699
|
+
}
|
|
10700
|
+
},
|
|
10701
|
+
/* Diffbot */
|
|
10702
|
+
{
|
|
10703
|
+
test: [/diffbot/i],
|
|
10704
|
+
describe(ua) {
|
|
10705
|
+
const browser = {
|
|
10706
|
+
name: "Diffbot"
|
|
10707
|
+
};
|
|
10708
|
+
const version = Utils.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10709
|
+
if (version) {
|
|
10710
|
+
browser.version = version;
|
|
10711
|
+
}
|
|
10712
|
+
return browser;
|
|
10713
|
+
}
|
|
10714
|
+
},
|
|
10715
|
+
/* PerplexityBot */
|
|
10716
|
+
{
|
|
10717
|
+
test: [/perplexitybot/i],
|
|
10718
|
+
describe(ua) {
|
|
10719
|
+
const browser = {
|
|
10720
|
+
name: "PerplexityBot"
|
|
10721
|
+
};
|
|
10722
|
+
const version = Utils.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10723
|
+
if (version) {
|
|
10724
|
+
browser.version = version;
|
|
10725
|
+
}
|
|
10726
|
+
return browser;
|
|
10727
|
+
}
|
|
10728
|
+
},
|
|
10729
|
+
/* Perplexity-User */
|
|
10730
|
+
{
|
|
10731
|
+
test: [/perplexity-user/i],
|
|
10732
|
+
describe(ua) {
|
|
10733
|
+
const browser = {
|
|
10734
|
+
name: "Perplexity-User"
|
|
10735
|
+
};
|
|
10736
|
+
const version = Utils.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10737
|
+
if (version) {
|
|
10738
|
+
browser.version = version;
|
|
10739
|
+
}
|
|
10740
|
+
return browser;
|
|
10741
|
+
}
|
|
10742
|
+
},
|
|
10743
|
+
/* YouBot */
|
|
10744
|
+
{
|
|
10745
|
+
test: [/youbot/i],
|
|
10746
|
+
describe(ua) {
|
|
10747
|
+
const browser = {
|
|
10748
|
+
name: "YouBot"
|
|
10749
|
+
};
|
|
10750
|
+
const version = Utils.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10751
|
+
if (version) {
|
|
10752
|
+
browser.version = version;
|
|
10753
|
+
}
|
|
10754
|
+
return browser;
|
|
10755
|
+
}
|
|
10756
|
+
},
|
|
10757
|
+
/* Meta-WebIndexer */
|
|
10758
|
+
{
|
|
10759
|
+
test: [/meta-webindexer/i],
|
|
10760
|
+
describe(ua) {
|
|
10761
|
+
const browser = {
|
|
10762
|
+
name: "Meta-WebIndexer"
|
|
10763
|
+
};
|
|
10764
|
+
const version = Utils.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10765
|
+
if (version) {
|
|
10766
|
+
browser.version = version;
|
|
10767
|
+
}
|
|
10768
|
+
return browser;
|
|
10769
|
+
}
|
|
10770
|
+
},
|
|
10771
|
+
/* Meta-ExternalAds */
|
|
10772
|
+
{
|
|
10773
|
+
test: [/meta-externalads/i],
|
|
10774
|
+
describe(ua) {
|
|
10775
|
+
const browser = {
|
|
10776
|
+
name: "Meta-ExternalAds"
|
|
10777
|
+
};
|
|
10778
|
+
const version = Utils.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10779
|
+
if (version) {
|
|
10780
|
+
browser.version = version;
|
|
10781
|
+
}
|
|
10782
|
+
return browser;
|
|
10783
|
+
}
|
|
10784
|
+
},
|
|
10785
|
+
/* Meta-ExternalAgent */
|
|
10786
|
+
{
|
|
10787
|
+
test: [/meta-externalagent/i],
|
|
10788
|
+
describe(ua) {
|
|
10789
|
+
const browser = {
|
|
10790
|
+
name: "Meta-ExternalAgent"
|
|
10791
|
+
};
|
|
10792
|
+
const version = Utils.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10793
|
+
if (version) {
|
|
10794
|
+
browser.version = version;
|
|
10795
|
+
}
|
|
10796
|
+
return browser;
|
|
10797
|
+
}
|
|
10798
|
+
},
|
|
10799
|
+
/* Meta-ExternalFetcher */
|
|
10800
|
+
{
|
|
10801
|
+
test: [/meta-externalfetcher/i],
|
|
10802
|
+
describe(ua) {
|
|
10803
|
+
const browser = {
|
|
10804
|
+
name: "Meta-ExternalFetcher"
|
|
10805
|
+
};
|
|
10806
|
+
const version = Utils.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10807
|
+
if (version) {
|
|
10808
|
+
browser.version = version;
|
|
10809
|
+
}
|
|
10810
|
+
return browser;
|
|
10811
|
+
}
|
|
10812
|
+
},
|
|
10405
10813
|
/* Googlebot */
|
|
10406
10814
|
{
|
|
10407
10815
|
test: [/googlebot/i],
|
|
@@ -10416,6 +10824,112 @@ const browsersList = [
|
|
|
10416
10824
|
return browser;
|
|
10417
10825
|
}
|
|
10418
10826
|
},
|
|
10827
|
+
/* AmazonBot */
|
|
10828
|
+
{
|
|
10829
|
+
test: [/amazonbot/i],
|
|
10830
|
+
describe(ua) {
|
|
10831
|
+
const browser = {
|
|
10832
|
+
name: "AmazonBot"
|
|
10833
|
+
};
|
|
10834
|
+
const version = Utils.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10835
|
+
if (version) {
|
|
10836
|
+
browser.version = version;
|
|
10837
|
+
}
|
|
10838
|
+
return browser;
|
|
10839
|
+
}
|
|
10840
|
+
},
|
|
10841
|
+
/* BingCrawler */
|
|
10842
|
+
{
|
|
10843
|
+
test: [/bingbot/i],
|
|
10844
|
+
describe(ua) {
|
|
10845
|
+
const browser = {
|
|
10846
|
+
name: "BingCrawler"
|
|
10847
|
+
};
|
|
10848
|
+
const version = Utils.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10849
|
+
if (version) {
|
|
10850
|
+
browser.version = version;
|
|
10851
|
+
}
|
|
10852
|
+
return browser;
|
|
10853
|
+
}
|
|
10854
|
+
},
|
|
10855
|
+
/* BaiduSpider */
|
|
10856
|
+
{
|
|
10857
|
+
test: [/baiduspider/i],
|
|
10858
|
+
describe(ua) {
|
|
10859
|
+
const browser = {
|
|
10860
|
+
name: "BaiduSpider"
|
|
10861
|
+
};
|
|
10862
|
+
const version = Utils.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10863
|
+
if (version) {
|
|
10864
|
+
browser.version = version;
|
|
10865
|
+
}
|
|
10866
|
+
return browser;
|
|
10867
|
+
}
|
|
10868
|
+
},
|
|
10869
|
+
/* DuckDuckBot */
|
|
10870
|
+
{
|
|
10871
|
+
test: [/duckduckbot/i],
|
|
10872
|
+
describe(ua) {
|
|
10873
|
+
const browser = {
|
|
10874
|
+
name: "DuckDuckBot"
|
|
10875
|
+
};
|
|
10876
|
+
const version = Utils.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10877
|
+
if (version) {
|
|
10878
|
+
browser.version = version;
|
|
10879
|
+
}
|
|
10880
|
+
return browser;
|
|
10881
|
+
}
|
|
10882
|
+
},
|
|
10883
|
+
/* InternetArchiveCrawler */
|
|
10884
|
+
{
|
|
10885
|
+
test: [/ia_archiver/i],
|
|
10886
|
+
describe(ua) {
|
|
10887
|
+
const browser = {
|
|
10888
|
+
name: "InternetArchiveCrawler"
|
|
10889
|
+
};
|
|
10890
|
+
const version = Utils.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
10891
|
+
if (version) {
|
|
10892
|
+
browser.version = version;
|
|
10893
|
+
}
|
|
10894
|
+
return browser;
|
|
10895
|
+
}
|
|
10896
|
+
},
|
|
10897
|
+
/* FacebookExternalHit */
|
|
10898
|
+
{
|
|
10899
|
+
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
|
10900
|
+
describe() {
|
|
10901
|
+
return {
|
|
10902
|
+
name: "FacebookExternalHit"
|
|
10903
|
+
};
|
|
10904
|
+
}
|
|
10905
|
+
},
|
|
10906
|
+
/* YahooSlurp */
|
|
10907
|
+
{
|
|
10908
|
+
test: [/yahoo!?[\s/]*slurp/i],
|
|
10909
|
+
describe() {
|
|
10910
|
+
return {
|
|
10911
|
+
name: "YahooSlurp"
|
|
10912
|
+
};
|
|
10913
|
+
}
|
|
10914
|
+
},
|
|
10915
|
+
/* YandexBot */
|
|
10916
|
+
{
|
|
10917
|
+
test: [/yandexbot/i, /yandexmobilebot/i],
|
|
10918
|
+
describe() {
|
|
10919
|
+
return {
|
|
10920
|
+
name: "YandexBot"
|
|
10921
|
+
};
|
|
10922
|
+
}
|
|
10923
|
+
},
|
|
10924
|
+
/* PingdomBot */
|
|
10925
|
+
{
|
|
10926
|
+
test: [/pingdom/i],
|
|
10927
|
+
describe() {
|
|
10928
|
+
return {
|
|
10929
|
+
name: "PingdomBot"
|
|
10930
|
+
};
|
|
10931
|
+
}
|
|
10932
|
+
},
|
|
10419
10933
|
/* Opera < 13.0 */
|
|
10420
10934
|
{
|
|
10421
10935
|
test: [/opera/i],
|
|
@@ -10847,6 +11361,19 @@ const browsersList = [
|
|
|
10847
11361
|
return browser;
|
|
10848
11362
|
}
|
|
10849
11363
|
},
|
|
11364
|
+
{
|
|
11365
|
+
test: [/librewolf/i],
|
|
11366
|
+
describe(ua) {
|
|
11367
|
+
const browser = {
|
|
11368
|
+
name: "LibreWolf"
|
|
11369
|
+
};
|
|
11370
|
+
const version = Utils.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
11371
|
+
if (version) {
|
|
11372
|
+
browser.version = version;
|
|
11373
|
+
}
|
|
11374
|
+
return browser;
|
|
11375
|
+
}
|
|
11376
|
+
},
|
|
10850
11377
|
{
|
|
10851
11378
|
test: [/firefox|iceweasel|fxios/i],
|
|
10852
11379
|
describe(ua) {
|
|
@@ -10873,6 +11400,22 @@ const browsersList = [
|
|
|
10873
11400
|
return browser;
|
|
10874
11401
|
}
|
|
10875
11402
|
},
|
|
11403
|
+
{
|
|
11404
|
+
test: [/sogoumobilebrowser/i, /metasr/i, /se 2\.[x]/i],
|
|
11405
|
+
describe(ua) {
|
|
11406
|
+
const browser = {
|
|
11407
|
+
name: "Sogou Browser"
|
|
11408
|
+
};
|
|
11409
|
+
const sogouMobileVersion = Utils.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
|
11410
|
+
const chromiumVersion = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua);
|
|
11411
|
+
const seVersion = Utils.getFirstMatch(/se ([\d.]+)x/i, ua);
|
|
11412
|
+
const version = sogouMobileVersion || chromiumVersion || seVersion;
|
|
11413
|
+
if (version) {
|
|
11414
|
+
browser.version = version;
|
|
11415
|
+
}
|
|
11416
|
+
return browser;
|
|
11417
|
+
}
|
|
11418
|
+
},
|
|
10876
11419
|
{
|
|
10877
11420
|
test: [/MiuiBrowser/i],
|
|
10878
11421
|
describe(ua) {
|
|
@@ -11064,6 +11607,17 @@ const osParsersList = [
|
|
|
11064
11607
|
};
|
|
11065
11608
|
}
|
|
11066
11609
|
},
|
|
11610
|
+
/* HarmonyOS */
|
|
11611
|
+
{
|
|
11612
|
+
test: [/OpenHarmony/i],
|
|
11613
|
+
describe(ua) {
|
|
11614
|
+
const version = Utils.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i, ua);
|
|
11615
|
+
return {
|
|
11616
|
+
name: OS_MAP.HarmonyOS,
|
|
11617
|
+
version
|
|
11618
|
+
};
|
|
11619
|
+
}
|
|
11620
|
+
},
|
|
11067
11621
|
/* Android */
|
|
11068
11622
|
{
|
|
11069
11623
|
test(parser) {
|
|
@@ -11173,6 +11727,226 @@ const platformParsersList = [
|
|
|
11173
11727
|
};
|
|
11174
11728
|
}
|
|
11175
11729
|
},
|
|
11730
|
+
/* AmazonBot */
|
|
11731
|
+
{
|
|
11732
|
+
test: [/amazonbot/i],
|
|
11733
|
+
describe() {
|
|
11734
|
+
return {
|
|
11735
|
+
type: PLATFORMS_MAP.bot,
|
|
11736
|
+
vendor: "Amazon"
|
|
11737
|
+
};
|
|
11738
|
+
}
|
|
11739
|
+
},
|
|
11740
|
+
/* GPTBot */
|
|
11741
|
+
{
|
|
11742
|
+
test: [/gptbot/i],
|
|
11743
|
+
describe() {
|
|
11744
|
+
return {
|
|
11745
|
+
type: PLATFORMS_MAP.bot,
|
|
11746
|
+
vendor: "OpenAI"
|
|
11747
|
+
};
|
|
11748
|
+
}
|
|
11749
|
+
},
|
|
11750
|
+
/* ChatGPT-User */
|
|
11751
|
+
{
|
|
11752
|
+
test: [/chatgpt-user/i],
|
|
11753
|
+
describe() {
|
|
11754
|
+
return {
|
|
11755
|
+
type: PLATFORMS_MAP.bot,
|
|
11756
|
+
vendor: "OpenAI"
|
|
11757
|
+
};
|
|
11758
|
+
}
|
|
11759
|
+
},
|
|
11760
|
+
/* OAI-SearchBot */
|
|
11761
|
+
{
|
|
11762
|
+
test: [/oai-searchbot/i],
|
|
11763
|
+
describe() {
|
|
11764
|
+
return {
|
|
11765
|
+
type: PLATFORMS_MAP.bot,
|
|
11766
|
+
vendor: "OpenAI"
|
|
11767
|
+
};
|
|
11768
|
+
}
|
|
11769
|
+
},
|
|
11770
|
+
/* Baidu */
|
|
11771
|
+
{
|
|
11772
|
+
test: [/baiduspider/i],
|
|
11773
|
+
describe() {
|
|
11774
|
+
return {
|
|
11775
|
+
type: PLATFORMS_MAP.bot,
|
|
11776
|
+
vendor: "Baidu"
|
|
11777
|
+
};
|
|
11778
|
+
}
|
|
11779
|
+
},
|
|
11780
|
+
/* Bingbot */
|
|
11781
|
+
{
|
|
11782
|
+
test: [/bingbot/i],
|
|
11783
|
+
describe() {
|
|
11784
|
+
return {
|
|
11785
|
+
type: PLATFORMS_MAP.bot,
|
|
11786
|
+
vendor: "Bing"
|
|
11787
|
+
};
|
|
11788
|
+
}
|
|
11789
|
+
},
|
|
11790
|
+
/* DuckDuckBot */
|
|
11791
|
+
{
|
|
11792
|
+
test: [/duckduckbot/i],
|
|
11793
|
+
describe() {
|
|
11794
|
+
return {
|
|
11795
|
+
type: PLATFORMS_MAP.bot,
|
|
11796
|
+
vendor: "DuckDuckGo"
|
|
11797
|
+
};
|
|
11798
|
+
}
|
|
11799
|
+
},
|
|
11800
|
+
/* ClaudeBot */
|
|
11801
|
+
{
|
|
11802
|
+
test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
|
|
11803
|
+
describe() {
|
|
11804
|
+
return {
|
|
11805
|
+
type: PLATFORMS_MAP.bot,
|
|
11806
|
+
vendor: "Anthropic"
|
|
11807
|
+
};
|
|
11808
|
+
}
|
|
11809
|
+
},
|
|
11810
|
+
/* Omgilibot */
|
|
11811
|
+
{
|
|
11812
|
+
test: [/omgilibot/i, /webzio-extended/i],
|
|
11813
|
+
describe() {
|
|
11814
|
+
return {
|
|
11815
|
+
type: PLATFORMS_MAP.bot,
|
|
11816
|
+
vendor: "Webz.io"
|
|
11817
|
+
};
|
|
11818
|
+
}
|
|
11819
|
+
},
|
|
11820
|
+
/* Diffbot */
|
|
11821
|
+
{
|
|
11822
|
+
test: [/diffbot/i],
|
|
11823
|
+
describe() {
|
|
11824
|
+
return {
|
|
11825
|
+
type: PLATFORMS_MAP.bot,
|
|
11826
|
+
vendor: "Diffbot"
|
|
11827
|
+
};
|
|
11828
|
+
}
|
|
11829
|
+
},
|
|
11830
|
+
/* PerplexityBot */
|
|
11831
|
+
{
|
|
11832
|
+
test: [/perplexitybot/i],
|
|
11833
|
+
describe() {
|
|
11834
|
+
return {
|
|
11835
|
+
type: PLATFORMS_MAP.bot,
|
|
11836
|
+
vendor: "Perplexity AI"
|
|
11837
|
+
};
|
|
11838
|
+
}
|
|
11839
|
+
},
|
|
11840
|
+
/* Perplexity-User */
|
|
11841
|
+
{
|
|
11842
|
+
test: [/perplexity-user/i],
|
|
11843
|
+
describe() {
|
|
11844
|
+
return {
|
|
11845
|
+
type: PLATFORMS_MAP.bot,
|
|
11846
|
+
vendor: "Perplexity AI"
|
|
11847
|
+
};
|
|
11848
|
+
}
|
|
11849
|
+
},
|
|
11850
|
+
/* YouBot */
|
|
11851
|
+
{
|
|
11852
|
+
test: [/youbot/i],
|
|
11853
|
+
describe() {
|
|
11854
|
+
return {
|
|
11855
|
+
type: PLATFORMS_MAP.bot,
|
|
11856
|
+
vendor: "You.com"
|
|
11857
|
+
};
|
|
11858
|
+
}
|
|
11859
|
+
},
|
|
11860
|
+
/* Internet Archive Crawler */
|
|
11861
|
+
{
|
|
11862
|
+
test: [/ia_archiver/i],
|
|
11863
|
+
describe() {
|
|
11864
|
+
return {
|
|
11865
|
+
type: PLATFORMS_MAP.bot,
|
|
11866
|
+
vendor: "Internet Archive"
|
|
11867
|
+
};
|
|
11868
|
+
}
|
|
11869
|
+
},
|
|
11870
|
+
/* Meta-WebIndexer */
|
|
11871
|
+
{
|
|
11872
|
+
test: [/meta-webindexer/i],
|
|
11873
|
+
describe() {
|
|
11874
|
+
return {
|
|
11875
|
+
type: PLATFORMS_MAP.bot,
|
|
11876
|
+
vendor: "Meta"
|
|
11877
|
+
};
|
|
11878
|
+
}
|
|
11879
|
+
},
|
|
11880
|
+
/* Meta-ExternalAds */
|
|
11881
|
+
{
|
|
11882
|
+
test: [/meta-externalads/i],
|
|
11883
|
+
describe() {
|
|
11884
|
+
return {
|
|
11885
|
+
type: PLATFORMS_MAP.bot,
|
|
11886
|
+
vendor: "Meta"
|
|
11887
|
+
};
|
|
11888
|
+
}
|
|
11889
|
+
},
|
|
11890
|
+
/* Meta-ExternalAgent */
|
|
11891
|
+
{
|
|
11892
|
+
test: [/meta-externalagent/i],
|
|
11893
|
+
describe() {
|
|
11894
|
+
return {
|
|
11895
|
+
type: PLATFORMS_MAP.bot,
|
|
11896
|
+
vendor: "Meta"
|
|
11897
|
+
};
|
|
11898
|
+
}
|
|
11899
|
+
},
|
|
11900
|
+
/* Meta-ExternalFetcher */
|
|
11901
|
+
{
|
|
11902
|
+
test: [/meta-externalfetcher/i],
|
|
11903
|
+
describe() {
|
|
11904
|
+
return {
|
|
11905
|
+
type: PLATFORMS_MAP.bot,
|
|
11906
|
+
vendor: "Meta"
|
|
11907
|
+
};
|
|
11908
|
+
}
|
|
11909
|
+
},
|
|
11910
|
+
/* Meta Web Crawler */
|
|
11911
|
+
{
|
|
11912
|
+
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
|
11913
|
+
describe() {
|
|
11914
|
+
return {
|
|
11915
|
+
type: PLATFORMS_MAP.bot,
|
|
11916
|
+
vendor: "Meta"
|
|
11917
|
+
};
|
|
11918
|
+
}
|
|
11919
|
+
},
|
|
11920
|
+
/* Yahoo! Slurp */
|
|
11921
|
+
{
|
|
11922
|
+
test: [/yahoo/i],
|
|
11923
|
+
describe() {
|
|
11924
|
+
return {
|
|
11925
|
+
type: PLATFORMS_MAP.bot,
|
|
11926
|
+
vendor: "Yahoo"
|
|
11927
|
+
};
|
|
11928
|
+
}
|
|
11929
|
+
},
|
|
11930
|
+
/* Yandex */
|
|
11931
|
+
{
|
|
11932
|
+
test: [/yandexbot/i, /yandexmobilebot/i],
|
|
11933
|
+
describe() {
|
|
11934
|
+
return {
|
|
11935
|
+
type: PLATFORMS_MAP.bot,
|
|
11936
|
+
vendor: "Yandex"
|
|
11937
|
+
};
|
|
11938
|
+
}
|
|
11939
|
+
},
|
|
11940
|
+
/* Pingdom */
|
|
11941
|
+
{
|
|
11942
|
+
test: [/pingdom/i],
|
|
11943
|
+
describe() {
|
|
11944
|
+
return {
|
|
11945
|
+
type: PLATFORMS_MAP.bot,
|
|
11946
|
+
vendor: "Pingdom"
|
|
11947
|
+
};
|
|
11948
|
+
}
|
|
11949
|
+
},
|
|
11176
11950
|
/* Huawei */
|
|
11177
11951
|
{
|
|
11178
11952
|
test: [/huawei/i],
|
|
@@ -12155,20 +12929,20 @@ var mods = {};
|
|
|
12155
12929
|
|
|
12156
12930
|
var utils = {};
|
|
12157
12931
|
|
|
12158
|
-
(function (exports) {
|
|
12159
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12160
|
-
exports.updateValues = exports.removeSuffix = exports.addSuffix = exports.splitTokens = exports.collapseTokens = exports.expandTokens = exports.getTokenType = exports.deepMerge = exports.isObject = void 0;
|
|
12932
|
+
(function (exports$1) {
|
|
12933
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
12934
|
+
exports$1.updateValues = exports$1.removeSuffix = exports$1.addSuffix = exports$1.splitTokens = exports$1.collapseTokens = exports$1.expandTokens = exports$1.getTokenType = exports$1.deepMerge = exports$1.isObject = void 0;
|
|
12161
12935
|
const isObject = (value) => value && typeof value === "object" && !Array.isArray(value);
|
|
12162
|
-
exports.isObject = isObject;
|
|
12936
|
+
exports$1.isObject = isObject;
|
|
12163
12937
|
const deepMerge = (target, source) => {
|
|
12164
12938
|
let retValues = Object.assign({}, target);
|
|
12165
|
-
if ((0, exports.isObject)(target) && (0, exports.isObject)(source)) {
|
|
12939
|
+
if ((0, exports$1.isObject)(target) && (0, exports$1.isObject)(source)) {
|
|
12166
12940
|
Object.keys(source).forEach((key) => {
|
|
12167
|
-
if ((0, exports.isObject)(source[key])) {
|
|
12941
|
+
if ((0, exports$1.isObject)(source[key])) {
|
|
12168
12942
|
if (!(key in target)) {
|
|
12169
12943
|
Object.assign(retValues, { [key]: source[key] });
|
|
12170
12944
|
} else {
|
|
12171
|
-
retValues[key] = (0, exports.deepMerge)(target[key], source[key]);
|
|
12945
|
+
retValues[key] = (0, exports$1.deepMerge)(target[key], source[key]);
|
|
12172
12946
|
}
|
|
12173
12947
|
} else {
|
|
12174
12948
|
Object.assign(retValues, { [key]: source[key] });
|
|
@@ -12177,7 +12951,7 @@ var utils = {};
|
|
|
12177
12951
|
}
|
|
12178
12952
|
return retValues;
|
|
12179
12953
|
};
|
|
12180
|
-
exports.deepMerge = deepMerge;
|
|
12954
|
+
exports$1.deepMerge = deepMerge;
|
|
12181
12955
|
const getTokenType = (token, core, leaf) => {
|
|
12182
12956
|
let tokenType = "new";
|
|
12183
12957
|
const coreKeys = Object.keys(core);
|
|
@@ -12204,7 +12978,7 @@ var utils = {};
|
|
|
12204
12978
|
});
|
|
12205
12979
|
return tokenType;
|
|
12206
12980
|
};
|
|
12207
|
-
exports.getTokenType = getTokenType;
|
|
12981
|
+
exports$1.getTokenType = getTokenType;
|
|
12208
12982
|
const expandTokens = (tokens) => {
|
|
12209
12983
|
let tokenList = [];
|
|
12210
12984
|
const rootEntries = Object.entries(tokens);
|
|
@@ -12217,13 +12991,13 @@ var utils = {};
|
|
|
12217
12991
|
});
|
|
12218
12992
|
return tokenList;
|
|
12219
12993
|
};
|
|
12220
|
-
exports.expandTokens = expandTokens;
|
|
12994
|
+
exports$1.expandTokens = expandTokens;
|
|
12221
12995
|
const collapseTokens = (tokenList) => {
|
|
12222
12996
|
let retToken = {};
|
|
12223
|
-
tokenList.map((token) => retToken = Object.assign({}, (0, exports.deepMerge)(retToken, token)));
|
|
12997
|
+
tokenList.map((token) => retToken = Object.assign({}, (0, exports$1.deepMerge)(retToken, token)));
|
|
12224
12998
|
return retToken;
|
|
12225
12999
|
};
|
|
12226
|
-
exports.collapseTokens = collapseTokens;
|
|
13000
|
+
exports$1.collapseTokens = collapseTokens;
|
|
12227
13001
|
const splitTokens = (tokens, core, leaf) => {
|
|
12228
13002
|
const partitionedLists = {
|
|
12229
13003
|
defaultTokens: {
|
|
@@ -12236,9 +13010,9 @@ var utils = {};
|
|
|
12236
13010
|
new: []
|
|
12237
13011
|
}
|
|
12238
13012
|
};
|
|
12239
|
-
const tokenList = (0, exports.expandTokens)(tokens);
|
|
13013
|
+
const tokenList = (0, exports$1.expandTokens)(tokens);
|
|
12240
13014
|
tokenList.map((token) => {
|
|
12241
|
-
const tokenType = (0, exports.getTokenType)(token, core, leaf);
|
|
13015
|
+
const tokenType = (0, exports$1.getTokenType)(token, core, leaf);
|
|
12242
13016
|
if (tokenType === "core-default") {
|
|
12243
13017
|
partitionedLists.defaultTokens.core.push(token);
|
|
12244
13018
|
} else if (tokenType === "core-updated") {
|
|
@@ -12253,7 +13027,7 @@ var utils = {};
|
|
|
12253
13027
|
});
|
|
12254
13028
|
return partitionedLists;
|
|
12255
13029
|
};
|
|
12256
|
-
exports.splitTokens = splitTokens;
|
|
13030
|
+
exports$1.splitTokens = splitTokens;
|
|
12257
13031
|
const addSuffix = (json, suffix = "px") => {
|
|
12258
13032
|
let retValues = {};
|
|
12259
13033
|
Object.keys(json).forEach(function(key) {
|
|
@@ -12261,7 +13035,7 @@ var utils = {};
|
|
|
12261
13035
|
});
|
|
12262
13036
|
return Object.assign({}, json, retValues);
|
|
12263
13037
|
};
|
|
12264
|
-
exports.addSuffix = addSuffix;
|
|
13038
|
+
exports$1.addSuffix = addSuffix;
|
|
12265
13039
|
const removeSuffix = (json, suffix = "px") => {
|
|
12266
13040
|
let retValues = {};
|
|
12267
13041
|
Object.keys(json).forEach((key) => {
|
|
@@ -12273,15 +13047,15 @@ var utils = {};
|
|
|
12273
13047
|
});
|
|
12274
13048
|
return Object.assign({}, json, retValues);
|
|
12275
13049
|
};
|
|
12276
|
-
exports.removeSuffix = removeSuffix;
|
|
13050
|
+
exports$1.removeSuffix = removeSuffix;
|
|
12277
13051
|
const updateValues = (json, value = "") => {
|
|
12278
13052
|
let retValues = {};
|
|
12279
13053
|
Object.keys(json).forEach(function(key) {
|
|
12280
|
-
retValues[key] = (0, exports.isObject)(value) ? Object.assign({}, retValues, value) : value;
|
|
13054
|
+
retValues[key] = (0, exports$1.isObject)(value) ? Object.assign({}, retValues, value) : value;
|
|
12281
13055
|
});
|
|
12282
13056
|
return Object.assign({}, json, retValues);
|
|
12283
13057
|
};
|
|
12284
|
-
exports.updateValues = updateValues;
|
|
13058
|
+
exports$1.updateValues = updateValues;
|
|
12285
13059
|
} (utils));
|
|
12286
13060
|
|
|
12287
13061
|
var hasRequiredMods;
|
|
@@ -13012,12 +13786,12 @@ var hasRequiredDist;
|
|
|
13012
13786
|
function requireDist () {
|
|
13013
13787
|
if (hasRequiredDist) return dist$1;
|
|
13014
13788
|
hasRequiredDist = 1;
|
|
13015
|
-
(function (exports) {
|
|
13789
|
+
(function (exports$1) {
|
|
13016
13790
|
var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
|
|
13017
13791
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
13018
13792
|
};
|
|
13019
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13020
|
-
exports.dark = exports.light = exports.buildTheme = exports.themes = exports.targets = void 0;
|
|
13793
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
13794
|
+
exports$1.dark = exports$1.light = exports$1.buildTheme = exports$1.themes = exports$1.targets = void 0;
|
|
13021
13795
|
const core_1 = __importDefault(core);
|
|
13022
13796
|
const mods_1 = requireMods();
|
|
13023
13797
|
const utils_1 = utils;
|
|
@@ -13029,26 +13803,26 @@ function requireDist () {
|
|
|
13029
13803
|
const spacing_1 = __importDefault(spacing);
|
|
13030
13804
|
const textColor_1 = __importDefault(textColor);
|
|
13031
13805
|
const zIndex_1 = __importDefault(zIndex$3);
|
|
13032
|
-
exports.targets = {
|
|
13806
|
+
exports$1.targets = {
|
|
13033
13807
|
REACT: "react",
|
|
13034
13808
|
REACT_NATIVE: "react_native",
|
|
13035
13809
|
NATIVE: "native"
|
|
13036
13810
|
};
|
|
13037
|
-
exports.themes = {
|
|
13811
|
+
exports$1.themes = {
|
|
13038
13812
|
LIGHT: "light",
|
|
13039
13813
|
DARK: "dark"
|
|
13040
13814
|
};
|
|
13041
|
-
const getSectionTokens = (theme = exports.themes.LIGHT, base = core_1.default) => ({
|
|
13042
|
-
BackgroundColor: theme === exports.themes.LIGHT ? backgroundColor_1.default.light(base) : backgroundColor_1.default.dark(base),
|
|
13043
|
-
BorderColor: theme === exports.themes.LIGHT ? borderColor_1.default.light(base) : borderColor_1.default.dark(base),
|
|
13044
|
-
BorderRadius: theme === exports.themes.LIGHT ? borderRadius_1.default.light(base) : borderRadius_1.default.dark(base),
|
|
13045
|
-
BoxShadow: theme === exports.themes.LIGHT ? boxShadow_1.default.light(base) : boxShadow_1.default.dark(base),
|
|
13046
|
-
FontSize: theme === exports.themes.LIGHT ? fontSize_1.default.light(base) : fontSize_1.default.dark(base),
|
|
13047
|
-
Spacing: theme === exports.themes.LIGHT ? spacing_1.default.light(base) : spacing_1.default.dark(base),
|
|
13048
|
-
TextColor: theme === exports.themes.LIGHT ? textColor_1.default.light(base) : textColor_1.default.dark(base),
|
|
13049
|
-
ZIndex: theme === exports.themes.LIGHT ? zIndex_1.default.light(base) : zIndex_1.default.dark(base)
|
|
13815
|
+
const getSectionTokens = (theme = exports$1.themes.LIGHT, base = core_1.default) => ({
|
|
13816
|
+
BackgroundColor: theme === exports$1.themes.LIGHT ? backgroundColor_1.default.light(base) : backgroundColor_1.default.dark(base),
|
|
13817
|
+
BorderColor: theme === exports$1.themes.LIGHT ? borderColor_1.default.light(base) : borderColor_1.default.dark(base),
|
|
13818
|
+
BorderRadius: theme === exports$1.themes.LIGHT ? borderRadius_1.default.light(base) : borderRadius_1.default.dark(base),
|
|
13819
|
+
BoxShadow: theme === exports$1.themes.LIGHT ? boxShadow_1.default.light(base) : boxShadow_1.default.dark(base),
|
|
13820
|
+
FontSize: theme === exports$1.themes.LIGHT ? fontSize_1.default.light(base) : fontSize_1.default.dark(base),
|
|
13821
|
+
Spacing: theme === exports$1.themes.LIGHT ? spacing_1.default.light(base) : spacing_1.default.dark(base),
|
|
13822
|
+
TextColor: theme === exports$1.themes.LIGHT ? textColor_1.default.light(base) : textColor_1.default.dark(base),
|
|
13823
|
+
ZIndex: theme === exports$1.themes.LIGHT ? zIndex_1.default.light(base) : zIndex_1.default.dark(base)
|
|
13050
13824
|
});
|
|
13051
|
-
const buildTheme = (theme = exports.themes.LIGHT, target = exports.targets.REACT, tokenOverrides = {}) => {
|
|
13825
|
+
const buildTheme = (theme = exports$1.themes.LIGHT, target = exports$1.targets.REACT, tokenOverrides = {}) => {
|
|
13052
13826
|
const baseCore = Object.assign({}, core_1.default);
|
|
13053
13827
|
const baseLeaf = getSectionTokens(theme);
|
|
13054
13828
|
const baseParts = (0, utils_1.splitTokens)(tokenOverrides, baseCore, baseLeaf);
|
|
@@ -13068,9 +13842,9 @@ function requireDist () {
|
|
|
13068
13842
|
});
|
|
13069
13843
|
return (0, utils_1.deepMerge)(customBoth, mergedLeaf);
|
|
13070
13844
|
};
|
|
13071
|
-
exports.buildTheme = buildTheme;
|
|
13072
|
-
exports.light = (0, exports.buildTheme)(exports.themes.LIGHT);
|
|
13073
|
-
exports.dark = (0, exports.buildTheme)(exports.themes.DARK);
|
|
13845
|
+
exports$1.buildTheme = buildTheme;
|
|
13846
|
+
exports$1.light = (0, exports$1.buildTheme)(exports$1.themes.LIGHT);
|
|
13847
|
+
exports$1.dark = (0, exports$1.buildTheme)(exports$1.themes.DARK);
|
|
13074
13848
|
} (dist$1));
|
|
13075
13849
|
return dist$1;
|
|
13076
13850
|
}
|
|
@@ -13889,16 +14663,16 @@ const require$$1$3 = /*@__PURE__*/getAugmentedNamespace(__viteBrowserExternal$1)
|
|
|
13889
14663
|
Sha256.prototype.finalize.call(this);
|
|
13890
14664
|
}
|
|
13891
14665
|
};
|
|
13892
|
-
var exports = createMethod();
|
|
13893
|
-
exports.sha256 = exports;
|
|
13894
|
-
exports.sha224 = createMethod(true);
|
|
13895
|
-
exports.sha256.hmac = createHmacMethod();
|
|
13896
|
-
exports.sha224.hmac = createHmacMethod(true);
|
|
14666
|
+
var exports$1 = createMethod();
|
|
14667
|
+
exports$1.sha256 = exports$1;
|
|
14668
|
+
exports$1.sha224 = createMethod(true);
|
|
14669
|
+
exports$1.sha256.hmac = createHmacMethod();
|
|
14670
|
+
exports$1.sha224.hmac = createHmacMethod(true);
|
|
13897
14671
|
if (COMMON_JS) {
|
|
13898
|
-
module.exports = exports;
|
|
14672
|
+
module.exports = exports$1;
|
|
13899
14673
|
} else {
|
|
13900
|
-
root.sha256 = exports.sha256;
|
|
13901
|
-
root.sha224 = exports.sha224;
|
|
14674
|
+
root.sha256 = exports$1.sha256;
|
|
14675
|
+
root.sha224 = exports$1.sha224;
|
|
13902
14676
|
}
|
|
13903
14677
|
})();
|
|
13904
14678
|
} (sha256));
|
|
@@ -14402,7 +15176,7 @@ function create$1(changes) {
|
|
|
14402
15176
|
}
|
|
14403
15177
|
dist_es5.create = create$1;
|
|
14404
15178
|
|
|
14405
|
-
(function (exports) {
|
|
15179
|
+
(function (exports$1) {
|
|
14406
15180
|
var __assign = commonjsGlobal && commonjsGlobal.__assign || function() {
|
|
14407
15181
|
__assign = Object.assign || function(t) {
|
|
14408
15182
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -14414,8 +15188,8 @@ dist_es5.create = create$1;
|
|
|
14414
15188
|
};
|
|
14415
15189
|
return __assign.apply(this, arguments);
|
|
14416
15190
|
};
|
|
14417
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14418
|
-
exports.keyframes = exports.global = exports.css = exports.makeKeyframes = exports.makeGlobal = exports.makeCss = exports.memo = void 0;
|
|
15191
|
+
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
15192
|
+
exports$1.keyframes = exports$1.global = exports$1.css = exports$1.makeKeyframes = exports$1.makeGlobal = exports$1.makeCss = exports$1.memo = void 0;
|
|
14419
15193
|
var insert_css_1 = insertCssExports;
|
|
14420
15194
|
var FreeStyle = dist_es5;
|
|
14421
15195
|
var compose = function(f, g) {
|
|
@@ -14440,7 +15214,7 @@ dist_es5.create = create$1;
|
|
|
14440
15214
|
return ret;
|
|
14441
15215
|
};
|
|
14442
15216
|
};
|
|
14443
|
-
exports.memo = memo;
|
|
15217
|
+
exports$1.memo = memo;
|
|
14444
15218
|
var insertCss = /* @__PURE__ */ function() {
|
|
14445
15219
|
var seenClassNames = {};
|
|
14446
15220
|
return function(_a) {
|
|
@@ -14461,24 +15235,24 @@ dist_es5.create = create$1;
|
|
|
14461
15235
|
var className = style.registerStyle(cssObj);
|
|
14462
15236
|
return [className, style.getStyles()];
|
|
14463
15237
|
};
|
|
14464
|
-
exports.makeCss = makeCss;
|
|
15238
|
+
exports$1.makeCss = makeCss;
|
|
14465
15239
|
var makeGlobal = function(cssObj) {
|
|
14466
|
-
return exports.makeCss(__assign({ $global: true }, cssObj));
|
|
15240
|
+
return exports$1.makeCss(__assign({ $global: true }, cssObj));
|
|
14467
15241
|
};
|
|
14468
|
-
exports.makeGlobal = makeGlobal;
|
|
15242
|
+
exports$1.makeGlobal = makeGlobal;
|
|
14469
15243
|
var makeKeyframes = function(arg1, arg2) {
|
|
14470
15244
|
var _a;
|
|
14471
15245
|
var _b = arg2 === void 0 ? [arg1, "&"] : [arg2, arg1], cssObj = _b[0], animName = _b[1];
|
|
14472
15246
|
if (!(typeof animName === "string" || animName instanceof String)) {
|
|
14473
15247
|
throw new Error("Animation name must be a string. Omit argument to auto-generate.");
|
|
14474
15248
|
}
|
|
14475
|
-
var _c = exports.makeCss((_a = { $global: true }, _a["@keyframes " + animName] = cssObj, _a)), className = _c[0], styles = _c[1];
|
|
15249
|
+
var _c = exports$1.makeCss((_a = { $global: true }, _a["@keyframes " + animName] = cssObj, _a)), className = _c[0], styles = _c[1];
|
|
14476
15250
|
return [arg2 === void 0 ? className : animName, styles];
|
|
14477
15251
|
};
|
|
14478
|
-
exports.makeKeyframes = makeKeyframes;
|
|
14479
|
-
exports.css = compose(insertCss, exports.memo(exports.makeCss));
|
|
14480
|
-
exports.global = compose(discard, compose(insertCss, exports.makeGlobal));
|
|
14481
|
-
exports.keyframes = compose(insertCss, exports.makeKeyframes);
|
|
15252
|
+
exports$1.makeKeyframes = makeKeyframes;
|
|
15253
|
+
exports$1.css = compose(insertCss, exports$1.memo(exports$1.makeCss));
|
|
15254
|
+
exports$1.global = compose(discard, compose(insertCss, exports$1.makeGlobal));
|
|
15255
|
+
exports$1.keyframes = compose(insertCss, exports$1.makeKeyframes);
|
|
14482
15256
|
} (dist));
|
|
14483
15257
|
|
|
14484
15258
|
const Spinner = ({ bgColor, fgColor, size = 64 }) => {
|
|
@@ -73547,7 +74321,7 @@ const Export = createSvgIcon$2(({ color }) => /* @__PURE__ */ jsxRuntimeExports.
|
|
|
73547
74321
|
] }));
|
|
73548
74322
|
Export.displayName = "Export";
|
|
73549
74323
|
|
|
73550
|
-
/*! @license DOMPurify 3.
|
|
74324
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
73551
74325
|
|
|
73552
74326
|
const {
|
|
73553
74327
|
entries,
|
|
@@ -73733,7 +74507,7 @@ function lookupGetter(object, prop) {
|
|
|
73733
74507
|
}
|
|
73734
74508
|
|
|
73735
74509
|
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
73736
|
-
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', '
|
|
74510
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
73737
74511
|
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
73738
74512
|
// List of SVG elements that are disallowed by default.
|
|
73739
74513
|
// We still need to know them so that we can do namespace
|
|
@@ -73747,7 +74521,7 @@ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongd
|
|
|
73747
74521
|
const text = freeze(['#text']);
|
|
73748
74522
|
|
|
73749
74523
|
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
73750
|
-
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
74524
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
73751
74525
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
73752
74526
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
73753
74527
|
|
|
@@ -73845,7 +74619,7 @@ const _createHooksMap = function _createHooksMap() {
|
|
|
73845
74619
|
function createDOMPurify() {
|
|
73846
74620
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
73847
74621
|
const DOMPurify = root => createDOMPurify(root);
|
|
73848
|
-
DOMPurify.version = '3.
|
|
74622
|
+
DOMPurify.version = '3.3.1';
|
|
73849
74623
|
DOMPurify.removed = [];
|
|
73850
74624
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
73851
74625
|
// Not running in a browser, provide a factory function
|
|
@@ -73956,6 +74730,21 @@ function createDOMPurify() {
|
|
|
73956
74730
|
let FORBID_TAGS = null;
|
|
73957
74731
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
73958
74732
|
let FORBID_ATTR = null;
|
|
74733
|
+
/* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
|
|
74734
|
+
const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
74735
|
+
tagCheck: {
|
|
74736
|
+
writable: true,
|
|
74737
|
+
configurable: false,
|
|
74738
|
+
enumerable: true,
|
|
74739
|
+
value: null
|
|
74740
|
+
},
|
|
74741
|
+
attributeCheck: {
|
|
74742
|
+
writable: true,
|
|
74743
|
+
configurable: false,
|
|
74744
|
+
enumerable: true,
|
|
74745
|
+
value: null
|
|
74746
|
+
}
|
|
74747
|
+
}));
|
|
73959
74748
|
/* Decide if ARIA attributes are okay */
|
|
73960
74749
|
let ALLOW_ARIA_ATTR = true;
|
|
73961
74750
|
/* Decide if custom data attributes are okay */
|
|
@@ -74148,16 +74937,24 @@ function createDOMPurify() {
|
|
|
74148
74937
|
}
|
|
74149
74938
|
/* Merge configuration parameters */
|
|
74150
74939
|
if (cfg.ADD_TAGS) {
|
|
74151
|
-
if (
|
|
74152
|
-
|
|
74940
|
+
if (typeof cfg.ADD_TAGS === 'function') {
|
|
74941
|
+
EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
74942
|
+
} else {
|
|
74943
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
74944
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
74945
|
+
}
|
|
74946
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
74153
74947
|
}
|
|
74154
|
-
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
74155
74948
|
}
|
|
74156
74949
|
if (cfg.ADD_ATTR) {
|
|
74157
|
-
if (
|
|
74158
|
-
|
|
74950
|
+
if (typeof cfg.ADD_ATTR === 'function') {
|
|
74951
|
+
EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
74952
|
+
} else {
|
|
74953
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
74954
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
74955
|
+
}
|
|
74956
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
74159
74957
|
}
|
|
74160
|
-
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
74161
74958
|
}
|
|
74162
74959
|
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
74163
74960
|
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
@@ -74168,6 +74965,12 @@ function createDOMPurify() {
|
|
|
74168
74965
|
}
|
|
74169
74966
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
74170
74967
|
}
|
|
74968
|
+
if (cfg.ADD_FORBID_CONTENTS) {
|
|
74969
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
74970
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
74971
|
+
}
|
|
74972
|
+
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
|
|
74973
|
+
}
|
|
74171
74974
|
/* Add #text in case KEEP_CONTENT is set to true */
|
|
74172
74975
|
if (KEEP_CONTENT) {
|
|
74173
74976
|
ALLOWED_TAGS['#text'] = true;
|
|
@@ -74465,7 +75268,7 @@ function createDOMPurify() {
|
|
|
74465
75268
|
return true;
|
|
74466
75269
|
}
|
|
74467
75270
|
/* Remove element if anything forbids its presence */
|
|
74468
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
75271
|
+
if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
|
|
74469
75272
|
/* Check if we have a custom element to handle */
|
|
74470
75273
|
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
74471
75274
|
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
@@ -74537,7 +75340,7 @@ function createDOMPurify() {
|
|
|
74537
75340
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
74538
75341
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
74539
75342
|
We don't need to check the value; it's always URI safe. */
|
|
74540
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
75343
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
74541
75344
|
if (
|
|
74542
75345
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
74543
75346
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -75126,58 +75929,109 @@ ExampleCheckbox.propTypes = {
|
|
|
75126
75929
|
id: PropTypes$1.string
|
|
75127
75930
|
};
|
|
75128
75931
|
|
|
75129
|
-
|
|
75932
|
+
function isWellsFargoInstitution(institution) {
|
|
75933
|
+
const wellsFargoGuids = [
|
|
75934
|
+
"INS-6073ad01-da9e-f6ba-dfdf-5f1500d8e867",
|
|
75935
|
+
// Wells Fargo PROD guid
|
|
75936
|
+
"INS-f9e8d5f6-b953-da63-32e4-6e88fbe8b250"
|
|
75937
|
+
// Wells Fargo SAND guid for testing
|
|
75938
|
+
];
|
|
75939
|
+
return wellsFargoGuids.includes(institution.guid) || institution.name === "Wells Fargo";
|
|
75940
|
+
}
|
|
75941
|
+
function getInstitutionBrandColor(institution, defaultColor) {
|
|
75942
|
+
const rawColor = institution?.brand_color_hex_code;
|
|
75943
|
+
const configuredInstitutionColor = rawColor && /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(rawColor) ? rawColor : null;
|
|
75944
|
+
if (isWellsFargoInstitution(institution)) {
|
|
75945
|
+
return configuredInstitutionColor || "#B22222";
|
|
75946
|
+
}
|
|
75947
|
+
return configuredInstitutionColor || defaultColor;
|
|
75948
|
+
}
|
|
75949
|
+
const OAUTH_PREDIRECT_INSTRUCTION = {
|
|
75950
|
+
ACCOUNT_AND_TRANSACTIONS_INSTRUCTION: 0,
|
|
75951
|
+
ACCOUNT_NUMBERS_INSTRUCTION: 1,
|
|
75952
|
+
PROFILE_INFORMATION_INSTRUCTION: 2,
|
|
75953
|
+
STATEMENTS_INSTRUCTION: 3,
|
|
75954
|
+
TAX_INSTRUCTION: 4
|
|
75955
|
+
};
|
|
75956
|
+
|
|
75957
|
+
const DEFAULT_HEADER_HEX_COLOR = "#444444";
|
|
75130
75958
|
function PredirectInstructions(props) {
|
|
75131
|
-
const
|
|
75132
|
-
|
|
75133
|
-
|
|
75134
|
-
|
|
75959
|
+
const configuredPredirectInstructions = Array.isArray(
|
|
75960
|
+
props.institution?.oauth_predirect_instructions
|
|
75961
|
+
) ? [...props.institution.oauth_predirect_instructions].filter(
|
|
75962
|
+
(instruction) => Object.values(OAUTH_PREDIRECT_INSTRUCTION).includes(instruction)
|
|
75963
|
+
) : [];
|
|
75964
|
+
if (isWellsFargoInstitution(props.institution) && configuredPredirectInstructions.length === 0) {
|
|
75965
|
+
configuredPredirectInstructions.push(
|
|
75966
|
+
OAUTH_PREDIRECT_INSTRUCTION.ACCOUNT_AND_TRANSACTIONS_INSTRUCTION
|
|
75967
|
+
);
|
|
75968
|
+
configuredPredirectInstructions.push(
|
|
75969
|
+
OAUTH_PREDIRECT_INSTRUCTION.PROFILE_INFORMATION_INSTRUCTION
|
|
75970
|
+
);
|
|
75971
|
+
}
|
|
75972
|
+
if (configuredPredirectInstructions.length === 0) {
|
|
75973
|
+
configuredPredirectInstructions.push(
|
|
75974
|
+
OAUTH_PREDIRECT_INSTRUCTION.ACCOUNT_AND_TRANSACTIONS_INSTRUCTION
|
|
75975
|
+
);
|
|
75976
|
+
}
|
|
75977
|
+
const institutionColor = getInstitutionBrandColor(props.institution, DEFAULT_HEADER_HEX_COLOR);
|
|
75135
75978
|
const uiElementTypes = {
|
|
75136
|
-
|
|
75137
|
-
|
|
75138
|
-
|
|
75979
|
+
[OAUTH_PREDIRECT_INSTRUCTION.ACCOUNT_AND_TRANSACTIONS_INSTRUCTION]: "checking-or-savings-account",
|
|
75980
|
+
[OAUTH_PREDIRECT_INSTRUCTION.ACCOUNT_NUMBERS_INSTRUCTION]: "account-numbers",
|
|
75981
|
+
[OAUTH_PREDIRECT_INSTRUCTION.PROFILE_INFORMATION_INSTRUCTION]: "profile",
|
|
75982
|
+
[OAUTH_PREDIRECT_INSTRUCTION.STATEMENTS_INSTRUCTION]: "statements",
|
|
75983
|
+
[OAUTH_PREDIRECT_INSTRUCTION.TAX_INSTRUCTION]: "tax"
|
|
75139
75984
|
};
|
|
75140
|
-
const checkboxItems = [
|
|
75141
|
-
|
|
75142
|
-
|
|
75143
|
-
|
|
75144
|
-
|
|
75145
|
-
|
|
75146
|
-
|
|
75985
|
+
const checkboxItems = [];
|
|
75986
|
+
configuredPredirectInstructions.forEach((instruction) => {
|
|
75987
|
+
const uiElementType = uiElementTypes[instruction];
|
|
75988
|
+
if (uiElementType) {
|
|
75989
|
+
checkboxItems.push(uiElementType);
|
|
75990
|
+
}
|
|
75991
|
+
});
|
|
75992
|
+
const instructionText = __(
|
|
75993
|
+
"To complete your connection, please %1share%2 the following after signing in:",
|
|
75147
75994
|
"<strong style='font-weight: bold;'>",
|
|
75148
75995
|
"</strong>"
|
|
75149
|
-
)
|
|
75996
|
+
);
|
|
75150
75997
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
75151
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(D, { bold: true, component: "h2", sx: { mb: 12 }, truncate: false, variant: "H2", children: __("Log in at %1", props.
|
|
75152
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
75153
|
-
|
|
75154
|
-
|
|
75155
|
-
|
|
75156
|
-
|
|
75157
|
-
|
|
75158
|
-
|
|
75159
|
-
|
|
75160
|
-
|
|
75161
|
-
|
|
75162
|
-
|
|
75163
|
-
|
|
75164
|
-
),
|
|
75165
|
-
showProfileSelection && /* @__PURE__ */ jsxRuntimeExports.jsx(M, { color: "secondary", name: "info", size: 20, weight: Fe.Dark })
|
|
75166
|
-
] }),
|
|
75998
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(D, { bold: true, component: "h2", sx: { mb: 12 }, truncate: false, variant: "H2", children: __("Log in at %1", props.institution.name) }),
|
|
75999
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "predirect-instruction-text-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76000
|
+
D,
|
|
76001
|
+
{
|
|
76002
|
+
className: "predirect-instruction-text",
|
|
76003
|
+
color: "textSecondary",
|
|
76004
|
+
dangerouslySetInnerHTML: {
|
|
76005
|
+
__html: instructionText
|
|
76006
|
+
},
|
|
76007
|
+
truncate: false,
|
|
76008
|
+
variant: "body1"
|
|
76009
|
+
}
|
|
76010
|
+
) }),
|
|
75167
76011
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "institution-panel-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Paper$1, { className: "institution-panel", elevation: 2, children: [
|
|
75168
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "institution-panel-header", style: { backgroundColor: institutionColor }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(D, { "aria-hidden": "true", sx: { fontWeight: 600, color: "white" }, uppercase: true, children: props.
|
|
75169
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "institution-panel-body", children: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { "aria-label": __("Information to select on the %1 site", props.
|
|
75170
|
-
|
|
75171
|
-
|
|
75172
|
-
|
|
75173
|
-
let text = "";
|
|
75174
|
-
if (item === uiElementTypes.CHECKING_OR_SAVINGS_ACCOUNT) {
|
|
76012
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "institution-panel-header", style: { backgroundColor: institutionColor }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(D, { "aria-hidden": "true", sx: { fontWeight: 600, color: "white" }, uppercase: true, children: props.institution.name }) }),
|
|
76013
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "institution-panel-body", children: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { "aria-label": __("Information to select on the %1 site", props.institution.name), children: checkboxItems.map((item, index) => {
|
|
76014
|
+
let text = "";
|
|
76015
|
+
switch (item) {
|
|
76016
|
+
case uiElementTypes[OAUTH_PREDIRECT_INSTRUCTION.ACCOUNT_AND_TRANSACTIONS_INSTRUCTION]:
|
|
75175
76017
|
text = __("Checking or savings account");
|
|
75176
|
-
|
|
76018
|
+
break;
|
|
76019
|
+
case uiElementTypes[OAUTH_PREDIRECT_INSTRUCTION.ACCOUNT_NUMBERS_INSTRUCTION]:
|
|
76020
|
+
text = __("Account numbers");
|
|
76021
|
+
break;
|
|
76022
|
+
case uiElementTypes[OAUTH_PREDIRECT_INSTRUCTION.PROFILE_INFORMATION_INSTRUCTION]:
|
|
75177
76023
|
text = __("Profile information");
|
|
75178
|
-
|
|
75179
|
-
|
|
75180
|
-
|
|
76024
|
+
break;
|
|
76025
|
+
case uiElementTypes[OAUTH_PREDIRECT_INSTRUCTION.STATEMENTS_INSTRUCTION]:
|
|
76026
|
+
text = __("Statements");
|
|
76027
|
+
break;
|
|
76028
|
+
case uiElementTypes[OAUTH_PREDIRECT_INSTRUCTION.TAX_INSTRUCTION]:
|
|
76029
|
+
text = __("Tax documents");
|
|
76030
|
+
break;
|
|
76031
|
+
}
|
|
76032
|
+
const isLastItem = index === checkboxItems.length - 1;
|
|
76033
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76034
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
|
|
75181
76035
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75182
76036
|
ExampleCheckbox,
|
|
75183
76037
|
{
|
|
@@ -75187,8 +76041,9 @@ function PredirectInstructions(props) {
|
|
|
75187
76041
|
}
|
|
75188
76042
|
),
|
|
75189
76043
|
/* @__PURE__ */ jsxRuntimeExports.jsx(D, { className: "psuedo-checkbox-label", variant: "body1", children: text })
|
|
75190
|
-
] }, item)
|
|
75191
|
-
|
|
76044
|
+
] }, item),
|
|
76045
|
+
!isLastItem && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {}, `divider-${index}`)
|
|
76046
|
+
] });
|
|
75192
76047
|
}) }) })
|
|
75193
76048
|
] }) })
|
|
75194
76049
|
] });
|
|
@@ -75196,12 +76051,8 @@ function PredirectInstructions(props) {
|
|
|
75196
76051
|
|
|
75197
76052
|
const OAuthDefault = (props) => {
|
|
75198
76053
|
const language = window?.app?.options?.language || "en-US";
|
|
75199
|
-
const
|
|
75200
|
-
const
|
|
75201
|
-
(feature) => feature.feature_name === WELLS_FARGO_INSTRUCTIONS_FEATURE_NAME && feature.is_enabled === "test"
|
|
75202
|
-
) && (props.institution.guid === "INS-6073ad01-da9e-f6ba-dfdf-5f1500d8e867" || // Wells Fargo PROD guid
|
|
75203
|
-
props.institution.guid === "INS-f9e8d5f6-b953-da63-32e4-6e88fbe8b250") && // Wells Fargo SAND guid for testing
|
|
75204
|
-
language.toLowerCase() === "en-us";
|
|
76054
|
+
const isWellsFargo = isWellsFargoInstitution(props.institution);
|
|
76055
|
+
const hasPredirectInstructions = Array.isArray(props.institution?.oauth_predirect_instructions) && props.institution?.oauth_predirect_instructions.length > 0;
|
|
75205
76056
|
const { api } = useApi();
|
|
75206
76057
|
useAnalyticsPath(...PageviewInfo.CONNECT_OAUTH_INSTRUCTIONS, {
|
|
75207
76058
|
institution_guid: props.institution.guid,
|
|
@@ -75218,7 +76069,7 @@ const OAuthDefault = (props) => {
|
|
|
75218
76069
|
const tokens = useTokens();
|
|
75219
76070
|
const styles = getStyles$X(tokens);
|
|
75220
76071
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { role: "alert", children: [
|
|
75221
|
-
|
|
76072
|
+
isWellsFargo || hasPredirectInstructions ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PredirectInstructions, { institution: props?.institution }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
75222
76073
|
/* @__PURE__ */ jsxRuntimeExports.jsx(InstitutionBlock, { institution: props.institution }),
|
|
75223
76074
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75224
76075
|
ViewTitle,
|
|
@@ -87040,8 +87891,6 @@ const frCa = {
|
|
|
87040
87891
|
"Unable to connect": "Impossible de se connecter",
|
|
87041
87892
|
"Maintenance in progress": "Entretien en cours",
|
|
87042
87893
|
"Deposits verified. You're almost done setting things up. Continue to your institution.": "Dépôts vérifiés. Vous avez presque terminé la configuration. Rendez-vous dans votre établissement.",
|
|
87043
|
-
"After logging in, share at least one account and %1profile information%2.": "Après vous être connecté, partagez au moins un compte et %1informations de profil%2.",
|
|
87044
|
-
"After logging in, share at least one account.": "Après vous être connecté, partagez au moins un compte.",
|
|
87045
87894
|
"Connection not supported by %1": "Connexion non prise en charge par %1",
|
|
87046
87895
|
"%1 currently limits how your data can be shared. We'll enable this connection once %1 opens access.": "%1 limite actuellement la manière dont vos données peuvent être partagées. Nous activerons cette connexion une fois que %1 ouvrira l'accès.",
|
|
87047
87896
|
UNAVAILABLE: UNAVAILABLE$1,
|
|
@@ -87055,6 +87904,8 @@ const frCa = {
|
|
|
87055
87904
|
"Information to select on the %1 site": "Informations à sélectionner sur le site %1.",
|
|
87056
87905
|
"Checking or savings account": "Compte courant ou compte d'épargne",
|
|
87057
87906
|
"Profile information": "Informations de profil",
|
|
87907
|
+
"Account numbers": "Numéros de compte",
|
|
87908
|
+
"To complete your connection, please %1share%2 the following after signing in:": "Pour finaliser votre connexion, veuillez %1partager%2 les informations suivantes après vous être connecté :",
|
|
87058
87909
|
"connect/disclosure/policy/text\u0004By clicking Continue, you agree to the ": "En cliquant sur Continuer, vous acceptez la ",
|
|
87059
87910
|
"connect/disclosure/policy/link\u0004MX Privacy Policy.": "Politique de confidentialité de MX.",
|
|
87060
87911
|
"connect/disclosure/policy/link\u0004MX Privacy Policy": "Politique de confidentialité de MX.",
|
|
@@ -87553,8 +88404,6 @@ const es = {
|
|
|
87553
88404
|
"Unable to connect": "No se puede conectar",
|
|
87554
88405
|
"Maintenance in progress": "Mantenimiento en curso",
|
|
87555
88406
|
"Deposits verified. You're almost done setting things up. Continue to your institution.": "Depósitos verificados. Ya casi terminas de configurar todo. Continúa con tu institución.",
|
|
87556
|
-
"After logging in, share at least one account and %1profile information%2.": "Después de iniciar sesión, comparta al menos una cuenta y %1información de perfil%2.",
|
|
87557
|
-
"After logging in, share at least one account.": "Después de iniciar sesión, comparta al menos una cuenta.",
|
|
87558
88407
|
"Connection not supported by %1": "Conexión no compatible con %1",
|
|
87559
88408
|
"%1 currently limits how your data can be shared. We'll enable this connection once %1 opens access.": "%1 actualmente limita cómo se pueden compartir sus datos. Habilitaremos esta conexión una vez que %1 abra el acceso.",
|
|
87560
88409
|
UNAVAILABLE: UNAVAILABLE,
|
|
@@ -87568,6 +88417,8 @@ const es = {
|
|
|
87568
88417
|
"Information to select on the %1 site": "Información para seleccionar en el sitio %1",
|
|
87569
88418
|
"Checking or savings account": "Cuenta corriente o de ahorros",
|
|
87570
88419
|
"Profile information": "Información del perfil",
|
|
88420
|
+
"Account numbers": "Números de cuenta",
|
|
88421
|
+
"To complete your connection, please %1share%2 the following after signing in:": "Para completar su conexión, por favor, %1comparta%2 lo siguiente después de iniciar sesión:",
|
|
87571
88422
|
"connect/disclosure/button\u0004Continue": "Continuar",
|
|
87572
88423
|
"connect/disclosure/policy/text\u0004By clicking Continue, you agree to the ": "Al hacer clic en Continuar, tu aceptas la ",
|
|
87573
88424
|
"connect/disclosure/policy/link\u0004MX Privacy Policy.": "Política de privacidad de Money Experience.",
|