@sudobility/ratelimit-components-rn 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1423 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require$$0 = require("react");
4
+ const reactNative = require("react-native");
5
+ const componentsRn = require("@sudobility/components-rn");
6
+ var jsxRuntime = { exports: {} };
7
+ var reactJsxRuntime_production_min = {};
8
+ /**
9
+ * @license React
10
+ * react-jsx-runtime.production.min.js
11
+ *
12
+ * Copyright (c) Facebook, Inc. and its affiliates.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ var hasRequiredReactJsxRuntime_production_min;
18
+ function requireReactJsxRuntime_production_min() {
19
+ if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
20
+ hasRequiredReactJsxRuntime_production_min = 1;
21
+ 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 };
22
+ function q(c, a, g) {
23
+ var b, d = {}, e = null, h = null;
24
+ void 0 !== g && (e = "" + g);
25
+ void 0 !== a.key && (e = "" + a.key);
26
+ void 0 !== a.ref && (h = a.ref);
27
+ for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
28
+ if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
29
+ return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
30
+ }
31
+ reactJsxRuntime_production_min.Fragment = l;
32
+ reactJsxRuntime_production_min.jsx = q;
33
+ reactJsxRuntime_production_min.jsxs = q;
34
+ return reactJsxRuntime_production_min;
35
+ }
36
+ var reactJsxRuntime_development = {};
37
+ /**
38
+ * @license React
39
+ * react-jsx-runtime.development.js
40
+ *
41
+ * Copyright (c) Facebook, Inc. and its affiliates.
42
+ *
43
+ * This source code is licensed under the MIT license found in the
44
+ * LICENSE file in the root directory of this source tree.
45
+ */
46
+ var hasRequiredReactJsxRuntime_development;
47
+ function requireReactJsxRuntime_development() {
48
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
49
+ hasRequiredReactJsxRuntime_development = 1;
50
+ if (process.env.NODE_ENV !== "production") {
51
+ (function() {
52
+ var React = require$$0;
53
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element");
54
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
55
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
56
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
57
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
58
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
59
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
60
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
61
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
62
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
63
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
64
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
65
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
66
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
67
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
68
+ function getIteratorFn(maybeIterable) {
69
+ if (maybeIterable === null || typeof maybeIterable !== "object") {
70
+ return null;
71
+ }
72
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
73
+ if (typeof maybeIterator === "function") {
74
+ return maybeIterator;
75
+ }
76
+ return null;
77
+ }
78
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
79
+ function error(format) {
80
+ {
81
+ {
82
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
83
+ args[_key2 - 1] = arguments[_key2];
84
+ }
85
+ printWarning("error", format, args);
86
+ }
87
+ }
88
+ }
89
+ function printWarning(level, format, args) {
90
+ {
91
+ var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
92
+ var stack = ReactDebugCurrentFrame2.getStackAddendum();
93
+ if (stack !== "") {
94
+ format += "%s";
95
+ args = args.concat([stack]);
96
+ }
97
+ var argsWithFormat = args.map(function(item) {
98
+ return String(item);
99
+ });
100
+ argsWithFormat.unshift("Warning: " + format);
101
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
102
+ }
103
+ }
104
+ var enableScopeAPI = false;
105
+ var enableCacheElement = false;
106
+ var enableTransitionTracing = false;
107
+ var enableLegacyHidden = false;
108
+ var enableDebugTracing = false;
109
+ var REACT_MODULE_REFERENCE;
110
+ {
111
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
112
+ }
113
+ function isValidElementType(type) {
114
+ if (typeof type === "string" || typeof type === "function") {
115
+ return true;
116
+ }
117
+ 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) {
118
+ return true;
119
+ }
120
+ if (typeof type === "object" && type !== null) {
121
+ 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
122
+ // types supported by any Flight configuration anywhere since
123
+ // we don't know which Flight build this will end up being used
124
+ // with.
125
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
126
+ return true;
127
+ }
128
+ }
129
+ return false;
130
+ }
131
+ function getWrappedName(outerType, innerType, wrapperName) {
132
+ var displayName = outerType.displayName;
133
+ if (displayName) {
134
+ return displayName;
135
+ }
136
+ var functionName = innerType.displayName || innerType.name || "";
137
+ return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
138
+ }
139
+ function getContextName(type) {
140
+ return type.displayName || "Context";
141
+ }
142
+ function getComponentNameFromType(type) {
143
+ if (type == null) {
144
+ return null;
145
+ }
146
+ {
147
+ if (typeof type.tag === "number") {
148
+ error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
149
+ }
150
+ }
151
+ if (typeof type === "function") {
152
+ return type.displayName || type.name || null;
153
+ }
154
+ if (typeof type === "string") {
155
+ return type;
156
+ }
157
+ switch (type) {
158
+ case REACT_FRAGMENT_TYPE:
159
+ return "Fragment";
160
+ case REACT_PORTAL_TYPE:
161
+ return "Portal";
162
+ case REACT_PROFILER_TYPE:
163
+ return "Profiler";
164
+ case REACT_STRICT_MODE_TYPE:
165
+ return "StrictMode";
166
+ case REACT_SUSPENSE_TYPE:
167
+ return "Suspense";
168
+ case REACT_SUSPENSE_LIST_TYPE:
169
+ return "SuspenseList";
170
+ }
171
+ if (typeof type === "object") {
172
+ switch (type.$$typeof) {
173
+ case REACT_CONTEXT_TYPE:
174
+ var context = type;
175
+ return getContextName(context) + ".Consumer";
176
+ case REACT_PROVIDER_TYPE:
177
+ var provider = type;
178
+ return getContextName(provider._context) + ".Provider";
179
+ case REACT_FORWARD_REF_TYPE:
180
+ return getWrappedName(type, type.render, "ForwardRef");
181
+ case REACT_MEMO_TYPE:
182
+ var outerName = type.displayName || null;
183
+ if (outerName !== null) {
184
+ return outerName;
185
+ }
186
+ return getComponentNameFromType(type.type) || "Memo";
187
+ case REACT_LAZY_TYPE: {
188
+ var lazyComponent = type;
189
+ var payload = lazyComponent._payload;
190
+ var init = lazyComponent._init;
191
+ try {
192
+ return getComponentNameFromType(init(payload));
193
+ } catch (x) {
194
+ return null;
195
+ }
196
+ }
197
+ }
198
+ }
199
+ return null;
200
+ }
201
+ var assign = Object.assign;
202
+ var disabledDepth = 0;
203
+ var prevLog;
204
+ var prevInfo;
205
+ var prevWarn;
206
+ var prevError;
207
+ var prevGroup;
208
+ var prevGroupCollapsed;
209
+ var prevGroupEnd;
210
+ function disabledLog() {
211
+ }
212
+ disabledLog.__reactDisabledLog = true;
213
+ function disableLogs() {
214
+ {
215
+ if (disabledDepth === 0) {
216
+ prevLog = console.log;
217
+ prevInfo = console.info;
218
+ prevWarn = console.warn;
219
+ prevError = console.error;
220
+ prevGroup = console.group;
221
+ prevGroupCollapsed = console.groupCollapsed;
222
+ prevGroupEnd = console.groupEnd;
223
+ var props = {
224
+ configurable: true,
225
+ enumerable: true,
226
+ value: disabledLog,
227
+ writable: true
228
+ };
229
+ Object.defineProperties(console, {
230
+ info: props,
231
+ log: props,
232
+ warn: props,
233
+ error: props,
234
+ group: props,
235
+ groupCollapsed: props,
236
+ groupEnd: props
237
+ });
238
+ }
239
+ disabledDepth++;
240
+ }
241
+ }
242
+ function reenableLogs() {
243
+ {
244
+ disabledDepth--;
245
+ if (disabledDepth === 0) {
246
+ var props = {
247
+ configurable: true,
248
+ enumerable: true,
249
+ writable: true
250
+ };
251
+ Object.defineProperties(console, {
252
+ log: assign({}, props, {
253
+ value: prevLog
254
+ }),
255
+ info: assign({}, props, {
256
+ value: prevInfo
257
+ }),
258
+ warn: assign({}, props, {
259
+ value: prevWarn
260
+ }),
261
+ error: assign({}, props, {
262
+ value: prevError
263
+ }),
264
+ group: assign({}, props, {
265
+ value: prevGroup
266
+ }),
267
+ groupCollapsed: assign({}, props, {
268
+ value: prevGroupCollapsed
269
+ }),
270
+ groupEnd: assign({}, props, {
271
+ value: prevGroupEnd
272
+ })
273
+ });
274
+ }
275
+ if (disabledDepth < 0) {
276
+ error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
277
+ }
278
+ }
279
+ }
280
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
281
+ var prefix;
282
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
283
+ {
284
+ if (prefix === void 0) {
285
+ try {
286
+ throw Error();
287
+ } catch (x) {
288
+ var match = x.stack.trim().match(/\n( *(at )?)/);
289
+ prefix = match && match[1] || "";
290
+ }
291
+ }
292
+ return "\n" + prefix + name;
293
+ }
294
+ }
295
+ var reentry = false;
296
+ var componentFrameCache;
297
+ {
298
+ var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
299
+ componentFrameCache = new PossiblyWeakMap();
300
+ }
301
+ function describeNativeComponentFrame(fn, construct) {
302
+ if (!fn || reentry) {
303
+ return "";
304
+ }
305
+ {
306
+ var frame = componentFrameCache.get(fn);
307
+ if (frame !== void 0) {
308
+ return frame;
309
+ }
310
+ }
311
+ var control;
312
+ reentry = true;
313
+ var previousPrepareStackTrace = Error.prepareStackTrace;
314
+ Error.prepareStackTrace = void 0;
315
+ var previousDispatcher;
316
+ {
317
+ previousDispatcher = ReactCurrentDispatcher.current;
318
+ ReactCurrentDispatcher.current = null;
319
+ disableLogs();
320
+ }
321
+ try {
322
+ if (construct) {
323
+ var Fake = function() {
324
+ throw Error();
325
+ };
326
+ Object.defineProperty(Fake.prototype, "props", {
327
+ set: function() {
328
+ throw Error();
329
+ }
330
+ });
331
+ if (typeof Reflect === "object" && Reflect.construct) {
332
+ try {
333
+ Reflect.construct(Fake, []);
334
+ } catch (x) {
335
+ control = x;
336
+ }
337
+ Reflect.construct(fn, [], Fake);
338
+ } else {
339
+ try {
340
+ Fake.call();
341
+ } catch (x) {
342
+ control = x;
343
+ }
344
+ fn.call(Fake.prototype);
345
+ }
346
+ } else {
347
+ try {
348
+ throw Error();
349
+ } catch (x) {
350
+ control = x;
351
+ }
352
+ fn();
353
+ }
354
+ } catch (sample) {
355
+ if (sample && control && typeof sample.stack === "string") {
356
+ var sampleLines = sample.stack.split("\n");
357
+ var controlLines = control.stack.split("\n");
358
+ var s = sampleLines.length - 1;
359
+ var c = controlLines.length - 1;
360
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
361
+ c--;
362
+ }
363
+ for (; s >= 1 && c >= 0; s--, c--) {
364
+ if (sampleLines[s] !== controlLines[c]) {
365
+ if (s !== 1 || c !== 1) {
366
+ do {
367
+ s--;
368
+ c--;
369
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
370
+ var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
371
+ if (fn.displayName && _frame.includes("<anonymous>")) {
372
+ _frame = _frame.replace("<anonymous>", fn.displayName);
373
+ }
374
+ {
375
+ if (typeof fn === "function") {
376
+ componentFrameCache.set(fn, _frame);
377
+ }
378
+ }
379
+ return _frame;
380
+ }
381
+ } while (s >= 1 && c >= 0);
382
+ }
383
+ break;
384
+ }
385
+ }
386
+ }
387
+ } finally {
388
+ reentry = false;
389
+ {
390
+ ReactCurrentDispatcher.current = previousDispatcher;
391
+ reenableLogs();
392
+ }
393
+ Error.prepareStackTrace = previousPrepareStackTrace;
394
+ }
395
+ var name = fn ? fn.displayName || fn.name : "";
396
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
397
+ {
398
+ if (typeof fn === "function") {
399
+ componentFrameCache.set(fn, syntheticFrame);
400
+ }
401
+ }
402
+ return syntheticFrame;
403
+ }
404
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
405
+ {
406
+ return describeNativeComponentFrame(fn, false);
407
+ }
408
+ }
409
+ function shouldConstruct(Component) {
410
+ var prototype = Component.prototype;
411
+ return !!(prototype && prototype.isReactComponent);
412
+ }
413
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
414
+ if (type == null) {
415
+ return "";
416
+ }
417
+ if (typeof type === "function") {
418
+ {
419
+ return describeNativeComponentFrame(type, shouldConstruct(type));
420
+ }
421
+ }
422
+ if (typeof type === "string") {
423
+ return describeBuiltInComponentFrame(type);
424
+ }
425
+ switch (type) {
426
+ case REACT_SUSPENSE_TYPE:
427
+ return describeBuiltInComponentFrame("Suspense");
428
+ case REACT_SUSPENSE_LIST_TYPE:
429
+ return describeBuiltInComponentFrame("SuspenseList");
430
+ }
431
+ if (typeof type === "object") {
432
+ switch (type.$$typeof) {
433
+ case REACT_FORWARD_REF_TYPE:
434
+ return describeFunctionComponentFrame(type.render);
435
+ case REACT_MEMO_TYPE:
436
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
437
+ case REACT_LAZY_TYPE: {
438
+ var lazyComponent = type;
439
+ var payload = lazyComponent._payload;
440
+ var init = lazyComponent._init;
441
+ try {
442
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
443
+ } catch (x) {
444
+ }
445
+ }
446
+ }
447
+ }
448
+ return "";
449
+ }
450
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
451
+ var loggedTypeFailures = {};
452
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
453
+ function setCurrentlyValidatingElement(element) {
454
+ {
455
+ if (element) {
456
+ var owner = element._owner;
457
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
458
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
459
+ } else {
460
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
461
+ }
462
+ }
463
+ }
464
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
465
+ {
466
+ var has = Function.call.bind(hasOwnProperty);
467
+ for (var typeSpecName in typeSpecs) {
468
+ if (has(typeSpecs, typeSpecName)) {
469
+ var error$1 = void 0;
470
+ try {
471
+ if (typeof typeSpecs[typeSpecName] !== "function") {
472
+ 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`.");
473
+ err.name = "Invariant Violation";
474
+ throw err;
475
+ }
476
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
477
+ } catch (ex) {
478
+ error$1 = ex;
479
+ }
480
+ if (error$1 && !(error$1 instanceof Error)) {
481
+ setCurrentlyValidatingElement(element);
482
+ 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);
483
+ setCurrentlyValidatingElement(null);
484
+ }
485
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
486
+ loggedTypeFailures[error$1.message] = true;
487
+ setCurrentlyValidatingElement(element);
488
+ error("Failed %s type: %s", location, error$1.message);
489
+ setCurrentlyValidatingElement(null);
490
+ }
491
+ }
492
+ }
493
+ }
494
+ }
495
+ var isArrayImpl = Array.isArray;
496
+ function isArray(a) {
497
+ return isArrayImpl(a);
498
+ }
499
+ function typeName(value) {
500
+ {
501
+ var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
502
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
503
+ return type;
504
+ }
505
+ }
506
+ function willCoercionThrow(value) {
507
+ {
508
+ try {
509
+ testStringCoercion(value);
510
+ return false;
511
+ } catch (e) {
512
+ return true;
513
+ }
514
+ }
515
+ }
516
+ function testStringCoercion(value) {
517
+ return "" + value;
518
+ }
519
+ function checkKeyStringCoercion(value) {
520
+ {
521
+ if (willCoercionThrow(value)) {
522
+ error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
523
+ return testStringCoercion(value);
524
+ }
525
+ }
526
+ }
527
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
528
+ var RESERVED_PROPS = {
529
+ key: true,
530
+ ref: true,
531
+ __self: true,
532
+ __source: true
533
+ };
534
+ var specialPropKeyWarningShown;
535
+ var specialPropRefWarningShown;
536
+ function hasValidRef(config) {
537
+ {
538
+ if (hasOwnProperty.call(config, "ref")) {
539
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
540
+ if (getter && getter.isReactWarning) {
541
+ return false;
542
+ }
543
+ }
544
+ }
545
+ return config.ref !== void 0;
546
+ }
547
+ function hasValidKey(config) {
548
+ {
549
+ if (hasOwnProperty.call(config, "key")) {
550
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
551
+ if (getter && getter.isReactWarning) {
552
+ return false;
553
+ }
554
+ }
555
+ }
556
+ return config.key !== void 0;
557
+ }
558
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
559
+ {
560
+ if (typeof config.ref === "string" && ReactCurrentOwner.current && self) ;
561
+ }
562
+ }
563
+ function defineKeyPropWarningGetter(props, displayName) {
564
+ {
565
+ var warnAboutAccessingKey = function() {
566
+ if (!specialPropKeyWarningShown) {
567
+ specialPropKeyWarningShown = true;
568
+ 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);
569
+ }
570
+ };
571
+ warnAboutAccessingKey.isReactWarning = true;
572
+ Object.defineProperty(props, "key", {
573
+ get: warnAboutAccessingKey,
574
+ configurable: true
575
+ });
576
+ }
577
+ }
578
+ function defineRefPropWarningGetter(props, displayName) {
579
+ {
580
+ var warnAboutAccessingRef = function() {
581
+ if (!specialPropRefWarningShown) {
582
+ specialPropRefWarningShown = true;
583
+ 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);
584
+ }
585
+ };
586
+ warnAboutAccessingRef.isReactWarning = true;
587
+ Object.defineProperty(props, "ref", {
588
+ get: warnAboutAccessingRef,
589
+ configurable: true
590
+ });
591
+ }
592
+ }
593
+ var ReactElement = function(type, key, ref, self, source, owner, props) {
594
+ var element = {
595
+ // This tag allows us to uniquely identify this as a React Element
596
+ $$typeof: REACT_ELEMENT_TYPE,
597
+ // Built-in properties that belong on the element
598
+ type,
599
+ key,
600
+ ref,
601
+ props,
602
+ // Record the component responsible for creating this element.
603
+ _owner: owner
604
+ };
605
+ {
606
+ element._store = {};
607
+ Object.defineProperty(element._store, "validated", {
608
+ configurable: false,
609
+ enumerable: false,
610
+ writable: true,
611
+ value: false
612
+ });
613
+ Object.defineProperty(element, "_self", {
614
+ configurable: false,
615
+ enumerable: false,
616
+ writable: false,
617
+ value: self
618
+ });
619
+ Object.defineProperty(element, "_source", {
620
+ configurable: false,
621
+ enumerable: false,
622
+ writable: false,
623
+ value: source
624
+ });
625
+ if (Object.freeze) {
626
+ Object.freeze(element.props);
627
+ Object.freeze(element);
628
+ }
629
+ }
630
+ return element;
631
+ };
632
+ function jsxDEV(type, config, maybeKey, source, self) {
633
+ {
634
+ var propName;
635
+ var props = {};
636
+ var key = null;
637
+ var ref = null;
638
+ if (maybeKey !== void 0) {
639
+ {
640
+ checkKeyStringCoercion(maybeKey);
641
+ }
642
+ key = "" + maybeKey;
643
+ }
644
+ if (hasValidKey(config)) {
645
+ {
646
+ checkKeyStringCoercion(config.key);
647
+ }
648
+ key = "" + config.key;
649
+ }
650
+ if (hasValidRef(config)) {
651
+ ref = config.ref;
652
+ warnIfStringRefCannotBeAutoConverted(config, self);
653
+ }
654
+ for (propName in config) {
655
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
656
+ props[propName] = config[propName];
657
+ }
658
+ }
659
+ if (type && type.defaultProps) {
660
+ var defaultProps = type.defaultProps;
661
+ for (propName in defaultProps) {
662
+ if (props[propName] === void 0) {
663
+ props[propName] = defaultProps[propName];
664
+ }
665
+ }
666
+ }
667
+ if (key || ref) {
668
+ var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
669
+ if (key) {
670
+ defineKeyPropWarningGetter(props, displayName);
671
+ }
672
+ if (ref) {
673
+ defineRefPropWarningGetter(props, displayName);
674
+ }
675
+ }
676
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
677
+ }
678
+ }
679
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
680
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
681
+ function setCurrentlyValidatingElement$1(element) {
682
+ {
683
+ if (element) {
684
+ var owner = element._owner;
685
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
686
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
687
+ } else {
688
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
689
+ }
690
+ }
691
+ }
692
+ var propTypesMisspellWarningShown;
693
+ {
694
+ propTypesMisspellWarningShown = false;
695
+ }
696
+ function isValidElement(object) {
697
+ {
698
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
699
+ }
700
+ }
701
+ function getDeclarationErrorAddendum() {
702
+ {
703
+ if (ReactCurrentOwner$1.current) {
704
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
705
+ if (name) {
706
+ return "\n\nCheck the render method of `" + name + "`.";
707
+ }
708
+ }
709
+ return "";
710
+ }
711
+ }
712
+ function getSourceInfoErrorAddendum(source) {
713
+ {
714
+ return "";
715
+ }
716
+ }
717
+ var ownerHasKeyUseWarning = {};
718
+ function getCurrentComponentErrorInfo(parentType) {
719
+ {
720
+ var info = getDeclarationErrorAddendum();
721
+ if (!info) {
722
+ var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
723
+ if (parentName) {
724
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
725
+ }
726
+ }
727
+ return info;
728
+ }
729
+ }
730
+ function validateExplicitKey(element, parentType) {
731
+ {
732
+ if (!element._store || element._store.validated || element.key != null) {
733
+ return;
734
+ }
735
+ element._store.validated = true;
736
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
737
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
738
+ return;
739
+ }
740
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
741
+ var childOwner = "";
742
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
743
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
744
+ }
745
+ setCurrentlyValidatingElement$1(element);
746
+ 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);
747
+ setCurrentlyValidatingElement$1(null);
748
+ }
749
+ }
750
+ function validateChildKeys(node, parentType) {
751
+ {
752
+ if (typeof node !== "object") {
753
+ return;
754
+ }
755
+ if (isArray(node)) {
756
+ for (var i = 0; i < node.length; i++) {
757
+ var child = node[i];
758
+ if (isValidElement(child)) {
759
+ validateExplicitKey(child, parentType);
760
+ }
761
+ }
762
+ } else if (isValidElement(node)) {
763
+ if (node._store) {
764
+ node._store.validated = true;
765
+ }
766
+ } else if (node) {
767
+ var iteratorFn = getIteratorFn(node);
768
+ if (typeof iteratorFn === "function") {
769
+ if (iteratorFn !== node.entries) {
770
+ var iterator = iteratorFn.call(node);
771
+ var step;
772
+ while (!(step = iterator.next()).done) {
773
+ if (isValidElement(step.value)) {
774
+ validateExplicitKey(step.value, parentType);
775
+ }
776
+ }
777
+ }
778
+ }
779
+ }
780
+ }
781
+ }
782
+ function validatePropTypes(element) {
783
+ {
784
+ var type = element.type;
785
+ if (type === null || type === void 0 || typeof type === "string") {
786
+ return;
787
+ }
788
+ var propTypes;
789
+ if (typeof type === "function") {
790
+ propTypes = type.propTypes;
791
+ } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
792
+ // Inner props are checked in the reconciler.
793
+ type.$$typeof === REACT_MEMO_TYPE)) {
794
+ propTypes = type.propTypes;
795
+ } else {
796
+ return;
797
+ }
798
+ if (propTypes) {
799
+ var name = getComponentNameFromType(type);
800
+ checkPropTypes(propTypes, element.props, "prop", name, element);
801
+ } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
802
+ propTypesMisspellWarningShown = true;
803
+ var _name = getComponentNameFromType(type);
804
+ error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
805
+ }
806
+ if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
807
+ error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
808
+ }
809
+ }
810
+ }
811
+ function validateFragmentProps(fragment) {
812
+ {
813
+ var keys = Object.keys(fragment.props);
814
+ for (var i = 0; i < keys.length; i++) {
815
+ var key = keys[i];
816
+ if (key !== "children" && key !== "key") {
817
+ setCurrentlyValidatingElement$1(fragment);
818
+ error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
819
+ setCurrentlyValidatingElement$1(null);
820
+ break;
821
+ }
822
+ }
823
+ if (fragment.ref !== null) {
824
+ setCurrentlyValidatingElement$1(fragment);
825
+ error("Invalid attribute `ref` supplied to `React.Fragment`.");
826
+ setCurrentlyValidatingElement$1(null);
827
+ }
828
+ }
829
+ }
830
+ var didWarnAboutKeySpread = {};
831
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
832
+ {
833
+ var validType = isValidElementType(type);
834
+ if (!validType) {
835
+ var info = "";
836
+ if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
837
+ 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.";
838
+ }
839
+ var sourceInfo = getSourceInfoErrorAddendum();
840
+ if (sourceInfo) {
841
+ info += sourceInfo;
842
+ } else {
843
+ info += getDeclarationErrorAddendum();
844
+ }
845
+ var typeString;
846
+ if (type === null) {
847
+ typeString = "null";
848
+ } else if (isArray(type)) {
849
+ typeString = "array";
850
+ } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
851
+ typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
852
+ info = " Did you accidentally export a JSX literal instead of a component?";
853
+ } else {
854
+ typeString = typeof type;
855
+ }
856
+ 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);
857
+ }
858
+ var element = jsxDEV(type, props, key, source, self);
859
+ if (element == null) {
860
+ return element;
861
+ }
862
+ if (validType) {
863
+ var children = props.children;
864
+ if (children !== void 0) {
865
+ if (isStaticChildren) {
866
+ if (isArray(children)) {
867
+ for (var i = 0; i < children.length; i++) {
868
+ validateChildKeys(children[i], type);
869
+ }
870
+ if (Object.freeze) {
871
+ Object.freeze(children);
872
+ }
873
+ } else {
874
+ 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.");
875
+ }
876
+ } else {
877
+ validateChildKeys(children, type);
878
+ }
879
+ }
880
+ }
881
+ {
882
+ if (hasOwnProperty.call(props, "key")) {
883
+ var componentName = getComponentNameFromType(type);
884
+ var keys = Object.keys(props).filter(function(k) {
885
+ return k !== "key";
886
+ });
887
+ var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
888
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
889
+ var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
890
+ error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
891
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
892
+ }
893
+ }
894
+ }
895
+ if (type === REACT_FRAGMENT_TYPE) {
896
+ validateFragmentProps(element);
897
+ } else {
898
+ validatePropTypes(element);
899
+ }
900
+ return element;
901
+ }
902
+ }
903
+ function jsxWithValidationStatic(type, props, key) {
904
+ {
905
+ return jsxWithValidation(type, props, key, true);
906
+ }
907
+ }
908
+ function jsxWithValidationDynamic(type, props, key) {
909
+ {
910
+ return jsxWithValidation(type, props, key, false);
911
+ }
912
+ }
913
+ var jsx = jsxWithValidationDynamic;
914
+ var jsxs = jsxWithValidationStatic;
915
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
916
+ reactJsxRuntime_development.jsx = jsx;
917
+ reactJsxRuntime_development.jsxs = jsxs;
918
+ })();
919
+ }
920
+ return reactJsxRuntime_development;
921
+ }
922
+ var hasRequiredJsxRuntime;
923
+ function requireJsxRuntime() {
924
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
925
+ hasRequiredJsxRuntime = 1;
926
+ if (process.env.NODE_ENV === "production") {
927
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
928
+ } else {
929
+ jsxRuntime.exports = requireReactJsxRuntime_development();
930
+ }
931
+ return jsxRuntime.exports;
932
+ }
933
+ var jsxRuntimeExports = requireJsxRuntime();
934
+ function getUsageColor(current, limit, colorOverride) {
935
+ if (colorOverride) {
936
+ const colorMap = {
937
+ green: { bg: "bg-green-500", text: "text-green-600 dark:text-green-400" },
938
+ yellow: {
939
+ bg: "bg-yellow-500",
940
+ text: "text-yellow-600 dark:text-yellow-400"
941
+ },
942
+ orange: {
943
+ bg: "bg-orange-500",
944
+ text: "text-orange-600 dark:text-orange-400"
945
+ },
946
+ red: { bg: "bg-red-500", text: "text-red-600 dark:text-red-400" },
947
+ blue: { bg: "bg-blue-500", text: "text-blue-600 dark:text-blue-400" },
948
+ gray: { bg: "bg-gray-500", text: "text-gray-600 dark:text-gray-400" }
949
+ };
950
+ return colorMap[colorOverride];
951
+ }
952
+ const percentage = limit > 0 ? current / limit * 100 : 0;
953
+ if (percentage >= 90) {
954
+ return { bg: "bg-red-500", text: "text-red-600 dark:text-red-400" };
955
+ } else if (percentage >= 75) {
956
+ return {
957
+ bg: "bg-orange-500",
958
+ text: "text-orange-600 dark:text-orange-400"
959
+ };
960
+ } else if (percentage >= 50) {
961
+ return {
962
+ bg: "bg-yellow-500",
963
+ text: "text-yellow-600 dark:text-yellow-400"
964
+ };
965
+ } else {
966
+ return { bg: "bg-green-500", text: "text-green-600 dark:text-green-400" };
967
+ }
968
+ }
969
+ function UsageBar({
970
+ config,
971
+ showPercentage = true,
972
+ showRemaining = true,
973
+ onPress
974
+ }) {
975
+ const { label, current, limit, subtitle, colorOverride } = config;
976
+ const percentage = limit > 0 ? Math.min(current / limit * 100, 100) : 0;
977
+ const remaining = Math.max(limit - current, 0);
978
+ const colors = getUsageColor(current, limit, colorOverride);
979
+ const content = /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "mb-4", children: [
980
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row justify-between items-center mb-2", children: [
981
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-1", children: [
982
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: label }),
983
+ subtitle && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400", children: subtitle })
984
+ ] }),
985
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center gap-2", children: [
986
+ showRemaining && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400", children: [
987
+ remaining.toLocaleString(),
988
+ " remaining"
989
+ ] }),
990
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.Text, { className: componentsRn.cn("text-sm font-semibold", colors.text), children: [
991
+ current.toLocaleString(),
992
+ " / ",
993
+ limit.toLocaleString()
994
+ ] })
995
+ ] })
996
+ ] }),
997
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "h-2.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
998
+ reactNative.View,
999
+ {
1000
+ className: componentsRn.cn("h-full rounded-full", colors.bg),
1001
+ style: { width: `${percentage}%` }
1002
+ }
1003
+ ) }),
1004
+ showPercentage && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-row justify-end mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.Text, { className: componentsRn.cn("text-xs font-medium", colors.text), children: [
1005
+ percentage.toFixed(1),
1006
+ "%"
1007
+ ] }) })
1008
+ ] });
1009
+ if (onPress) {
1010
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1011
+ reactNative.Pressable,
1012
+ {
1013
+ onPress,
1014
+ className: "active:opacity-80",
1015
+ accessibilityRole: "button",
1016
+ accessibilityLabel: `${label}: ${current} of ${limit} used`,
1017
+ children: content
1018
+ }
1019
+ );
1020
+ }
1021
+ return content;
1022
+ }
1023
+ function UsageDashboard({
1024
+ bars,
1025
+ title,
1026
+ subtitle,
1027
+ showPercentage = true,
1028
+ showRemaining = true,
1029
+ onBarPress,
1030
+ className
1031
+ }) {
1032
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1033
+ reactNative.View,
1034
+ {
1035
+ className: componentsRn.cn(
1036
+ "bg-white dark:bg-gray-800 rounded-xl p-4 shadow-sm",
1037
+ className
1038
+ ),
1039
+ accessibilityRole: "none",
1040
+ accessibilityLabel: title || "Usage Dashboard",
1041
+ children: [
1042
+ (title || subtitle) && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "mb-4", children: [
1043
+ title && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-lg font-semibold text-gray-900 dark:text-gray-100", children: title }),
1044
+ subtitle && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-500 dark:text-gray-400 mt-1", children: subtitle })
1045
+ ] }),
1046
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { children: bars.map((bar, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1047
+ UsageBar,
1048
+ {
1049
+ config: bar,
1050
+ showPercentage,
1051
+ showRemaining,
1052
+ onPress: onBarPress ? () => onBarPress(bar, index) : void 0
1053
+ },
1054
+ `${bar.label}-${index}`
1055
+ )) }),
1056
+ bars.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "py-8 items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-gray-500 dark:text-gray-400", children: "No usage data available" }) })
1057
+ ]
1058
+ }
1059
+ );
1060
+ }
1061
+ function formatLimit(value) {
1062
+ if (value >= 1e6) {
1063
+ const formatted = value / 1e6;
1064
+ return value % 1e6 === 0 ? formatted.toFixed(0) + "M" : formatted.toFixed(1) + "M";
1065
+ } else if (value >= 1e3) {
1066
+ const formatted = value / 1e3;
1067
+ return value % 1e3 === 0 ? formatted.toFixed(0) + "K" : formatted.toFixed(1) + "K";
1068
+ }
1069
+ return value.toLocaleString();
1070
+ }
1071
+ function TierCard({
1072
+ tier,
1073
+ onSelect,
1074
+ highlightCurrent = true,
1075
+ showPrice = true
1076
+ }) {
1077
+ const {
1078
+ name,
1079
+ hourlyLimit,
1080
+ dailyLimit,
1081
+ monthlyLimit,
1082
+ price,
1083
+ isCurrent,
1084
+ isRecommended,
1085
+ description,
1086
+ features
1087
+ } = tier;
1088
+ const cardClasses = componentsRn.cn(
1089
+ "rounded-xl p-4 border-2",
1090
+ isCurrent && highlightCurrent ? "border-blue-500 bg-blue-50 dark:bg-blue-900/20" : isRecommended ? "border-green-500 bg-green-50 dark:bg-green-900/20" : "border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"
1091
+ );
1092
+ const content = /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: cardClasses, children: [
1093
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row justify-between items-start mb-3", children: [
1094
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { children: [
1095
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-lg font-bold text-gray-900 dark:text-gray-100", children: name }),
1096
+ (isCurrent || isRecommended) && /* @__PURE__ */ jsxRuntimeExports.jsx(
1097
+ reactNative.View,
1098
+ {
1099
+ className: componentsRn.cn(
1100
+ "mt-1 px-2 py-0.5 rounded-full self-start",
1101
+ isCurrent ? "bg-blue-500" : "bg-green-500"
1102
+ ),
1103
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs font-medium text-white", children: isCurrent ? "Current" : "Recommended" })
1104
+ }
1105
+ )
1106
+ ] }),
1107
+ showPrice && price && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xl font-bold text-gray-900 dark:text-gray-100", children: price })
1108
+ ] }),
1109
+ description && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-600 dark:text-gray-400 mb-3", children: description }),
1110
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "space-y-2", children: [
1111
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row justify-between py-2 border-b border-gray-100 dark:border-gray-700", children: [
1112
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-600 dark:text-gray-400", children: "Hourly" }),
1113
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: formatLimit(hourlyLimit) })
1114
+ ] }),
1115
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row justify-between py-2 border-b border-gray-100 dark:border-gray-700", children: [
1116
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-600 dark:text-gray-400", children: "Daily" }),
1117
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: formatLimit(dailyLimit) })
1118
+ ] }),
1119
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row justify-between py-2", children: [
1120
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-600 dark:text-gray-400", children: "Monthly" }),
1121
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: formatLimit(monthlyLimit) })
1122
+ ] })
1123
+ ] }),
1124
+ features && features.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "mt-4 pt-3 border-t border-gray-200 dark:border-gray-700", children: features.map((feature, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center mb-2", children: [
1125
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-green-500 mr-2", children: "✓" }),
1126
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-700 dark:text-gray-300", children: feature })
1127
+ ] }, index)) }),
1128
+ onSelect && !isCurrent && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1129
+ reactNative.View,
1130
+ {
1131
+ className: componentsRn.cn(
1132
+ "py-2.5 rounded-lg items-center",
1133
+ isRecommended ? "bg-green-500" : "bg-blue-500"
1134
+ ),
1135
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-semibold text-white", children: isRecommended ? "Upgrade Now" : "Select Plan" })
1136
+ }
1137
+ ) })
1138
+ ] });
1139
+ if (onSelect && !isCurrent) {
1140
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1141
+ reactNative.Pressable,
1142
+ {
1143
+ onPress: onSelect,
1144
+ className: "active:opacity-90 mb-4",
1145
+ accessibilityRole: "button",
1146
+ accessibilityLabel: "Select " + name + " plan",
1147
+ children: content
1148
+ }
1149
+ );
1150
+ }
1151
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "mb-4", children: content });
1152
+ }
1153
+ function TierComparisonTable({
1154
+ tiers,
1155
+ title,
1156
+ onTierSelect,
1157
+ highlightCurrent = true,
1158
+ showPrice = true,
1159
+ className
1160
+ }) {
1161
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1162
+ reactNative.View,
1163
+ {
1164
+ className: componentsRn.cn("", className),
1165
+ accessibilityRole: "none",
1166
+ accessibilityLabel: title || "Tier Comparison",
1167
+ children: [
1168
+ title && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xl font-bold text-gray-900 dark:text-gray-100 mb-4", children: title }),
1169
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.ScrollView, { showsVerticalScrollIndicator: false, children: tiers.map((tier, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1170
+ TierCard,
1171
+ {
1172
+ tier,
1173
+ onSelect: onTierSelect ? () => onTierSelect(tier) : void 0,
1174
+ highlightCurrent,
1175
+ showPrice
1176
+ },
1177
+ tier.name + "-" + index
1178
+ )) }),
1179
+ tiers.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "py-8 items-center bg-gray-50 dark:bg-gray-800 rounded-xl", children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-gray-500 dark:text-gray-400", children: "No tiers available" }) })
1180
+ ]
1181
+ }
1182
+ );
1183
+ }
1184
+ function getColorClasses(color) {
1185
+ const colorMap = {
1186
+ green: {
1187
+ bg: "bg-green-500",
1188
+ border: "border-green-500",
1189
+ text: "text-green-600 dark:text-green-400"
1190
+ },
1191
+ yellow: {
1192
+ bg: "bg-yellow-500",
1193
+ border: "border-yellow-500",
1194
+ text: "text-yellow-600 dark:text-yellow-400"
1195
+ },
1196
+ orange: {
1197
+ bg: "bg-orange-500",
1198
+ border: "border-orange-500",
1199
+ text: "text-orange-600 dark:text-orange-400"
1200
+ },
1201
+ red: {
1202
+ bg: "bg-red-500",
1203
+ border: "border-red-500",
1204
+ text: "text-red-600 dark:text-red-400"
1205
+ },
1206
+ blue: {
1207
+ bg: "bg-blue-500",
1208
+ border: "border-blue-500",
1209
+ text: "text-blue-600 dark:text-blue-400"
1210
+ },
1211
+ gray: {
1212
+ bg: "bg-gray-500",
1213
+ border: "border-gray-500",
1214
+ text: "text-gray-600 dark:text-gray-400"
1215
+ }
1216
+ };
1217
+ return colorMap[color];
1218
+ }
1219
+ function formatTimestamp(timestamp) {
1220
+ if (typeof timestamp === "string") {
1221
+ return timestamp;
1222
+ }
1223
+ return timestamp.toLocaleDateString(void 0, {
1224
+ month: "short",
1225
+ day: "numeric"
1226
+ });
1227
+ }
1228
+ function BarChart({
1229
+ data,
1230
+ height,
1231
+ color,
1232
+ showLimit,
1233
+ showLabels,
1234
+ onDataPointPress
1235
+ }) {
1236
+ const maxValue = Math.max(...data.map((d) => Math.max(d.value, d.limit || 0)));
1237
+ const colors = getColorClasses(color);
1238
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-row items-end", style: { height }, children: data.map((entry, index) => {
1239
+ const barHeight = maxValue > 0 ? entry.value / maxValue * (height - 40) : 0;
1240
+ const limitHeight = entry.limit && maxValue > 0 ? entry.limit / maxValue * (height - 40) : 0;
1241
+ const label = entry.label || formatTimestamp(entry.timestamp);
1242
+ const barContent = /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "items-center mx-1.5", children: [
1243
+ showLabels && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: componentsRn.cn("text-xs font-medium mb-1", colors.text), children: entry.value.toLocaleString() }),
1244
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1245
+ reactNative.View,
1246
+ {
1247
+ className: "relative items-center justify-end",
1248
+ style: { height: height - 40, width: 32 },
1249
+ children: [
1250
+ showLimit && entry.limit && /* @__PURE__ */ jsxRuntimeExports.jsx(
1251
+ reactNative.View,
1252
+ {
1253
+ className: "absolute left-0 right-0 border-t-2 border-dashed border-red-400",
1254
+ style: { bottom: limitHeight }
1255
+ }
1256
+ ),
1257
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1258
+ reactNative.View,
1259
+ {
1260
+ className: componentsRn.cn("w-6 rounded-t", colors.bg),
1261
+ style: { height: Math.max(barHeight, 4) }
1262
+ }
1263
+ )
1264
+ ]
1265
+ }
1266
+ ),
1267
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400 mt-1 w-12 text-center", children: label })
1268
+ ] }, index);
1269
+ if (onDataPointPress) {
1270
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1271
+ reactNative.Pressable,
1272
+ {
1273
+ onPress: () => onDataPointPress(entry, index),
1274
+ className: "active:opacity-70",
1275
+ accessibilityRole: "button",
1276
+ accessibilityLabel: label + ": " + entry.value,
1277
+ children: barContent
1278
+ },
1279
+ index
1280
+ );
1281
+ }
1282
+ return barContent;
1283
+ }) }) });
1284
+ }
1285
+ function LineChart({
1286
+ data,
1287
+ height,
1288
+ color,
1289
+ showLimit,
1290
+ showLabels,
1291
+ onDataPointPress
1292
+ }) {
1293
+ const maxValue = Math.max(...data.map((d) => Math.max(d.value, d.limit || 0)));
1294
+ const colors = getColorClasses(color);
1295
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-row items-end", style: { height }, children: data.map((entry, index) => {
1296
+ const dotY = maxValue > 0 ? (1 - entry.value / maxValue) * (height - 50) : height - 50;
1297
+ const limitY = entry.limit && maxValue > 0 ? (1 - entry.limit / maxValue) * (height - 50) : null;
1298
+ const label = entry.label || formatTimestamp(entry.timestamp);
1299
+ const pointContent = /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "items-center mx-3", children: [
1300
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1301
+ reactNative.View,
1302
+ {
1303
+ className: "relative items-center",
1304
+ style: { height: height - 40, width: 40 },
1305
+ children: [
1306
+ showLimit && limitY !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(
1307
+ reactNative.View,
1308
+ {
1309
+ className: "absolute left-0 right-0 h-0.5 bg-red-400/50",
1310
+ style: { top: limitY }
1311
+ }
1312
+ ),
1313
+ showLabels && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { style: { position: "absolute", top: dotY - 20 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: componentsRn.cn("text-xs font-medium", colors.text), children: entry.value.toLocaleString() }) }),
1314
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1315
+ reactNative.View,
1316
+ {
1317
+ className: componentsRn.cn("w-3 h-3 rounded-full absolute", colors.bg),
1318
+ style: { top: dotY }
1319
+ }
1320
+ ),
1321
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1322
+ reactNative.View,
1323
+ {
1324
+ className: "w-px bg-gray-200 dark:bg-gray-700 absolute bottom-0",
1325
+ style: { height: height - 50 - dotY, top: dotY + 6 }
1326
+ }
1327
+ )
1328
+ ]
1329
+ }
1330
+ ),
1331
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400 mt-1 w-14 text-center", children: label })
1332
+ ] }, index);
1333
+ if (onDataPointPress) {
1334
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1335
+ reactNative.Pressable,
1336
+ {
1337
+ onPress: () => onDataPointPress(entry, index),
1338
+ className: "active:opacity-70",
1339
+ accessibilityRole: "button",
1340
+ accessibilityLabel: label + ": " + entry.value,
1341
+ children: pointContent
1342
+ },
1343
+ index
1344
+ );
1345
+ }
1346
+ return pointContent;
1347
+ }) }) });
1348
+ }
1349
+ function UsageHistoryChart({
1350
+ data,
1351
+ title,
1352
+ height = 200,
1353
+ color = "blue",
1354
+ showLimit = true,
1355
+ showLabels = true,
1356
+ mode = "bar",
1357
+ onDataPointPress,
1358
+ className
1359
+ }) {
1360
+ const totalUsage = data.reduce((sum, entry) => sum + entry.value, 0);
1361
+ const avgUsage = data.length > 0 ? Math.round(totalUsage / data.length) : 0;
1362
+ const maxUsage = data.length > 0 ? Math.max(...data.map((d) => d.value)) : 0;
1363
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1364
+ reactNative.View,
1365
+ {
1366
+ className: componentsRn.cn(
1367
+ "bg-white dark:bg-gray-800 rounded-xl p-4 shadow-sm",
1368
+ className
1369
+ ),
1370
+ accessibilityRole: "none",
1371
+ accessibilityLabel: title || "Usage History Chart",
1372
+ children: [
1373
+ title && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2", children: title }),
1374
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row justify-between mb-4 pb-3 border-b border-gray-100 dark:border-gray-700", children: [
1375
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "items-center", children: [
1376
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400", children: "Total" }),
1377
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: totalUsage.toLocaleString() })
1378
+ ] }),
1379
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "items-center", children: [
1380
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400", children: "Average" }),
1381
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: avgUsage.toLocaleString() })
1382
+ ] }),
1383
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "items-center", children: [
1384
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400", children: "Peak" }),
1385
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: maxUsage.toLocaleString() })
1386
+ ] })
1387
+ ] }),
1388
+ data.length > 0 ? mode === "bar" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
1389
+ BarChart,
1390
+ {
1391
+ data,
1392
+ height,
1393
+ color,
1394
+ showLimit,
1395
+ showLabels,
1396
+ onDataPointPress
1397
+ }
1398
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
1399
+ LineChart,
1400
+ {
1401
+ data,
1402
+ height,
1403
+ color,
1404
+ showLimit,
1405
+ showLabels,
1406
+ onDataPointPress
1407
+ }
1408
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "items-center justify-center", style: { height }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-gray-500 dark:text-gray-400", children: "No history data available" }) }),
1409
+ showLimit && data.some((d) => d.limit) && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center justify-center mt-3 pt-2 border-t border-gray-100 dark:border-gray-700", children: [
1410
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "w-4 h-0.5 bg-red-400 mr-2" }),
1411
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-500 dark:text-gray-400", children: "Limit" })
1412
+ ] })
1413
+ ]
1414
+ }
1415
+ );
1416
+ }
1417
+ exports.TierComparisonTable = TierComparisonTable;
1418
+ exports.TierComparisonTableDefault = TierComparisonTable;
1419
+ exports.UsageDashboard = UsageDashboard;
1420
+ exports.UsageDashboardDefault = UsageDashboard;
1421
+ exports.UsageHistoryChart = UsageHistoryChart;
1422
+ exports.UsageHistoryChartDefault = UsageHistoryChart;
1423
+ //# sourceMappingURL=index.js.map