decord/alpha/source/modules/conjure/chat/useConjureDraftHasText.tsx

96 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 17187
// Function ID: 17188
2026-10-05 08:00:40 +00:00
// Name: useConjureDraftHasText
2026-10-09 10:00:15 +00:00
// Dependencies: [32, 19, 17188, 558, 576, 2]
2026-10-09 10:00:15 +00:00
// Module 17187 (useConjureDraftHasText)
2026-10-03 08:58:59 +00:00
import _slicedToArray from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
2026-10-09 10:00:15 +00:00
import ConjureComposerDraftStore from "ConjureComposerDraftStore" /* 17188 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-10-03 08:58:59 +00:00
const require = globalThis.__r;
let _require;
2026-10-08 09:57:35 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useConjureDraftHasText(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0;
let tmp2;
let tmp4;
let tmp5;
_require = arg0;
const obj = require("react");
const cResult = obj.c(8);
if (cResult[0] !== arg0) {
2026-10-05 08:00:40 +00:00
const fn = function n() {
const str = ConjureComposerDraftStore.getDraft(closure_0);
2026-10-03 08:58:59 +00:00
return "" !== str.trim();
};
cResult[0] = arg0;
cResult[1] = fn;
tmp2 = fn;
} else {
tmp2 = cResult[1];
}
[tmp4, tmp5] = react.useState(tmp2);
_slicedToArray(react.useState(tmp2), 2);
const tmp8 = _slicedToArray(react.useState(arg0), 2)[0] !== arg0;
if (cResult[2] === tmp4) {
if (cResult[3] === arg0) {
let tmp9;
let tmp14;
if (cResult[4] === tmp8) {
tmp9 = cResult[5];
}
if (tmp8) {
tmp7(arg0);
tmp5(tmp9);
}
if (cResult[6] !== tmp9) {
const items = [tmp9, tmp5];
cResult[6] = tmp9;
cResult[7] = items;
tmp14 = items;
} else {
tmp14 = cResult[7];
}
return tmp14;
}
}
let tmp10 = tmp4;
if (tmp8) {
2026-10-05 08:00:40 +00:00
let str = ConjureComposerDraftStore.getDraft(arg0);
2026-10-03 08:58:59 +00:00
tmp10 = "" !== str.trim();
}
cResult[2] = tmp4;
cResult[3] = arg0;
cResult[4] = tmp8;
cResult[5] = tmp10;
tmp9 = tmp10;
2026-10-08 09:57:35 +00:00
}) : (function useConjureDraftHasText(arg0) {
2026-10-03 08:58:59 +00:00
let tmp2;
let tmp3;
2026-10-09 10:00:15 +00:00
const f128100 = () => {
2026-10-05 08:00:40 +00:00
const str = ConjureComposerDraftStore.getDraft(closure_0);
2026-10-03 08:58:59 +00:00
return "" !== str.trim();
};
let closure_0 = arg0;
2026-10-09 10:00:15 +00:00
[tmp2, tmp3] = react.useState(f128100);
_slicedToArray(react.useState(f128100), 2);
2026-10-03 08:58:59 +00:00
const tmp4 = _slicedToArray(react.useState(arg0), 2);
const tmp5 = tmp4[1];
if (tmp4[0] !== arg0) {
2026-10-05 08:00:40 +00:00
let str = ConjureComposerDraftStore.getDraft(arg0);
2026-10-03 08:58:59 +00:00
tmp2 = "" !== str.trim();
}
if (tmp4[0] !== arg0) {
2026-10-03 08:58:59 +00:00
tmp5(arg0);
tmp3(tmp2);
}
const items = [tmp2, tmp3];
return items;
2026-10-03 08:58:59 +00:00
});
2026-10-05 08:00:40 +00:00
const result = size.fileFinishedImporting("modules/conjure/chat/useConjureDraftHasText.tsx");
2026-10-03 08:58:59 +00:00
export default tmp2;