@wlloyalty/wll-react-sdk 1.4.7 → 1.4.9
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.d.ts +270 -16
- package/dist/native.js +1558 -360
- package/dist/native.js.map +1 -1
- package/dist/types/components/organisms/VenueTile/VenueTile.spec.d.ts +1 -0
- package/dist/types/components/organisms/VenueTile/VenueTile.stories.d.ts +12 -0
- package/dist/types/components/organisms/VenueTile/index.d.ts +18 -0
- package/dist/types/components/organisms/VenueTile/styles.d.ts +8 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-chevron.d.ts +7 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-description.d.ts +7 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-media.d.ts +13 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-title.d.ts +7 -0
- package/dist/types/components/organisms/index.d.ts +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/mocks/tiles/venueTile.d.ts +6 -0
- package/dist/types/types/tile.d.ts +9 -2
- package/dist/web.js +299 -7
- package/dist/web.js.map +1 -1
- package/package.json +12 -13
package/dist/native.js
CHANGED
|
@@ -27,47 +27,26 @@ var LucideReactIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(LucideRe
|
|
|
27
27
|
|
|
28
28
|
var jsxRuntime = {exports: {}};
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var reactJsxRuntime_production_min = {};
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* @license React
|
|
34
|
-
* react-jsx-runtime.production.js
|
|
34
|
+
* react-jsx-runtime.production.min.js
|
|
35
35
|
*
|
|
36
|
-
* Copyright (c)
|
|
36
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var key = null;
|
|
51
|
-
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
52
|
-
void 0 !== config.key && (key = "" + config.key);
|
|
53
|
-
if ("key" in config) {
|
|
54
|
-
maybeKey = {};
|
|
55
|
-
for (var propName in config)
|
|
56
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
57
|
-
} else maybeKey = config;
|
|
58
|
-
config = maybeKey.ref;
|
|
59
|
-
return {
|
|
60
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
61
|
-
type: type,
|
|
62
|
-
key: key,
|
|
63
|
-
ref: void 0 !== config ? config : null,
|
|
64
|
-
props: maybeKey
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
68
|
-
reactJsxRuntime_production.jsx = jsxProd;
|
|
69
|
-
reactJsxRuntime_production.jsxs = jsxProd;
|
|
70
|
-
return reactJsxRuntime_production;
|
|
42
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
43
|
+
|
|
44
|
+
function requireReactJsxRuntime_production_min () {
|
|
45
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
46
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
47
|
+
var f=React,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
48
|
+
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
49
|
+
return reactJsxRuntime_production_min;
|
|
71
50
|
}
|
|
72
51
|
|
|
73
52
|
var reactJsxRuntime_development = {};
|
|
@@ -76,7 +55,7 @@ var reactJsxRuntime_development = {};
|
|
|
76
55
|
* @license React
|
|
77
56
|
* react-jsx-runtime.development.js
|
|
78
57
|
*
|
|
79
|
-
* Copyright (c)
|
|
58
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
80
59
|
*
|
|
81
60
|
* This source code is licensed under the MIT license found in the
|
|
82
61
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -87,357 +66,1332 @@ var hasRequiredReactJsxRuntime_development;
|
|
|
87
66
|
function requireReactJsxRuntime_development () {
|
|
88
67
|
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
89
68
|
hasRequiredReactJsxRuntime_development = 1;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
69
|
+
|
|
70
|
+
if (process.env.NODE_ENV !== "production") {
|
|
71
|
+
(function() {
|
|
72
|
+
|
|
73
|
+
var React$1 = React;
|
|
74
|
+
|
|
75
|
+
// ATTENTION
|
|
76
|
+
// When adding new symbols to this file,
|
|
77
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
78
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
79
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
80
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
81
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
82
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
83
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
84
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
85
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
86
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
87
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
88
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
89
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
90
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
91
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
92
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
93
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
94
|
+
function getIteratorFn(maybeIterable) {
|
|
95
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
100
|
+
|
|
101
|
+
if (typeof maybeIterator === 'function') {
|
|
102
|
+
return maybeIterator;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
109
|
+
|
|
110
|
+
function error(format) {
|
|
111
|
+
{
|
|
112
|
+
{
|
|
113
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
114
|
+
args[_key2 - 1] = arguments[_key2];
|
|
112
115
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
116
|
+
|
|
117
|
+
printWarning('error', format, args);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function printWarning(level, format, args) {
|
|
123
|
+
// When changing this logic, you might want to also
|
|
124
|
+
// update consoleWithStackDev.www.js as well.
|
|
125
|
+
{
|
|
126
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
127
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
128
|
+
|
|
129
|
+
if (stack !== '') {
|
|
130
|
+
format += '%s';
|
|
131
|
+
args = args.concat([stack]);
|
|
132
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
var argsWithFormat = args.map(function (item) {
|
|
136
|
+
return String(item);
|
|
137
|
+
}); // Careful: RN currently depends on this prefix
|
|
138
|
+
|
|
139
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
140
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
141
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
142
|
+
|
|
143
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// -----------------------------------------------------------------------------
|
|
148
|
+
|
|
149
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
150
|
+
var enableCacheElement = false;
|
|
151
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
152
|
+
|
|
153
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
154
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
155
|
+
// issues in DEV builds.
|
|
156
|
+
|
|
157
|
+
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
158
|
+
|
|
159
|
+
var REACT_MODULE_REFERENCE;
|
|
160
|
+
|
|
161
|
+
{
|
|
162
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function isValidElementType(type) {
|
|
166
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
167
|
+
return true;
|
|
168
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (typeof type === 'object' && type !== null) {
|
|
176
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
177
|
+
// types supported by any Flight configuration anywhere since
|
|
178
|
+
// we don't know which Flight build this will end up being used
|
|
179
|
+
// with.
|
|
180
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
189
|
+
var displayName = outerType.displayName;
|
|
190
|
+
|
|
191
|
+
if (displayName) {
|
|
192
|
+
return displayName;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
196
|
+
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
197
|
+
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
function getContextName(type) {
|
|
201
|
+
return type.displayName || 'Context';
|
|
202
|
+
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
function getComponentNameFromType(type) {
|
|
206
|
+
if (type == null) {
|
|
207
|
+
// Host root, text node or just invalid type.
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
{
|
|
212
|
+
if (typeof type.tag === 'number') {
|
|
213
|
+
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (typeof type === 'function') {
|
|
218
|
+
return type.displayName || type.name || null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (typeof type === 'string') {
|
|
222
|
+
return type;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
switch (type) {
|
|
226
|
+
case REACT_FRAGMENT_TYPE:
|
|
227
|
+
return 'Fragment';
|
|
228
|
+
|
|
229
|
+
case REACT_PORTAL_TYPE:
|
|
230
|
+
return 'Portal';
|
|
231
|
+
|
|
232
|
+
case REACT_PROFILER_TYPE:
|
|
233
|
+
return 'Profiler';
|
|
234
|
+
|
|
235
|
+
case REACT_STRICT_MODE_TYPE:
|
|
236
|
+
return 'StrictMode';
|
|
237
|
+
|
|
238
|
+
case REACT_SUSPENSE_TYPE:
|
|
239
|
+
return 'Suspense';
|
|
240
|
+
|
|
241
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
242
|
+
return 'SuspenseList';
|
|
243
|
+
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (typeof type === 'object') {
|
|
247
|
+
switch (type.$$typeof) {
|
|
248
|
+
case REACT_CONTEXT_TYPE:
|
|
249
|
+
var context = type;
|
|
250
|
+
return getContextName(context) + '.Consumer';
|
|
251
|
+
|
|
252
|
+
case REACT_PROVIDER_TYPE:
|
|
253
|
+
var provider = type;
|
|
254
|
+
return getContextName(provider._context) + '.Provider';
|
|
255
|
+
|
|
256
|
+
case REACT_FORWARD_REF_TYPE:
|
|
257
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
258
|
+
|
|
259
|
+
case REACT_MEMO_TYPE:
|
|
260
|
+
var outerName = type.displayName || null;
|
|
261
|
+
|
|
262
|
+
if (outerName !== null) {
|
|
263
|
+
return outerName;
|
|
147
264
|
}
|
|
148
|
-
|
|
265
|
+
|
|
266
|
+
return getComponentNameFromType(type.type) || 'Memo';
|
|
267
|
+
|
|
268
|
+
case REACT_LAZY_TYPE:
|
|
269
|
+
{
|
|
270
|
+
var lazyComponent = type;
|
|
271
|
+
var payload = lazyComponent._payload;
|
|
272
|
+
var init = lazyComponent._init;
|
|
273
|
+
|
|
274
|
+
try {
|
|
275
|
+
return getComponentNameFromType(init(payload));
|
|
276
|
+
} catch (x) {
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// eslint-disable-next-line no-fallthrough
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
var assign = Object.assign;
|
|
289
|
+
|
|
290
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
291
|
+
// replaying on render function. This currently only patches the object
|
|
292
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
293
|
+
// We could also eagerly patch the method.
|
|
294
|
+
var disabledDepth = 0;
|
|
295
|
+
var prevLog;
|
|
296
|
+
var prevInfo;
|
|
297
|
+
var prevWarn;
|
|
298
|
+
var prevError;
|
|
299
|
+
var prevGroup;
|
|
300
|
+
var prevGroupCollapsed;
|
|
301
|
+
var prevGroupEnd;
|
|
302
|
+
|
|
303
|
+
function disabledLog() {}
|
|
304
|
+
|
|
305
|
+
disabledLog.__reactDisabledLog = true;
|
|
306
|
+
function disableLogs() {
|
|
307
|
+
{
|
|
308
|
+
if (disabledDepth === 0) {
|
|
309
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
310
|
+
prevLog = console.log;
|
|
311
|
+
prevInfo = console.info;
|
|
312
|
+
prevWarn = console.warn;
|
|
313
|
+
prevError = console.error;
|
|
314
|
+
prevGroup = console.group;
|
|
315
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
316
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
317
|
+
|
|
318
|
+
var props = {
|
|
319
|
+
configurable: true,
|
|
320
|
+
enumerable: true,
|
|
321
|
+
value: disabledLog,
|
|
322
|
+
writable: true
|
|
323
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
324
|
+
|
|
325
|
+
Object.defineProperties(console, {
|
|
326
|
+
info: props,
|
|
327
|
+
log: props,
|
|
328
|
+
warn: props,
|
|
329
|
+
error: props,
|
|
330
|
+
group: props,
|
|
331
|
+
groupCollapsed: props,
|
|
332
|
+
groupEnd: props
|
|
333
|
+
});
|
|
334
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
disabledDepth++;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function reenableLogs() {
|
|
341
|
+
{
|
|
342
|
+
disabledDepth--;
|
|
343
|
+
|
|
344
|
+
if (disabledDepth === 0) {
|
|
345
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
346
|
+
var props = {
|
|
347
|
+
configurable: true,
|
|
348
|
+
enumerable: true,
|
|
349
|
+
writable: true
|
|
350
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
351
|
+
|
|
352
|
+
Object.defineProperties(console, {
|
|
353
|
+
log: assign({}, props, {
|
|
354
|
+
value: prevLog
|
|
355
|
+
}),
|
|
356
|
+
info: assign({}, props, {
|
|
357
|
+
value: prevInfo
|
|
358
|
+
}),
|
|
359
|
+
warn: assign({}, props, {
|
|
360
|
+
value: prevWarn
|
|
361
|
+
}),
|
|
362
|
+
error: assign({}, props, {
|
|
363
|
+
value: prevError
|
|
364
|
+
}),
|
|
365
|
+
group: assign({}, props, {
|
|
366
|
+
value: prevGroup
|
|
367
|
+
}),
|
|
368
|
+
groupCollapsed: assign({}, props, {
|
|
369
|
+
value: prevGroupCollapsed
|
|
370
|
+
}),
|
|
371
|
+
groupEnd: assign({}, props, {
|
|
372
|
+
value: prevGroupEnd
|
|
373
|
+
})
|
|
374
|
+
});
|
|
375
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
149
376
|
}
|
|
150
|
-
|
|
151
|
-
|
|
377
|
+
|
|
378
|
+
if (disabledDepth < 0) {
|
|
379
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
152
380
|
}
|
|
153
|
-
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
385
|
+
var prefix;
|
|
386
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
387
|
+
{
|
|
388
|
+
if (prefix === undefined) {
|
|
389
|
+
// Extract the VM specific prefix used by each line.
|
|
154
390
|
try {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
if (JSCompiler_inline_result) {
|
|
161
|
-
JSCompiler_inline_result = console;
|
|
162
|
-
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
163
|
-
var JSCompiler_inline_result$jscomp$0 =
|
|
164
|
-
("function" === typeof Symbol &&
|
|
165
|
-
Symbol.toStringTag &&
|
|
166
|
-
value[Symbol.toStringTag]) ||
|
|
167
|
-
value.constructor.name ||
|
|
168
|
-
"Object";
|
|
169
|
-
JSCompiler_temp_const.call(
|
|
170
|
-
JSCompiler_inline_result,
|
|
171
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
172
|
-
JSCompiler_inline_result$jscomp$0
|
|
173
|
-
);
|
|
174
|
-
return testStringCoercion(value);
|
|
391
|
+
throw Error();
|
|
392
|
+
} catch (x) {
|
|
393
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
394
|
+
prefix = match && match[1] || '';
|
|
175
395
|
}
|
|
396
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
return '\n' + prefix + name;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
var reentry = false;
|
|
403
|
+
var componentFrameCache;
|
|
404
|
+
|
|
405
|
+
{
|
|
406
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
407
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
411
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
412
|
+
if ( !fn || reentry) {
|
|
413
|
+
return '';
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
{
|
|
417
|
+
var frame = componentFrameCache.get(fn);
|
|
418
|
+
|
|
419
|
+
if (frame !== undefined) {
|
|
420
|
+
return frame;
|
|
176
421
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
var control;
|
|
425
|
+
reentry = true;
|
|
426
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
427
|
+
|
|
428
|
+
Error.prepareStackTrace = undefined;
|
|
429
|
+
var previousDispatcher;
|
|
430
|
+
|
|
431
|
+
{
|
|
432
|
+
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
433
|
+
// for warnings.
|
|
434
|
+
|
|
435
|
+
ReactCurrentDispatcher.current = null;
|
|
436
|
+
disableLogs();
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
try {
|
|
440
|
+
// This should throw.
|
|
441
|
+
if (construct) {
|
|
442
|
+
// Something should be setting the props in the constructor.
|
|
443
|
+
var Fake = function () {
|
|
444
|
+
throw Error();
|
|
445
|
+
}; // $FlowFixMe
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
449
|
+
set: function () {
|
|
450
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
451
|
+
// because that won't throw in a non-strict mode function.
|
|
452
|
+
throw Error();
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
457
|
+
// We construct a different control for this case to include any extra
|
|
458
|
+
// frames added by the construct call.
|
|
459
|
+
try {
|
|
460
|
+
Reflect.construct(Fake, []);
|
|
461
|
+
} catch (x) {
|
|
462
|
+
control = x;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
Reflect.construct(fn, [], Fake);
|
|
466
|
+
} else {
|
|
467
|
+
try {
|
|
468
|
+
Fake.call();
|
|
469
|
+
} catch (x) {
|
|
470
|
+
control = x;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
fn.call(Fake.prototype);
|
|
474
|
+
}
|
|
475
|
+
} else {
|
|
185
476
|
try {
|
|
186
|
-
|
|
187
|
-
return name ? "<" + name + ">" : "<...>";
|
|
477
|
+
throw Error();
|
|
188
478
|
} catch (x) {
|
|
189
|
-
|
|
479
|
+
control = x;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
fn();
|
|
483
|
+
}
|
|
484
|
+
} catch (sample) {
|
|
485
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
486
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
487
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
488
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
489
|
+
var sampleLines = sample.stack.split('\n');
|
|
490
|
+
var controlLines = control.stack.split('\n');
|
|
491
|
+
var s = sampleLines.length - 1;
|
|
492
|
+
var c = controlLines.length - 1;
|
|
493
|
+
|
|
494
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
495
|
+
// We expect at least one stack frame to be shared.
|
|
496
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
497
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
498
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
499
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
500
|
+
// the sample somewhere in the control.
|
|
501
|
+
c--;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
505
|
+
// Next we find the first one that isn't the same which should be the
|
|
506
|
+
// frame that called our sample function and the control.
|
|
507
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
508
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
509
|
+
// If we're about to return the first line, and the control is also on the same
|
|
510
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
511
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
512
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
513
|
+
if (s !== 1 || c !== 1) {
|
|
514
|
+
do {
|
|
515
|
+
s--;
|
|
516
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
517
|
+
// The next one that isn't the same should be our match though.
|
|
518
|
+
|
|
519
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
520
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
521
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
522
|
+
// but we have a user-provided "displayName"
|
|
523
|
+
// splice it in to make the stack more readable.
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
527
|
+
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
{
|
|
531
|
+
if (typeof fn === 'function') {
|
|
532
|
+
componentFrameCache.set(fn, _frame);
|
|
533
|
+
}
|
|
534
|
+
} // Return the line we found.
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
return _frame;
|
|
538
|
+
}
|
|
539
|
+
} while (s >= 1 && c >= 0);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
190
544
|
}
|
|
191
545
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
546
|
+
} finally {
|
|
547
|
+
reentry = false;
|
|
548
|
+
|
|
549
|
+
{
|
|
550
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
551
|
+
reenableLogs();
|
|
195
552
|
}
|
|
196
|
-
|
|
197
|
-
|
|
553
|
+
|
|
554
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
555
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
559
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
560
|
+
|
|
561
|
+
{
|
|
562
|
+
if (typeof fn === 'function') {
|
|
563
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
198
564
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
return syntheticFrame;
|
|
568
|
+
}
|
|
569
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
570
|
+
{
|
|
571
|
+
return describeNativeComponentFrame(fn, false);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function shouldConstruct(Component) {
|
|
576
|
+
var prototype = Component.prototype;
|
|
577
|
+
return !!(prototype && prototype.isReactComponent);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
581
|
+
|
|
582
|
+
if (type == null) {
|
|
583
|
+
return '';
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
if (typeof type === 'function') {
|
|
587
|
+
{
|
|
588
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
if (typeof type === 'string') {
|
|
593
|
+
return describeBuiltInComponentFrame(type);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
switch (type) {
|
|
597
|
+
case REACT_SUSPENSE_TYPE:
|
|
598
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
599
|
+
|
|
600
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
601
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
if (typeof type === 'object') {
|
|
605
|
+
switch (type.$$typeof) {
|
|
606
|
+
case REACT_FORWARD_REF_TYPE:
|
|
607
|
+
return describeFunctionComponentFrame(type.render);
|
|
608
|
+
|
|
609
|
+
case REACT_MEMO_TYPE:
|
|
610
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
611
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
612
|
+
|
|
613
|
+
case REACT_LAZY_TYPE:
|
|
614
|
+
{
|
|
615
|
+
var lazyComponent = type;
|
|
616
|
+
var payload = lazyComponent._payload;
|
|
617
|
+
var init = lazyComponent._init;
|
|
618
|
+
|
|
619
|
+
try {
|
|
620
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
621
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
622
|
+
} catch (x) {}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
return '';
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
631
|
+
|
|
632
|
+
var loggedTypeFailures = {};
|
|
633
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
634
|
+
|
|
635
|
+
function setCurrentlyValidatingElement(element) {
|
|
636
|
+
{
|
|
637
|
+
if (element) {
|
|
638
|
+
var owner = element._owner;
|
|
639
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
640
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
641
|
+
} else {
|
|
642
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
205
643
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
648
|
+
{
|
|
649
|
+
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
650
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
651
|
+
|
|
652
|
+
for (var typeSpecName in typeSpecs) {
|
|
653
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
654
|
+
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
655
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
656
|
+
// After these have been cleaned up, we'll let them throw.
|
|
657
|
+
|
|
658
|
+
try {
|
|
659
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
660
|
+
// behavior as without this statement except with a better message.
|
|
661
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
662
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
663
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
664
|
+
err.name = 'Invariant Violation';
|
|
665
|
+
throw err;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
669
|
+
} catch (ex) {
|
|
670
|
+
error$1 = ex;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
674
|
+
setCurrentlyValidatingElement(element);
|
|
675
|
+
|
|
676
|
+
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
677
|
+
|
|
678
|
+
setCurrentlyValidatingElement(null);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
682
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
683
|
+
// same error.
|
|
684
|
+
loggedTypeFailures[error$1.message] = true;
|
|
685
|
+
setCurrentlyValidatingElement(element);
|
|
686
|
+
|
|
687
|
+
error('Failed %s type: %s', location, error$1.message);
|
|
688
|
+
|
|
689
|
+
setCurrentlyValidatingElement(null);
|
|
690
|
+
}
|
|
214
691
|
}
|
|
215
|
-
warnAboutAccessingKey.isReactWarning = !0;
|
|
216
|
-
Object.defineProperty(props, "key", {
|
|
217
|
-
get: warnAboutAccessingKey,
|
|
218
|
-
configurable: !0
|
|
219
|
-
});
|
|
220
692
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
697
|
+
|
|
698
|
+
function isArray(a) {
|
|
699
|
+
return isArrayImpl(a);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/*
|
|
703
|
+
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
704
|
+
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
705
|
+
*
|
|
706
|
+
* The functions in this module will throw an easier-to-understand,
|
|
707
|
+
* easier-to-debug exception with a clear errors message message explaining the
|
|
708
|
+
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
709
|
+
* of the `value` object).
|
|
710
|
+
*/
|
|
711
|
+
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
712
|
+
function typeName(value) {
|
|
713
|
+
{
|
|
714
|
+
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
715
|
+
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
716
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
717
|
+
return type;
|
|
718
|
+
}
|
|
719
|
+
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
function willCoercionThrow(value) {
|
|
723
|
+
{
|
|
724
|
+
try {
|
|
725
|
+
testStringCoercion(value);
|
|
726
|
+
return false;
|
|
727
|
+
} catch (e) {
|
|
728
|
+
return true;
|
|
230
729
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
value: null
|
|
267
|
-
});
|
|
268
|
-
Object.defineProperty(type, "_debugStack", {
|
|
269
|
-
configurable: !1,
|
|
270
|
-
enumerable: !1,
|
|
271
|
-
writable: !0,
|
|
272
|
-
value: debugStack
|
|
273
|
-
});
|
|
274
|
-
Object.defineProperty(type, "_debugTask", {
|
|
275
|
-
configurable: !1,
|
|
276
|
-
enumerable: !1,
|
|
277
|
-
writable: !0,
|
|
278
|
-
value: debugTask
|
|
279
|
-
});
|
|
280
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
281
|
-
return type;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function testStringCoercion(value) {
|
|
734
|
+
// If you ended up here by following an exception call stack, here's what's
|
|
735
|
+
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
736
|
+
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
737
|
+
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
738
|
+
//
|
|
739
|
+
// The most common types that will cause this exception are `Symbol` instances
|
|
740
|
+
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
741
|
+
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
742
|
+
// exception. (Library authors do this to prevent users from using built-in
|
|
743
|
+
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
744
|
+
// methods are needed to perform accurate arithmetic or comparison.)
|
|
745
|
+
//
|
|
746
|
+
// To fix the problem, coerce this object or symbol value to a string before
|
|
747
|
+
// passing it to React. The most reliable way is usually `String(value)`.
|
|
748
|
+
//
|
|
749
|
+
// To find which value is throwing, check the browser or debugger console.
|
|
750
|
+
// Before this exception was thrown, there should be `console.error` output
|
|
751
|
+
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
752
|
+
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
753
|
+
// In most cases, this console output also shows the component and its
|
|
754
|
+
// ancestor components where the exception happened.
|
|
755
|
+
//
|
|
756
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
757
|
+
return '' + value;
|
|
758
|
+
}
|
|
759
|
+
function checkKeyStringCoercion(value) {
|
|
760
|
+
{
|
|
761
|
+
if (willCoercionThrow(value)) {
|
|
762
|
+
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
763
|
+
|
|
764
|
+
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
282
765
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
else validateChildKeys(children);
|
|
309
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
310
|
-
children = getComponentNameFromType(type);
|
|
311
|
-
var keys = Object.keys(config).filter(function (k) {
|
|
312
|
-
return "key" !== k;
|
|
313
|
-
});
|
|
314
|
-
isStaticChildren =
|
|
315
|
-
0 < keys.length
|
|
316
|
-
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
317
|
-
: "{key: someKey}";
|
|
318
|
-
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
319
|
-
((keys =
|
|
320
|
-
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
321
|
-
console.error(
|
|
322
|
-
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
323
|
-
isStaticChildren,
|
|
324
|
-
children,
|
|
325
|
-
keys,
|
|
326
|
-
children
|
|
327
|
-
),
|
|
328
|
-
(didWarnAboutKeySpread[children + isStaticChildren] = !0));
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
770
|
+
var RESERVED_PROPS = {
|
|
771
|
+
key: true,
|
|
772
|
+
ref: true,
|
|
773
|
+
__self: true,
|
|
774
|
+
__source: true
|
|
775
|
+
};
|
|
776
|
+
var specialPropKeyWarningShown;
|
|
777
|
+
var specialPropRefWarningShown;
|
|
778
|
+
var didWarnAboutStringRefs;
|
|
779
|
+
|
|
780
|
+
{
|
|
781
|
+
didWarnAboutStringRefs = {};
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
function hasValidRef(config) {
|
|
785
|
+
{
|
|
786
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
787
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
788
|
+
|
|
789
|
+
if (getter && getter.isReactWarning) {
|
|
790
|
+
return false;
|
|
329
791
|
}
|
|
330
|
-
children = null;
|
|
331
|
-
void 0 !== maybeKey &&
|
|
332
|
-
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
333
|
-
hasValidKey(config) &&
|
|
334
|
-
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
335
|
-
if ("key" in config) {
|
|
336
|
-
maybeKey = {};
|
|
337
|
-
for (var propName in config)
|
|
338
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
339
|
-
} else maybeKey = config;
|
|
340
|
-
children &&
|
|
341
|
-
defineKeyPropWarningGetter(
|
|
342
|
-
maybeKey,
|
|
343
|
-
"function" === typeof type
|
|
344
|
-
? type.displayName || type.name || "Unknown"
|
|
345
|
-
: type
|
|
346
|
-
);
|
|
347
|
-
return ReactElement(
|
|
348
|
-
type,
|
|
349
|
-
children,
|
|
350
|
-
self,
|
|
351
|
-
source,
|
|
352
|
-
getOwner(),
|
|
353
|
-
maybeKey,
|
|
354
|
-
debugStack,
|
|
355
|
-
debugTask
|
|
356
|
-
);
|
|
357
792
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
return config.ref !== undefined;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function hasValidKey(config) {
|
|
799
|
+
{
|
|
800
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
801
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
802
|
+
|
|
803
|
+
if (getter && getter.isReactWarning) {
|
|
804
|
+
return false;
|
|
805
|
+
}
|
|
364
806
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return callStackForError();
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
return config.key !== undefined;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
813
|
+
{
|
|
814
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
815
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
816
|
+
|
|
817
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
818
|
+
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
819
|
+
|
|
820
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
827
|
+
{
|
|
828
|
+
var warnAboutAccessingKey = function () {
|
|
829
|
+
if (!specialPropKeyWarningShown) {
|
|
830
|
+
specialPropKeyWarningShown = true;
|
|
831
|
+
|
|
832
|
+
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
392
833
|
}
|
|
393
834
|
};
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
)
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
source,
|
|
412
|
-
self,
|
|
413
|
-
trackActualOwner
|
|
414
|
-
? Error("react-stack-top-frame")
|
|
415
|
-
: unknownOwnerDebugStack,
|
|
416
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
417
|
-
);
|
|
418
|
-
};
|
|
419
|
-
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
|
|
420
|
-
var trackActualOwner =
|
|
421
|
-
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
422
|
-
return jsxDEVImpl(
|
|
423
|
-
type,
|
|
424
|
-
config,
|
|
425
|
-
maybeKey,
|
|
426
|
-
!0,
|
|
427
|
-
source,
|
|
428
|
-
self,
|
|
429
|
-
trackActualOwner
|
|
430
|
-
? Error("react-stack-top-frame")
|
|
431
|
-
: unknownOwnerDebugStack,
|
|
432
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
433
|
-
);
|
|
835
|
+
|
|
836
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
837
|
+
Object.defineProperty(props, 'key', {
|
|
838
|
+
get: warnAboutAccessingKey,
|
|
839
|
+
configurable: true
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
845
|
+
{
|
|
846
|
+
var warnAboutAccessingRef = function () {
|
|
847
|
+
if (!specialPropRefWarningShown) {
|
|
848
|
+
specialPropRefWarningShown = true;
|
|
849
|
+
|
|
850
|
+
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
851
|
+
}
|
|
434
852
|
};
|
|
853
|
+
|
|
854
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
855
|
+
Object.defineProperty(props, 'ref', {
|
|
856
|
+
get: warnAboutAccessingRef,
|
|
857
|
+
configurable: true
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Factory method to create a new React element. This no longer adheres to
|
|
863
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
864
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
865
|
+
* if something is a React Element.
|
|
866
|
+
*
|
|
867
|
+
* @param {*} type
|
|
868
|
+
* @param {*} props
|
|
869
|
+
* @param {*} key
|
|
870
|
+
* @param {string|object} ref
|
|
871
|
+
* @param {*} owner
|
|
872
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
873
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
874
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
875
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
876
|
+
* change in behavior.
|
|
877
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
878
|
+
* indicating filename, line number, and/or other information.
|
|
879
|
+
* @internal
|
|
880
|
+
*/
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
884
|
+
var element = {
|
|
885
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
886
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
887
|
+
// Built-in properties that belong on the element
|
|
888
|
+
type: type,
|
|
889
|
+
key: key,
|
|
890
|
+
ref: ref,
|
|
891
|
+
props: props,
|
|
892
|
+
// Record the component responsible for creating this element.
|
|
893
|
+
_owner: owner
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
{
|
|
897
|
+
// The validation flag is currently mutative. We put it on
|
|
898
|
+
// an external backing store so that we can freeze the whole object.
|
|
899
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
900
|
+
// commonly used development environments.
|
|
901
|
+
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
902
|
+
// the validation flag non-enumerable (where possible, which should
|
|
903
|
+
// include every environment we run tests in), so the test framework
|
|
904
|
+
// ignores it.
|
|
905
|
+
|
|
906
|
+
Object.defineProperty(element._store, 'validated', {
|
|
907
|
+
configurable: false,
|
|
908
|
+
enumerable: false,
|
|
909
|
+
writable: true,
|
|
910
|
+
value: false
|
|
911
|
+
}); // self and source are DEV only properties.
|
|
912
|
+
|
|
913
|
+
Object.defineProperty(element, '_self', {
|
|
914
|
+
configurable: false,
|
|
915
|
+
enumerable: false,
|
|
916
|
+
writable: false,
|
|
917
|
+
value: self
|
|
918
|
+
}); // Two elements created in two different places should be considered
|
|
919
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
920
|
+
|
|
921
|
+
Object.defineProperty(element, '_source', {
|
|
922
|
+
configurable: false,
|
|
923
|
+
enumerable: false,
|
|
924
|
+
writable: false,
|
|
925
|
+
value: source
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
if (Object.freeze) {
|
|
929
|
+
Object.freeze(element.props);
|
|
930
|
+
Object.freeze(element);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
return element;
|
|
935
|
+
};
|
|
936
|
+
/**
|
|
937
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
938
|
+
* @param {*} type
|
|
939
|
+
* @param {object} props
|
|
940
|
+
* @param {string} key
|
|
941
|
+
*/
|
|
942
|
+
|
|
943
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
944
|
+
{
|
|
945
|
+
var propName; // Reserved names are extracted
|
|
946
|
+
|
|
947
|
+
var props = {};
|
|
948
|
+
var key = null;
|
|
949
|
+
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
950
|
+
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
951
|
+
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
952
|
+
// but as an intermediary step, we will use jsxDEV for everything except
|
|
953
|
+
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
954
|
+
// key is explicitly declared to be undefined or not.
|
|
955
|
+
|
|
956
|
+
if (maybeKey !== undefined) {
|
|
957
|
+
{
|
|
958
|
+
checkKeyStringCoercion(maybeKey);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
key = '' + maybeKey;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
if (hasValidKey(config)) {
|
|
965
|
+
{
|
|
966
|
+
checkKeyStringCoercion(config.key);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
key = '' + config.key;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
if (hasValidRef(config)) {
|
|
973
|
+
ref = config.ref;
|
|
974
|
+
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
975
|
+
} // Remaining properties are added to a new props object
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
for (propName in config) {
|
|
979
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
980
|
+
props[propName] = config[propName];
|
|
981
|
+
}
|
|
982
|
+
} // Resolve default props
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
if (type && type.defaultProps) {
|
|
986
|
+
var defaultProps = type.defaultProps;
|
|
987
|
+
|
|
988
|
+
for (propName in defaultProps) {
|
|
989
|
+
if (props[propName] === undefined) {
|
|
990
|
+
props[propName] = defaultProps[propName];
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
if (key || ref) {
|
|
996
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
997
|
+
|
|
998
|
+
if (key) {
|
|
999
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
if (ref) {
|
|
1003
|
+
defineRefPropWarningGetter(props, displayName);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
1012
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1013
|
+
|
|
1014
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
1015
|
+
{
|
|
1016
|
+
if (element) {
|
|
1017
|
+
var owner = element._owner;
|
|
1018
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1019
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1020
|
+
} else {
|
|
1021
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
var propTypesMisspellWarningShown;
|
|
1027
|
+
|
|
1028
|
+
{
|
|
1029
|
+
propTypesMisspellWarningShown = false;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Verifies the object is a ReactElement.
|
|
1033
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1034
|
+
* @param {?object} object
|
|
1035
|
+
* @return {boolean} True if `object` is a ReactElement.
|
|
1036
|
+
* @final
|
|
1037
|
+
*/
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
function isValidElement(object) {
|
|
1041
|
+
{
|
|
1042
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
function getDeclarationErrorAddendum() {
|
|
1047
|
+
{
|
|
1048
|
+
if (ReactCurrentOwner$1.current) {
|
|
1049
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1050
|
+
|
|
1051
|
+
if (name) {
|
|
1052
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
return '';
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1061
|
+
{
|
|
1062
|
+
if (source !== undefined) {
|
|
1063
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1064
|
+
var lineNumber = source.lineNumber;
|
|
1065
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
return '';
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1073
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
1074
|
+
* updates.
|
|
1075
|
+
*/
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
var ownerHasKeyUseWarning = {};
|
|
1079
|
+
|
|
1080
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1081
|
+
{
|
|
1082
|
+
var info = getDeclarationErrorAddendum();
|
|
1083
|
+
|
|
1084
|
+
if (!info) {
|
|
1085
|
+
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1086
|
+
|
|
1087
|
+
if (parentName) {
|
|
1088
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
return info;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1097
|
+
* This element is in an array. The array could grow and shrink or be
|
|
1098
|
+
* reordered. All children that haven't already been validated are required to
|
|
1099
|
+
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1100
|
+
* will only be shown once.
|
|
1101
|
+
*
|
|
1102
|
+
* @internal
|
|
1103
|
+
* @param {ReactElement} element Element that requires a key.
|
|
1104
|
+
* @param {*} parentType element's parent's type.
|
|
1105
|
+
*/
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
function validateExplicitKey(element, parentType) {
|
|
1109
|
+
{
|
|
1110
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
element._store.validated = true;
|
|
1115
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1116
|
+
|
|
1117
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1122
|
+
// property, it may be the creator of the child that's responsible for
|
|
1123
|
+
// assigning it a key.
|
|
1124
|
+
|
|
1125
|
+
var childOwner = '';
|
|
1126
|
+
|
|
1127
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1128
|
+
// Give the component that originally created this child.
|
|
1129
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
setCurrentlyValidatingElement$1(element);
|
|
1133
|
+
|
|
1134
|
+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1135
|
+
|
|
1136
|
+
setCurrentlyValidatingElement$1(null);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Ensure that every element either is passed in a static location, in an
|
|
1141
|
+
* array with an explicit keys property defined, or in an object literal
|
|
1142
|
+
* with valid key property.
|
|
1143
|
+
*
|
|
1144
|
+
* @internal
|
|
1145
|
+
* @param {ReactNode} node Statically passed child of any type.
|
|
1146
|
+
* @param {*} parentType node's parent's type.
|
|
1147
|
+
*/
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
function validateChildKeys(node, parentType) {
|
|
1151
|
+
{
|
|
1152
|
+
if (typeof node !== 'object') {
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
if (isArray(node)) {
|
|
1157
|
+
for (var i = 0; i < node.length; i++) {
|
|
1158
|
+
var child = node[i];
|
|
1159
|
+
|
|
1160
|
+
if (isValidElement(child)) {
|
|
1161
|
+
validateExplicitKey(child, parentType);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
} else if (isValidElement(node)) {
|
|
1165
|
+
// This element was passed in a valid location.
|
|
1166
|
+
if (node._store) {
|
|
1167
|
+
node._store.validated = true;
|
|
1168
|
+
}
|
|
1169
|
+
} else if (node) {
|
|
1170
|
+
var iteratorFn = getIteratorFn(node);
|
|
1171
|
+
|
|
1172
|
+
if (typeof iteratorFn === 'function') {
|
|
1173
|
+
// Entry iterators used to provide implicit keys,
|
|
1174
|
+
// but now we print a separate warning for them later.
|
|
1175
|
+
if (iteratorFn !== node.entries) {
|
|
1176
|
+
var iterator = iteratorFn.call(node);
|
|
1177
|
+
var step;
|
|
1178
|
+
|
|
1179
|
+
while (!(step = iterator.next()).done) {
|
|
1180
|
+
if (isValidElement(step.value)) {
|
|
1181
|
+
validateExplicitKey(step.value, parentType);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Given an element, validate that its props follow the propTypes definition,
|
|
1191
|
+
* provided by the type.
|
|
1192
|
+
*
|
|
1193
|
+
* @param {ReactElement} element
|
|
1194
|
+
*/
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
function validatePropTypes(element) {
|
|
1198
|
+
{
|
|
1199
|
+
var type = element.type;
|
|
1200
|
+
|
|
1201
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
var propTypes;
|
|
1206
|
+
|
|
1207
|
+
if (typeof type === 'function') {
|
|
1208
|
+
propTypes = type.propTypes;
|
|
1209
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1210
|
+
// Inner props are checked in the reconciler.
|
|
1211
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1212
|
+
propTypes = type.propTypes;
|
|
1213
|
+
} else {
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
if (propTypes) {
|
|
1218
|
+
// Intentionally inside to avoid triggering lazy initializers:
|
|
1219
|
+
var name = getComponentNameFromType(type);
|
|
1220
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1221
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1222
|
+
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1223
|
+
|
|
1224
|
+
var _name = getComponentNameFromType(type);
|
|
1225
|
+
|
|
1226
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1230
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
1236
|
+
* @param {ReactElement} fragment
|
|
1237
|
+
*/
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
function validateFragmentProps(fragment) {
|
|
1241
|
+
{
|
|
1242
|
+
var keys = Object.keys(fragment.props);
|
|
1243
|
+
|
|
1244
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1245
|
+
var key = keys[i];
|
|
1246
|
+
|
|
1247
|
+
if (key !== 'children' && key !== 'key') {
|
|
1248
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1249
|
+
|
|
1250
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1251
|
+
|
|
1252
|
+
setCurrentlyValidatingElement$1(null);
|
|
1253
|
+
break;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
if (fragment.ref !== null) {
|
|
1258
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1259
|
+
|
|
1260
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1261
|
+
|
|
1262
|
+
setCurrentlyValidatingElement$1(null);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
var didWarnAboutKeySpread = {};
|
|
1268
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1269
|
+
{
|
|
1270
|
+
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1271
|
+
// succeed and there will likely be errors in render.
|
|
1272
|
+
|
|
1273
|
+
if (!validType) {
|
|
1274
|
+
var info = '';
|
|
1275
|
+
|
|
1276
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1277
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1281
|
+
|
|
1282
|
+
if (sourceInfo) {
|
|
1283
|
+
info += sourceInfo;
|
|
1284
|
+
} else {
|
|
1285
|
+
info += getDeclarationErrorAddendum();
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
var typeString;
|
|
1289
|
+
|
|
1290
|
+
if (type === null) {
|
|
1291
|
+
typeString = 'null';
|
|
1292
|
+
} else if (isArray(type)) {
|
|
1293
|
+
typeString = 'array';
|
|
1294
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1295
|
+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1296
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1297
|
+
} else {
|
|
1298
|
+
typeString = typeof type;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1305
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1306
|
+
|
|
1307
|
+
if (element == null) {
|
|
1308
|
+
return element;
|
|
1309
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1310
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1311
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
1312
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1313
|
+
// fixed, the key warnings will appear.)
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
if (validType) {
|
|
1317
|
+
var children = props.children;
|
|
1318
|
+
|
|
1319
|
+
if (children !== undefined) {
|
|
1320
|
+
if (isStaticChildren) {
|
|
1321
|
+
if (isArray(children)) {
|
|
1322
|
+
for (var i = 0; i < children.length; i++) {
|
|
1323
|
+
validateChildKeys(children[i], type);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
if (Object.freeze) {
|
|
1327
|
+
Object.freeze(children);
|
|
1328
|
+
}
|
|
1329
|
+
} else {
|
|
1330
|
+
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1331
|
+
}
|
|
1332
|
+
} else {
|
|
1333
|
+
validateChildKeys(children, type);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
{
|
|
1339
|
+
if (hasOwnProperty.call(props, 'key')) {
|
|
1340
|
+
var componentName = getComponentNameFromType(type);
|
|
1341
|
+
var keys = Object.keys(props).filter(function (k) {
|
|
1342
|
+
return k !== 'key';
|
|
1343
|
+
});
|
|
1344
|
+
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
1345
|
+
|
|
1346
|
+
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
1347
|
+
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
1348
|
+
|
|
1349
|
+
error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
1350
|
+
|
|
1351
|
+
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1357
|
+
validateFragmentProps(element);
|
|
1358
|
+
} else {
|
|
1359
|
+
validatePropTypes(element);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
return element;
|
|
1363
|
+
}
|
|
1364
|
+
} // These two functions exist to still get child warnings in dev
|
|
1365
|
+
// even with the prod transform. This means that jsxDEV is purely
|
|
1366
|
+
// opt-in behavior for better messages but that we won't stop
|
|
1367
|
+
// giving you warnings if you use production apis.
|
|
1368
|
+
|
|
1369
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
1370
|
+
{
|
|
1371
|
+
return jsxWithValidation(type, props, key, true);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
1375
|
+
{
|
|
1376
|
+
return jsxWithValidation(type, props, key, false);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1381
|
+
// for now we can ship identical prod functions
|
|
1382
|
+
|
|
1383
|
+
var jsxs = jsxWithValidationStatic ;
|
|
1384
|
+
|
|
1385
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1386
|
+
reactJsxRuntime_development.jsx = jsx;
|
|
1387
|
+
reactJsxRuntime_development.jsxs = jsxs;
|
|
435
1388
|
})();
|
|
1389
|
+
}
|
|
436
1390
|
return reactJsxRuntime_development;
|
|
437
1391
|
}
|
|
438
1392
|
|
|
439
1393
|
if (process.env.NODE_ENV === 'production') {
|
|
440
|
-
jsxRuntime.exports =
|
|
1394
|
+
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
441
1395
|
} else {
|
|
442
1396
|
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
443
1397
|
}
|
|
@@ -705,8 +1659,10 @@ var IS_WEB = reactNative.Platform.OS === "web";
|
|
|
705
1659
|
var IS_IOS = reactNative.Platform.OS === "ios";
|
|
706
1660
|
var IS_ANDROID = reactNative.Platform.OS === "android";
|
|
707
1661
|
var IS_MOBILE = IS_IOS || IS_ANDROID;
|
|
708
|
-
var
|
|
1662
|
+
var IS_DESKTOP = !IS_MOBILE;
|
|
1663
|
+
var _a$1 = reactNative.Dimensions.get("window"), width = _a$1.width, height = _a$1.height;
|
|
709
1664
|
var SCREEN_WIDTH = width;
|
|
1665
|
+
var SCREEN_HEIGHT = height;
|
|
710
1666
|
|
|
711
1667
|
var sizes = {
|
|
712
1668
|
borderRadiusSm: 15,
|
|
@@ -773,13 +1729,31 @@ var COLOR_CONSTANTS = {
|
|
|
773
1729
|
};
|
|
774
1730
|
|
|
775
1731
|
// Storybook Themes
|
|
776
|
-
|
|
1732
|
+
var storyBookThemes = {
|
|
777
1733
|
modern: __assign(__assign({}, defaultTheme), { primary: '#f72585', accent: '#ffc300', background: '#e5e5e5', surface: '#f4f3ee', surfaceText: '#f72585' }),
|
|
778
1734
|
warm: __assign(__assign({}, defaultTheme), { primary: '#014F5C', accent: '#F38A51', background: '#BE9C80', surface: '#F1CFB3', surfaceText: '#014F5C' }),
|
|
779
1735
|
dark: __assign(__assign({}, defaultTheme), { background: '#1e1e1e', text: '#ffffff', primary: '#ffbe0b', accent: '#d00000', surface: '#2f3037', surfaceText: '#ffffff' }),
|
|
780
1736
|
forest: __assign(__assign({}, defaultTheme), { primary: '#354f52', accent: '#84a98c', background: '#f0f4f0', surface: '#cad2c5', surfaceText: '#2d3436' }),
|
|
781
1737
|
sunset: __assign(__assign({}, defaultTheme), { primary: '#c32f27', accent: '#db7c26', background: '#f9edcc', surface: '#f0dfad', surfaceText: '#2d3436' }),
|
|
782
|
-
}
|
|
1738
|
+
};
|
|
1739
|
+
// Create the themes object
|
|
1740
|
+
var themes = {
|
|
1741
|
+
default: defaultTheme,
|
|
1742
|
+
dark: storyBookThemes.dark,
|
|
1743
|
+
modern: storyBookThemes.modern,
|
|
1744
|
+
warm: storyBookThemes.warm,
|
|
1745
|
+
forest: storyBookThemes.forest,
|
|
1746
|
+
sunset: storyBookThemes.sunset,
|
|
1747
|
+
};
|
|
1748
|
+
// Theme selector items
|
|
1749
|
+
var themeItems = [
|
|
1750
|
+
{ value: 'default', title: 'Default' },
|
|
1751
|
+
{ value: 'dark', title: 'Dark' },
|
|
1752
|
+
{ value: 'modern', title: 'Modern' },
|
|
1753
|
+
{ value: 'warm', title: 'Warm' },
|
|
1754
|
+
{ value: 'forest', title: 'Forest' },
|
|
1755
|
+
{ value: 'sunset', title: 'Sunset' },
|
|
1756
|
+
];
|
|
783
1757
|
|
|
784
1758
|
var isValidColor = function (color) {
|
|
785
1759
|
try {
|
|
@@ -947,6 +1921,16 @@ var desaturateColor = function (color) {
|
|
|
947
1921
|
.lighten(COLOR_CONSTANTS.DESATURATION_LIGHTEN_AMOUNT)
|
|
948
1922
|
.toString();
|
|
949
1923
|
};
|
|
1924
|
+
/**
|
|
1925
|
+
* Gets the appropriate state color based on type and count
|
|
1926
|
+
* @param baseColor - Base color to process
|
|
1927
|
+
* @param type - Type of state
|
|
1928
|
+
* @param count - Count affecting the state
|
|
1929
|
+
* @returns Processed color string
|
|
1930
|
+
*/
|
|
1931
|
+
var getStateColor = function (baseColor, type, count) {
|
|
1932
|
+
return shouldDesaturate(type, count) ? desaturateColor(baseColor) : baseColor;
|
|
1933
|
+
};
|
|
950
1934
|
|
|
951
1935
|
var DIMENSION_MODES = {
|
|
952
1936
|
DESKTOP: 'desktop',
|
|
@@ -1498,6 +2482,7 @@ var Text = function (_a) {
|
|
|
1498
2482
|
};
|
|
1499
2483
|
|
|
1500
2484
|
var MAX_WIDTH = 1080;
|
|
2485
|
+
var SLIDE_WIDTH = MAX_WIDTH;
|
|
1501
2486
|
var BUTTON_SIZE = 42;
|
|
1502
2487
|
|
|
1503
2488
|
exports.CTALinkTarget = void 0;
|
|
@@ -1525,6 +2510,7 @@ exports.TileType = void 0;
|
|
|
1525
2510
|
TileType["RewardCategory"] = "REWARD_CATEGORY";
|
|
1526
2511
|
TileType["Tier"] = "TIER";
|
|
1527
2512
|
TileType["Roundup"] = "ROUND_UP_BALANCE";
|
|
2513
|
+
TileType["Venue"] = "VENUE";
|
|
1528
2514
|
})(exports.TileType || (exports.TileType = {}));
|
|
1529
2515
|
exports.TileHeight = void 0;
|
|
1530
2516
|
(function (TileHeight) {
|
|
@@ -1604,6 +2590,15 @@ var RewardTileConfig = /** @class */ (function () {
|
|
|
1604
2590
|
}
|
|
1605
2591
|
return RewardTileConfig;
|
|
1606
2592
|
}());
|
|
2593
|
+
var VenueTileConfig = /** @class */ (function () {
|
|
2594
|
+
function VenueTileConfig() {
|
|
2595
|
+
this.venueId = '';
|
|
2596
|
+
this.name = '';
|
|
2597
|
+
this.artworkUrl = '';
|
|
2598
|
+
this.description = '';
|
|
2599
|
+
}
|
|
2600
|
+
return VenueTileConfig;
|
|
2601
|
+
}());
|
|
1607
2602
|
exports.BadgeTileType = void 0;
|
|
1608
2603
|
(function (BadgeTileType) {
|
|
1609
2604
|
BadgeTileType["Specific"] = "SPECIFIC";
|
|
@@ -1659,6 +2654,13 @@ var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
|
1659
2654
|
return handleNavigation(url, exports.CTALinkTarget.sameWindow);
|
|
1660
2655
|
}
|
|
1661
2656
|
}
|
|
2657
|
+
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.Venue) {
|
|
2658
|
+
var config = tile.configuration;
|
|
2659
|
+
if (config === null || config === void 0 ? void 0 : config.venueId) {
|
|
2660
|
+
var url = "/venue?id=".concat(config.venueId);
|
|
2661
|
+
return handleNavigation(url, exports.CTALinkTarget.sameWindow);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
1662
2664
|
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.RewardCategory) {
|
|
1663
2665
|
var config = tile.configuration;
|
|
1664
2666
|
var url = "/category?id=".concat(config.rewardCategoryId);
|
|
@@ -1958,7 +2960,7 @@ var BaseTileContainer = function (_a) {
|
|
|
1958
2960
|
var _b = tile.configuration, _c = _b.ctaLink, ctaLink = _c === void 0 ? '' : _c, ctaLinkTarget = _b.ctaLinkTarget, _d = _b.title, title = _d === void 0 ? 'Tile' : _d;
|
|
1959
2961
|
var theme = (sdk === null || sdk === void 0 ? void 0 : sdk.theme) || { surface: '#ffffff' };
|
|
1960
2962
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
1961
|
-
var isInteractive = Boolean(ctaLink || tile.type === 'REWARD' || tile.type === 'REWARD_CATEGORY');
|
|
2963
|
+
var isInteractive = Boolean(ctaLink || tile.type === 'REWARD' || tile.type === 'REWARD_CATEGORY' || tile.type === 'VENUE');
|
|
1962
2964
|
var layout = {
|
|
1963
2965
|
flexDirection: 'column',
|
|
1964
2966
|
justifyContent: isHalfSize ? 'center' : 'flex-start',
|
|
@@ -2303,7 +3305,7 @@ var BadgeTileDateEarned = function () {
|
|
|
2303
3305
|
var formattedDate = handleLastEarnedDate(lastEarnedAt, locale);
|
|
2304
3306
|
var displayText = count === 0
|
|
2305
3307
|
? badgeNotEarnedMessage
|
|
2306
|
-
: "".concat(awardedDatePrefix
|
|
3308
|
+
: "".concat(awardedDatePrefix).concat(formattedDate);
|
|
2307
3309
|
var accessibilityLabel = count === 0 ? 'Badge not yet earned' : "Badge earned on ".concat(formattedDate);
|
|
2308
3310
|
return (jsxRuntimeExports.jsx(Chip, { label: (displayText === null || displayText === void 0 ? void 0 : displayText.toString()) || '', variant: count === 0 ? exports.StatusVariant.GREY : exports.StatusVariant.PRIMARY, accessibilityLabel: accessibilityLabel, testID: "badge-tile-date-earned" }));
|
|
2309
3311
|
};
|
|
@@ -4423,6 +5425,151 @@ var RoundupTile = Object.assign(RoundupTileRoot, {
|
|
|
4423
5425
|
});
|
|
4424
5426
|
var RoundupTile$1 = withTileFetching(RoundupTile);
|
|
4425
5427
|
|
|
5428
|
+
/**
|
|
5429
|
+
* Renders a chevron icon for a Venue Tile.
|
|
5430
|
+
*
|
|
5431
|
+
* @returns React.ReactElement
|
|
5432
|
+
*/
|
|
5433
|
+
var VenueTileChevron = function () {
|
|
5434
|
+
var _a;
|
|
5435
|
+
var theme = useWllSdk().theme;
|
|
5436
|
+
return (jsxRuntimeExports.jsx(Icon, { name: "ChevronRight", size: IS_MOBILE ? 16 : undefined, color: ((_a = theme === null || theme === void 0 ? void 0 : theme.derivedSurfaceText) === null || _a === void 0 ? void 0 : _a[20]) || '#000000', role: "img", accessibilityLabel: "View venue details" }));
|
|
5437
|
+
};
|
|
5438
|
+
|
|
5439
|
+
/**
|
|
5440
|
+
* Custom hook that returns the styles for the VenueTile component.
|
|
5441
|
+
* Applies responsive styling based on the current device.
|
|
5442
|
+
*
|
|
5443
|
+
* @returns StyleSheet styles for the VenueTile component
|
|
5444
|
+
*/
|
|
5445
|
+
var useVenueTileStyles = function () {
|
|
5446
|
+
var _a = useResponsive$1(), isDesktop = _a.isDesktop, isTablet = _a.isTablet;
|
|
5447
|
+
var theme = useWllSdk().theme;
|
|
5448
|
+
return reactNative.StyleSheet.create({
|
|
5449
|
+
imageContainer: {
|
|
5450
|
+
width: '100%',
|
|
5451
|
+
marginBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
5452
|
+
},
|
|
5453
|
+
image: {
|
|
5454
|
+
position: 'absolute',
|
|
5455
|
+
top: 0,
|
|
5456
|
+
left: 0,
|
|
5457
|
+
bottom: 0,
|
|
5458
|
+
right: 0,
|
|
5459
|
+
width: '100%',
|
|
5460
|
+
height: '100%',
|
|
5461
|
+
resizeMode: 'cover',
|
|
5462
|
+
},
|
|
5463
|
+
content: {
|
|
5464
|
+
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
5465
|
+
flex: 1,
|
|
5466
|
+
},
|
|
5467
|
+
footer: {
|
|
5468
|
+
marginTop: 8,
|
|
5469
|
+
},
|
|
5470
|
+
pointsContainer: {
|
|
5471
|
+
flexDirection: 'row',
|
|
5472
|
+
alignItems: 'center',
|
|
5473
|
+
justifyContent: 'center',
|
|
5474
|
+
},
|
|
5475
|
+
suffix: {
|
|
5476
|
+
color: theme.primary,
|
|
5477
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
5478
|
+
},
|
|
5479
|
+
header: {
|
|
5480
|
+
width: '100%',
|
|
5481
|
+
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
|
|
5482
|
+
},
|
|
5483
|
+
tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
|
|
5484
|
+
});
|
|
5485
|
+
};
|
|
5486
|
+
|
|
5487
|
+
/**
|
|
5488
|
+
* Renders the media for a Venue Tile.
|
|
5489
|
+
*
|
|
5490
|
+
* @param props {VenueTileMediaProps} - Component props
|
|
5491
|
+
* @param props.isArtworkOnly {boolean} - Whether the media should be rendered as an artwork only component
|
|
5492
|
+
* @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
|
|
5493
|
+
*/
|
|
5494
|
+
var VenueTileMedia = function (_a) {
|
|
5495
|
+
var isArtworkOnly = _a.isArtworkOnly;
|
|
5496
|
+
var styles = useVenueTileStyles();
|
|
5497
|
+
var tileContext = useTileContext();
|
|
5498
|
+
if (!isContextValid(tileContext))
|
|
5499
|
+
return null;
|
|
5500
|
+
var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.name, name = _c === void 0 ? 'Venue' : _c;
|
|
5501
|
+
if (!artworkUrl)
|
|
5502
|
+
return null;
|
|
5503
|
+
var containerStyle = {
|
|
5504
|
+
flexBasis: isArtworkOnly ? '100%' : '50%',
|
|
5505
|
+
};
|
|
5506
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "venue-tile-media", role: "img", accessibilityLabel: "Venue image for ".concat(name), children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Venue image for ".concat(name) }) }));
|
|
5507
|
+
};
|
|
5508
|
+
|
|
5509
|
+
/**
|
|
5510
|
+
* Renders the summary of a Venue Tile.
|
|
5511
|
+
*
|
|
5512
|
+
* @returns React.ReactElement or null if no summary is present
|
|
5513
|
+
*/
|
|
5514
|
+
var VenueTileDescription = function () {
|
|
5515
|
+
var tileContext = useTileContext();
|
|
5516
|
+
if (!isContextValid(tileContext))
|
|
5517
|
+
return null;
|
|
5518
|
+
var description = tileContext.configuration.description;
|
|
5519
|
+
if (!description)
|
|
5520
|
+
return null;
|
|
5521
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "body", role: "article", accessibilityLabel: description, testID: "venue-tile-description", numberOfLines: 3, ellipsizeMode: "tail", children: description }));
|
|
5522
|
+
};
|
|
5523
|
+
|
|
5524
|
+
/**
|
|
5525
|
+
* Renders the title of a Venue Tile.
|
|
5526
|
+
*
|
|
5527
|
+
* @returns React.ReactElement or null if no name is present
|
|
5528
|
+
*/
|
|
5529
|
+
var VenueTileTitle = function () {
|
|
5530
|
+
var tileContext = useTileContext();
|
|
5531
|
+
var styles = useVenueTileStyles();
|
|
5532
|
+
if (!isContextValid(tileContext))
|
|
5533
|
+
return null;
|
|
5534
|
+
var name = tileContext.configuration.name;
|
|
5535
|
+
if (!name)
|
|
5536
|
+
return null;
|
|
5537
|
+
var handleTitleWidth = function () {
|
|
5538
|
+
if (IS_MOBILE) {
|
|
5539
|
+
return styles.tileTitle;
|
|
5540
|
+
}
|
|
5541
|
+
};
|
|
5542
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "title", ellipsizeMode: "tail", numberOfLines: 1, role: "heading", accessibilityLabel: "Venue title: ".concat(name), testID: "venue-tile-title", style: handleTitleWidth(), children: name }));
|
|
5543
|
+
};
|
|
5544
|
+
|
|
5545
|
+
/**
|
|
5546
|
+
* The VenueTile component renders a tile with media, title, summary, points, and a chevron.
|
|
5547
|
+
*
|
|
5548
|
+
* @param {VenueTileProps} props - Component props
|
|
5549
|
+
* @param {Tile} props.tile - The tile data to render
|
|
5550
|
+
* @returns React.ReactElement or null if tile is inactive or not a full-height tile
|
|
5551
|
+
*/
|
|
5552
|
+
var VenueTileRoot = function (_a) {
|
|
5553
|
+
var tile = _a.tile;
|
|
5554
|
+
var styles = useVenueTileStyles();
|
|
5555
|
+
if (!tile ||
|
|
5556
|
+
tile.tileHeight !== exports.TileHeight.Full ||
|
|
5557
|
+
!tile.active ||
|
|
5558
|
+
!tile.configuration)
|
|
5559
|
+
return null;
|
|
5560
|
+
return (jsxRuntimeExports.jsxs(BaseTile, { tile: tile, children: [jsxRuntimeExports.jsx(VenueTile.Media, { isArtworkOnly: false }), jsxRuntimeExports.jsxs(Layout, { children: [jsxRuntimeExports.jsxs(Row, { justify: "between", align: "center", style: styles.header, children: [jsxRuntimeExports.jsx(VenueTile.Title, {}), jsxRuntimeExports.jsx(VenueTile.Chevron, {})] }), jsxRuntimeExports.jsx(VenueTile.Description, {})] })] }));
|
|
5561
|
+
};
|
|
5562
|
+
/**
|
|
5563
|
+
* The VenueTile component with subcomponents attached.
|
|
5564
|
+
*/
|
|
5565
|
+
var VenueTile = Object.assign(VenueTileRoot, {
|
|
5566
|
+
Media: VenueTileMedia,
|
|
5567
|
+
Title: VenueTileTitle,
|
|
5568
|
+
Description: VenueTileDescription,
|
|
5569
|
+
Chevron: VenueTileChevron,
|
|
5570
|
+
});
|
|
5571
|
+
var VenueTile$1 = withTileFetching(VenueTile);
|
|
5572
|
+
|
|
4426
5573
|
var _a;
|
|
4427
5574
|
var TILE_COMPONENTS = (_a = {},
|
|
4428
5575
|
_a[exports.TileType.Content] = ContentTile$1,
|
|
@@ -4433,6 +5580,7 @@ var TILE_COMPONENTS = (_a = {},
|
|
|
4433
5580
|
_a[exports.TileType.RewardCategory] = RewardCategoryTile$1,
|
|
4434
5581
|
_a[exports.TileType.Banner] = BannerTile$1,
|
|
4435
5582
|
_a[exports.TileType.Roundup] = RoundupTile$1,
|
|
5583
|
+
_a[exports.TileType.Venue] = VenueTile$1,
|
|
4436
5584
|
_a);
|
|
4437
5585
|
/**
|
|
4438
5586
|
* TileContainer component to render a list of tiles with proper layout and spacing.
|
|
@@ -4551,6 +5699,7 @@ var Reward = /** @class */ (function () {
|
|
|
4551
5699
|
return Reward;
|
|
4552
5700
|
}());
|
|
4553
5701
|
|
|
5702
|
+
exports.BUTTON_SIZE = BUTTON_SIZE;
|
|
4554
5703
|
exports.BadgeTile = BadgeTile$1;
|
|
4555
5704
|
exports.BadgeTileConfig = BadgeTileConfig;
|
|
4556
5705
|
exports.BannerTile = BannerTile$1;
|
|
@@ -4558,19 +5707,29 @@ exports.BannerTileConfig = BannerTileConfig;
|
|
|
4558
5707
|
exports.BaseBanner = BaseBanner;
|
|
4559
5708
|
exports.BaseTile = BaseTile;
|
|
4560
5709
|
exports.Button = Button;
|
|
5710
|
+
exports.COLOR_CONSTANTS = COLOR_CONSTANTS;
|
|
4561
5711
|
exports.Carousel = Carousel;
|
|
4562
5712
|
exports.CarouselNavButton = CarouselNavButton;
|
|
4563
5713
|
exports.Chip = Chip;
|
|
4564
5714
|
exports.Column = Column;
|
|
4565
5715
|
exports.ContentTile = ContentTile$1;
|
|
4566
5716
|
exports.ContentTileConfig = ContentTileConfig;
|
|
5717
|
+
exports.DIMENSION_MODES = DIMENSION_MODES;
|
|
5718
|
+
exports.EventEmitter = EventEmitter;
|
|
4567
5719
|
exports.FullFlex = FullFlex;
|
|
5720
|
+
exports.GRID_GAP = GRID_GAP;
|
|
4568
5721
|
exports.Grid = Grid;
|
|
4569
5722
|
exports.Group = Group;
|
|
5723
|
+
exports.IS_ANDROID = IS_ANDROID;
|
|
5724
|
+
exports.IS_DESKTOP = IS_DESKTOP;
|
|
5725
|
+
exports.IS_IOS = IS_IOS;
|
|
5726
|
+
exports.IS_MOBILE = IS_MOBILE;
|
|
5727
|
+
exports.IS_WEB = IS_WEB;
|
|
4570
5728
|
exports.Icon = Icon;
|
|
4571
5729
|
exports.Indicator = Indicator;
|
|
4572
5730
|
exports.Layout = Layout;
|
|
4573
5731
|
exports.LoadingIndicator = LoadingIndicator;
|
|
5732
|
+
exports.MAX_WIDTH = MAX_WIDTH;
|
|
4574
5733
|
exports.PointsTile = PointsTile$1;
|
|
4575
5734
|
exports.PointsTileConfig = PointsTileConfig;
|
|
4576
5735
|
exports.ProgressBar = ProgressBar;
|
|
@@ -4584,18 +5743,57 @@ exports.RewardTileConfig = RewardTileConfig;
|
|
|
4584
5743
|
exports.RoundupTile = RoundupTile$1;
|
|
4585
5744
|
exports.RoundupTileConfig = RoundupTileConfig;
|
|
4586
5745
|
exports.Row = Row;
|
|
5746
|
+
exports.SCREEN_HEIGHT = SCREEN_HEIGHT;
|
|
5747
|
+
exports.SCREEN_WIDTH = SCREEN_WIDTH;
|
|
5748
|
+
exports.SLIDE_WIDTH = SLIDE_WIDTH;
|
|
5749
|
+
exports.SMALL_SCREEN_WIDTH = SMALL_SCREEN_WIDTH;
|
|
4587
5750
|
exports.Section = Section;
|
|
4588
5751
|
exports.SectionHeader = SectionHeader;
|
|
4589
5752
|
exports.Skeleton = Skeleton;
|
|
4590
5753
|
exports.Spacer = Spacer;
|
|
5754
|
+
exports.TABLET_SCREEN_WIDTH = TABLET_SCREEN_WIDTH;
|
|
4591
5755
|
exports.Text = Text;
|
|
4592
5756
|
exports.TierTileConfig = TierTileConfig;
|
|
4593
5757
|
exports.TierTileUpdated = TierTile;
|
|
4594
5758
|
exports.TileContainer = TileContainer;
|
|
5759
|
+
exports.VenueTile = VenueTile$1;
|
|
5760
|
+
exports.VenueTileConfig = VenueTileConfig;
|
|
4595
5761
|
exports.WllSdkProvider = WllSdkProvider;
|
|
4596
5762
|
exports.alignMap = alignMap;
|
|
5763
|
+
exports.commonStyles = commonStyles;
|
|
5764
|
+
exports.createResourceGetter = createResourceGetter;
|
|
5765
|
+
exports.defaultTheme = defaultTheme;
|
|
5766
|
+
exports.desaturateColor = desaturateColor;
|
|
5767
|
+
exports.getAlphaDerivedColors = getAlphaDerivedColors;
|
|
5768
|
+
exports.getDerivedColor = getDerivedColor;
|
|
5769
|
+
exports.getDerivedColorPercentages = getDerivedColorPercentages;
|
|
5770
|
+
exports.getDimensionMode = getDimensionMode;
|
|
5771
|
+
exports.getDirectionalMargin = getDirectionalMargin;
|
|
5772
|
+
exports.getReadableTextColor = getReadableTextColor;
|
|
5773
|
+
exports.getResponsiveValue = getResponsiveValue;
|
|
5774
|
+
exports.getStateColor = getStateColor;
|
|
5775
|
+
exports.handleLastEarnedDate = handleLastEarnedDate;
|
|
4597
5776
|
exports.justifyMap = justifyMap;
|
|
5777
|
+
exports.sdkEventEmitter = sdkEventEmitter;
|
|
5778
|
+
exports.shouldDesaturate = shouldDesaturate;
|
|
5779
|
+
exports.sizes = sizes;
|
|
5780
|
+
exports.sortByPriority = sortByPriority;
|
|
5781
|
+
exports.themeItems = themeItems;
|
|
5782
|
+
exports.themes = themes;
|
|
5783
|
+
exports.transformLocale = transformLocale;
|
|
5784
|
+
exports.useCreateRequestOptions = useCreateRequestOptions;
|
|
5785
|
+
exports.useGetGroupByID = useGetGroupByID;
|
|
5786
|
+
exports.useGetSectionByID = useGetSectionByID;
|
|
5787
|
+
exports.useGetTileByID = useGetTileByID;
|
|
5788
|
+
exports.useGroupRefresh = useGroupRefresh;
|
|
5789
|
+
exports.useInitialGroupFetch = useInitialGroupFetch;
|
|
4598
5790
|
exports.useInvalidateData = useInvalidateData;
|
|
5791
|
+
exports.useMakeRequest = useMakeRequest;
|
|
5792
|
+
exports.useNavigation = useNavigation;
|
|
4599
5793
|
exports.usePullToRefresh = usePullToRefresh;
|
|
5794
|
+
exports.useResponsive = useResponsive$1;
|
|
5795
|
+
exports.useResponsiveValue = useResponsiveValue;
|
|
5796
|
+
exports.useTileSize = useTileSize;
|
|
4600
5797
|
exports.useWllSdk = useWllSdk;
|
|
5798
|
+
exports.validateTheme = validateTheme;
|
|
4601
5799
|
//# sourceMappingURL=native.js.map
|