aport-tools 4.0.30 → 4.0.32

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,70 +1,401 @@
1
- /*! aport-tools v4.0.30 | ISC */
1
+ /*! aport-tools v4.0.32 | ISC */
2
2
  'use strict';
3
3
 
4
4
  var React = require('react');
5
5
  var reactNative = require('react-native');
6
6
  var asyncStorage = require('@react-native-async-storage/async-storage');
7
- var Animated = require('react-native-reanimated');
7
+ var Reanimated = require('react-native-reanimated');
8
8
 
9
- /******************************************************************************
10
- Copyright (c) Microsoft Corporation.
11
-
12
- Permission to use, copy, modify, and/or distribute this software for any
13
- purpose with or without fee is hereby granted.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
- PERFORMANCE OF THIS SOFTWARE.
22
- ***************************************************************************** */
23
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
24
-
25
-
26
- function __awaiter(thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- }
35
-
36
- function __generator(thisArg, body) {
37
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
38
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
39
- function verb(n) { return function (v) { return step([n, v]); }; }
40
- function step(op) {
41
- if (f) throw new TypeError("Generator is already executing.");
42
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
44
- if (y = 0, t) op = [op[0] & 2, t.value];
45
- switch (op[0]) {
46
- case 0: case 1: t = op; break;
47
- case 4: _.label++; return { value: op[1], done: false };
48
- case 5: _.label++; y = op[1]; op = [0]; continue;
49
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
50
- default:
51
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
52
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
53
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
54
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
55
- if (t[2]) _.ops.pop();
56
- _.trys.pop(); continue;
57
- }
58
- op = body.call(thisArg, _);
59
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
60
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
61
- }
62
- }
63
-
64
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
65
- var e = new Error(message);
66
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
67
- };
9
+ function _interopNamespaceDefault(e) {
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var Reanimated__namespace = /*#__PURE__*/_interopNamespaceDefault(Reanimated);
27
+
28
+ function _arrayLikeToArray(r, a) {
29
+ (null == a || a > r.length) && (a = r.length);
30
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
31
+ return n;
32
+ }
33
+ function _arrayWithHoles(r) {
34
+ if (Array.isArray(r)) return r;
35
+ }
36
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
37
+ try {
38
+ var i = n[a](c),
39
+ u = i.value;
40
+ } catch (n) {
41
+ return void e(n);
42
+ }
43
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
44
+ }
45
+ function _asyncToGenerator(n) {
46
+ return function () {
47
+ var t = this,
48
+ e = arguments;
49
+ return new Promise(function (r, o) {
50
+ var a = n.apply(t, e);
51
+ function _next(n) {
52
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
53
+ }
54
+ function _throw(n) {
55
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
56
+ }
57
+ _next(void 0);
58
+ });
59
+ };
60
+ }
61
+ function _iterableToArrayLimit(r, l) {
62
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
63
+ if (null != t) {
64
+ var e,
65
+ n,
66
+ i,
67
+ u,
68
+ a = [],
69
+ f = !0,
70
+ o = !1;
71
+ try {
72
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
73
+ } catch (r) {
74
+ o = !0, n = r;
75
+ } finally {
76
+ try {
77
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
78
+ } finally {
79
+ if (o) throw n;
80
+ }
81
+ }
82
+ return a;
83
+ }
84
+ }
85
+ function _nonIterableRest() {
86
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
87
+ }
88
+ function _regeneratorRuntime() {
89
+ _regeneratorRuntime = function () {
90
+ return e;
91
+ };
92
+ var t,
93
+ e = {},
94
+ r = Object.prototype,
95
+ n = r.hasOwnProperty,
96
+ o = Object.defineProperty || function (t, e, r) {
97
+ t[e] = r.value;
98
+ },
99
+ i = "function" == typeof Symbol ? Symbol : {},
100
+ a = i.iterator || "@@iterator",
101
+ c = i.asyncIterator || "@@asyncIterator",
102
+ u = i.toStringTag || "@@toStringTag";
103
+ function define(t, e, r) {
104
+ return Object.defineProperty(t, e, {
105
+ value: r,
106
+ enumerable: !0,
107
+ configurable: !0,
108
+ writable: !0
109
+ }), t[e];
110
+ }
111
+ try {
112
+ define({}, "");
113
+ } catch (t) {
114
+ define = function (t, e, r) {
115
+ return t[e] = r;
116
+ };
117
+ }
118
+ function wrap(t, e, r, n) {
119
+ var i = e && e.prototype instanceof Generator ? e : Generator,
120
+ a = Object.create(i.prototype),
121
+ c = new Context(n || []);
122
+ return o(a, "_invoke", {
123
+ value: makeInvokeMethod(t, r, c)
124
+ }), a;
125
+ }
126
+ function tryCatch(t, e, r) {
127
+ try {
128
+ return {
129
+ type: "normal",
130
+ arg: t.call(e, r)
131
+ };
132
+ } catch (t) {
133
+ return {
134
+ type: "throw",
135
+ arg: t
136
+ };
137
+ }
138
+ }
139
+ e.wrap = wrap;
140
+ var h = "suspendedStart",
141
+ l = "suspendedYield",
142
+ f = "executing",
143
+ s = "completed",
144
+ y = {};
145
+ function Generator() {}
146
+ function GeneratorFunction() {}
147
+ function GeneratorFunctionPrototype() {}
148
+ var p = {};
149
+ define(p, a, function () {
150
+ return this;
151
+ });
152
+ var d = Object.getPrototypeOf,
153
+ v = d && d(d(values([])));
154
+ v && v !== r && n.call(v, a) && (p = v);
155
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
156
+ function defineIteratorMethods(t) {
157
+ ["next", "throw", "return"].forEach(function (e) {
158
+ define(t, e, function (t) {
159
+ return this._invoke(e, t);
160
+ });
161
+ });
162
+ }
163
+ function AsyncIterator(t, e) {
164
+ function invoke(r, o, i, a) {
165
+ var c = tryCatch(t[r], t, o);
166
+ if ("throw" !== c.type) {
167
+ var u = c.arg,
168
+ h = u.value;
169
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
170
+ invoke("next", t, i, a);
171
+ }, function (t) {
172
+ invoke("throw", t, i, a);
173
+ }) : e.resolve(h).then(function (t) {
174
+ u.value = t, i(u);
175
+ }, function (t) {
176
+ return invoke("throw", t, i, a);
177
+ });
178
+ }
179
+ a(c.arg);
180
+ }
181
+ var r;
182
+ o(this, "_invoke", {
183
+ value: function (t, n) {
184
+ function callInvokeWithMethodAndArg() {
185
+ return new e(function (e, r) {
186
+ invoke(t, n, e, r);
187
+ });
188
+ }
189
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
190
+ }
191
+ });
192
+ }
193
+ function makeInvokeMethod(e, r, n) {
194
+ var o = h;
195
+ return function (i, a) {
196
+ if (o === f) throw Error("Generator is already running");
197
+ if (o === s) {
198
+ if ("throw" === i) throw a;
199
+ return {
200
+ value: t,
201
+ done: !0
202
+ };
203
+ }
204
+ for (n.method = i, n.arg = a;;) {
205
+ var c = n.delegate;
206
+ if (c) {
207
+ var u = maybeInvokeDelegate(c, n);
208
+ if (u) {
209
+ if (u === y) continue;
210
+ return u;
211
+ }
212
+ }
213
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
214
+ if (o === h) throw o = s, n.arg;
215
+ n.dispatchException(n.arg);
216
+ } else "return" === n.method && n.abrupt("return", n.arg);
217
+ o = f;
218
+ var p = tryCatch(e, r, n);
219
+ if ("normal" === p.type) {
220
+ if (o = n.done ? s : l, p.arg === y) continue;
221
+ return {
222
+ value: p.arg,
223
+ done: n.done
224
+ };
225
+ }
226
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
227
+ }
228
+ };
229
+ }
230
+ function maybeInvokeDelegate(e, r) {
231
+ var n = r.method,
232
+ o = e.iterator[n];
233
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
234
+ var i = tryCatch(o, e.iterator, r.arg);
235
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
236
+ var a = i.arg;
237
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
238
+ }
239
+ function pushTryEntry(t) {
240
+ var e = {
241
+ tryLoc: t[0]
242
+ };
243
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
244
+ }
245
+ function resetTryEntry(t) {
246
+ var e = t.completion || {};
247
+ e.type = "normal", delete e.arg, t.completion = e;
248
+ }
249
+ function Context(t) {
250
+ this.tryEntries = [{
251
+ tryLoc: "root"
252
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
253
+ }
254
+ function values(e) {
255
+ if (e || "" === e) {
256
+ var r = e[a];
257
+ if (r) return r.call(e);
258
+ if ("function" == typeof e.next) return e;
259
+ if (!isNaN(e.length)) {
260
+ var o = -1,
261
+ i = function next() {
262
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
263
+ return next.value = t, next.done = !0, next;
264
+ };
265
+ return i.next = i;
266
+ }
267
+ }
268
+ throw new TypeError(typeof e + " is not iterable");
269
+ }
270
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
271
+ value: GeneratorFunctionPrototype,
272
+ configurable: !0
273
+ }), o(GeneratorFunctionPrototype, "constructor", {
274
+ value: GeneratorFunction,
275
+ configurable: !0
276
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
277
+ var e = "function" == typeof t && t.constructor;
278
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
279
+ }, e.mark = function (t) {
280
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
281
+ }, e.awrap = function (t) {
282
+ return {
283
+ __await: t
284
+ };
285
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
286
+ return this;
287
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
288
+ void 0 === i && (i = Promise);
289
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
290
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
291
+ return t.done ? t.value : a.next();
292
+ });
293
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
294
+ return this;
295
+ }), define(g, "toString", function () {
296
+ return "[object Generator]";
297
+ }), e.keys = function (t) {
298
+ var e = Object(t),
299
+ r = [];
300
+ for (var n in e) r.push(n);
301
+ return r.reverse(), function next() {
302
+ for (; r.length;) {
303
+ var t = r.pop();
304
+ if (t in e) return next.value = t, next.done = !1, next;
305
+ }
306
+ return next.done = !0, next;
307
+ };
308
+ }, e.values = values, Context.prototype = {
309
+ constructor: Context,
310
+ reset: function (e) {
311
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
312
+ },
313
+ stop: function () {
314
+ this.done = !0;
315
+ var t = this.tryEntries[0].completion;
316
+ if ("throw" === t.type) throw t.arg;
317
+ return this.rval;
318
+ },
319
+ dispatchException: function (e) {
320
+ if (this.done) throw e;
321
+ var r = this;
322
+ function handle(n, o) {
323
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
324
+ }
325
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
326
+ var i = this.tryEntries[o],
327
+ a = i.completion;
328
+ if ("root" === i.tryLoc) return handle("end");
329
+ if (i.tryLoc <= this.prev) {
330
+ var c = n.call(i, "catchLoc"),
331
+ u = n.call(i, "finallyLoc");
332
+ if (c && u) {
333
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
334
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
335
+ } else if (c) {
336
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
337
+ } else {
338
+ if (!u) throw Error("try statement without catch or finally");
339
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
340
+ }
341
+ }
342
+ }
343
+ },
344
+ abrupt: function (t, e) {
345
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
346
+ var o = this.tryEntries[r];
347
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
348
+ var i = o;
349
+ break;
350
+ }
351
+ }
352
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
353
+ var a = i ? i.completion : {};
354
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
355
+ },
356
+ complete: function (t, e) {
357
+ if ("throw" === t.type) throw t.arg;
358
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
359
+ },
360
+ finish: function (t) {
361
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
362
+ var r = this.tryEntries[e];
363
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
364
+ }
365
+ },
366
+ catch: function (t) {
367
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
368
+ var r = this.tryEntries[e];
369
+ if (r.tryLoc === t) {
370
+ var n = r.completion;
371
+ if ("throw" === n.type) {
372
+ var o = n.arg;
373
+ resetTryEntry(r);
374
+ }
375
+ return o;
376
+ }
377
+ }
378
+ throw Error("illegal catch attempt");
379
+ },
380
+ delegateYield: function (e, r, n) {
381
+ return this.delegate = {
382
+ iterator: values(e),
383
+ resultName: r,
384
+ nextLoc: n
385
+ }, "next" === this.method && (this.arg = t), y;
386
+ }
387
+ }, e;
388
+ }
389
+ function _slicedToArray(r, e) {
390
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
391
+ }
392
+ function _unsupportedIterableToArray(r, a) {
393
+ if (r) {
394
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
395
+ var t = {}.toString.call(r).slice(8, -1);
396
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
397
+ }
398
+ }
68
399
 
69
400
  // src/styles/colors.ts
70
401
  var lightTheme = {
@@ -168,43 +499,52 @@ var ThemeContext = /*#__PURE__*/React.createContext({
168
499
  * @param children - The child components that will consume the theme context.
169
500
  * @param initialTheme - Optional prop to set the initial theme.
170
501
  */
171
- var ThemeProvider = function ThemeProvider(_a) {
172
- var children = _a.children,
173
- initialTheme = _a.initialTheme;
174
- var _b = React.useState(null),
175
- colorScheme = _b[0],
176
- setColorScheme = _b[1];
502
+ var ThemeProvider = function ThemeProvider(_ref) {
503
+ var children = _ref.children,
504
+ initialTheme = _ref.initialTheme;
505
+ var _useState = React.useState(null),
506
+ _useState2 = _slicedToArray(_useState, 2),
507
+ colorScheme = _useState2[0],
508
+ setColorScheme = _useState2[1];
177
509
  // Use useAsyncStorage hook for managing the theme storage
178
- var _c = asyncStorage.useAsyncStorage('theme'),
179
- getItem = _c.getItem,
180
- setItem = _c.setItem;
510
+ var _useAsyncStorage = asyncStorage.useAsyncStorage('theme'),
511
+ getItem = _useAsyncStorage.getItem,
512
+ setItem = _useAsyncStorage.setItem;
181
513
  React.useEffect(function () {
182
- var loadTheme = function loadTheme() {
183
- return __awaiter(void 0, void 0, void 0, function () {
514
+ var loadTheme = /*#__PURE__*/function () {
515
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
184
516
  var systemTheme;
185
- return __generator(this, function (_a) {
186
- try {
187
- // const storedTheme = await getItem();
188
- // if (storedTheme === 'dark' || storedTheme === 'light') {
189
- // setColorScheme(storedTheme);
190
- //}
191
- if (initialTheme) {
192
- setColorScheme(initialTheme);
193
- } else {
194
- systemTheme = reactNative.Appearance.getColorScheme();
195
- setColorScheme(systemTheme);
196
- }
197
- } catch (error) {
198
- console.error('Failed to load theme.', error);
199
- setColorScheme(reactNative.Appearance.getColorScheme());
517
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
518
+ while (1) switch (_context.prev = _context.next) {
519
+ case 0:
520
+ try {
521
+ // const storedTheme = await getItem();
522
+ // if (storedTheme === 'dark' || storedTheme === 'light') {
523
+ // setColorScheme(storedTheme);
524
+ //}
525
+ if (initialTheme) {
526
+ setColorScheme(initialTheme);
527
+ } else {
528
+ systemTheme = reactNative.Appearance.getColorScheme();
529
+ setColorScheme(systemTheme);
530
+ }
531
+ } catch (error) {
532
+ console.error('Failed to load theme.', error);
533
+ setColorScheme(reactNative.Appearance.getColorScheme());
534
+ }
535
+ case 1:
536
+ case "end":
537
+ return _context.stop();
200
538
  }
201
- return [2 /*return*/];
202
- });
203
- });
204
- };
539
+ }, _callee);
540
+ }));
541
+ return function loadTheme() {
542
+ return _ref2.apply(this, arguments);
543
+ };
544
+ }();
205
545
  loadTheme();
206
- var subscription = reactNative.Appearance.addChangeListener(function (_a) {
207
- var colorScheme = _a.colorScheme;
546
+ var subscription = reactNative.Appearance.addChangeListener(function (_ref3) {
547
+ var colorScheme = _ref3.colorScheme;
208
548
  if (!colorScheme) return; // Prevent setting null
209
549
  setColorScheme(colorScheme);
210
550
  });
@@ -212,29 +552,34 @@ var ThemeProvider = function ThemeProvider(_a) {
212
552
  return subscription.remove();
213
553
  };
214
554
  }, [initialTheme, getItem]);
215
- var toggleTheme = function toggleTheme() {
216
- return __awaiter(void 0, void 0, void 0, function () {
217
- var newTheme, error_1;
218
- return __generator(this, function (_a) {
219
- switch (_a.label) {
555
+ var toggleTheme = /*#__PURE__*/function () {
556
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
557
+ var newTheme;
558
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
559
+ while (1) switch (_context2.prev = _context2.next) {
220
560
  case 0:
221
- _a.trys.push([0, 2,, 3]);
561
+ _context2.prev = 0;
222
562
  newTheme = colorScheme === 'dark' ? 'light' : 'dark';
223
563
  setColorScheme(newTheme);
224
- return [4 /*yield*/, setItem(newTheme)];
225
- case 1:
226
- _a.sent(); // Use setItem from useAsyncStorage
227
- return [3 /*break*/, 3];
228
- case 2:
229
- error_1 = _a.sent();
230
- console.error('Failed to toggle theme.', error_1);
231
- return [3 /*break*/, 3];
232
- case 3:
233
- return [2 /*return*/];
564
+ _context2.next = 5;
565
+ return setItem(newTheme);
566
+ case 5:
567
+ _context2.next = 10;
568
+ break;
569
+ case 7:
570
+ _context2.prev = 7;
571
+ _context2.t0 = _context2["catch"](0);
572
+ console.error('Failed to toggle theme.', _context2.t0);
573
+ case 10:
574
+ case "end":
575
+ return _context2.stop();
234
576
  }
235
- });
236
- });
237
- };
577
+ }, _callee2, null, [[0, 7]]);
578
+ }));
579
+ return function toggleTheme() {
580
+ return _ref4.apply(this, arguments);
581
+ };
582
+ }();
238
583
  var theme = {
239
584
  colors: colorScheme === 'dark' ? darkTheme : lightTheme
240
585
  };
@@ -247,9 +592,9 @@ var ThemeProvider = function ThemeProvider(_a) {
247
592
  };
248
593
 
249
594
  var ThemeToggle = function ThemeToggle() {
250
- var _a = React.useContext(ThemeContext),
251
- theme = _a.theme,
252
- toggleTheme = _a.toggleTheme;
595
+ var _useContext = React.useContext(ThemeContext),
596
+ theme = _useContext.theme,
597
+ toggleTheme = _useContext.toggleTheme;
253
598
  var isDarkMode = theme.colors === darkTheme;
254
599
  return /*#__PURE__*/React.createElement(reactNative.View, {
255
600
  style: styles$2.container
@@ -324,20 +669,21 @@ function typeStyles(type, disabled, themeColors) {
324
669
  * @param borderRadius - Custom border radius value. Overrides the `rounded` prop if provided.
325
670
  * @param type - Specifies the button type for styling ('submit', 'button', 'cancel').
326
671
  */
327
- var Button = function Button(_a) {
328
- var children = _a.children,
329
- _b = _a.disabled,
330
- disabled = _b === void 0 ? false : _b,
331
- _c = _a.type,
332
- type = _c === void 0 ? 'button' : _c,
333
- _d = _a.rounded,
334
- rounded = _d === void 0 ? true : _d,
335
- _e = _a.borderRadius,
336
- borderRadius = _e === void 0 ? 30 : _e,
337
- _f = _a.isFullWidth,
338
- isFullWidth = _f === void 0 ? false : _f,
339
- onPress = _a.onPress;
340
- var theme = React.useContext(ThemeContext).theme;
672
+ var Button = function Button(_ref) {
673
+ var children = _ref.children,
674
+ _ref$disabled = _ref.disabled,
675
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
676
+ _ref$type = _ref.type,
677
+ type = _ref$type === void 0 ? 'button' : _ref$type,
678
+ _ref$rounded = _ref.rounded,
679
+ rounded = _ref$rounded === void 0 ? true : _ref$rounded,
680
+ _ref$borderRadius = _ref.borderRadius,
681
+ borderRadius = _ref$borderRadius === void 0 ? 30 : _ref$borderRadius,
682
+ _ref$isFullWidth = _ref.isFullWidth,
683
+ isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
684
+ onPress = _ref.onPress;
685
+ var _useContext = React.useContext(ThemeContext),
686
+ theme = _useContext.theme;
341
687
  var colors = theme.colors;
342
688
  var computedStyles = React.useMemo(function () {
343
689
  return reactNative.StyleSheet.flatten([styles$1.button, typeStyles(type, disabled, colors), rounded && {
@@ -373,6 +719,10 @@ var styles$1 = reactNative.StyleSheet.create({
373
719
  });
374
720
 
375
721
  // src/cards/Card.tsx
722
+ var Animated = Reanimated__namespace["default"];
723
+ var useAnimatedStyle = Reanimated__namespace.useAnimatedStyle,
724
+ useSharedValue = Reanimated__namespace.useSharedValue,
725
+ withSpring = Reanimated__namespace.withSpring;
376
726
  /**
377
727
  * Card component that adapts its styles based on the current theme.
378
728
  * Supports dynamic styling, shadows, and press animations.
@@ -385,23 +735,24 @@ var styles$1 = reactNative.StyleSheet.create({
385
735
  * @param elevation - Elevation for Android shadow. Overrides default.
386
736
  * @param shadowProps - Custom shadow properties for iOS. Overrides defaults.
387
737
  */
388
- var Card = function Card(_a) {
389
- var children = _a.children,
390
- style = _a.style,
391
- onPress = _a.onPress,
392
- _b = _a.pressable,
393
- pressable = _b === void 0 ? false : _b,
394
- _c = _a.borderRadius,
395
- borderRadius = _c === void 0 ? 12 : _c,
396
- _d = _a.elevation,
397
- elevation = _d === void 0 ? 4 : _d,
398
- _e = _a.shadowProps,
399
- shadowProps = _e === void 0 ? {} : _e;
400
- var theme = React.useContext(ThemeContext).theme;
738
+ var Card = function Card(_ref) {
739
+ var children = _ref.children,
740
+ style = _ref.style,
741
+ onPress = _ref.onPress,
742
+ _ref$pressable = _ref.pressable,
743
+ pressable = _ref$pressable === void 0 ? false : _ref$pressable,
744
+ _ref$borderRadius = _ref.borderRadius,
745
+ borderRadius = _ref$borderRadius === void 0 ? 12 : _ref$borderRadius,
746
+ _ref$elevation = _ref.elevation,
747
+ elevation = _ref$elevation === void 0 ? 4 : _ref$elevation,
748
+ _ref$shadowProps = _ref.shadowProps,
749
+ shadowProps = _ref$shadowProps === void 0 ? {} : _ref$shadowProps;
750
+ var _useContext = React.useContext(ThemeContext),
751
+ theme = _useContext.theme;
401
752
  var colors = theme.colors;
402
753
  // Animation state for pressable effect
403
- var scale = Animated.useSharedValue(1);
404
- var animatedStyle = Animated.useAnimatedStyle(function () {
754
+ var scale = useSharedValue(1);
755
+ var animatedStyle = useAnimatedStyle(function () {
405
756
  return {
406
757
  transform: [{
407
758
  scale: scale.value
@@ -409,10 +760,10 @@ var Card = function Card(_a) {
409
760
  };
410
761
  });
411
762
  var handlePressIn = function handlePressIn() {
412
- scale.value = Animated.withSpring(0.95);
763
+ scale.value = withSpring(0.95);
413
764
  };
414
765
  var handlePressOut = function handlePressOut() {
415
- scale.value = Animated.withSpring(1);
766
+ scale.value = withSpring(1);
416
767
  };
417
768
  // Default shadow styles (improved platform-specific handling)
418
769
  var defaultShadow = reactNative.Platform.select({