decord/source/components_native/MobileSurvey.tsx

131 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 16138
// Function ID: 16139
2026-07-20 16:05:17 +00:00
// Name: MobileSurvey
2026-08-15 05:55:55 +00:00
// Dependencies: [5, 19, 9874, 676, 21, 4661, 589, 698, 9875, 4763, 1236, 4090, 1297, 712, 9841, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-15 05:55:55 +00:00
// Module 16138 (MobileSurvey)
2026-07-29 08:29:29 +00:00
import closure_3 from "createCacheKey";
import noop from "noop";
import fetchSurveyIfNeeded from "fetchSurveyIfNeeded";
2026-07-23 10:11:24 +00:00
import { AnalyticEvents } from "ME";
import { jsx } from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let closure_8 = createCacheKey.createStyles({ confirmIcon: { marginLeft: 4 } });
const result = require("fetchSurveyIfNeeded").fileFinishedImporting("components_native/MobileSurvey.tsx");
2026-07-20 16:05:17 +00:00
export default function MobileSurvey() {
2026-07-23 10:11:24 +00:00
const _require = callback();
2026-07-29 08:29:29 +00:00
let obj = _require(589);
const items = [fetchSurveyIfNeeded];
const stateFromStores = obj.useStateFromStores(items, () => currentSurvey.getCurrentSurvey());
2026-07-20 16:05:17 +00:00
const items1 = [stateFromStores];
const effect = React.useEffect(() => {
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
function _setSurveySeen() {
const self = this;
const tmp = outer2_3(function*() {
if (c0 === 2) {
c0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-15 05:55:55 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c0 = 2;
if (0 === c1) {
if (arg0 === 1) {
c0 = 3;
throw arg1;
} else if (arg0 === 2) {
c0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else if (null != c1) {
let obj1 = v0(outer2_2[8]);
c1 = 1;
c0 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.surveySeen(tmp5.key);
return obj1;
}
} else if (arg0 === 1) {
c0 = 3;
throw arg1;
} else if (arg0 === 2) {
c0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c0 = 3;
2026-08-15 05:55:55 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
} catch (tmp9) {
c0 = tmp;
throw tmp9;
}
}
});
const _setSurveySeen = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
2026-07-23 10:11:24 +00:00
let obj = stateFromStores(outer1_2[7]);
2026-07-29 08:29:29 +00:00
obj = { type: "survey", promotion_id: null };
obj[1] = tmp.id;
2026-07-23 10:11:24 +00:00
obj.track(outer1_6.OPEN_MODAL, obj);
(function setSurveySeen() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _setSurveySeen.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-07-29 08:29:29 +00:00
let tmp5 = null;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { body: null, confirmText: null, cancelText: null, onConfirm: null, onCancel: null, renderConfirmRightIcon: null };
({ prompt: obj2[0], cta: obj2[1] } = stateFromStores);
const intl = tmp(1236).intl;
obj[2] = intl.string(tmp(1236).t.f3Pet9);
obj[3] = function onConfirm() {
2026-07-23 10:11:24 +00:00
stateFromStores(outer1_2[11]).openURL(stateFromStores.url);
const obj = stateFromStores(outer1_2[11]);
lib(outer1_2[8]).surveyHide(stateFromStores.key, false);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[4] = function onCancel() {
2026-07-23 10:11:24 +00:00
return lib(outer1_2[8]).surveyHide(stateFromStores.key, true);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[5] = function renderConfirmRightIcon() {
const obj = { style: lib.confirmIcon, color: null, size: null, source: null };
obj[1] = stateFromStores(outer1_2[13]).unsafe_rawColors.WHITE;
obj[2] = lib(outer1_2[12]).Icon.Sizes.SMALL;
obj[3] = stateFromStores(outer1_2[14]);
2026-07-23 10:11:24 +00:00
return outer1_7(lib(outer1_2[12]).Icon, obj);
2026-07-20 16:05:17 +00:00
};
2026-08-15 05:55:55 +00:00
tmp5 = jsx(stateFromStores(4763), { body: null, confirmText: null, cancelText: null, onConfirm: null, onCancel: null, renderConfirmRightIcon: null });
const tmp8 = stateFromStores(4763);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
};