@micromerce/media-fileuploader 1.0.1894 → 1.0.1911

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/esm/index.js CHANGED
@@ -1,1380 +1,6 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
1
2
  import r$1, { createContext, useContext, useState, useRef, useEffect, useDebugValue, createElement, Component, memo } from 'react';
2
3
 
3
- var global$1 = (typeof global !== "undefined" ? global :
4
- typeof self !== "undefined" ? self :
5
- typeof window !== "undefined" ? window : {});
6
-
7
- var env = {};
8
-
9
- // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
10
- var performance = global$1.performance || {};
11
- performance.now ||
12
- performance.mozNow ||
13
- performance.msNow ||
14
- performance.oNow ||
15
- performance.webkitNow ||
16
- function(){ return (new Date()).getTime() };
17
-
18
- var browser$1 = {
19
- env: env};
20
-
21
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
22
-
23
- function getDefaultExportFromCjs (x) {
24
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
25
- }
26
-
27
- function getAugmentedNamespace(n) {
28
- if (n.__esModule) return n;
29
- var f = n.default;
30
- if (typeof f == "function") {
31
- var a = function a () {
32
- if (this instanceof a) {
33
- return Reflect.construct(f, arguments, this.constructor);
34
- }
35
- return f.apply(this, arguments);
36
- };
37
- a.prototype = f.prototype;
38
- } else a = {};
39
- Object.defineProperty(a, '__esModule', {value: true});
40
- Object.keys(n).forEach(function (k) {
41
- var d = Object.getOwnPropertyDescriptor(n, k);
42
- Object.defineProperty(a, k, d.get ? d : {
43
- enumerable: true,
44
- get: function () {
45
- return n[k];
46
- }
47
- });
48
- });
49
- return a;
50
- }
51
-
52
- var jsxRuntime = {exports: {}};
53
-
54
- var reactJsxRuntime_production_min = {};
55
-
56
- /**
57
- * @license React
58
- * react-jsx-runtime.production.min.js
59
- *
60
- * Copyright (c) Facebook, Inc. and its affiliates.
61
- *
62
- * This source code is licensed under the MIT license found in the
63
- * LICENSE file in the root directory of this source tree.
64
- */
65
-
66
- var hasRequiredReactJsxRuntime_production_min;
67
-
68
- function requireReactJsxRuntime_production_min () {
69
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
70
- hasRequiredReactJsxRuntime_production_min = 1;
71
- var f=r$1,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:true,ref:true,__self:true,__source:true};
72
- 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;
73
- return reactJsxRuntime_production_min;
74
- }
75
-
76
- var reactJsxRuntime_development = {};
77
-
78
- var hasRequiredReactJsxRuntime_development;
79
-
80
- function requireReactJsxRuntime_development () {
81
- if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
82
- hasRequiredReactJsxRuntime_development = 1;
83
-
84
- if (browser$1.env.NODE_ENV !== "production") {
85
- (function() {
86
-
87
- var React = r$1;
88
-
89
- // ATTENTION
90
- // When adding new symbols to this file,
91
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
92
- // The Symbol used to tag the ReactElement-like types.
93
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
94
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
95
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
96
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
97
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
98
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
99
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
100
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
101
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
102
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
103
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
104
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
105
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
106
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
107
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
108
- function getIteratorFn(maybeIterable) {
109
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
110
- return null;
111
- }
112
-
113
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
114
-
115
- if (typeof maybeIterator === 'function') {
116
- return maybeIterator;
117
- }
118
-
119
- return null;
120
- }
121
-
122
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
123
-
124
- function error(format) {
125
- {
126
- {
127
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
128
- args[_key2 - 1] = arguments[_key2];
129
- }
130
-
131
- printWarning('error', format, args);
132
- }
133
- }
134
- }
135
-
136
- function printWarning(level, format, args) {
137
- // When changing this logic, you might want to also
138
- // update consoleWithStackDev.www.js as well.
139
- {
140
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
141
- var stack = ReactDebugCurrentFrame.getStackAddendum();
142
-
143
- if (stack !== '') {
144
- format += '%s';
145
- args = args.concat([stack]);
146
- } // eslint-disable-next-line react-internal/safe-string-coercion
147
-
148
-
149
- var argsWithFormat = args.map(function (item) {
150
- return String(item);
151
- }); // Careful: RN currently depends on this prefix
152
-
153
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
154
- // breaks IE9: https://github.com/facebook/react/issues/13610
155
- // eslint-disable-next-line react-internal/no-production-logging
156
-
157
- Function.prototype.apply.call(console[level], console, argsWithFormat);
158
- }
159
- }
160
-
161
- // -----------------------------------------------------------------------------
162
-
163
- var enableScopeAPI = false; // Experimental Create Event Handle API.
164
- var enableCacheElement = false;
165
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
166
-
167
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
168
- // stuff. Intended to enable React core members to more easily debug scheduling
169
- // issues in DEV builds.
170
-
171
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
172
-
173
- var REACT_MODULE_REFERENCE;
174
-
175
- {
176
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
177
- }
178
-
179
- function isValidElementType(type) {
180
- if (typeof type === 'string' || typeof type === 'function') {
181
- return true;
182
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
183
-
184
-
185
- 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 ) {
186
- return true;
187
- }
188
-
189
- if (typeof type === 'object' && type !== null) {
190
- 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
191
- // types supported by any Flight configuration anywhere since
192
- // we don't know which Flight build this will end up being used
193
- // with.
194
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
195
- return true;
196
- }
197
- }
198
-
199
- return false;
200
- }
201
-
202
- function getWrappedName(outerType, innerType, wrapperName) {
203
- var displayName = outerType.displayName;
204
-
205
- if (displayName) {
206
- return displayName;
207
- }
208
-
209
- var functionName = innerType.displayName || innerType.name || '';
210
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
211
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
212
-
213
-
214
- function getContextName(type) {
215
- return type.displayName || 'Context';
216
- } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
217
-
218
-
219
- function getComponentNameFromType(type) {
220
- if (type == null) {
221
- // Host root, text node or just invalid type.
222
- return null;
223
- }
224
-
225
- {
226
- if (typeof type.tag === 'number') {
227
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
228
- }
229
- }
230
-
231
- if (typeof type === 'function') {
232
- return type.displayName || type.name || null;
233
- }
234
-
235
- if (typeof type === 'string') {
236
- return type;
237
- }
238
-
239
- switch (type) {
240
- case REACT_FRAGMENT_TYPE:
241
- return 'Fragment';
242
-
243
- case REACT_PORTAL_TYPE:
244
- return 'Portal';
245
-
246
- case REACT_PROFILER_TYPE:
247
- return 'Profiler';
248
-
249
- case REACT_STRICT_MODE_TYPE:
250
- return 'StrictMode';
251
-
252
- case REACT_SUSPENSE_TYPE:
253
- return 'Suspense';
254
-
255
- case REACT_SUSPENSE_LIST_TYPE:
256
- return 'SuspenseList';
257
-
258
- }
259
-
260
- if (typeof type === 'object') {
261
- switch (type.$$typeof) {
262
- case REACT_CONTEXT_TYPE:
263
- var context = type;
264
- return getContextName(context) + '.Consumer';
265
-
266
- case REACT_PROVIDER_TYPE:
267
- var provider = type;
268
- return getContextName(provider._context) + '.Provider';
269
-
270
- case REACT_FORWARD_REF_TYPE:
271
- return getWrappedName(type, type.render, 'ForwardRef');
272
-
273
- case REACT_MEMO_TYPE:
274
- var outerName = type.displayName || null;
275
-
276
- if (outerName !== null) {
277
- return outerName;
278
- }
279
-
280
- return getComponentNameFromType(type.type) || 'Memo';
281
-
282
- case REACT_LAZY_TYPE:
283
- {
284
- var lazyComponent = type;
285
- var payload = lazyComponent._payload;
286
- var init = lazyComponent._init;
287
-
288
- try {
289
- return getComponentNameFromType(init(payload));
290
- } catch (x) {
291
- return null;
292
- }
293
- }
294
-
295
- // eslint-disable-next-line no-fallthrough
296
- }
297
- }
298
-
299
- return null;
300
- }
301
-
302
- var assign = Object.assign;
303
-
304
- // Helpers to patch console.logs to avoid logging during side-effect free
305
- // replaying on render function. This currently only patches the object
306
- // lazily which won't cover if the log function was extracted eagerly.
307
- // We could also eagerly patch the method.
308
- var disabledDepth = 0;
309
- var prevLog;
310
- var prevInfo;
311
- var prevWarn;
312
- var prevError;
313
- var prevGroup;
314
- var prevGroupCollapsed;
315
- var prevGroupEnd;
316
-
317
- function disabledLog() {}
318
-
319
- disabledLog.__reactDisabledLog = true;
320
- function disableLogs() {
321
- {
322
- if (disabledDepth === 0) {
323
- /* eslint-disable react-internal/no-production-logging */
324
- prevLog = console.log;
325
- prevInfo = console.info;
326
- prevWarn = console.warn;
327
- prevError = console.error;
328
- prevGroup = console.group;
329
- prevGroupCollapsed = console.groupCollapsed;
330
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
331
-
332
- var props = {
333
- configurable: true,
334
- enumerable: true,
335
- value: disabledLog,
336
- writable: true
337
- }; // $FlowFixMe Flow thinks console is immutable.
338
-
339
- Object.defineProperties(console, {
340
- info: props,
341
- log: props,
342
- warn: props,
343
- error: props,
344
- group: props,
345
- groupCollapsed: props,
346
- groupEnd: props
347
- });
348
- /* eslint-enable react-internal/no-production-logging */
349
- }
350
-
351
- disabledDepth++;
352
- }
353
- }
354
- function reenableLogs() {
355
- {
356
- disabledDepth--;
357
-
358
- if (disabledDepth === 0) {
359
- /* eslint-disable react-internal/no-production-logging */
360
- var props = {
361
- configurable: true,
362
- enumerable: true,
363
- writable: true
364
- }; // $FlowFixMe Flow thinks console is immutable.
365
-
366
- Object.defineProperties(console, {
367
- log: assign({}, props, {
368
- value: prevLog
369
- }),
370
- info: assign({}, props, {
371
- value: prevInfo
372
- }),
373
- warn: assign({}, props, {
374
- value: prevWarn
375
- }),
376
- error: assign({}, props, {
377
- value: prevError
378
- }),
379
- group: assign({}, props, {
380
- value: prevGroup
381
- }),
382
- groupCollapsed: assign({}, props, {
383
- value: prevGroupCollapsed
384
- }),
385
- groupEnd: assign({}, props, {
386
- value: prevGroupEnd
387
- })
388
- });
389
- /* eslint-enable react-internal/no-production-logging */
390
- }
391
-
392
- if (disabledDepth < 0) {
393
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
394
- }
395
- }
396
- }
397
-
398
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
399
- var prefix;
400
- function describeBuiltInComponentFrame(name, source, ownerFn) {
401
- {
402
- if (prefix === undefined) {
403
- // Extract the VM specific prefix used by each line.
404
- try {
405
- throw Error();
406
- } catch (x) {
407
- var match = x.stack.trim().match(/\n( *(at )?)/);
408
- prefix = match && match[1] || '';
409
- }
410
- } // We use the prefix to ensure our stacks line up with native stack frames.
411
-
412
-
413
- return '\n' + prefix + name;
414
- }
415
- }
416
- var reentry = false;
417
- var componentFrameCache;
418
-
419
- {
420
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
421
- componentFrameCache = new PossiblyWeakMap();
422
- }
423
-
424
- function describeNativeComponentFrame(fn, construct) {
425
- // If something asked for a stack inside a fake render, it should get ignored.
426
- if ( !fn || reentry) {
427
- return '';
428
- }
429
-
430
- {
431
- var frame = componentFrameCache.get(fn);
432
-
433
- if (frame !== undefined) {
434
- return frame;
435
- }
436
- }
437
-
438
- var control;
439
- reentry = true;
440
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
441
-
442
- Error.prepareStackTrace = undefined;
443
- var previousDispatcher;
444
-
445
- {
446
- previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
447
- // for warnings.
448
-
449
- ReactCurrentDispatcher.current = null;
450
- disableLogs();
451
- }
452
-
453
- try {
454
- // This should throw.
455
- if (construct) {
456
- // Something should be setting the props in the constructor.
457
- var Fake = function () {
458
- throw Error();
459
- }; // $FlowFixMe
460
-
461
-
462
- Object.defineProperty(Fake.prototype, 'props', {
463
- set: function () {
464
- // We use a throwing setter instead of frozen or non-writable props
465
- // because that won't throw in a non-strict mode function.
466
- throw Error();
467
- }
468
- });
469
-
470
- if (typeof Reflect === 'object' && Reflect.construct) {
471
- // We construct a different control for this case to include any extra
472
- // frames added by the construct call.
473
- try {
474
- Reflect.construct(Fake, []);
475
- } catch (x) {
476
- control = x;
477
- }
478
-
479
- Reflect.construct(fn, [], Fake);
480
- } else {
481
- try {
482
- Fake.call();
483
- } catch (x) {
484
- control = x;
485
- }
486
-
487
- fn.call(Fake.prototype);
488
- }
489
- } else {
490
- try {
491
- throw Error();
492
- } catch (x) {
493
- control = x;
494
- }
495
-
496
- fn();
497
- }
498
- } catch (sample) {
499
- // This is inlined manually because closure doesn't do it for us.
500
- if (sample && control && typeof sample.stack === 'string') {
501
- // This extracts the first frame from the sample that isn't also in the control.
502
- // Skipping one frame that we assume is the frame that calls the two.
503
- var sampleLines = sample.stack.split('\n');
504
- var controlLines = control.stack.split('\n');
505
- var s = sampleLines.length - 1;
506
- var c = controlLines.length - 1;
507
-
508
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
509
- // We expect at least one stack frame to be shared.
510
- // Typically this will be the root most one. However, stack frames may be
511
- // cut off due to maximum stack limits. In this case, one maybe cut off
512
- // earlier than the other. We assume that the sample is longer or the same
513
- // and there for cut off earlier. So we should find the root most frame in
514
- // the sample somewhere in the control.
515
- c--;
516
- }
517
-
518
- for (; s >= 1 && c >= 0; s--, c--) {
519
- // Next we find the first one that isn't the same which should be the
520
- // frame that called our sample function and the control.
521
- if (sampleLines[s] !== controlLines[c]) {
522
- // In V8, the first line is describing the message but other VMs don't.
523
- // If we're about to return the first line, and the control is also on the same
524
- // line, that's a pretty good indicator that our sample threw at same line as
525
- // the control. I.e. before we entered the sample frame. So we ignore this result.
526
- // This can happen if you passed a class to function component, or non-function.
527
- if (s !== 1 || c !== 1) {
528
- do {
529
- s--;
530
- c--; // We may still have similar intermediate frames from the construct call.
531
- // The next one that isn't the same should be our match though.
532
-
533
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
534
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
535
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
536
- // but we have a user-provided "displayName"
537
- // splice it in to make the stack more readable.
538
-
539
-
540
- if (fn.displayName && _frame.includes('<anonymous>')) {
541
- _frame = _frame.replace('<anonymous>', fn.displayName);
542
- }
543
-
544
- {
545
- if (typeof fn === 'function') {
546
- componentFrameCache.set(fn, _frame);
547
- }
548
- } // Return the line we found.
549
-
550
-
551
- return _frame;
552
- }
553
- } while (s >= 1 && c >= 0);
554
- }
555
-
556
- break;
557
- }
558
- }
559
- }
560
- } finally {
561
- reentry = false;
562
-
563
- {
564
- ReactCurrentDispatcher.current = previousDispatcher;
565
- reenableLogs();
566
- }
567
-
568
- Error.prepareStackTrace = previousPrepareStackTrace;
569
- } // Fallback to just using the name if we couldn't make it throw.
570
-
571
-
572
- var name = fn ? fn.displayName || fn.name : '';
573
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
574
-
575
- {
576
- if (typeof fn === 'function') {
577
- componentFrameCache.set(fn, syntheticFrame);
578
- }
579
- }
580
-
581
- return syntheticFrame;
582
- }
583
- function describeFunctionComponentFrame(fn, source, ownerFn) {
584
- {
585
- return describeNativeComponentFrame(fn, false);
586
- }
587
- }
588
-
589
- function shouldConstruct(Component) {
590
- var prototype = Component.prototype;
591
- return !!(prototype && prototype.isReactComponent);
592
- }
593
-
594
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
595
-
596
- if (type == null) {
597
- return '';
598
- }
599
-
600
- if (typeof type === 'function') {
601
- {
602
- return describeNativeComponentFrame(type, shouldConstruct(type));
603
- }
604
- }
605
-
606
- if (typeof type === 'string') {
607
- return describeBuiltInComponentFrame(type);
608
- }
609
-
610
- switch (type) {
611
- case REACT_SUSPENSE_TYPE:
612
- return describeBuiltInComponentFrame('Suspense');
613
-
614
- case REACT_SUSPENSE_LIST_TYPE:
615
- return describeBuiltInComponentFrame('SuspenseList');
616
- }
617
-
618
- if (typeof type === 'object') {
619
- switch (type.$$typeof) {
620
- case REACT_FORWARD_REF_TYPE:
621
- return describeFunctionComponentFrame(type.render);
622
-
623
- case REACT_MEMO_TYPE:
624
- // Memo may contain any component type so we recursively resolve it.
625
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
626
-
627
- case REACT_LAZY_TYPE:
628
- {
629
- var lazyComponent = type;
630
- var payload = lazyComponent._payload;
631
- var init = lazyComponent._init;
632
-
633
- try {
634
- // Lazy may contain any component type so we recursively resolve it.
635
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
636
- } catch (x) {}
637
- }
638
- }
639
- }
640
-
641
- return '';
642
- }
643
-
644
- var hasOwnProperty = Object.prototype.hasOwnProperty;
645
-
646
- var loggedTypeFailures = {};
647
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
648
-
649
- function setCurrentlyValidatingElement(element) {
650
- {
651
- if (element) {
652
- var owner = element._owner;
653
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
654
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
655
- } else {
656
- ReactDebugCurrentFrame.setExtraStackFrame(null);
657
- }
658
- }
659
- }
660
-
661
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
662
- {
663
- // $FlowFixMe This is okay but Flow doesn't know it.
664
- var has = Function.call.bind(hasOwnProperty);
665
-
666
- for (var typeSpecName in typeSpecs) {
667
- if (has(typeSpecs, typeSpecName)) {
668
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
669
- // fail the render phase where it didn't fail before. So we log it.
670
- // After these have been cleaned up, we'll let them throw.
671
-
672
- try {
673
- // This is intentionally an invariant that gets caught. It's the same
674
- // behavior as without this statement except with a better message.
675
- if (typeof typeSpecs[typeSpecName] !== 'function') {
676
- // eslint-disable-next-line react-internal/prod-error-codes
677
- 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`.');
678
- err.name = 'Invariant Violation';
679
- throw err;
680
- }
681
-
682
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
683
- } catch (ex) {
684
- error$1 = ex;
685
- }
686
-
687
- if (error$1 && !(error$1 instanceof Error)) {
688
- setCurrentlyValidatingElement(element);
689
-
690
- 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);
691
-
692
- setCurrentlyValidatingElement(null);
693
- }
694
-
695
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
696
- // Only monitor this failure once because there tends to be a lot of the
697
- // same error.
698
- loggedTypeFailures[error$1.message] = true;
699
- setCurrentlyValidatingElement(element);
700
-
701
- error('Failed %s type: %s', location, error$1.message);
702
-
703
- setCurrentlyValidatingElement(null);
704
- }
705
- }
706
- }
707
- }
708
- }
709
-
710
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
711
-
712
- function isArray(a) {
713
- return isArrayImpl(a);
714
- }
715
-
716
- /*
717
- * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
718
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
719
- *
720
- * The functions in this module will throw an easier-to-understand,
721
- * easier-to-debug exception with a clear errors message message explaining the
722
- * problem. (Instead of a confusing exception thrown inside the implementation
723
- * of the `value` object).
724
- */
725
- // $FlowFixMe only called in DEV, so void return is not possible.
726
- function typeName(value) {
727
- {
728
- // toStringTag is needed for namespaced types like Temporal.Instant
729
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
730
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
731
- return type;
732
- }
733
- } // $FlowFixMe only called in DEV, so void return is not possible.
734
-
735
-
736
- function willCoercionThrow(value) {
737
- {
738
- try {
739
- testStringCoercion(value);
740
- return false;
741
- } catch (e) {
742
- return true;
743
- }
744
- }
745
- }
746
-
747
- function testStringCoercion(value) {
748
- // If you ended up here by following an exception call stack, here's what's
749
- // happened: you supplied an object or symbol value to React (as a prop, key,
750
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
751
- // coerce it to a string using `'' + value`, an exception was thrown.
752
- //
753
- // The most common types that will cause this exception are `Symbol` instances
754
- // and Temporal objects like `Temporal.Instant`. But any object that has a
755
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
756
- // exception. (Library authors do this to prevent users from using built-in
757
- // numeric operators like `+` or comparison operators like `>=` because custom
758
- // methods are needed to perform accurate arithmetic or comparison.)
759
- //
760
- // To fix the problem, coerce this object or symbol value to a string before
761
- // passing it to React. The most reliable way is usually `String(value)`.
762
- //
763
- // To find which value is throwing, check the browser or debugger console.
764
- // Before this exception was thrown, there should be `console.error` output
765
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
766
- // problem and how that type was used: key, atrribute, input value prop, etc.
767
- // In most cases, this console output also shows the component and its
768
- // ancestor components where the exception happened.
769
- //
770
- // eslint-disable-next-line react-internal/safe-string-coercion
771
- return '' + value;
772
- }
773
- function checkKeyStringCoercion(value) {
774
- {
775
- if (willCoercionThrow(value)) {
776
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
777
-
778
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
779
- }
780
- }
781
- }
782
-
783
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
784
- var RESERVED_PROPS = {
785
- key: true,
786
- ref: true,
787
- __self: true,
788
- __source: true
789
- };
790
- var specialPropKeyWarningShown;
791
- var specialPropRefWarningShown;
792
-
793
- function hasValidRef(config) {
794
- {
795
- if (hasOwnProperty.call(config, 'ref')) {
796
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
797
-
798
- if (getter && getter.isReactWarning) {
799
- return false;
800
- }
801
- }
802
- }
803
-
804
- return config.ref !== undefined;
805
- }
806
-
807
- function hasValidKey(config) {
808
- {
809
- if (hasOwnProperty.call(config, 'key')) {
810
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
811
-
812
- if (getter && getter.isReactWarning) {
813
- return false;
814
- }
815
- }
816
- }
817
-
818
- return config.key !== undefined;
819
- }
820
-
821
- function warnIfStringRefCannotBeAutoConverted(config, self) {
822
- {
823
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
824
- }
825
- }
826
-
827
- function defineKeyPropWarningGetter(props, displayName) {
828
- {
829
- var warnAboutAccessingKey = function () {
830
- if (!specialPropKeyWarningShown) {
831
- specialPropKeyWarningShown = true;
832
-
833
- 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);
834
- }
835
- };
836
-
837
- warnAboutAccessingKey.isReactWarning = true;
838
- Object.defineProperty(props, 'key', {
839
- get: warnAboutAccessingKey,
840
- configurable: true
841
- });
842
- }
843
- }
844
-
845
- function defineRefPropWarningGetter(props, displayName) {
846
- {
847
- var warnAboutAccessingRef = function () {
848
- if (!specialPropRefWarningShown) {
849
- specialPropRefWarningShown = true;
850
-
851
- 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);
852
- }
853
- };
854
-
855
- warnAboutAccessingRef.isReactWarning = true;
856
- Object.defineProperty(props, 'ref', {
857
- get: warnAboutAccessingRef,
858
- configurable: true
859
- });
860
- }
861
- }
862
- /**
863
- * Factory method to create a new React element. This no longer adheres to
864
- * the class pattern, so do not use new to call it. Also, instanceof check
865
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
866
- * if something is a React Element.
867
- *
868
- * @param {*} type
869
- * @param {*} props
870
- * @param {*} key
871
- * @param {string|object} ref
872
- * @param {*} owner
873
- * @param {*} self A *temporary* helper to detect places where `this` is
874
- * different from the `owner` when React.createElement is called, so that we
875
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
876
- * functions, and as long as `this` and owner are the same, there will be no
877
- * change in behavior.
878
- * @param {*} source An annotation object (added by a transpiler or otherwise)
879
- * indicating filename, line number, and/or other information.
880
- * @internal
881
- */
882
-
883
-
884
- var ReactElement = function (type, key, ref, self, source, owner, props) {
885
- var element = {
886
- // This tag allows us to uniquely identify this as a React Element
887
- $$typeof: REACT_ELEMENT_TYPE,
888
- // Built-in properties that belong on the element
889
- type: type,
890
- key: key,
891
- ref: ref,
892
- props: props,
893
- // Record the component responsible for creating this element.
894
- _owner: owner
895
- };
896
-
897
- {
898
- // The validation flag is currently mutative. We put it on
899
- // an external backing store so that we can freeze the whole object.
900
- // This can be replaced with a WeakMap once they are implemented in
901
- // commonly used development environments.
902
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
903
- // the validation flag non-enumerable (where possible, which should
904
- // include every environment we run tests in), so the test framework
905
- // ignores it.
906
-
907
- Object.defineProperty(element._store, 'validated', {
908
- configurable: false,
909
- enumerable: false,
910
- writable: true,
911
- value: false
912
- }); // self and source are DEV only properties.
913
-
914
- Object.defineProperty(element, '_self', {
915
- configurable: false,
916
- enumerable: false,
917
- writable: false,
918
- value: self
919
- }); // Two elements created in two different places should be considered
920
- // equal for testing purposes and therefore we hide it from enumeration.
921
-
922
- Object.defineProperty(element, '_source', {
923
- configurable: false,
924
- enumerable: false,
925
- writable: false,
926
- value: source
927
- });
928
-
929
- if (Object.freeze) {
930
- Object.freeze(element.props);
931
- Object.freeze(element);
932
- }
933
- }
934
-
935
- return element;
936
- };
937
- /**
938
- * https://github.com/reactjs/rfcs/pull/107
939
- * @param {*} type
940
- * @param {object} props
941
- * @param {string} key
942
- */
943
-
944
- function jsxDEV(type, config, maybeKey, source, self) {
945
- {
946
- var propName; // Reserved names are extracted
947
-
948
- var props = {};
949
- var key = null;
950
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
951
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
952
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
953
- // but as an intermediary step, we will use jsxDEV for everything except
954
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
955
- // key is explicitly declared to be undefined or not.
956
-
957
- if (maybeKey !== undefined) {
958
- {
959
- checkKeyStringCoercion(maybeKey);
960
- }
961
-
962
- key = '' + maybeKey;
963
- }
964
-
965
- if (hasValidKey(config)) {
966
- {
967
- checkKeyStringCoercion(config.key);
968
- }
969
-
970
- key = '' + config.key;
971
- }
972
-
973
- if (hasValidRef(config)) {
974
- ref = config.ref;
975
- warnIfStringRefCannotBeAutoConverted(config, self);
976
- } // Remaining properties are added to a new props object
977
-
978
-
979
- for (propName in config) {
980
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
981
- props[propName] = config[propName];
982
- }
983
- } // Resolve default props
984
-
985
-
986
- if (type && type.defaultProps) {
987
- var defaultProps = type.defaultProps;
988
-
989
- for (propName in defaultProps) {
990
- if (props[propName] === undefined) {
991
- props[propName] = defaultProps[propName];
992
- }
993
- }
994
- }
995
-
996
- if (key || ref) {
997
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
998
-
999
- if (key) {
1000
- defineKeyPropWarningGetter(props, displayName);
1001
- }
1002
-
1003
- if (ref) {
1004
- defineRefPropWarningGetter(props, displayName);
1005
- }
1006
- }
1007
-
1008
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1009
- }
1010
- }
1011
-
1012
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
1013
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1014
-
1015
- function setCurrentlyValidatingElement$1(element) {
1016
- {
1017
- if (element) {
1018
- var owner = element._owner;
1019
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1020
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1021
- } else {
1022
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1023
- }
1024
- }
1025
- }
1026
-
1027
- var propTypesMisspellWarningShown;
1028
-
1029
- {
1030
- propTypesMisspellWarningShown = false;
1031
- }
1032
- /**
1033
- * Verifies the object is a ReactElement.
1034
- * See https://reactjs.org/docs/react-api.html#isvalidelement
1035
- * @param {?object} object
1036
- * @return {boolean} True if `object` is a ReactElement.
1037
- * @final
1038
- */
1039
-
1040
-
1041
- function isValidElement(object) {
1042
- {
1043
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1044
- }
1045
- }
1046
-
1047
- function getDeclarationErrorAddendum() {
1048
- {
1049
- if (ReactCurrentOwner$1.current) {
1050
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1051
-
1052
- if (name) {
1053
- return '\n\nCheck the render method of `' + name + '`.';
1054
- }
1055
- }
1056
-
1057
- return '';
1058
- }
1059
- }
1060
-
1061
- function getSourceInfoErrorAddendum(source) {
1062
- {
1063
-
1064
- return '';
1065
- }
1066
- }
1067
- /**
1068
- * Warn if there's no key explicitly set on dynamic arrays of children or
1069
- * object keys are not valid. This allows us to keep track of children between
1070
- * updates.
1071
- */
1072
-
1073
-
1074
- var ownerHasKeyUseWarning = {};
1075
-
1076
- function getCurrentComponentErrorInfo(parentType) {
1077
- {
1078
- var info = getDeclarationErrorAddendum();
1079
-
1080
- if (!info) {
1081
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1082
-
1083
- if (parentName) {
1084
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1085
- }
1086
- }
1087
-
1088
- return info;
1089
- }
1090
- }
1091
- /**
1092
- * Warn if the element doesn't have an explicit key assigned to it.
1093
- * This element is in an array. The array could grow and shrink or be
1094
- * reordered. All children that haven't already been validated are required to
1095
- * have a "key" property assigned to it. Error statuses are cached so a warning
1096
- * will only be shown once.
1097
- *
1098
- * @internal
1099
- * @param {ReactElement} element Element that requires a key.
1100
- * @param {*} parentType element's parent's type.
1101
- */
1102
-
1103
-
1104
- function validateExplicitKey(element, parentType) {
1105
- {
1106
- if (!element._store || element._store.validated || element.key != null) {
1107
- return;
1108
- }
1109
-
1110
- element._store.validated = true;
1111
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1112
-
1113
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1114
- return;
1115
- }
1116
-
1117
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1118
- // property, it may be the creator of the child that's responsible for
1119
- // assigning it a key.
1120
-
1121
- var childOwner = '';
1122
-
1123
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1124
- // Give the component that originally created this child.
1125
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1126
- }
1127
-
1128
- setCurrentlyValidatingElement$1(element);
1129
-
1130
- 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);
1131
-
1132
- setCurrentlyValidatingElement$1(null);
1133
- }
1134
- }
1135
- /**
1136
- * Ensure that every element either is passed in a static location, in an
1137
- * array with an explicit keys property defined, or in an object literal
1138
- * with valid key property.
1139
- *
1140
- * @internal
1141
- * @param {ReactNode} node Statically passed child of any type.
1142
- * @param {*} parentType node's parent's type.
1143
- */
1144
-
1145
-
1146
- function validateChildKeys(node, parentType) {
1147
- {
1148
- if (typeof node !== 'object') {
1149
- return;
1150
- }
1151
-
1152
- if (isArray(node)) {
1153
- for (var i = 0; i < node.length; i++) {
1154
- var child = node[i];
1155
-
1156
- if (isValidElement(child)) {
1157
- validateExplicitKey(child, parentType);
1158
- }
1159
- }
1160
- } else if (isValidElement(node)) {
1161
- // This element was passed in a valid location.
1162
- if (node._store) {
1163
- node._store.validated = true;
1164
- }
1165
- } else if (node) {
1166
- var iteratorFn = getIteratorFn(node);
1167
-
1168
- if (typeof iteratorFn === 'function') {
1169
- // Entry iterators used to provide implicit keys,
1170
- // but now we print a separate warning for them later.
1171
- if (iteratorFn !== node.entries) {
1172
- var iterator = iteratorFn.call(node);
1173
- var step;
1174
-
1175
- while (!(step = iterator.next()).done) {
1176
- if (isValidElement(step.value)) {
1177
- validateExplicitKey(step.value, parentType);
1178
- }
1179
- }
1180
- }
1181
- }
1182
- }
1183
- }
1184
- }
1185
- /**
1186
- * Given an element, validate that its props follow the propTypes definition,
1187
- * provided by the type.
1188
- *
1189
- * @param {ReactElement} element
1190
- */
1191
-
1192
-
1193
- function validatePropTypes(element) {
1194
- {
1195
- var type = element.type;
1196
-
1197
- if (type === null || type === undefined || typeof type === 'string') {
1198
- return;
1199
- }
1200
-
1201
- var propTypes;
1202
-
1203
- if (typeof type === 'function') {
1204
- propTypes = type.propTypes;
1205
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1206
- // Inner props are checked in the reconciler.
1207
- type.$$typeof === REACT_MEMO_TYPE)) {
1208
- propTypes = type.propTypes;
1209
- } else {
1210
- return;
1211
- }
1212
-
1213
- if (propTypes) {
1214
- // Intentionally inside to avoid triggering lazy initializers:
1215
- var name = getComponentNameFromType(type);
1216
- checkPropTypes(propTypes, element.props, 'prop', name, element);
1217
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1218
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1219
-
1220
- var _name = getComponentNameFromType(type);
1221
-
1222
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1223
- }
1224
-
1225
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1226
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1227
- }
1228
- }
1229
- }
1230
- /**
1231
- * Given a fragment, validate that it can only be provided with fragment props
1232
- * @param {ReactElement} fragment
1233
- */
1234
-
1235
-
1236
- function validateFragmentProps(fragment) {
1237
- {
1238
- var keys = Object.keys(fragment.props);
1239
-
1240
- for (var i = 0; i < keys.length; i++) {
1241
- var key = keys[i];
1242
-
1243
- if (key !== 'children' && key !== 'key') {
1244
- setCurrentlyValidatingElement$1(fragment);
1245
-
1246
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1247
-
1248
- setCurrentlyValidatingElement$1(null);
1249
- break;
1250
- }
1251
- }
1252
-
1253
- if (fragment.ref !== null) {
1254
- setCurrentlyValidatingElement$1(fragment);
1255
-
1256
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
1257
-
1258
- setCurrentlyValidatingElement$1(null);
1259
- }
1260
- }
1261
- }
1262
-
1263
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1264
- {
1265
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1266
- // succeed and there will likely be errors in render.
1267
-
1268
- if (!validType) {
1269
- var info = '';
1270
-
1271
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1272
- 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.";
1273
- }
1274
-
1275
- var sourceInfo = getSourceInfoErrorAddendum();
1276
-
1277
- if (sourceInfo) {
1278
- info += sourceInfo;
1279
- } else {
1280
- info += getDeclarationErrorAddendum();
1281
- }
1282
-
1283
- var typeString;
1284
-
1285
- if (type === null) {
1286
- typeString = 'null';
1287
- } else if (isArray(type)) {
1288
- typeString = 'array';
1289
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1290
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1291
- info = ' Did you accidentally export a JSX literal instead of a component?';
1292
- } else {
1293
- typeString = typeof type;
1294
- }
1295
-
1296
- 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);
1297
- }
1298
-
1299
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1300
- // TODO: Drop this when these are no longer allowed as the type argument.
1301
-
1302
- if (element == null) {
1303
- return element;
1304
- } // Skip key warning if the type isn't valid since our key validation logic
1305
- // doesn't expect a non-string/function type and can throw confusing errors.
1306
- // We don't want exception behavior to differ between dev and prod.
1307
- // (Rendering will throw with a helpful message and as soon as the type is
1308
- // fixed, the key warnings will appear.)
1309
-
1310
-
1311
- if (validType) {
1312
- var children = props.children;
1313
-
1314
- if (children !== undefined) {
1315
- if (isStaticChildren) {
1316
- if (isArray(children)) {
1317
- for (var i = 0; i < children.length; i++) {
1318
- validateChildKeys(children[i], type);
1319
- }
1320
-
1321
- if (Object.freeze) {
1322
- Object.freeze(children);
1323
- }
1324
- } else {
1325
- 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.');
1326
- }
1327
- } else {
1328
- validateChildKeys(children, type);
1329
- }
1330
- }
1331
- }
1332
-
1333
- if (type === REACT_FRAGMENT_TYPE) {
1334
- validateFragmentProps(element);
1335
- } else {
1336
- validatePropTypes(element);
1337
- }
1338
-
1339
- return element;
1340
- }
1341
- } // These two functions exist to still get child warnings in dev
1342
- // even with the prod transform. This means that jsxDEV is purely
1343
- // opt-in behavior for better messages but that we won't stop
1344
- // giving you warnings if you use production apis.
1345
-
1346
- function jsxWithValidationStatic(type, props, key) {
1347
- {
1348
- return jsxWithValidation(type, props, key, true);
1349
- }
1350
- }
1351
- function jsxWithValidationDynamic(type, props, key) {
1352
- {
1353
- return jsxWithValidation(type, props, key, false);
1354
- }
1355
- }
1356
-
1357
- var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
1358
- // for now we can ship identical prod functions
1359
-
1360
- var jsxs = jsxWithValidationStatic ;
1361
-
1362
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1363
- reactJsxRuntime_development.jsx = jsx;
1364
- reactJsxRuntime_development.jsxs = jsxs;
1365
- })();
1366
- }
1367
- return reactJsxRuntime_development;
1368
- }
1369
-
1370
- if (browser$1.env.NODE_ENV === 'production') {
1371
- jsxRuntime.exports = requireReactJsxRuntime_production_min();
1372
- } else {
1373
- jsxRuntime.exports = requireReactJsxRuntime_development();
1374
- }
1375
-
1376
- var jsxRuntimeExports = jsxRuntime.exports;
1377
-
1378
4
  function _typeof$9(o) {
1379
5
  "@babel/helpers - typeof";
1380
6
 
@@ -4023,6 +2649,37 @@ instance.hasLoadedNamespace;
4023
2649
  instance.loadNamespaces;
4024
2650
  instance.loadLanguages;
4025
2651
 
2652
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2653
+
2654
+ function getDefaultExportFromCjs (x) {
2655
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2656
+ }
2657
+
2658
+ function getAugmentedNamespace(n) {
2659
+ if (n.__esModule) return n;
2660
+ var f = n.default;
2661
+ if (typeof f == "function") {
2662
+ var a = function a () {
2663
+ if (this instanceof a) {
2664
+ return Reflect.construct(f, arguments, this.constructor);
2665
+ }
2666
+ return f.apply(this, arguments);
2667
+ };
2668
+ a.prototype = f.prototype;
2669
+ } else a = {};
2670
+ Object.defineProperty(a, '__esModule', {value: true});
2671
+ Object.keys(n).forEach(function (k) {
2672
+ var d = Object.getOwnPropertyDescriptor(n, k);
2673
+ Object.defineProperty(a, k, d.get ? d : {
2674
+ enumerable: true,
2675
+ get: function () {
2676
+ return n[k];
2677
+ }
2678
+ });
2679
+ });
2680
+ return a;
2681
+ }
2682
+
4026
2683
  function warn() {
4027
2684
  if (console && console.warn) {
4028
2685
  var _console;
@@ -8324,6 +6981,10 @@ class UIPlugin extends BasePlugin {
8324
6981
  onUnmount() {}
8325
6982
  }
8326
6983
 
6984
+ var global$1 = (typeof global !== "undefined" ? global :
6985
+ typeof self !== "undefined" ? self :
6986
+ typeof window !== "undefined" ? window : {});
6987
+
8327
6988
  var lookup = [];
8328
6989
  var revLookup = [];
8329
6990
  var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
@@ -14113,6 +12774,20 @@ function prettyBytes(number, options) {
14113
12774
  return prefix + numberString + separator + unit;
14114
12775
  }
14115
12776
 
12777
+ var env = {};
12778
+
12779
+ // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
12780
+ var performance = global$1.performance || {};
12781
+ performance.now ||
12782
+ performance.mozNow ||
12783
+ performance.msNow ||
12784
+ performance.oNow ||
12785
+ performance.webkitNow ||
12786
+ function(){ return (new Date()).getTime() };
12787
+
12788
+ var browser$1 = {
12789
+ env: env};
12790
+
14116
12791
  var reactIs$3 = {exports: {}};
14117
12792
 
14118
12793
  var reactIs_production_min$2 = {};
@@ -15740,12 +14415,12 @@ const StyledSelect = He.select `
15740
14415
  const EndpointSelector = ({ connectorUrl, endpoints, infoText, changeEndpoint }) => {
15741
14416
  const noMediaServiceAvailable = !(connectorUrl || endpoints?.length > 0);
15742
14417
  if (noMediaServiceAvailable)
15743
- return jsxRuntimeExports.jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext--no-endpoint', children: [jsxRuntimeExports.jsx(StyledIconWrapper$1, { children: jsxRuntimeExports.jsx(FaExclamationCircle_1, {}) }), infoText] });
14418
+ return jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext--no-endpoint', children: [jsx(StyledIconWrapper$1, { children: jsx(FaExclamationCircle_1, {}) }), infoText] });
15744
14419
  if (!connectorUrl) {
15745
- return (jsxRuntimeExports.jsxs(StyledSelectWrapper, { children: [endpoints?.length > 1
15746
- //@ts-ignore
15747
- ? jsxRuntimeExports.jsx(StyledSelect, { "data-testid": 'fileuploader__selector', role: 'listbox', onChange: event => changeEndpoint(event.target.value), children: endpoints.map((endpoint, i) => jsxRuntimeExports.jsx("option", { "data-testid": `fileuploader__selector--option-${i}`, value: endpoint.url, children: endpoint.name }, i)) })
15748
- : jsxRuntimeExports.jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext', children: [endpoints?.length === 0 && jsxRuntimeExports.jsx(StyledIconWrapper$1, { children: jsxRuntimeExports.jsx(FaExclamationCircle_1, {}) }), infoText] }), endpoints?.length > 1 && (jsxRuntimeExports.jsx("div", { style: { position: 'absolute', top: 9, right: 12, pointerEvents: 'none' }, children: jsxRuntimeExports.jsx(FaChevronDown_1, { color: 'rgb(167, 168, 169)' }) }))] }));
14420
+ return (jsxs(StyledSelectWrapper, { children: [endpoints?.length > 1
14421
+ // @ts-ignore
14422
+ ? jsx(StyledSelect, { "data-testid": 'fileuploader__selector', role: 'listbox', onChange: event => changeEndpoint(event.target.value), children: endpoints.map((endpoint, i) => jsx("option", { "data-testid": `fileuploader__selector--option-${i}`, value: endpoint.url, children: endpoint.name }, i)) })
14423
+ : jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext', children: [endpoints?.length === 0 && jsx(StyledIconWrapper$1, { children: jsx(FaExclamationCircle_1, {}) }), infoText] }), endpoints?.length > 1 && (jsx("div", { style: { position: 'absolute', top: 9, right: 12, pointerEvents: 'none' }, children: jsx(FaChevronDown_1, { color: 'rgb(167, 168, 169)' }) }))] }));
15749
14424
  }
15750
14425
  };
15751
14426
 
@@ -17762,7 +16437,7 @@ const StyledErrorMessage = He.label `
17762
16437
  `;
17763
16438
 
17764
16439
  const Error$1 = ({ mode, errorMessage }) => {
17765
- return (jsxRuntimeExports.jsx(StyledErrorWrapper, { visible: Boolean(errorMessage), children: jsxRuntimeExports.jsxs(StyledErrorContainer, { mode: mode, children: [jsxRuntimeExports.jsx(StyledIconWrapper, { "data-testid": 'fileuploader__error--message-icon', children: jsxRuntimeExports.jsx(FaExclamationCircle_1, {}) }), jsxRuntimeExports.jsx(StyledErrorMessage, { "data-testid": 'fileuploader__error--message', children: errorMessage })] }) }));
16440
+ return (jsx(StyledErrorWrapper, { visible: Boolean(errorMessage), children: jsxs(StyledErrorContainer, { mode: mode, children: [jsx(StyledIconWrapper, { "data-testid": 'fileuploader__error--message-icon', children: jsx(FaExclamationCircle_1, {}) }), jsx(StyledErrorMessage, { "data-testid": 'fileuploader__error--message', children: errorMessage })] }) }));
17766
16441
  };
17767
16442
 
17768
16443
  const StyledFilenametext = He.span `
@@ -17785,11 +16460,11 @@ const StyledLink = He.a `
17785
16460
  const FilenameText = ({ decodedFileName, type, previewUrl }) => {
17786
16461
  if (!decodedFileName)
17787
16462
  return (null);
17788
- const Text = jsxRuntimeExports.jsx(StyledFilenametext, { "data-testid": 'fileuploader__file-name', type: type, children: decodedFileName });
16463
+ const Text = jsx(StyledFilenametext, { "data-testid": 'fileuploader__file-name', type: type, children: decodedFileName });
17789
16464
  if (type === 'pdf' && previewUrl) {
17790
- return jsxRuntimeExports.jsx(StyledLink, { href: previewUrl, target: "_blank", rel: "noreferrer", "data-testid": "fileuploader__pdf-preview-link", children: Text });
16465
+ return jsx(StyledLink, { href: previewUrl, target: "_blank", rel: "noreferrer", "data-testid": "fileuploader__pdf-preview-link", children: Text });
17791
16466
  }
17792
- return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Text });
16467
+ return jsx(Fragment, { children: Text });
17793
16468
  };
17794
16469
 
17795
16470
  const StyledHover = He.img `
@@ -17838,7 +16513,7 @@ const ImagePreview = ({ previewUrl, type, decodedFileName }) => {
17838
16513
  const isSvg = decodedFileName.toLowerCase().endsWith('.svg');
17839
16514
  const iconSrc = isSvg ? previewUrl : withWidth(previewUrl, 150);
17840
16515
  const hoverSrc = isSvg ? previewUrl : withWidth(previewUrl, 450);
17841
- return (jsxRuntimeExports.jsxs(StyledImagePreviewWrapper, { "data-testid": 'fileuploader__preview-image', children: [jsxRuntimeExports.jsx(StyledIcon, { "data-testid": 'fileuploader__preview-image__icon', className: 'lazyload', src: iconSrc, "data-sizes": 'auto' }), jsxRuntimeExports.jsx(StyledHover, { className: 'lazyload', src: hoverSrc, "data-sizes": 'auto' })] }));
16516
+ return (jsxs(StyledImagePreviewWrapper, { "data-testid": 'fileuploader__preview-image', children: [jsx(StyledIcon, { "data-testid": 'fileuploader__preview-image__icon', className: 'lazyload', src: iconSrc, "data-sizes": 'auto' }), jsx(StyledHover, { className: 'lazyload', src: hoverSrc, "data-sizes": 'auto' })] }));
17842
16517
  };
17843
16518
 
17844
16519
  const StyledProgressbar = He(StyledVisibilityContainerProgress) `
@@ -17914,17 +16589,17 @@ const StyledProgressSubline = He.div `
17914
16589
  `;
17915
16590
 
17916
16591
  const CustomProgressbar = () => {
17917
- return (jsxRuntimeExports.jsx(StyledProgressContainer, { children: jsxRuntimeExports.jsxs(StyledProgressSlider, { children: [jsxRuntimeExports.jsx(StyledProgressLine, {}), jsxRuntimeExports.jsx(StyledProgressSubline, { state: 1 }), jsxRuntimeExports.jsx(StyledProgressSubline, { state: -1 })] }) }));
16592
+ return (jsx(StyledProgressContainer, { children: jsxs(StyledProgressSlider, { children: [jsx(StyledProgressLine, {}), jsx(StyledProgressSubline, { state: 1 }), jsx(StyledProgressSubline, { state: -1 })] }) }));
17918
16593
  };
17919
16594
 
17920
16595
  const Progressbar = ({ loaded }) => {
17921
- return loaded === 100 ? jsxRuntimeExports.jsx(CustomProgressbar, {}) : jsxRuntimeExports.jsx(StyledProgressbar, { role: 'progressbar', value: loaded, max: '100', visible: loaded > 0 });
16596
+ return loaded === 100 ? jsx(CustomProgressbar, {}) : jsx(StyledProgressbar, { role: 'progressbar', value: loaded, max: '100', visible: loaded > 0 });
17922
16597
  };
17923
16598
 
17924
16599
  const UploadIcon$1 = () => {
17925
16600
  return (
17926
- //@ts-ignore
17927
- jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "15", viewBox: "0 0 14 15", style: { marginRight: 7 }, dangerouslySetInnerHTML: {
16601
+ // @ts-ignore
16602
+ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "15", viewBox: "0 0 14 15", style: { marginRight: 7 }, dangerouslySetInnerHTML: {
17928
16603
  __html: '<path id="Pfad_590" data-name="Pfad 590" d="M19,8.294H15V3H9V8.294H5l7,6.176ZM5,16.235V18H19V16.235Z" transform="translate(-5 -3)" fill="rgb(51,51,51)"/>'
17929
16604
  } }));
17930
16605
  };
@@ -18098,9 +16773,9 @@ const Uploader = ({ type, errorMessage, inputType, loaded, previewUrl, uploaderM
18098
16773
  const defaultUploaderLabel = MEDIA_TYPE[type] ? t('uploaderLabel', { type }) : t('defaultUploaderLabel');
18099
16774
  const defaultLabel = mode !== MODE.STATEFUL && defaultUploaderLabel;
18100
16775
  const uploadLabelText = defaultLabel || uploaderMessage || defaultUploaderLabel;
18101
- return (jsxRuntimeExports.jsxs(StyledUploaderWrapper, { visible: inputType === 'file', error: errorMessage, mode: mode, height: height, children: [mode === MODE.STATELESS &&
18102
- jsxRuntimeExports.jsxs(StyledLabelWrapper, { mode: mode, visible: true, children: [jsxRuntimeExports.jsx(UploadIcon, {}), jsxRuntimeExports.jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText })] }), mode === MODE.STATEFUL &&
18103
- jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(StyledMediaIconWrapper, { children: jsxRuntimeExports.jsx(UploaderIcon, { color: '#4a96d0' }) }), jsxRuntimeExports.jsx(StyledLabelWrapper, { mode: mode, visible: Boolean(!file.url), children: jsxRuntimeExports.jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText }) }), jsxRuntimeExports.jsxs(StyledExistingFile, { visible: Boolean(file.url), "data-testid": 'existing-file', children: [jsxRuntimeExports.jsx(ImagePreview, { type: type, previewUrl: previewUrl, decodedFileName: decodedFileName }), jsxRuntimeExports.jsx(FilenameText, { decodedFileName: decodedFileName, type: type, previewUrl: previewUrl }), jsxRuntimeExports.jsx(StyledDeleteIconWrapper, { role: 'button', "data-testid": 'fileuploader__delete-icon', onClick: () => onDeleteFile(), children: jsxRuntimeExports.jsx(FaRegTrashAlt_1, {}) })] })] }), jsxRuntimeExports.jsx(DragDrop, { uppy: uppy,
16776
+ return (jsxs(StyledUploaderWrapper, { "data-testid": 'fileuploader__uploader', visible: inputType === 'file', error: errorMessage, mode: mode, height: height, children: [mode === MODE.STATELESS &&
16777
+ jsxs(StyledLabelWrapper, { mode: mode, visible: true, children: [jsx(UploadIcon, {}), jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText })] }), mode === MODE.STATEFUL &&
16778
+ jsxs(Fragment, { children: [jsx(StyledMediaIconWrapper, { children: jsx(UploaderIcon, { color: '#4a96d0' }) }), jsx(StyledLabelWrapper, { mode: mode, visible: Boolean(!file.url), children: jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText }) }), jsxs(StyledExistingFile, { visible: Boolean(file.url), "data-testid": 'existing-file', children: [jsx(ImagePreview, { type: type, previewUrl: previewUrl, decodedFileName: decodedFileName }), jsx(FilenameText, { decodedFileName: decodedFileName, type: type, previewUrl: previewUrl }), jsx(StyledDeleteIconWrapper, { role: 'button', "data-testid": 'fileuploader__delete-icon', onClick: () => onDeleteFile(), children: jsx(FaRegTrashAlt_1, {}) })] })] }), jsx(DragDrop, { uppy: uppy,
18104
16779
  // @ts-ignore
18105
16780
  className: selectFileClass, inputName: '', style: {
18106
16781
  display: dragDropIsHidden ? 'none' : 'block',
@@ -18109,7 +16784,7 @@ const Uploader = ({ type, errorMessage, inputType, loaded, previewUrl, uploaderM
18109
16784
  strings: {
18110
16785
  dropHereOr: ''
18111
16786
  }
18112
- } }), jsxRuntimeExports.jsx(Progressbar, { loaded: loaded }), jsxRuntimeExports.jsx(Error$1, { mode: mode, errorMessage: errorMessage })] }));
16787
+ } }), jsx(Progressbar, { loaded: loaded }), jsx(Error$1, { mode: mode, errorMessage: errorMessage })] }));
18113
16788
  };
18114
16789
 
18115
16790
  var uniqueId = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@@ -18302,11 +16977,15 @@ const FileUploader = ({ ...props }) => {
18302
16977
  uppy?.removePlugin(instance);
18303
16978
  setEndpointUrl(url);
18304
16979
  };
18305
- return (jsxRuntimeExports.jsx(StyledFileUploader, { readOnly: readOnly, children: jsxRuntimeExports.jsxs(StyledFileUploaderContainer, { "data-testid": 'fileuploader__container', "data-id": id, children: [jsxRuntimeExports.jsx(StyledInput, { id: id, className: className, name: id, "data-testid": 'fileuploader__input-control', type: 'url', "data-type": 'url', value: value || '', placeholder: !connectorUrl ? 'Url...' : '', readOnly: true, required: required, inputType: inputType, "data-disabled": !mediaServiceAvailable }), uppy &&
18306
- jsxRuntimeExports.jsx(Uploader, { errorMessage: errorMessage, file: file, height: height, inputType: inputType, loaded: loaded, mode: mode, previewUrl: preview, type: type, uploaderMessage: uploaderMessage, uppy: uppy, onDeleteFile: onDeleteFile }), !connectorUrl &&
18307
- jsxRuntimeExports.jsx(EndpointSelector, { connectorUrl: connectorUrl, endpoints: endpoints, infoText: infoText, changeEndpoint: changeEndpoint })] }) }));
16980
+ return (jsx(StyledFileUploader, { readOnly: readOnly, children: jsxs(StyledFileUploaderContainer, { "data-testid": 'fileuploader__container', "data-id": id, children: [jsx(StyledInput, { id: id, className: className, name: id, "data-testid": 'fileuploader__input-control', type: 'url', "data-type": 'url', value: value || '', placeholder: !connectorUrl ? 'Url...' : '', readOnly: true, required: required, inputType: inputType, "data-disabled": !mediaServiceAvailable }), uppy &&
16981
+ jsx(Uploader, { errorMessage: errorMessage, file: file, height: height, inputType: inputType, loaded: loaded, mode: mode, previewUrl: preview, type: type, uploaderMessage: uploaderMessage, uppy: uppy, onDeleteFile: onDeleteFile }), !connectorUrl &&
16982
+ jsx(EndpointSelector, { connectorUrl: connectorUrl, endpoints: endpoints, infoText: infoText, changeEndpoint: changeEndpoint })] }) }));
18308
16983
  };
18309
16984
 
16985
+ // The return type is annotated on purpose: inferred, it emits `JSX.Element` into
16986
+ // dist/index.d.ts, and React 19 scoped the JSX namespace to React.JSX and dropped
16987
+ // the global one — so consumers on @types/react 19 fail with
16988
+ // "TS2503: Cannot find namespace 'JSX'". ReactElement is stable across 18 and 19.
18310
16989
  const FileUploaderComponent = (props) => {
18311
16990
  const { language } = props;
18312
16991
  // i18n
@@ -18315,7 +16994,7 @@ const FileUploaderComponent = (props) => {
18315
16994
  instance.changeLanguage(language.toLowerCase());
18316
16995
  }, [language]);
18317
16996
  //
18318
- return jsxRuntimeExports.jsx(FileUploader, { ...props, language: instance.language });
16997
+ return jsx(FileUploader, { ...props, language: instance.language });
18319
16998
  };
18320
16999
 
18321
17000
  export { FileUploaderComponent as FileUploader };