tevrocsdk 0.1.14 → 0.1.17

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/tevroc-sdk.umd.js CHANGED
@@ -1,9 +1,7 @@
1
1
  var Tevroc = (() => {
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __esm = (fn, res, err) => function __init() {
9
7
  if (err) throw err[0];
@@ -13,13 +11,6 @@ var Tevroc = (() => {
13
11
  throw err = [e], e;
14
12
  }
15
13
  };
16
- var __commonJS = (cb, mod) => function __require() {
17
- try {
18
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
- } catch (e) {
20
- throw mod = 0, e;
21
- }
22
- };
23
14
  var __export = (target, all) => {
24
15
  for (var name in all)
25
16
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -32,1000 +23,8 @@ var Tevroc = (() => {
32
23
  }
33
24
  return to;
34
25
  };
35
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
36
- // If the importer is in node compatibility mode or this is not an ESM
37
- // file that has been converted to a CommonJS file using a Babel-
38
- // compatible transform (i.e. "__esModule" has not been set), then set
39
- // "default" to the CommonJS "module.exports" for node compatibility.
40
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
41
- mod
42
- ));
43
26
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
44
27
 
45
- // node_modules/react/cjs/react.development.js
46
- var require_react_development = __commonJS({
47
- "node_modules/react/cjs/react.development.js"(exports, module) {
48
- "use strict";
49
- (function() {
50
- function defineDeprecationWarning(methodName, info) {
51
- Object.defineProperty(Component.prototype, methodName, {
52
- get: function() {
53
- console.warn(
54
- "%s(...) is deprecated in plain JavaScript React classes. %s",
55
- info[0],
56
- info[1]
57
- );
58
- }
59
- });
60
- }
61
- function getIteratorFn(maybeIterable) {
62
- if (null === maybeIterable || "object" !== typeof maybeIterable)
63
- return null;
64
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
65
- return "function" === typeof maybeIterable ? maybeIterable : null;
66
- }
67
- function warnNoop(publicInstance, callerName) {
68
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
69
- var warningKey = publicInstance + "." + callerName;
70
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
71
- "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
72
- callerName,
73
- publicInstance
74
- ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
75
- }
76
- function Component(props, context, updater) {
77
- this.props = props;
78
- this.context = context;
79
- this.refs = emptyObject;
80
- this.updater = updater || ReactNoopUpdateQueue;
81
- }
82
- function ComponentDummy() {
83
- }
84
- function PureComponent(props, context, updater) {
85
- this.props = props;
86
- this.context = context;
87
- this.refs = emptyObject;
88
- this.updater = updater || ReactNoopUpdateQueue;
89
- }
90
- function noop() {
91
- }
92
- function testStringCoercion(value) {
93
- return "" + value;
94
- }
95
- function checkKeyStringCoercion(value) {
96
- try {
97
- testStringCoercion(value);
98
- var JSCompiler_inline_result = false;
99
- } catch (e) {
100
- JSCompiler_inline_result = true;
101
- }
102
- if (JSCompiler_inline_result) {
103
- JSCompiler_inline_result = console;
104
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
105
- var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
106
- JSCompiler_temp_const.call(
107
- JSCompiler_inline_result,
108
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- JSCompiler_inline_result$jscomp$0
110
- );
111
- return testStringCoercion(value);
112
- }
113
- }
114
- function getComponentNameFromType(type) {
115
- if (null == type) return null;
116
- if ("function" === typeof type)
117
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
118
- if ("string" === typeof type) return type;
119
- switch (type) {
120
- case REACT_FRAGMENT_TYPE:
121
- return "Fragment";
122
- case REACT_PROFILER_TYPE:
123
- return "Profiler";
124
- case REACT_STRICT_MODE_TYPE:
125
- return "StrictMode";
126
- case REACT_SUSPENSE_TYPE:
127
- return "Suspense";
128
- case REACT_SUSPENSE_LIST_TYPE:
129
- return "SuspenseList";
130
- case REACT_ACTIVITY_TYPE:
131
- return "Activity";
132
- }
133
- if ("object" === typeof type)
134
- switch ("number" === typeof type.tag && console.error(
135
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
136
- ), type.$$typeof) {
137
- case REACT_PORTAL_TYPE:
138
- return "Portal";
139
- case REACT_CONTEXT_TYPE:
140
- return type.displayName || "Context";
141
- case REACT_CONSUMER_TYPE:
142
- return (type._context.displayName || "Context") + ".Consumer";
143
- case REACT_FORWARD_REF_TYPE:
144
- var innerType = type.render;
145
- type = type.displayName;
146
- type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
147
- return type;
148
- case REACT_MEMO_TYPE:
149
- return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
150
- case REACT_LAZY_TYPE:
151
- innerType = type._payload;
152
- type = type._init;
153
- try {
154
- return getComponentNameFromType(type(innerType));
155
- } catch (x) {
156
- }
157
- }
158
- return null;
159
- }
160
- function getTaskName(type) {
161
- if (type === REACT_FRAGMENT_TYPE) return "<>";
162
- if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
163
- return "<...>";
164
- try {
165
- var name = getComponentNameFromType(type);
166
- return name ? "<" + name + ">" : "<...>";
167
- } catch (x) {
168
- return "<...>";
169
- }
170
- }
171
- function getOwner() {
172
- var dispatcher = ReactSharedInternals.A;
173
- return null === dispatcher ? null : dispatcher.getOwner();
174
- }
175
- function UnknownOwner() {
176
- return Error("react-stack-top-frame");
177
- }
178
- function hasValidKey(config) {
179
- if (hasOwnProperty.call(config, "key")) {
180
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
181
- if (getter && getter.isReactWarning) return false;
182
- }
183
- return void 0 !== config.key;
184
- }
185
- function defineKeyPropWarningGetter(props, displayName) {
186
- function warnAboutAccessingKey() {
187
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
188
- "%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://react.dev/link/special-props)",
189
- displayName
190
- ));
191
- }
192
- warnAboutAccessingKey.isReactWarning = true;
193
- Object.defineProperty(props, "key", {
194
- get: warnAboutAccessingKey,
195
- configurable: true
196
- });
197
- }
198
- function elementRefGetterWithDeprecationWarning() {
199
- var componentName = getComponentNameFromType(this.type);
200
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
201
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
202
- ));
203
- componentName = this.props.ref;
204
- return void 0 !== componentName ? componentName : null;
205
- }
206
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
207
- var refProp = props.ref;
208
- type = {
209
- $$typeof: REACT_ELEMENT_TYPE,
210
- type,
211
- key,
212
- props,
213
- _owner: owner
214
- };
215
- null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
216
- enumerable: false,
217
- get: elementRefGetterWithDeprecationWarning
218
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
219
- type._store = {};
220
- Object.defineProperty(type._store, "validated", {
221
- configurable: false,
222
- enumerable: false,
223
- writable: true,
224
- value: 0
225
- });
226
- Object.defineProperty(type, "_debugInfo", {
227
- configurable: false,
228
- enumerable: false,
229
- writable: true,
230
- value: null
231
- });
232
- Object.defineProperty(type, "_debugStack", {
233
- configurable: false,
234
- enumerable: false,
235
- writable: true,
236
- value: debugStack
237
- });
238
- Object.defineProperty(type, "_debugTask", {
239
- configurable: false,
240
- enumerable: false,
241
- writable: true,
242
- value: debugTask
243
- });
244
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
245
- return type;
246
- }
247
- function cloneAndReplaceKey(oldElement, newKey) {
248
- newKey = ReactElement(
249
- oldElement.type,
250
- newKey,
251
- oldElement.props,
252
- oldElement._owner,
253
- oldElement._debugStack,
254
- oldElement._debugTask
255
- );
256
- oldElement._store && (newKey._store.validated = oldElement._store.validated);
257
- return newKey;
258
- }
259
- function validateChildKeys(node) {
260
- isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
261
- }
262
- function isValidElement(object) {
263
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
264
- }
265
- function escape2(key) {
266
- var escaperLookup = { "=": "=0", ":": "=2" };
267
- return "$" + key.replace(/[=:]/g, function(match) {
268
- return escaperLookup[match];
269
- });
270
- }
271
- function getElementKey(element, index) {
272
- return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape2("" + element.key)) : index.toString(36);
273
- }
274
- function resolveThenable(thenable) {
275
- switch (thenable.status) {
276
- case "fulfilled":
277
- return thenable.value;
278
- case "rejected":
279
- throw thenable.reason;
280
- default:
281
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
282
- function(fulfilledValue) {
283
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
284
- },
285
- function(error) {
286
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
287
- }
288
- )), thenable.status) {
289
- case "fulfilled":
290
- return thenable.value;
291
- case "rejected":
292
- throw thenable.reason;
293
- }
294
- }
295
- throw thenable;
296
- }
297
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
298
- var type = typeof children;
299
- if ("undefined" === type || "boolean" === type) children = null;
300
- var invokeCallback = false;
301
- if (null === children) invokeCallback = true;
302
- else
303
- switch (type) {
304
- case "bigint":
305
- case "string":
306
- case "number":
307
- invokeCallback = true;
308
- break;
309
- case "object":
310
- switch (children.$$typeof) {
311
- case REACT_ELEMENT_TYPE:
312
- case REACT_PORTAL_TYPE:
313
- invokeCallback = true;
314
- break;
315
- case REACT_LAZY_TYPE:
316
- return invokeCallback = children._init, mapIntoArray(
317
- invokeCallback(children._payload),
318
- array,
319
- escapedPrefix,
320
- nameSoFar,
321
- callback
322
- );
323
- }
324
- }
325
- if (invokeCallback) {
326
- invokeCallback = children;
327
- callback = callback(invokeCallback);
328
- var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
329
- isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
330
- return c;
331
- })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
332
- callback,
333
- escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
334
- userProvidedKeyEscapeRegex,
335
- "$&/"
336
- ) + "/") + childKey
337
- ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
338
- return 1;
339
- }
340
- invokeCallback = 0;
341
- childKey = "" === nameSoFar ? "." : nameSoFar + ":";
342
- if (isArrayImpl(children))
343
- for (var i = 0; i < children.length; i++)
344
- nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
345
- nameSoFar,
346
- array,
347
- escapedPrefix,
348
- type,
349
- callback
350
- );
351
- else if (i = getIteratorFn(children), "function" === typeof i)
352
- for (i === children.entries && (didWarnAboutMaps || console.warn(
353
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
354
- ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
355
- nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
356
- nameSoFar,
357
- array,
358
- escapedPrefix,
359
- type,
360
- callback
361
- );
362
- else if ("object" === type) {
363
- if ("function" === typeof children.then)
364
- return mapIntoArray(
365
- resolveThenable(children),
366
- array,
367
- escapedPrefix,
368
- nameSoFar,
369
- callback
370
- );
371
- array = String(children);
372
- throw Error(
373
- "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
374
- );
375
- }
376
- return invokeCallback;
377
- }
378
- function mapChildren(children, func, context) {
379
- if (null == children) return children;
380
- var result = [], count = 0;
381
- mapIntoArray(children, result, "", "", function(child) {
382
- return func.call(context, child, count++);
383
- });
384
- return result;
385
- }
386
- function lazyInitializer(payload) {
387
- if (-1 === payload._status) {
388
- var ioInfo = payload._ioInfo;
389
- null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
390
- ioInfo = payload._result;
391
- var thenable = ioInfo();
392
- thenable.then(
393
- function(moduleObject) {
394
- if (0 === payload._status || -1 === payload._status) {
395
- payload._status = 1;
396
- payload._result = moduleObject;
397
- var _ioInfo = payload._ioInfo;
398
- null != _ioInfo && (_ioInfo.end = performance.now());
399
- void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
400
- }
401
- },
402
- function(error) {
403
- if (0 === payload._status || -1 === payload._status) {
404
- payload._status = 2;
405
- payload._result = error;
406
- var _ioInfo2 = payload._ioInfo;
407
- null != _ioInfo2 && (_ioInfo2.end = performance.now());
408
- void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
409
- }
410
- }
411
- );
412
- ioInfo = payload._ioInfo;
413
- if (null != ioInfo) {
414
- ioInfo.value = thenable;
415
- var displayName = thenable.displayName;
416
- "string" === typeof displayName && (ioInfo.name = displayName);
417
- }
418
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
419
- }
420
- if (1 === payload._status)
421
- return ioInfo = payload._result, void 0 === ioInfo && console.error(
422
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
423
- ioInfo
424
- ), "default" in ioInfo || console.error(
425
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
426
- ioInfo
427
- ), ioInfo.default;
428
- throw payload._result;
429
- }
430
- function resolveDispatcher() {
431
- var dispatcher = ReactSharedInternals.H;
432
- null === dispatcher && console.error(
433
- "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
434
- );
435
- return dispatcher;
436
- }
437
- function releaseAsyncTransition() {
438
- ReactSharedInternals.asyncTransitions--;
439
- }
440
- function enqueueTask(task) {
441
- if (null === enqueueTaskImpl)
442
- try {
443
- var requireString = ("require" + Math.random()).slice(0, 7);
444
- enqueueTaskImpl = (module && module[requireString]).call(
445
- module,
446
- "timers"
447
- ).setImmediate;
448
- } catch (_err) {
449
- enqueueTaskImpl = function(callback) {
450
- false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
451
- "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
452
- ));
453
- var channel = new MessageChannel();
454
- channel.port1.onmessage = callback;
455
- channel.port2.postMessage(void 0);
456
- };
457
- }
458
- return enqueueTaskImpl(task);
459
- }
460
- function aggregateErrors(errors) {
461
- return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
462
- }
463
- function popActScope(prevActQueue, prevActScopeDepth) {
464
- prevActScopeDepth !== actScopeDepth - 1 && console.error(
465
- "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
466
- );
467
- actScopeDepth = prevActScopeDepth;
468
- }
469
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
470
- var queue = ReactSharedInternals.actQueue;
471
- if (null !== queue)
472
- if (0 !== queue.length)
473
- try {
474
- flushActQueue(queue);
475
- enqueueTask(function() {
476
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
477
- });
478
- return;
479
- } catch (error) {
480
- ReactSharedInternals.thrownErrors.push(error);
481
- }
482
- else ReactSharedInternals.actQueue = null;
483
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
484
- }
485
- function flushActQueue(queue) {
486
- if (!isFlushing) {
487
- isFlushing = true;
488
- var i = 0;
489
- try {
490
- for (; i < queue.length; i++) {
491
- var callback = queue[i];
492
- do {
493
- ReactSharedInternals.didUsePromise = false;
494
- var continuation = callback(false);
495
- if (null !== continuation) {
496
- if (ReactSharedInternals.didUsePromise) {
497
- queue[i] = callback;
498
- queue.splice(0, i);
499
- return;
500
- }
501
- callback = continuation;
502
- } else break;
503
- } while (1);
504
- }
505
- queue.length = 0;
506
- } catch (error) {
507
- queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
508
- } finally {
509
- isFlushing = false;
510
- }
511
- }
512
- }
513
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
514
- var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
515
- isMounted: function() {
516
- return false;
517
- },
518
- enqueueForceUpdate: function(publicInstance) {
519
- warnNoop(publicInstance, "forceUpdate");
520
- },
521
- enqueueReplaceState: function(publicInstance) {
522
- warnNoop(publicInstance, "replaceState");
523
- },
524
- enqueueSetState: function(publicInstance) {
525
- warnNoop(publicInstance, "setState");
526
- }
527
- }, assign = Object.assign, emptyObject = {};
528
- Object.freeze(emptyObject);
529
- Component.prototype.isReactComponent = {};
530
- Component.prototype.setState = function(partialState, callback) {
531
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
532
- throw Error(
533
- "takes an object of state variables to update or a function which returns an object of state variables."
534
- );
535
- this.updater.enqueueSetState(this, partialState, callback, "setState");
536
- };
537
- Component.prototype.forceUpdate = function(callback) {
538
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
539
- };
540
- var deprecatedAPIs = {
541
- isMounted: [
542
- "isMounted",
543
- "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
544
- ],
545
- replaceState: [
546
- "replaceState",
547
- "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
548
- ]
549
- };
550
- for (fnName in deprecatedAPIs)
551
- deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
552
- ComponentDummy.prototype = Component.prototype;
553
- deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
554
- deprecatedAPIs.constructor = PureComponent;
555
- assign(deprecatedAPIs, Component.prototype);
556
- deprecatedAPIs.isPureReactComponent = true;
557
- var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
558
- H: null,
559
- A: null,
560
- T: null,
561
- S: null,
562
- actQueue: null,
563
- asyncTransitions: 0,
564
- isBatchingLegacy: false,
565
- didScheduleLegacyUpdate: false,
566
- didUsePromise: false,
567
- thrownErrors: [],
568
- getCurrentStack: null,
569
- recentlyCreatedOwnerStacks: 0
570
- }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
571
- return null;
572
- };
573
- deprecatedAPIs = {
574
- react_stack_bottom_frame: function(callStackForError) {
575
- return callStackForError();
576
- }
577
- };
578
- var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
579
- var didWarnAboutElementRef = {};
580
- var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
581
- deprecatedAPIs,
582
- UnknownOwner
583
- )();
584
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
585
- var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
586
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
587
- var event = new window.ErrorEvent("error", {
588
- bubbles: true,
589
- cancelable: true,
590
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
591
- error
592
- });
593
- if (!window.dispatchEvent(event)) return;
594
- } else if ("object" === typeof process && "function" === typeof process.emit) {
595
- process.emit("uncaughtException", error);
596
- return;
597
- }
598
- console.error(error);
599
- }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
600
- queueMicrotask(function() {
601
- return queueMicrotask(callback);
602
- });
603
- } : enqueueTask;
604
- deprecatedAPIs = Object.freeze({
605
- __proto__: null,
606
- c: function(size) {
607
- return resolveDispatcher().useMemoCache(size);
608
- }
609
- });
610
- var fnName = {
611
- map: mapChildren,
612
- forEach: function(children, forEachFunc, forEachContext) {
613
- mapChildren(
614
- children,
615
- function() {
616
- forEachFunc.apply(this, arguments);
617
- },
618
- forEachContext
619
- );
620
- },
621
- count: function(children) {
622
- var n = 0;
623
- mapChildren(children, function() {
624
- n++;
625
- });
626
- return n;
627
- },
628
- toArray: function(children) {
629
- return mapChildren(children, function(child) {
630
- return child;
631
- }) || [];
632
- },
633
- only: function(children) {
634
- if (!isValidElement(children))
635
- throw Error(
636
- "React.Children.only expected to receive a single React element child."
637
- );
638
- return children;
639
- }
640
- };
641
- exports.Activity = REACT_ACTIVITY_TYPE;
642
- exports.Children = fnName;
643
- exports.Component = Component;
644
- exports.Fragment = REACT_FRAGMENT_TYPE;
645
- exports.Profiler = REACT_PROFILER_TYPE;
646
- exports.PureComponent = PureComponent;
647
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
648
- exports.Suspense = REACT_SUSPENSE_TYPE;
649
- exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
650
- exports.__COMPILER_RUNTIME = deprecatedAPIs;
651
- exports.act = function(callback) {
652
- var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
653
- actScopeDepth++;
654
- var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
655
- try {
656
- var result = callback();
657
- } catch (error) {
658
- ReactSharedInternals.thrownErrors.push(error);
659
- }
660
- if (0 < ReactSharedInternals.thrownErrors.length)
661
- throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
662
- if (null !== result && "object" === typeof result && "function" === typeof result.then) {
663
- var thenable = result;
664
- queueSeveralMicrotasks(function() {
665
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
666
- "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
667
- ));
668
- });
669
- return {
670
- then: function(resolve, reject) {
671
- didAwaitActCall = true;
672
- thenable.then(
673
- function(returnValue) {
674
- popActScope(prevActQueue, prevActScopeDepth);
675
- if (0 === prevActScopeDepth) {
676
- try {
677
- flushActQueue(queue), enqueueTask(function() {
678
- return recursivelyFlushAsyncActWork(
679
- returnValue,
680
- resolve,
681
- reject
682
- );
683
- });
684
- } catch (error$0) {
685
- ReactSharedInternals.thrownErrors.push(error$0);
686
- }
687
- if (0 < ReactSharedInternals.thrownErrors.length) {
688
- var _thrownError = aggregateErrors(
689
- ReactSharedInternals.thrownErrors
690
- );
691
- ReactSharedInternals.thrownErrors.length = 0;
692
- reject(_thrownError);
693
- }
694
- } else resolve(returnValue);
695
- },
696
- function(error) {
697
- popActScope(prevActQueue, prevActScopeDepth);
698
- 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
699
- ReactSharedInternals.thrownErrors
700
- ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
701
- }
702
- );
703
- }
704
- };
705
- }
706
- var returnValue$jscomp$0 = result;
707
- popActScope(prevActQueue, prevActScopeDepth);
708
- 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
709
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
710
- "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
711
- ));
712
- }), ReactSharedInternals.actQueue = null);
713
- if (0 < ReactSharedInternals.thrownErrors.length)
714
- throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
715
- return {
716
- then: function(resolve, reject) {
717
- didAwaitActCall = true;
718
- 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
719
- return recursivelyFlushAsyncActWork(
720
- returnValue$jscomp$0,
721
- resolve,
722
- reject
723
- );
724
- })) : resolve(returnValue$jscomp$0);
725
- }
726
- };
727
- };
728
- exports.cache = function(fn) {
729
- return function() {
730
- return fn.apply(null, arguments);
731
- };
732
- };
733
- exports.cacheSignal = function() {
734
- return null;
735
- };
736
- exports.captureOwnerStack = function() {
737
- var getCurrentStack = ReactSharedInternals.getCurrentStack;
738
- return null === getCurrentStack ? null : getCurrentStack();
739
- };
740
- exports.cloneElement = function(element, config, children) {
741
- if (null === element || void 0 === element)
742
- throw Error(
743
- "The argument must be a React element, but you passed " + element + "."
744
- );
745
- var props = assign({}, element.props), key = element.key, owner = element._owner;
746
- if (null != config) {
747
- var JSCompiler_inline_result;
748
- a: {
749
- if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
750
- config,
751
- "ref"
752
- ).get) && JSCompiler_inline_result.isReactWarning) {
753
- JSCompiler_inline_result = false;
754
- break a;
755
- }
756
- JSCompiler_inline_result = void 0 !== config.ref;
757
- }
758
- JSCompiler_inline_result && (owner = getOwner());
759
- hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
760
- for (propName in config)
761
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
762
- }
763
- var propName = arguments.length - 2;
764
- if (1 === propName) props.children = children;
765
- else if (1 < propName) {
766
- JSCompiler_inline_result = Array(propName);
767
- for (var i = 0; i < propName; i++)
768
- JSCompiler_inline_result[i] = arguments[i + 2];
769
- props.children = JSCompiler_inline_result;
770
- }
771
- props = ReactElement(
772
- element.type,
773
- key,
774
- props,
775
- owner,
776
- element._debugStack,
777
- element._debugTask
778
- );
779
- for (key = 2; key < arguments.length; key++)
780
- validateChildKeys(arguments[key]);
781
- return props;
782
- };
783
- exports.createContext = function(defaultValue) {
784
- defaultValue = {
785
- $$typeof: REACT_CONTEXT_TYPE,
786
- _currentValue: defaultValue,
787
- _currentValue2: defaultValue,
788
- _threadCount: 0,
789
- Provider: null,
790
- Consumer: null
791
- };
792
- defaultValue.Provider = defaultValue;
793
- defaultValue.Consumer = {
794
- $$typeof: REACT_CONSUMER_TYPE,
795
- _context: defaultValue
796
- };
797
- defaultValue._currentRenderer = null;
798
- defaultValue._currentRenderer2 = null;
799
- return defaultValue;
800
- };
801
- exports.createElement = function(type, config, children) {
802
- for (var i = 2; i < arguments.length; i++)
803
- validateChildKeys(arguments[i]);
804
- i = {};
805
- var key = null;
806
- if (null != config)
807
- for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
808
- "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
809
- )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
810
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
811
- var childrenLength = arguments.length - 2;
812
- if (1 === childrenLength) i.children = children;
813
- else if (1 < childrenLength) {
814
- for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
815
- childArray[_i] = arguments[_i + 2];
816
- Object.freeze && Object.freeze(childArray);
817
- i.children = childArray;
818
- }
819
- if (type && type.defaultProps)
820
- for (propName in childrenLength = type.defaultProps, childrenLength)
821
- void 0 === i[propName] && (i[propName] = childrenLength[propName]);
822
- key && defineKeyPropWarningGetter(
823
- i,
824
- "function" === typeof type ? type.displayName || type.name || "Unknown" : type
825
- );
826
- var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
827
- return ReactElement(
828
- type,
829
- key,
830
- i,
831
- getOwner(),
832
- propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
833
- propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
834
- );
835
- };
836
- exports.createRef = function() {
837
- var refObject = { current: null };
838
- Object.seal(refObject);
839
- return refObject;
840
- };
841
- exports.forwardRef = function(render) {
842
- null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
843
- "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
844
- ) : "function" !== typeof render ? console.error(
845
- "forwardRef requires a render function but was given %s.",
846
- null === render ? "null" : typeof render
847
- ) : 0 !== render.length && 2 !== render.length && console.error(
848
- "forwardRef render functions accept exactly two parameters: props and ref. %s",
849
- 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
850
- );
851
- null != render && null != render.defaultProps && console.error(
852
- "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
853
- );
854
- var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
855
- Object.defineProperty(elementType, "displayName", {
856
- enumerable: false,
857
- configurable: true,
858
- get: function() {
859
- return ownName;
860
- },
861
- set: function(name) {
862
- ownName = name;
863
- render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
864
- }
865
- });
866
- return elementType;
867
- };
868
- exports.isValidElement = isValidElement;
869
- exports.lazy = function(ctor) {
870
- ctor = { _status: -1, _result: ctor };
871
- var lazyType = {
872
- $$typeof: REACT_LAZY_TYPE,
873
- _payload: ctor,
874
- _init: lazyInitializer
875
- }, ioInfo = {
876
- name: "lazy",
877
- start: -1,
878
- end: -1,
879
- value: null,
880
- owner: null,
881
- debugStack: Error("react-stack-top-frame"),
882
- debugTask: console.createTask ? console.createTask("lazy()") : null
883
- };
884
- ctor._ioInfo = ioInfo;
885
- lazyType._debugInfo = [{ awaited: ioInfo }];
886
- return lazyType;
887
- };
888
- exports.memo = function(type, compare) {
889
- null == type && console.error(
890
- "memo: The first argument must be a component. Instead received: %s",
891
- null === type ? "null" : typeof type
892
- );
893
- compare = {
894
- $$typeof: REACT_MEMO_TYPE,
895
- type,
896
- compare: void 0 === compare ? null : compare
897
- };
898
- var ownName;
899
- Object.defineProperty(compare, "displayName", {
900
- enumerable: false,
901
- configurable: true,
902
- get: function() {
903
- return ownName;
904
- },
905
- set: function(name) {
906
- ownName = name;
907
- type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
908
- }
909
- });
910
- return compare;
911
- };
912
- exports.startTransition = function(scope) {
913
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
914
- currentTransition._updatedFibers = /* @__PURE__ */ new Set();
915
- ReactSharedInternals.T = currentTransition;
916
- try {
917
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
918
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
919
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
920
- } catch (error) {
921
- reportGlobalError(error);
922
- } finally {
923
- null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
924
- "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
925
- )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
926
- "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
927
- ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
928
- }
929
- };
930
- exports.unstable_useCacheRefresh = function() {
931
- return resolveDispatcher().useCacheRefresh();
932
- };
933
- exports.use = function(usable) {
934
- return resolveDispatcher().use(usable);
935
- };
936
- exports.useActionState = function(action, initialState, permalink) {
937
- return resolveDispatcher().useActionState(
938
- action,
939
- initialState,
940
- permalink
941
- );
942
- };
943
- exports.useCallback = function(callback, deps) {
944
- return resolveDispatcher().useCallback(callback, deps);
945
- };
946
- exports.useContext = function(Context) {
947
- var dispatcher = resolveDispatcher();
948
- Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
949
- "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
950
- );
951
- return dispatcher.useContext(Context);
952
- };
953
- exports.useDebugValue = function(value, formatterFn) {
954
- return resolveDispatcher().useDebugValue(value, formatterFn);
955
- };
956
- exports.useDeferredValue = function(value, initialValue) {
957
- return resolveDispatcher().useDeferredValue(value, initialValue);
958
- };
959
- exports.useEffect = function(create, deps) {
960
- null == create && console.warn(
961
- "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
962
- );
963
- return resolveDispatcher().useEffect(create, deps);
964
- };
965
- exports.useEffectEvent = function(callback) {
966
- return resolveDispatcher().useEffectEvent(callback);
967
- };
968
- exports.useId = function() {
969
- return resolveDispatcher().useId();
970
- };
971
- exports.useImperativeHandle = function(ref, create, deps) {
972
- return resolveDispatcher().useImperativeHandle(ref, create, deps);
973
- };
974
- exports.useInsertionEffect = function(create, deps) {
975
- null == create && console.warn(
976
- "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
977
- );
978
- return resolveDispatcher().useInsertionEffect(create, deps);
979
- };
980
- exports.useLayoutEffect = function(create, deps) {
981
- null == create && console.warn(
982
- "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
983
- );
984
- return resolveDispatcher().useLayoutEffect(create, deps);
985
- };
986
- exports.useMemo = function(create, deps) {
987
- return resolveDispatcher().useMemo(create, deps);
988
- };
989
- exports.useOptimistic = function(passthrough, reducer) {
990
- return resolveDispatcher().useOptimistic(passthrough, reducer);
991
- };
992
- exports.useReducer = function(reducer, initialArg, init) {
993
- return resolveDispatcher().useReducer(reducer, initialArg, init);
994
- };
995
- exports.useRef = function(initialValue) {
996
- return resolveDispatcher().useRef(initialValue);
997
- };
998
- exports.useState = function(initialState) {
999
- return resolveDispatcher().useState(initialState);
1000
- };
1001
- exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1002
- return resolveDispatcher().useSyncExternalStore(
1003
- subscribe,
1004
- getSnapshot,
1005
- getServerSnapshot
1006
- );
1007
- };
1008
- exports.useTransition = function() {
1009
- return resolveDispatcher().useTransition();
1010
- };
1011
- exports.version = "19.2.7";
1012
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1013
- })();
1014
- }
1015
- });
1016
-
1017
- // node_modules/react/index.js
1018
- var require_react = __commonJS({
1019
- "node_modules/react/index.js"(exports, module) {
1020
- "use strict";
1021
- if (false) {
1022
- module.exports = null;
1023
- } else {
1024
- module.exports = require_react_development();
1025
- }
1026
- }
1027
- });
1028
-
1029
28
  // node_modules/@capacitor/core/dist/index.js
1030
29
  var ExceptionCode, CapacitorException, getPlatformId, createCapacitor, initCapacitorGlobal, Capacitor, registerPlugin, WebPlugin, encode, decode, CapacitorCookiesPluginWeb, CapacitorCookies, readBlobAsBase64, normalizeHttpHeaders, buildUrlParams, buildRequestInit, CapacitorHttpPluginWeb, CapacitorHttp, SystemBarsStyle, SystemBarType, SystemBarsPluginWeb, SystemBars;
1031
30
  var init_dist = __esm({
@@ -1804,9 +803,6 @@ var Tevroc = (() => {
1804
803
  createClient: () => createClient
1805
804
  });
1806
805
 
1807
- // src/services/useGoogleAuth.js
1808
- var import_react = __toESM(require_react(), 1);
1809
-
1810
806
  // node_modules/@capacitor/app/dist/esm/index.js
1811
807
  init_dist();
1812
808
  var App = registerPlugin("App", {
@@ -4536,48 +3532,21 @@ var Tevroc = (() => {
4536
3532
  googleListeners.push(cb);
4537
3533
  return () => {
4538
3534
  const i = googleListeners.indexOf(cb);
4539
- if (i !== -1) googleListeners.splice(i, 1);
3535
+ if (i !== -1) {
3536
+ googleListeners.splice(i, 1);
3537
+ }
4540
3538
  };
4541
3539
  }
4542
3540
  var authWindowRef = null;
4543
- var createGoogleLogin = async ({
4544
- appId = "tevrocsoft",
4545
- serviceUrl = "https://tevrocsoftapi.netlify.app"
4546
- } = {}) => {
4547
- let authUrl = `${serviceUrl}/login?mode=mobile&app=${appId}`;
4548
- if (isCapacitor) {
4549
- await Browser2.open({ url: authUrl });
4550
- return;
4551
- }
4552
- if (isTauri) {
4553
- const url = `${serviceUrl}/login?mode=desktop&app=${appId}`;
4554
- const win = new WebviewWindow("auth", {
4555
- url,
4556
- title: "Tevroc Login",
4557
- width: 550,
4558
- height: 500,
4559
- resizable: true,
4560
- center: true
4561
- });
4562
- authWindowRef = win;
4563
- win.once("tauri://created", () => {
4564
- console.log("Auth window opened");
4565
- });
4566
- win.once("tauri://error", (e) => {
4567
- console.error("Auth window error:", e);
4568
- });
4569
- return;
4570
- }
4571
- const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
4572
- const mode = isLocalhost ? "localhost" : "netlify";
4573
- authUrl = `${serviceUrl}/login?mode=${mode}&app=${appId}`;
4574
- window.location.href = authUrl;
4575
- };
3541
+ var initialized = false;
3542
+ var tauriUnlisten = null;
3543
+ var capacitorListener = null;
4576
3544
  var handleCallback = async (url) => {
4577
3545
  try {
4578
3546
  if (!url?.includes("token=")) return;
4579
3547
  const params = new URLSearchParams(url.split("?")[1]);
4580
3548
  const token = params.get("token");
3549
+ if (!token) return;
4581
3550
  const res = await fetch(
4582
3551
  "https://www.googleapis.com/oauth2/v3/userinfo",
4583
3552
  {
@@ -4599,71 +3568,198 @@ var Tevroc = (() => {
4599
3568
  localStorage.setItem("idToken", token);
4600
3569
  emitGoogleLogin(profile, null);
4601
3570
  } catch (err) {
3571
+ console.error(err);
4602
3572
  emitGoogleLogin(null, err);
4603
3573
  }
4604
3574
  };
4605
- (0, import_react.useEffect)(() => {
4606
- if (!isCapacitor) return;
4607
- const sub = App.addListener("appUrlOpen", (event) => {
4608
- handleCallback(event.url);
4609
- });
4610
- return () => sub.remove();
4611
- }, []);
4612
- (0, import_react.useEffect)(() => {
4613
- if (!isTauri) return;
4614
- let unlisten;
4615
- const setup = async () => {
4616
- const { listen: listen2 } = await Promise.resolve().then(() => (init_event(), event_exports));
4617
- unlisten = await listen2("deep-link://open-url", async (event) => {
4618
- let url = event.payload;
4619
- if (typeof url === "object") {
4620
- url = url?.url || url?.payload || null;
4621
- }
4622
- if (!url) return;
4623
- if (authWindowRef) {
4624
- try {
4625
- await authWindowRef.close();
4626
- authWindowRef = null;
4627
- } catch (e) {
3575
+ async function initializeGoogleLogin() {
3576
+ if (initialized) return;
3577
+ initialized = true;
3578
+ try {
3579
+ if (isCapacitor) {
3580
+ capacitorListener = await App.addListener(
3581
+ "appUrlOpen",
3582
+ async (event) => {
3583
+ await handleCallback(event.url);
4628
3584
  }
4629
- }
4630
- handleCallback(url);
3585
+ );
3586
+ }
3587
+ if (isTauri) {
3588
+ const { listen: listen2 } = await Promise.resolve().then(() => (init_event(), event_exports));
3589
+ tauriUnlisten = await listen2(
3590
+ "deep-link://open-url",
3591
+ async (event) => {
3592
+ let url = event.payload;
3593
+ if (typeof url === "object") {
3594
+ url = url?.url || url?.payload || null;
3595
+ }
3596
+ if (!url) return;
3597
+ if (authWindowRef) {
3598
+ try {
3599
+ await authWindowRef.close();
3600
+ } catch (e) {
3601
+ }
3602
+ authWindowRef = null;
3603
+ }
3604
+ await handleCallback(url);
3605
+ }
3606
+ );
3607
+ }
3608
+ console.log("Google login initialized");
3609
+ } catch (err) {
3610
+ console.error("Google login init failed:", err);
3611
+ }
3612
+ }
3613
+ var createGoogleLogin = async ({
3614
+ appId = "tevrocsoft",
3615
+ serviceUrl = "https://tevrocsoftapi.netlify.app"
3616
+ } = {}) => {
3617
+ await initializeGoogleLogin();
3618
+ let authUrl = `${serviceUrl}/login?mode=mobile&app=${encodeURIComponent(
3619
+ appId
3620
+ )}`;
3621
+ if (isCapacitor) {
3622
+ await Browser2.open({
3623
+ url: authUrl
4631
3624
  });
4632
- };
4633
- setup();
4634
- return () => {
4635
- unlisten?.();
4636
- };
4637
- }, []);
3625
+ return;
3626
+ }
3627
+ if (isTauri) {
3628
+ const url = `${serviceUrl}/login?mode=desktop&app=${encodeURIComponent(
3629
+ appId
3630
+ )}`;
3631
+ const win = new WebviewWindow("auth", {
3632
+ url,
3633
+ title: "Tevroc Login",
3634
+ width: 550,
3635
+ height: 500,
3636
+ resizable: true,
3637
+ center: true
3638
+ });
3639
+ authWindowRef = win;
3640
+ win.once("tauri://created", () => {
3641
+ console.log("Auth window opened");
3642
+ });
3643
+ win.once("tauri://error", (e) => {
3644
+ console.error("Auth window error:", e);
3645
+ });
3646
+ return;
3647
+ }
3648
+ const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
3649
+ const mode = isLocalhost ? "localhost" : "netlify";
3650
+ authUrl = `${serviceUrl}/login?mode=${mode}&app=${encodeURIComponent(appId)}`;
3651
+ window.location.href = authUrl;
3652
+ };
4638
3653
 
4639
3654
  // src/services/useYocoPayment.js
4640
- var import_react2 = __toESM(require_react(), 1);
4641
3655
  var paymentStatusListeners = [];
3656
+ function emitPaymentStatus(status, err = null) {
3657
+ paymentStatusListeners.forEach((cb) => {
3658
+ try {
3659
+ cb(status, err);
3660
+ } catch (e) {
3661
+ console.error("Payment listener error:", e);
3662
+ }
3663
+ });
3664
+ }
4642
3665
  function subscribePaymentStatus(cb) {
4643
3666
  paymentStatusListeners.push(cb);
4644
3667
  return () => {
4645
3668
  const i = paymentStatusListeners.indexOf(cb);
4646
- if (i !== -1) paymentStatusListeners.splice(i, 1);
3669
+ if (i !== -1) {
3670
+ paymentStatusListeners.splice(i, 1);
3671
+ }
4647
3672
  };
4648
3673
  }
4649
3674
  var paymentWindowRef = null;
3675
+ var initialized2 = false;
3676
+ var tauriUnlisten2 = null;
3677
+ var capacitorListener2 = null;
3678
+ function addLog(...msgs) {
3679
+ msgs.forEach((m) => {
3680
+ console.log("[TEVROC PAYMENT]", m);
3681
+ });
3682
+ }
3683
+ async function handlePaymentCallback(url) {
3684
+ try {
3685
+ addLog("PAYMENT CALLBACK:", url);
3686
+ if (!url?.includes("state=")) {
3687
+ return;
3688
+ }
3689
+ const params = new URLSearchParams(url.split("?")[1]);
3690
+ const state = params.get("state");
3691
+ addLog("PAYMENT RESULT:", state);
3692
+ if (state === "success") {
3693
+ addLog("PAYMENT SUCCESS");
3694
+ } else {
3695
+ addLog("PAYMENT FAILED");
3696
+ }
3697
+ emitPaymentStatus(state, null);
3698
+ } catch (err) {
3699
+ addLog("PAYMENT CALLBACK ERROR:", err?.message);
3700
+ emitPaymentStatus(null, err);
3701
+ }
3702
+ }
3703
+ async function initializePayment() {
3704
+ if (initialized2) {
3705
+ return;
3706
+ }
3707
+ initialized2 = true;
3708
+ try {
3709
+ if (isCapacitor) {
3710
+ capacitorListener2 = await App.addListener(
3711
+ "appUrlOpen",
3712
+ async (event) => {
3713
+ await handlePaymentCallback(event.url);
3714
+ }
3715
+ );
3716
+ }
3717
+ if (isTauri) {
3718
+ const { listen: listen2 } = await Promise.resolve().then(() => (init_event(), event_exports));
3719
+ tauriUnlisten2 = await listen2(
3720
+ "deep-link://open-url",
3721
+ async (event) => {
3722
+ let url = event.payload;
3723
+ if (typeof url === "object") {
3724
+ url = url?.url || url?.payload || null;
3725
+ }
3726
+ if (!url) {
3727
+ return;
3728
+ }
3729
+ if (paymentWindowRef) {
3730
+ try {
3731
+ await paymentWindowRef.close();
3732
+ } catch (e) {
3733
+ }
3734
+ paymentWindowRef = null;
3735
+ }
3736
+ await handlePaymentCallback(url);
3737
+ }
3738
+ );
3739
+ }
3740
+ addLog("Payment listeners initialized");
3741
+ } catch (err) {
3742
+ console.error("Payment initialization failed:", err);
3743
+ }
3744
+ }
4650
3745
  var createPayment = async (amountZAR, {
4651
3746
  appId = "tevrocsoft",
4652
3747
  serviceUrl = "https://tevrocsoftapi.netlify.app"
4653
3748
  } = {}) => {
3749
+ await initializePayment();
4654
3750
  const cents = Math.round(Number(amountZAR) * 100);
4655
3751
  const basePaymentUrl = `${serviceUrl}/pay`;
4656
- const paymentUrl = `${basePaymentUrl}?mode=mobile&amount=${cents}&app=${appId}`;
3752
+ const mobileUrl = `${basePaymentUrl}?mode=mobile&amount=${encodeURIComponent(cents)}&app=${encodeURIComponent(appId)}`;
4657
3753
  if (isCapacitor) {
4658
3754
  await Browser2.open({
4659
- url: paymentUrl
3755
+ url: mobileUrl
4660
3756
  });
4661
3757
  return;
4662
3758
  }
4663
3759
  if (isTauri) {
4664
- const url = `${basePaymentUrl}?mode=desktop&amount=${cents}&app=${appId}`;
3760
+ const desktopUrl = `${basePaymentUrl}?mode=desktop&amount=${encodeURIComponent(cents)}&app=${encodeURIComponent(appId)}`;
4665
3761
  const win = new WebviewWindow("payment", {
4666
- url,
3762
+ url: desktopUrl,
4667
3763
  title: "Complete Payment",
4668
3764
  width: 550,
4669
3765
  height: 600,
@@ -4672,7 +3768,7 @@ var Tevroc = (() => {
4672
3768
  });
4673
3769
  paymentWindowRef = win;
4674
3770
  win.once("tauri://created", () => {
4675
- console.log("Payment window opened");
3771
+ addLog("Payment window opened");
4676
3772
  });
4677
3773
  win.once("tauri://error", (e) => {
4678
3774
  console.error("Payment window error:", e);
@@ -4681,7 +3777,7 @@ var Tevroc = (() => {
4681
3777
  }
4682
3778
  const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
4683
3779
  const mode = isLocalhost ? "localhost" : "netlify";
4684
- window.location.href = `${basePaymentUrl}?mode=${mode}&amount=${cents}&app=${appId}`;
3780
+ window.location.href = `${basePaymentUrl}?mode=${mode}&amount=${encodeURIComponent(cents)}&app=${encodeURIComponent(appId)}`;
4685
3781
  };
4686
3782
 
4687
3783
  // src/index.js
@@ -4806,10 +3902,28 @@ var Tevroc = (() => {
4806
3902
  if (result.token) client.setToken(result.token);
4807
3903
  return result;
4808
3904
  },
3905
+ // base44
3906
+ loginWithProvider: (provider, redirectTo) => {
3907
+ if (provider === "google") {
3908
+ createGoogleLogin({ serviceUrl: client.serviceUrl, redirectTo });
3909
+ if (redirectTo) {
3910
+ subscribeGoogleLogin(async (user, err) => {
3911
+ const result = await client.request("/provider/google/auth/login", {
3912
+ method: "POST",
3913
+ body: { user },
3914
+ auth: false
3915
+ });
3916
+ window.location.href = redirectTo;
3917
+ });
3918
+ }
3919
+ }
3920
+ },
3921
+ // extra
4809
3922
  googleLogin: (params) => createGoogleLogin(params),
4810
3923
  onGoogleLogin: (callback) => {
4811
3924
  return subscribeGoogleLogin(callback);
4812
3925
  },
3926
+ //
4813
3927
  async login(input) {
4814
3928
  const result = await client.request("/auth/login", { method: "POST", body: input, auth: false });
4815
3929
  if (result.token) client.setToken(result.token);
@@ -5014,17 +4128,6 @@ var Tevroc = (() => {
5014
4128
  })();
5015
4129
  /*! Bundled license information:
5016
4130
 
5017
- react/cjs/react.development.js:
5018
- (**
5019
- * @license React
5020
- * react.development.js
5021
- *
5022
- * Copyright (c) Meta Platforms, Inc. and affiliates.
5023
- *
5024
- * This source code is licensed under the MIT license found in the
5025
- * LICENSE file in the root directory of this source tree.
5026
- *)
5027
-
5028
4131
  @capacitor/core/dist/index.js:
5029
4132
  (*! Capacitor: https://capacitorjs.com/ - MIT License *)
5030
4133
  */