decord/beta/source/modules/scheduled_messages/ScheduledMessageDraftCoachmarkHooks.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

186 lines
5.5 KiB
TypeScript

// Module ID: 12116
// Function ID: 12117
// Name: ScheduledMessageDraftCoachmarkHooks
// Dependencies: [32, 19, 5496, 5107, 2042, 2031, 558, 568, 4579, 504, 2033, 2]
// Module 12116 (ScheduledMessageDraftCoachmarkHooks)
import DismissibleContentUtils from "DismissibleContentUtils" /* 2033 */;
import DismissibleContentUnsafeUtils from "DismissibleContentUnsafeUtils" /* 4579 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
import GatewayConnectionStore from "GatewayConnectionStore" /* 5496 */;
import DraftStore from "DraftStore" /* 5107 */;
require = fn;
const ContentDismissActionType = fn(2042).ContentDismissActionType;
let closure_7 = fn(2031).DismissibleContent.SCHEDULED_MESSAGES_DRAFT_COACHMARK;
const ReactCompilerGating = fn(558);
const size = fn(2);
let result = size.fileFinishedImporting("modules/scheduled_messages/ScheduledMessageDraftCoachmarkHooks.tsx");
export const useScheduledMessageDraftCoachmarkState = ReactCompilerGating.isReactCompilerEnabled() ? ((channel) => {
const cResult = channel(568).c(25);
channel = channel.channel;
({ draftText, isEligible } = channel);
let obj = channel(568);
let result = channel(4579).useIsDismissibleContentDismissed_UNSAFE(closure_7);
dependencyMap = result;
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [DraftStore];
cResult[0] = items;
let first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== channel.id) {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
cResult[1] = channel.id;
cResult[2] = C;
const tmp7 = C;
} else {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
}
let obj2 = channel(4579);
const stateFromStores = channel(504).useStateFromStores(first, tmp7);
if (cResult[3] === Symbol.for("react.memo_cache_sentinel")) {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
const items1 = [GatewayConnectionStore];
class E {
constructor() {
return closure_4.isConnected();
}
}
cResult[3] = items1;
cResult[4] = E;
let tmp10 = E;
const tmp9 = items1;
} else {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
tmp10 = cResult[4];
}
const tmpResult = channel(504);
const stateFromStores1 = channel(504).useStateFromStores(tmp9, tmp10);
if (cResult[5] === draftText) {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
}
let tmp12 = isEligible;
if (isEligible) {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
tmp12 = draftText.trim().length > 10;
}
if (tmp12) {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
}
if (tmp12) {
class C {
constructor() {
return null != closure_5.getScheduledMessage(channel.id);
}
}
}
cResult[5] = draftText;
cResult[6] = stateFromStores;
cResult[7] = stateFromStores1;
cResult[8] = isEligible;
cResult[9] = tmp12;
}) : ((channel) => {
channel = channel.channel;
({ draftText, isEligible } = channel);
isEligible = undefined;
let first;
let connected;
let isCoachmarkVisible;
let result = channel(4579).useIsDismissibleContentDismissed_UNSAFE(closure_7);
dependencyMap = result;
let obj = channel(4579);
const items = [isCoachmarkVisible];
const stateFromStores = channel(504).useStateFromStores(items, () => null != DraftStore.getScheduledMessage(channel.id));
let obj2 = channel(504);
const items1 = [connected];
const stateFromStores1 = channel(504).useStateFromStores(items1, () => connected.isConnected());
if (isEligible) {
isEligible = draftText.trim().length > 10;
}
if (isEligible) {
isEligible = !stateFromStores;
}
if (isEligible) {
isEligible = stateFromStores1;
}
const tmp5 = isEligible(first.useState(false), 2);
first = tmp5[0];
connected = tmp7;
isCoachmarkVisible = first;
if (first) {
isCoachmarkVisible = isEligible;
}
let obj3 = channel(504);
if (tmp4Result[0] !== channel.id) {
tmp10(channel.id);
let tmp12 = isEligible;
if (isEligible) {
tmp12 = !result;
}
tmp7(tmp12);
}
const items2 = [isEligible, result, first, draftText];
const effect = obj4.useEffect(() => {
if (isEligible) {
if (!c1) {
if (!first) {
const _setTimeout = setTimeout;
const timeout = setTimeout(() => connected(true), 60000);
return () => clearTimeout(closure_0);
}
}
}
}, items2);
let tmp15 = !isEligible;
if (!isEligible) {
tmp15 = first;
}
if (tmp15) {
tmp7(false);
}
const items3 = [isCoachmarkVisible];
const dismissCoachmark = obj4.useCallback((dismissAction) => {
connected(false);
const result = DismissibleContentUnsafeUtils.UNSAFE_markDismissibleContentAsDismissed(closure_7, { dismissAction });
}, []);
const effect1 = obj4.useEffect(() => {
if (isCoachmarkVisible) {
const result = DismissibleContentUtils.trackDismissibleContentShown(closure_7);
const obj3 = { dismissAction: ContentDismissActionType.AUTO_DISMISS };
const result1 = DismissibleContentUnsafeUtils.UNSAFE_markDismissibleContentAsDismissed(closure_7, obj3);
}
}, items3);
return { isCoachmarkVisible, dismissCoachmark };
});