133 lines
5.1 KiB
TypeScript
133 lines
5.1 KiB
TypeScript
/* Metro module 12192; source: modules/billing/hooks/useFPDurationLeft.tsx; dependencies: [1244, 7054, 3826, 1216, 2] */
|
|
function _fun93405(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12378:6, offset: 0x020b23ea, size: 213 bytes, params: 8, frame: 19
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = roundFPCountdownUnits;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object2 = {SHORT_TIME_LEFT: 0};
|
|
object2[0] = 'SHORT_TIME_LEFT';
|
|
object2.LONG_TIME_LEFT = 1;
|
|
object2[1] = 'LONG_TIME_LEFT';
|
|
object2.ENDS_IN = 2;
|
|
object2[2] = 'ENDS_IN';
|
|
object2.SHORT_TIME = 3;
|
|
object2[3] = 'SHORT_TIME';
|
|
object2.CREDITS_ENDS_IN = 4;
|
|
object2[4] = 'CREDITS_ENDS_IN';
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/billing/hooks/useFPDurationLeft.tsx');
|
|
exports.default = useFPDurationLeft;
|
|
exports.CountDownMessageTypes = object2;
|
|
exports.roundFPCountdownUnits = closure;
|
|
}
|
|
|
|
function roundFPCountdownUnits(a0) { // fn#93406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12378:301, offset: 0x020b24bf, size: 379 bytes, params: 2, frame: 15
|
|
var r5;
|
|
var r1;
|
|
const object2 = {};
|
|
copyDataProperties(object2, a0, r5);
|
|
const seconds = object2.seconds;
|
|
const value = 0;
|
|
if (seconds > value) {
|
|
object2.minutes = object2.minutes + 1;
|
|
object2.seconds = value;
|
|
}
|
|
if (object2.minutes === 60) {
|
|
object2.hours = object2.hours + 1;
|
|
object2.minutes = value;
|
|
}
|
|
if (object2.hours === 24) {
|
|
object2.days = object2.days + 1;
|
|
object2.hours = value;
|
|
}
|
|
if (object2.days > value) {
|
|
return {'days': null, 'hours': 0, 'minutes': 0, 'seconds': 0,
|
|
days: object2.hours > value ? object2.days + 1 : object2.days};
|
|
}
|
|
if (object2.hours > value) {
|
|
r1 = object2.minutes > 45 ? object2.hours + 1 : object2.hours;
|
|
return r1 > 11 ? {'days': 1, 'hours': 0, 'minutes': 0, 'seconds': 0} : {'days': 0, 'hours': null, 'minutes': 0,
|
|
'seconds': 0, hours: r1};
|
|
}
|
|
let minutes = object2.minutes;
|
|
if (minutes > value) {
|
|
minutes = object2.minutes;
|
|
r5 = minutes > 45 ? 1 : value;
|
|
minutes = r5 === 1 ? value : object2.minutes;
|
|
return {days: value, hours: r5, minutes: minutes, seconds: value};
|
|
}
|
|
return object2.seconds > value ? {'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 0} : object2;
|
|
}
|
|
|
|
function useFPDurationLeft(a0, a1) { // fn#93407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12378:946, offset: 0x020b263a, size: 782 bytes, params: 3, frame: 20
|
|
var object;
|
|
var r0;
|
|
var error;
|
|
const t = require(dependencyMap[0]).t;
|
|
var property;
|
|
var moduleValue;
|
|
var unitsAsStrings;
|
|
var value6;
|
|
var captureMessage;
|
|
let value = environment;
|
|
const SHORT_TIME_LEFT = env0_3.SHORT_TIME_LEFT;
|
|
if (SHORT_TIME_LEFT === a1) {
|
|
object = {days: t['/wnvqA'], hours: t.Jsq0XN, minutes: t['SBd+Bs']};
|
|
} else if (env0_3.LONG_TIME_LEFT === a1) {
|
|
object = {days: t.UD5nn5, hours: t.Hg8Fee, minutes: t.XSbQZZ};
|
|
} else if (env0_3.ENDS_IN === a1) {
|
|
object = {days: t.rLqNad, hours: t.d1LvCA, minutes: t.Z2LX7K};
|
|
} else if (env0_3.CREDITS_ENDS_IN === a1) {
|
|
object = {days: t.xQ3zuN, hours: t.SFU7QN, minutes: t.Y4FNdL};
|
|
} else {
|
|
if (env0_3.SHORT_TIME !== a1) {
|
|
throw new global.Error('Unknown messageType (' + a1 + ') when rendering time left');
|
|
}
|
|
object = {days: t.fYmirx, hours: t['C3RO+g'], minutes: t.r77oHc};
|
|
}
|
|
const value4 = roundFPCountdownUnits(importDefault(dependencyMap[1])(a0.toDate(), 60000));
|
|
reducibleJoin13: while (true) {
|
|
reduciblePort20: while (true) {
|
|
exceptionLanding19: while (true) {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding19;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
value = importDefault(dependencyMap[3]);
|
|
captureMessage = value.captureMessage;
|
|
Reflect.apply(captureMessage, value, ['Error trying to format string for fractional nitro duration pill']);
|
|
r0 = '';
|
|
break reduciblePort20;
|
|
}
|
|
return r0;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding19;
|
|
}
|
|
try {
|
|
property = dependencyMap[2];
|
|
} catch (error) {
|
|
break exceptionLanding19;
|
|
}
|
|
try {
|
|
moduleValue = require(property);
|
|
} catch (error) {
|
|
break exceptionLanding19;
|
|
}
|
|
try {
|
|
unitsAsStrings = moduleValue.unitsAsStrings;
|
|
} catch (error) {
|
|
break exceptionLanding19;
|
|
}
|
|
try {
|
|
value6 = Reflect.apply(unitsAsStrings, moduleValue, [value4, object]);
|
|
} catch (error) {
|
|
break exceptionLanding19;
|
|
}
|
|
return value6;
|
|
}
|
|
|