Files
2026-07-28 01:06:53 +03:00

73 lines
4.1 KiB
TypeScript

/* Metro module 10198; source: modules/masked_link/SharedStateUtils.tsx; dependencies: [57, 31, 8875, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
function _fun79316(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10384:6, offset: 0x01e4d678, size: 150 bytes, params: 8, frame: 19
const env0_0 = require;
const useUrlParts2 = useUrlParts;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/masked_link/SharedStateUtils.tsx');
exports.useUrlParts = useUrlParts2;
exports.useModalState = useModalState;
function useUrlParts(a0) { // fn#79317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10384:116, offset: 0x01e4d70e, size: 149 bytes, params: 2, frame: 18
const env0_0 = a0;
let value = ReactModule.useMemo(_fun79318, [a0]);
const protocol = value.protocol;
const hostname = value.hostname;
value = a0.substr(protocol.length, 2);
const value2 = '';
const value3 = '//';
const r5 = value3 !== value ? value2 : value3;
object = {protocol: protocol, authorityPrefix: r5, hostname: hostname};
object.theRestOfTheUrl = a0.replace(value2 + protocol + r5 + hostname, value2);
return object;
function _fun79318() { // fn#79318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10384:157, offset: 0x01e4d7a3, size: 77 bytes, params: 1, frame: 16
const object = {};
let value = environment.__proto__;
value = require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */;
const getProtocol = value.getProtocol;
const binding = env0_0;
object.protocol = Reflect.apply(getProtocol, value, [binding]);
object.hostname = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getHostname(binding);
return object;
}
}
function useModalState({url, trustUrl, onConfirm, onCancel, onClose}) { // fn#79319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10384:508, offset: 0x01e4d7f0, size: 262 bytes, params: 2, frame: 25
const onConfirm2 = onConfirm;
const onCancel2 = onCancel;
let binding = onCancel2;
const [property, property2] = onConfirm2(binding.useState(false), 2);
const {protocol, authorityPrefix, hostname, theRestOfTheUrl} = useUrlParts(url);
binding = onCancel2;
let useCallback = binding.useCallback;
const value5 = Reflect.apply(useCallback, binding, [_fun79320, [url, property, trustUrl, onConfirm, onClose]]);
binding = onCancel2;
useCallback = binding.useCallback;
return {protocol: protocol, authorityPrefix: authorityPrefix, hostname: hostname, theRestOfTheUrl: theRestOfTheUrl,
shouldTrustUrl: property, setShouldTrustUrl: property2, handleConfirm: value5,
handleCancel: Reflect.apply(useCallback, binding, [function() {
if (onClose != null) {
onClose();
}
onCancel();
}, [onCancel, onClose]])};
function _fun79320() { // fn#79320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10384:728, offset: 0x01e4d8f6, size: 57 bytes, params: 1, frame: 12
if (env0_5) {
trustUrl(url);
}
if (onClose != null) {
onClose();
}
onConfirm();
}
}
}
global.__d(_fun79316, 10198, [57, 31, 8875, 2]) /* metro module 10198, dependencies: [57, 31, 8875, 2] */;