@tonconnect/ui-react 2.0.12 → 2.0.13-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -28,935 +28,16 @@ var __objRest = (source, exclude) => {
28
28
  return target;
29
29
  };
30
30
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
31
- const require$$0 = require("react");
31
+ const jsxRuntime = require("react/jsx-runtime");
32
+ const react = require("react");
32
33
  const ui = require("@tonconnect/ui");
33
- var jsxRuntime = { exports: {} };
34
- var reactJsxRuntime_production_min = {};
35
- /**
36
- * @license React
37
- * react-jsx-runtime.production.min.js
38
- *
39
- * Copyright (c) Facebook, Inc. and its affiliates.
40
- *
41
- * This source code is licensed under the MIT license found in the
42
- * LICENSE file in the root directory of this source tree.
43
- */
44
- var hasRequiredReactJsxRuntime_production_min;
45
- function requireReactJsxRuntime_production_min() {
46
- if (hasRequiredReactJsxRuntime_production_min)
47
- return reactJsxRuntime_production_min;
48
- hasRequiredReactJsxRuntime_production_min = 1;
49
- var f = require$$0, 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 };
50
- function q(c, a, g) {
51
- var b, d = {}, e = null, h = null;
52
- void 0 !== g && (e = "" + g);
53
- void 0 !== a.key && (e = "" + a.key);
54
- void 0 !== a.ref && (h = a.ref);
55
- for (b in a)
56
- m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
57
- if (c && c.defaultProps)
58
- for (b in a = c.defaultProps, a)
59
- void 0 === d[b] && (d[b] = a[b]);
60
- return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
61
- }
62
- reactJsxRuntime_production_min.Fragment = l;
63
- reactJsxRuntime_production_min.jsx = q;
64
- reactJsxRuntime_production_min.jsxs = q;
65
- return reactJsxRuntime_production_min;
66
- }
67
- var reactJsxRuntime_development = {};
68
- /**
69
- * @license React
70
- * react-jsx-runtime.development.js
71
- *
72
- * Copyright (c) Facebook, Inc. and its affiliates.
73
- *
74
- * This source code is licensed under the MIT license found in the
75
- * LICENSE file in the root directory of this source tree.
76
- */
77
- var hasRequiredReactJsxRuntime_development;
78
- function requireReactJsxRuntime_development() {
79
- if (hasRequiredReactJsxRuntime_development)
80
- return reactJsxRuntime_development;
81
- hasRequiredReactJsxRuntime_development = 1;
82
- if (process.env.NODE_ENV !== "production") {
83
- (function() {
84
- var React = require$$0;
85
- var REACT_ELEMENT_TYPE = Symbol.for("react.element");
86
- var REACT_PORTAL_TYPE = Symbol.for("react.portal");
87
- var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
88
- var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
89
- var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
90
- var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
91
- var REACT_CONTEXT_TYPE = Symbol.for("react.context");
92
- var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
93
- var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
94
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
95
- var REACT_MEMO_TYPE = Symbol.for("react.memo");
96
- var REACT_LAZY_TYPE = Symbol.for("react.lazy");
97
- var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
98
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
99
- var FAUX_ITERATOR_SYMBOL = "@@iterator";
100
- function getIteratorFn(maybeIterable) {
101
- if (maybeIterable === null || typeof maybeIterable !== "object") {
102
- return null;
103
- }
104
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
105
- if (typeof maybeIterator === "function") {
106
- return maybeIterator;
107
- }
108
- return null;
109
- }
110
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
111
- function error(format) {
112
- {
113
- {
114
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
115
- args[_key2 - 1] = arguments[_key2];
116
- }
117
- printWarning("error", format, args);
118
- }
119
- }
120
- }
121
- function printWarning(level, format, args) {
122
- {
123
- var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
124
- var stack = ReactDebugCurrentFrame2.getStackAddendum();
125
- if (stack !== "") {
126
- format += "%s";
127
- args = args.concat([stack]);
128
- }
129
- var argsWithFormat = args.map(function(item) {
130
- return String(item);
131
- });
132
- argsWithFormat.unshift("Warning: " + format);
133
- Function.prototype.apply.call(console[level], console, argsWithFormat);
134
- }
135
- }
136
- var enableScopeAPI = false;
137
- var enableCacheElement = false;
138
- var enableTransitionTracing = false;
139
- var enableLegacyHidden = false;
140
- var enableDebugTracing = false;
141
- var REACT_MODULE_REFERENCE;
142
- {
143
- REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
144
- }
145
- function isValidElementType(type) {
146
- if (typeof type === "string" || typeof type === "function") {
147
- return true;
148
- }
149
- 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) {
150
- return true;
151
- }
152
- if (typeof type === "object" && type !== null) {
153
- 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 || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
154
- return true;
155
- }
156
- }
157
- return false;
158
- }
159
- function getWrappedName(outerType, innerType, wrapperName) {
160
- var displayName = outerType.displayName;
161
- if (displayName) {
162
- return displayName;
163
- }
164
- var functionName = innerType.displayName || innerType.name || "";
165
- return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
166
- }
167
- function getContextName(type) {
168
- return type.displayName || "Context";
169
- }
170
- function getComponentNameFromType(type) {
171
- if (type == null) {
172
- return null;
173
- }
174
- {
175
- if (typeof type.tag === "number") {
176
- error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
177
- }
178
- }
179
- if (typeof type === "function") {
180
- return type.displayName || type.name || null;
181
- }
182
- if (typeof type === "string") {
183
- return type;
184
- }
185
- switch (type) {
186
- case REACT_FRAGMENT_TYPE:
187
- return "Fragment";
188
- case REACT_PORTAL_TYPE:
189
- return "Portal";
190
- case REACT_PROFILER_TYPE:
191
- return "Profiler";
192
- case REACT_STRICT_MODE_TYPE:
193
- return "StrictMode";
194
- case REACT_SUSPENSE_TYPE:
195
- return "Suspense";
196
- case REACT_SUSPENSE_LIST_TYPE:
197
- return "SuspenseList";
198
- }
199
- if (typeof type === "object") {
200
- switch (type.$$typeof) {
201
- case REACT_CONTEXT_TYPE:
202
- var context = type;
203
- return getContextName(context) + ".Consumer";
204
- case REACT_PROVIDER_TYPE:
205
- var provider = type;
206
- return getContextName(provider._context) + ".Provider";
207
- case REACT_FORWARD_REF_TYPE:
208
- return getWrappedName(type, type.render, "ForwardRef");
209
- case REACT_MEMO_TYPE:
210
- var outerName = type.displayName || null;
211
- if (outerName !== null) {
212
- return outerName;
213
- }
214
- return getComponentNameFromType(type.type) || "Memo";
215
- case REACT_LAZY_TYPE: {
216
- var lazyComponent = type;
217
- var payload = lazyComponent._payload;
218
- var init = lazyComponent._init;
219
- try {
220
- return getComponentNameFromType(init(payload));
221
- } catch (x) {
222
- return null;
223
- }
224
- }
225
- }
226
- }
227
- return null;
228
- }
229
- var assign = Object.assign;
230
- var disabledDepth = 0;
231
- var prevLog;
232
- var prevInfo;
233
- var prevWarn;
234
- var prevError;
235
- var prevGroup;
236
- var prevGroupCollapsed;
237
- var prevGroupEnd;
238
- function disabledLog() {
239
- }
240
- disabledLog.__reactDisabledLog = true;
241
- function disableLogs() {
242
- {
243
- if (disabledDepth === 0) {
244
- prevLog = console.log;
245
- prevInfo = console.info;
246
- prevWarn = console.warn;
247
- prevError = console.error;
248
- prevGroup = console.group;
249
- prevGroupCollapsed = console.groupCollapsed;
250
- prevGroupEnd = console.groupEnd;
251
- var props = {
252
- configurable: true,
253
- enumerable: true,
254
- value: disabledLog,
255
- writable: true
256
- };
257
- Object.defineProperties(console, {
258
- info: props,
259
- log: props,
260
- warn: props,
261
- error: props,
262
- group: props,
263
- groupCollapsed: props,
264
- groupEnd: props
265
- });
266
- }
267
- disabledDepth++;
268
- }
269
- }
270
- function reenableLogs() {
271
- {
272
- disabledDepth--;
273
- if (disabledDepth === 0) {
274
- var props = {
275
- configurable: true,
276
- enumerable: true,
277
- writable: true
278
- };
279
- Object.defineProperties(console, {
280
- log: assign({}, props, {
281
- value: prevLog
282
- }),
283
- info: assign({}, props, {
284
- value: prevInfo
285
- }),
286
- warn: assign({}, props, {
287
- value: prevWarn
288
- }),
289
- error: assign({}, props, {
290
- value: prevError
291
- }),
292
- group: assign({}, props, {
293
- value: prevGroup
294
- }),
295
- groupCollapsed: assign({}, props, {
296
- value: prevGroupCollapsed
297
- }),
298
- groupEnd: assign({}, props, {
299
- value: prevGroupEnd
300
- })
301
- });
302
- }
303
- if (disabledDepth < 0) {
304
- error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
305
- }
306
- }
307
- }
308
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
309
- var prefix;
310
- function describeBuiltInComponentFrame(name, source, ownerFn) {
311
- {
312
- if (prefix === void 0) {
313
- try {
314
- throw Error();
315
- } catch (x) {
316
- var match = x.stack.trim().match(/\n( *(at )?)/);
317
- prefix = match && match[1] || "";
318
- }
319
- }
320
- return "\n" + prefix + name;
321
- }
322
- }
323
- var reentry = false;
324
- var componentFrameCache;
325
- {
326
- var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
327
- componentFrameCache = new PossiblyWeakMap();
328
- }
329
- function describeNativeComponentFrame(fn, construct) {
330
- if (!fn || reentry) {
331
- return "";
332
- }
333
- {
334
- var frame = componentFrameCache.get(fn);
335
- if (frame !== void 0) {
336
- return frame;
337
- }
338
- }
339
- var control;
340
- reentry = true;
341
- var previousPrepareStackTrace = Error.prepareStackTrace;
342
- Error.prepareStackTrace = void 0;
343
- var previousDispatcher;
344
- {
345
- previousDispatcher = ReactCurrentDispatcher.current;
346
- ReactCurrentDispatcher.current = null;
347
- disableLogs();
348
- }
349
- try {
350
- if (construct) {
351
- var Fake = function() {
352
- throw Error();
353
- };
354
- Object.defineProperty(Fake.prototype, "props", {
355
- set: function() {
356
- throw Error();
357
- }
358
- });
359
- if (typeof Reflect === "object" && Reflect.construct) {
360
- try {
361
- Reflect.construct(Fake, []);
362
- } catch (x) {
363
- control = x;
364
- }
365
- Reflect.construct(fn, [], Fake);
366
- } else {
367
- try {
368
- Fake.call();
369
- } catch (x) {
370
- control = x;
371
- }
372
- fn.call(Fake.prototype);
373
- }
374
- } else {
375
- try {
376
- throw Error();
377
- } catch (x) {
378
- control = x;
379
- }
380
- fn();
381
- }
382
- } catch (sample) {
383
- if (sample && control && typeof sample.stack === "string") {
384
- var sampleLines = sample.stack.split("\n");
385
- var controlLines = control.stack.split("\n");
386
- var s = sampleLines.length - 1;
387
- var c = controlLines.length - 1;
388
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
389
- c--;
390
- }
391
- for (; s >= 1 && c >= 0; s--, c--) {
392
- if (sampleLines[s] !== controlLines[c]) {
393
- if (s !== 1 || c !== 1) {
394
- do {
395
- s--;
396
- c--;
397
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
398
- var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
399
- if (fn.displayName && _frame.includes("<anonymous>")) {
400
- _frame = _frame.replace("<anonymous>", fn.displayName);
401
- }
402
- {
403
- if (typeof fn === "function") {
404
- componentFrameCache.set(fn, _frame);
405
- }
406
- }
407
- return _frame;
408
- }
409
- } while (s >= 1 && c >= 0);
410
- }
411
- break;
412
- }
413
- }
414
- }
415
- } finally {
416
- reentry = false;
417
- {
418
- ReactCurrentDispatcher.current = previousDispatcher;
419
- reenableLogs();
420
- }
421
- Error.prepareStackTrace = previousPrepareStackTrace;
422
- }
423
- var name = fn ? fn.displayName || fn.name : "";
424
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
425
- {
426
- if (typeof fn === "function") {
427
- componentFrameCache.set(fn, syntheticFrame);
428
- }
429
- }
430
- return syntheticFrame;
431
- }
432
- function describeFunctionComponentFrame(fn, source, ownerFn) {
433
- {
434
- return describeNativeComponentFrame(fn, false);
435
- }
436
- }
437
- function shouldConstruct(Component) {
438
- var prototype = Component.prototype;
439
- return !!(prototype && prototype.isReactComponent);
440
- }
441
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
442
- if (type == null) {
443
- return "";
444
- }
445
- if (typeof type === "function") {
446
- {
447
- return describeNativeComponentFrame(type, shouldConstruct(type));
448
- }
449
- }
450
- if (typeof type === "string") {
451
- return describeBuiltInComponentFrame(type);
452
- }
453
- switch (type) {
454
- case REACT_SUSPENSE_TYPE:
455
- return describeBuiltInComponentFrame("Suspense");
456
- case REACT_SUSPENSE_LIST_TYPE:
457
- return describeBuiltInComponentFrame("SuspenseList");
458
- }
459
- if (typeof type === "object") {
460
- switch (type.$$typeof) {
461
- case REACT_FORWARD_REF_TYPE:
462
- return describeFunctionComponentFrame(type.render);
463
- case REACT_MEMO_TYPE:
464
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
465
- case REACT_LAZY_TYPE: {
466
- var lazyComponent = type;
467
- var payload = lazyComponent._payload;
468
- var init = lazyComponent._init;
469
- try {
470
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
471
- } catch (x) {
472
- }
473
- }
474
- }
475
- }
476
- return "";
477
- }
478
- var hasOwnProperty = Object.prototype.hasOwnProperty;
479
- var loggedTypeFailures = {};
480
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
481
- function setCurrentlyValidatingElement(element) {
482
- {
483
- if (element) {
484
- var owner = element._owner;
485
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
486
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
487
- } else {
488
- ReactDebugCurrentFrame.setExtraStackFrame(null);
489
- }
490
- }
491
- }
492
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
493
- {
494
- var has = Function.call.bind(hasOwnProperty);
495
- for (var typeSpecName in typeSpecs) {
496
- if (has(typeSpecs, typeSpecName)) {
497
- var error$1 = void 0;
498
- try {
499
- if (typeof typeSpecs[typeSpecName] !== "function") {
500
- 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`.");
501
- err.name = "Invariant Violation";
502
- throw err;
503
- }
504
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
505
- } catch (ex) {
506
- error$1 = ex;
507
- }
508
- if (error$1 && !(error$1 instanceof Error)) {
509
- setCurrentlyValidatingElement(element);
510
- 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);
511
- setCurrentlyValidatingElement(null);
512
- }
513
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
514
- loggedTypeFailures[error$1.message] = true;
515
- setCurrentlyValidatingElement(element);
516
- error("Failed %s type: %s", location, error$1.message);
517
- setCurrentlyValidatingElement(null);
518
- }
519
- }
520
- }
521
- }
522
- }
523
- var isArrayImpl = Array.isArray;
524
- function isArray(a) {
525
- return isArrayImpl(a);
526
- }
527
- function typeName(value) {
528
- {
529
- var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
530
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
531
- return type;
532
- }
533
- }
534
- function willCoercionThrow(value) {
535
- {
536
- try {
537
- testStringCoercion(value);
538
- return false;
539
- } catch (e) {
540
- return true;
541
- }
542
- }
543
- }
544
- function testStringCoercion(value) {
545
- return "" + value;
546
- }
547
- function checkKeyStringCoercion(value) {
548
- {
549
- if (willCoercionThrow(value)) {
550
- error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
551
- return testStringCoercion(value);
552
- }
553
- }
554
- }
555
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
556
- var RESERVED_PROPS = {
557
- key: true,
558
- ref: true,
559
- __self: true,
560
- __source: true
561
- };
562
- var specialPropKeyWarningShown;
563
- var specialPropRefWarningShown;
564
- var didWarnAboutStringRefs;
565
- {
566
- didWarnAboutStringRefs = {};
567
- }
568
- function hasValidRef(config) {
569
- {
570
- if (hasOwnProperty.call(config, "ref")) {
571
- var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
572
- if (getter && getter.isReactWarning) {
573
- return false;
574
- }
575
- }
576
- }
577
- return config.ref !== void 0;
578
- }
579
- function hasValidKey(config) {
580
- {
581
- if (hasOwnProperty.call(config, "key")) {
582
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
583
- if (getter && getter.isReactWarning) {
584
- return false;
585
- }
586
- }
587
- }
588
- return config.key !== void 0;
589
- }
590
- function warnIfStringRefCannotBeAutoConverted(config, self) {
591
- {
592
- if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
593
- var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
594
- if (!didWarnAboutStringRefs[componentName]) {
595
- 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);
596
- didWarnAboutStringRefs[componentName] = true;
597
- }
598
- }
599
- }
600
- }
601
- function defineKeyPropWarningGetter(props, displayName) {
602
- {
603
- var warnAboutAccessingKey = function() {
604
- if (!specialPropKeyWarningShown) {
605
- specialPropKeyWarningShown = true;
606
- 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);
607
- }
608
- };
609
- warnAboutAccessingKey.isReactWarning = true;
610
- Object.defineProperty(props, "key", {
611
- get: warnAboutAccessingKey,
612
- configurable: true
613
- });
614
- }
615
- }
616
- function defineRefPropWarningGetter(props, displayName) {
617
- {
618
- var warnAboutAccessingRef = function() {
619
- if (!specialPropRefWarningShown) {
620
- specialPropRefWarningShown = true;
621
- 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);
622
- }
623
- };
624
- warnAboutAccessingRef.isReactWarning = true;
625
- Object.defineProperty(props, "ref", {
626
- get: warnAboutAccessingRef,
627
- configurable: true
628
- });
629
- }
630
- }
631
- var ReactElement = function(type, key, ref, self, source, owner, props) {
632
- var element = {
633
- $$typeof: REACT_ELEMENT_TYPE,
634
- type,
635
- key,
636
- ref,
637
- props,
638
- _owner: owner
639
- };
640
- {
641
- element._store = {};
642
- Object.defineProperty(element._store, "validated", {
643
- configurable: false,
644
- enumerable: false,
645
- writable: true,
646
- value: false
647
- });
648
- Object.defineProperty(element, "_self", {
649
- configurable: false,
650
- enumerable: false,
651
- writable: false,
652
- value: self
653
- });
654
- Object.defineProperty(element, "_source", {
655
- configurable: false,
656
- enumerable: false,
657
- writable: false,
658
- value: source
659
- });
660
- if (Object.freeze) {
661
- Object.freeze(element.props);
662
- Object.freeze(element);
663
- }
664
- }
665
- return element;
666
- };
667
- function jsxDEV(type, config, maybeKey, source, self) {
668
- {
669
- var propName;
670
- var props = {};
671
- var key = null;
672
- var ref = null;
673
- if (maybeKey !== void 0) {
674
- {
675
- checkKeyStringCoercion(maybeKey);
676
- }
677
- key = "" + maybeKey;
678
- }
679
- if (hasValidKey(config)) {
680
- {
681
- checkKeyStringCoercion(config.key);
682
- }
683
- key = "" + config.key;
684
- }
685
- if (hasValidRef(config)) {
686
- ref = config.ref;
687
- warnIfStringRefCannotBeAutoConverted(config, self);
688
- }
689
- for (propName in config) {
690
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
691
- props[propName] = config[propName];
692
- }
693
- }
694
- if (type && type.defaultProps) {
695
- var defaultProps = type.defaultProps;
696
- for (propName in defaultProps) {
697
- if (props[propName] === void 0) {
698
- props[propName] = defaultProps[propName];
699
- }
700
- }
701
- }
702
- if (key || ref) {
703
- var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
704
- if (key) {
705
- defineKeyPropWarningGetter(props, displayName);
706
- }
707
- if (ref) {
708
- defineRefPropWarningGetter(props, displayName);
709
- }
710
- }
711
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
712
- }
713
- }
714
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
715
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
716
- function setCurrentlyValidatingElement$1(element) {
717
- {
718
- if (element) {
719
- var owner = element._owner;
720
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
721
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
722
- } else {
723
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
724
- }
725
- }
726
- }
727
- var propTypesMisspellWarningShown;
728
- {
729
- propTypesMisspellWarningShown = false;
730
- }
731
- function isValidElement(object) {
732
- {
733
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
734
- }
735
- }
736
- function getDeclarationErrorAddendum() {
737
- {
738
- if (ReactCurrentOwner$1.current) {
739
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
740
- if (name) {
741
- return "\n\nCheck the render method of `" + name + "`.";
742
- }
743
- }
744
- return "";
745
- }
746
- }
747
- function getSourceInfoErrorAddendum(source) {
748
- {
749
- if (source !== void 0) {
750
- var fileName = source.fileName.replace(/^.*[\\\/]/, "");
751
- var lineNumber = source.lineNumber;
752
- return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
753
- }
754
- return "";
755
- }
756
- }
757
- var ownerHasKeyUseWarning = {};
758
- function getCurrentComponentErrorInfo(parentType) {
759
- {
760
- var info = getDeclarationErrorAddendum();
761
- if (!info) {
762
- var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
763
- if (parentName) {
764
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
765
- }
766
- }
767
- return info;
768
- }
769
- }
770
- function validateExplicitKey(element, parentType) {
771
- {
772
- if (!element._store || element._store.validated || element.key != null) {
773
- return;
774
- }
775
- element._store.validated = true;
776
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
777
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
778
- return;
779
- }
780
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
781
- var childOwner = "";
782
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
783
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
784
- }
785
- setCurrentlyValidatingElement$1(element);
786
- 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);
787
- setCurrentlyValidatingElement$1(null);
788
- }
789
- }
790
- function validateChildKeys(node, parentType) {
791
- {
792
- if (typeof node !== "object") {
793
- return;
794
- }
795
- if (isArray(node)) {
796
- for (var i = 0; i < node.length; i++) {
797
- var child = node[i];
798
- if (isValidElement(child)) {
799
- validateExplicitKey(child, parentType);
800
- }
801
- }
802
- } else if (isValidElement(node)) {
803
- if (node._store) {
804
- node._store.validated = true;
805
- }
806
- } else if (node) {
807
- var iteratorFn = getIteratorFn(node);
808
- if (typeof iteratorFn === "function") {
809
- if (iteratorFn !== node.entries) {
810
- var iterator = iteratorFn.call(node);
811
- var step;
812
- while (!(step = iterator.next()).done) {
813
- if (isValidElement(step.value)) {
814
- validateExplicitKey(step.value, parentType);
815
- }
816
- }
817
- }
818
- }
819
- }
820
- }
821
- }
822
- function validatePropTypes(element) {
823
- {
824
- var type = element.type;
825
- if (type === null || type === void 0 || typeof type === "string") {
826
- return;
827
- }
828
- var propTypes;
829
- if (typeof type === "function") {
830
- propTypes = type.propTypes;
831
- } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
832
- propTypes = type.propTypes;
833
- } else {
834
- return;
835
- }
836
- if (propTypes) {
837
- var name = getComponentNameFromType(type);
838
- checkPropTypes(propTypes, element.props, "prop", name, element);
839
- } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
840
- propTypesMisspellWarningShown = true;
841
- var _name = getComponentNameFromType(type);
842
- error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
843
- }
844
- if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
845
- error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
846
- }
847
- }
848
- }
849
- function validateFragmentProps(fragment) {
850
- {
851
- var keys = Object.keys(fragment.props);
852
- for (var i = 0; i < keys.length; i++) {
853
- var key = keys[i];
854
- if (key !== "children" && key !== "key") {
855
- setCurrentlyValidatingElement$1(fragment);
856
- error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
857
- setCurrentlyValidatingElement$1(null);
858
- break;
859
- }
860
- }
861
- if (fragment.ref !== null) {
862
- setCurrentlyValidatingElement$1(fragment);
863
- error("Invalid attribute `ref` supplied to `React.Fragment`.");
864
- setCurrentlyValidatingElement$1(null);
865
- }
866
- }
867
- }
868
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
869
- {
870
- var validType = isValidElementType(type);
871
- if (!validType) {
872
- var info = "";
873
- if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
874
- 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.";
875
- }
876
- var sourceInfo = getSourceInfoErrorAddendum(source);
877
- if (sourceInfo) {
878
- info += sourceInfo;
879
- } else {
880
- info += getDeclarationErrorAddendum();
881
- }
882
- var typeString;
883
- if (type === null) {
884
- typeString = "null";
885
- } else if (isArray(type)) {
886
- typeString = "array";
887
- } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
888
- typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
889
- info = " Did you accidentally export a JSX literal instead of a component?";
890
- } else {
891
- typeString = typeof type;
892
- }
893
- 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);
894
- }
895
- var element = jsxDEV(type, props, key, source, self);
896
- if (element == null) {
897
- return element;
898
- }
899
- if (validType) {
900
- var children = props.children;
901
- if (children !== void 0) {
902
- if (isStaticChildren) {
903
- if (isArray(children)) {
904
- for (var i = 0; i < children.length; i++) {
905
- validateChildKeys(children[i], type);
906
- }
907
- if (Object.freeze) {
908
- Object.freeze(children);
909
- }
910
- } else {
911
- 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.");
912
- }
913
- } else {
914
- validateChildKeys(children, type);
915
- }
916
- }
917
- }
918
- if (type === REACT_FRAGMENT_TYPE) {
919
- validateFragmentProps(element);
920
- } else {
921
- validatePropTypes(element);
922
- }
923
- return element;
924
- }
925
- }
926
- function jsxWithValidationStatic(type, props, key) {
927
- {
928
- return jsxWithValidation(type, props, key, true);
929
- }
930
- }
931
- function jsxWithValidationDynamic(type, props, key) {
932
- {
933
- return jsxWithValidation(type, props, key, false);
934
- }
935
- }
936
- var jsx2 = jsxWithValidationDynamic;
937
- var jsxs = jsxWithValidationStatic;
938
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
939
- reactJsxRuntime_development.jsx = jsx2;
940
- reactJsxRuntime_development.jsxs = jsxs;
941
- })();
942
- }
943
- return reactJsxRuntime_development;
944
- }
945
- (function(module2) {
946
- if (process.env.NODE_ENV === "production") {
947
- module2.exports = requireReactJsxRuntime_production_min();
948
- } else {
949
- module2.exports = requireReactJsxRuntime_development();
950
- }
951
- })(jsxRuntime);
952
- const jsx = jsxRuntime.exports.jsx;
953
34
  function isClientSide() {
954
35
  return typeof window !== "undefined";
955
36
  }
956
37
  function isServerSide() {
957
38
  return !isClientSide();
958
39
  }
959
- const TonConnectUIContext = require$$0.createContext(null);
40
+ const TonConnectUIContext = react.createContext(null);
960
41
  let tonConnectUI = null;
961
42
  const TonConnectUIProvider = (_a) => {
962
43
  var _b = _a, {
@@ -967,9 +48,9 @@ const TonConnectUIProvider = (_a) => {
967
48
  if (isClientSide() && !tonConnectUI) {
968
49
  tonConnectUI = new ui.TonConnectUI(options);
969
50
  }
970
- return /* @__PURE__ */ jsx(TonConnectUIContext.Provider, { value: tonConnectUI, children });
51
+ return /* @__PURE__ */ jsxRuntime.jsx(TonConnectUIContext.Provider, { value: tonConnectUI, children });
971
52
  };
972
- const TonConnectUIProvider$1 = require$$0.memo(TonConnectUIProvider);
53
+ const TonConnectUIProvider$1 = react.memo(TonConnectUIProvider);
973
54
  class TonConnectUIReactError extends ui.TonConnectUIError {
974
55
  constructor(...args) {
975
56
  super(...args);
@@ -991,8 +72,8 @@ function checkProvider(provider) {
991
72
  return true;
992
73
  }
993
74
  function useTonConnectUI() {
994
- const tonConnectUI2 = require$$0.useContext(TonConnectUIContext);
995
- const setOptions = require$$0.useCallback(
75
+ const tonConnectUI2 = react.useContext(TonConnectUIContext);
76
+ const setOptions = react.useCallback(
996
77
  (options) => {
997
78
  if (tonConnectUI2) {
998
79
  tonConnectUI2.uiOptions = options;
@@ -1010,11 +91,11 @@ function useTonConnectUI() {
1010
91
  const buttonRootId = "ton-connect-button";
1011
92
  const TonConnectButton = ({ className, style }) => {
1012
93
  const [_, setOptions] = useTonConnectUI();
1013
- require$$0.useEffect(() => {
94
+ react.useEffect(() => {
1014
95
  setOptions({ buttonRootId });
1015
96
  return () => setOptions({ buttonRootId: null });
1016
97
  }, [setOptions]);
1017
- return /* @__PURE__ */ jsx(
98
+ return /* @__PURE__ */ jsxRuntime.jsx(
1018
99
  "div",
1019
100
  {
1020
101
  id: buttonRootId,
@@ -1023,13 +104,13 @@ const TonConnectButton = ({ className, style }) => {
1023
104
  }
1024
105
  );
1025
106
  };
1026
- const TonConnectButton$1 = require$$0.memo(TonConnectButton);
107
+ const TonConnectButton$1 = react.memo(TonConnectButton);
1027
108
  function useTonWallet() {
1028
109
  const [tonConnectUI2] = useTonConnectUI();
1029
- const [wallet, setWallet] = require$$0.useState(
110
+ const [wallet, setWallet] = react.useState(
1030
111
  (tonConnectUI2 == null ? void 0 : tonConnectUI2.wallet) || null
1031
112
  );
1032
- require$$0.useEffect(() => {
113
+ react.useEffect(() => {
1033
114
  if (tonConnectUI2) {
1034
115
  setWallet(tonConnectUI2.wallet);
1035
116
  return tonConnectUI2.onStatusChange((value) => {
@@ -1041,7 +122,7 @@ function useTonWallet() {
1041
122
  }
1042
123
  function useTonAddress(userFriendly = true) {
1043
124
  const wallet = useTonWallet();
1044
- return require$$0.useMemo(() => {
125
+ return react.useMemo(() => {
1045
126
  if (wallet) {
1046
127
  return userFriendly ? ui.toUserFriendlyAddress(
1047
128
  wallet.account.address,
@@ -1054,8 +135,8 @@ function useTonAddress(userFriendly = true) {
1054
135
  }
1055
136
  function useTonConnectModal() {
1056
137
  const [tonConnectUI2] = useTonConnectUI();
1057
- const [state, setState] = require$$0.useState((tonConnectUI2 == null ? void 0 : tonConnectUI2.modal.state) || null);
1058
- require$$0.useEffect(() => {
138
+ const [state, setState] = react.useState((tonConnectUI2 == null ? void 0 : tonConnectUI2.modal.state) || null);
139
+ react.useEffect(() => {
1059
140
  if (tonConnectUI2) {
1060
141
  setState(tonConnectUI2.modal.state);
1061
142
  return tonConnectUI2.onModalStateChange((value) => {
@@ -1070,9 +151,9 @@ function useTonConnectModal() {
1070
151
  };
1071
152
  }
1072
153
  function useIsConnectionRestored() {
1073
- const [restored, setRestored] = require$$0.useState(false);
154
+ const [restored, setRestored] = react.useState(false);
1074
155
  const [tonConnectUI2] = useTonConnectUI();
1075
- require$$0.useEffect(() => {
156
+ react.useEffect(() => {
1076
157
  if (tonConnectUI2) {
1077
158
  tonConnectUI2.connectionRestored.then(() => setRestored(true));
1078
159
  }
@@ -1089,11 +170,10 @@ exports.useTonAddress = useTonAddress;
1089
170
  exports.useTonConnectModal = useTonConnectModal;
1090
171
  exports.useTonConnectUI = useTonConnectUI;
1091
172
  exports.useTonWallet = useTonWallet;
1092
- for (const k in ui) {
1093
- if (k !== "default" && !exports.hasOwnProperty(k))
1094
- Object.defineProperty(exports, k, {
1095
- enumerable: true,
1096
- get: () => ui[k]
1097
- });
1098
- }
173
+ Object.keys(ui).forEach((k) => {
174
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
175
+ enumerable: true,
176
+ get: () => ui[k]
177
+ });
178
+ });
1099
179
  //# sourceMappingURL=index.cjs.map