decord/source/437_AppStateImpl.js

103 lines
2.9 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 437
// Function ID: 5999
// Name: AppStateImpl
2026-07-23 10:11:24 +00:00
// Dependencies: [6, 7, 438, 209, 440]
2026-07-20 16:05:17 +00:00
// Module 437 (AppStateImpl)
2026-07-23 10:11:24 +00:00
import _classCallCheck from "_classCallCheck";
import _defineProperties from "_defineProperties";
2026-07-22 07:54:56 +00:00
2026-07-23 10:11:24 +00:00
let tmp2 = (() => {
2026-07-20 16:05:17 +00:00
class AppStateImpl {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
self = this;
tmp = outer1_2(this, self);
2026-07-20 16:05:17 +00:00
this.currentState = null;
2026-07-23 10:11:24 +00:00
if (null == AppStateImpl(outer1_1[2])) {
2026-07-20 16:05:17 +00:00
flag = false;
self.isAvailable = false;
} else {
flag2 = true;
self.isAvailable = true;
tmp2 = AppStateImpl;
2026-07-23 10:11:24 +00:00
tmp3 = outer1_1;
2026-07-20 16:05:17 +00:00
num = 3;
2026-07-23 10:11:24 +00:00
tmp4 = AppStateImpl(outer1_1[3]);
2026-07-20 16:05:17 +00:00
prototype = tmp4.prototype;
tmp5 = new.target;
tmp6 = new.target;
tmp7 = null;
tmp4 = new tmp4(null);
tmp8 = tmp4;
2026-07-23 10:11:24 +00:00
c1 = tmp4;
2026-07-20 16:05:17 +00:00
self._emitter = tmp4;
2026-07-23 10:11:24 +00:00
obj2 = AppStateImpl(outer1_1[2]);
2026-07-20 16:05:17 +00:00
self.currentState = obj2.getConstants().initialAppState;
flag3 = false;
2026-07-23 10:11:24 +00:00
c2 = false;
2026-07-20 16:05:17 +00:00
str = "appStateDidChange";
addListenerResult = tmp4.addListener("appStateDidChange", (app_state) => {
2026-07-23 10:11:24 +00:00
let c2 = true;
2026-07-20 16:05:17 +00:00
self.currentState = app_state.app_state;
});
2026-07-23 10:11:24 +00:00
obj3 = AppStateImpl(outer1_1[2]);
2026-07-20 16:05:17 +00:00
num2 = 4;
currentAppState = obj3.getCurrentAppState((app_state) => {
2026-07-23 10:11:24 +00:00
let tmp = c2;
if (!c2) {
2026-07-20 16:05:17 +00:00
tmp = self.currentState === app_state.app_state;
}
if (!tmp) {
self.currentState = app_state.app_state;
tmp4.emit("appStateDidChange", app_state);
}
2026-07-23 10:11:24 +00:00
}, AppStateImpl(outer1_1[4]));
2026-07-20 16:05:17 +00:00
}
return;
}
}
const items = [
{
key: "addEventListener",
value: function addEventListener(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
const _emitter = this._emitter;
if (null == _emitter) {
const _Error2 = Error;
const error = new Error("Cannot use AppState when `isAvailable` is false.");
throw error;
} else if ("change" === arg0) {
2026-07-23 10:11:24 +00:00
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
return _emitter.addListener("appStateDidChange", (app_state) => {
2026-07-23 10:11:24 +00:00
callback(app_state.app_state);
2026-07-20 16:05:17 +00:00
});
} else if ("memoryWarning" === arg0) {
return _emitter.addListener("memoryWarning", arg1);
} else {
if ("blur" !== arg0) {
if ("focus" !== arg0) {
const _Error = Error;
const error1 = new Error("Trying to subscribe to unknown event: " + arg0);
throw error1;
}
}
2026-07-23 10:11:24 +00:00
let _classCallCheck = arg1;
2026-07-20 16:05:17 +00:00
return _emitter.addListener("appStateFocusChange", (arg0) => {
if (!tmp) {
2026-07-23 10:11:24 +00:00
callback2();
2026-07-20 16:05:17 +00:00
}
if (tmp4) {
2026-07-23 10:11:24 +00:00
callback2();
2026-07-20 16:05:17 +00:00
}
});
}
}
}
];
return callback(AppStateImpl, items);
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
tmp2 = new tmp2();
export default tmp2;