Files
discord-decomp/sources/modules/now_playing/native/UserActivitySpotify.tsx
T
2026-07-28 01:06:53 +03:00

372 lines
20 KiB
TypeScript

/* Metro module 10216; source: modules/now_playing/native/UserActivitySpotify.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 6868, 33, 1582, 507, 3853, 10217, 4578, 8381, 1244, 1305, 2] */
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as SpotifyConstantsModule from '../../spotify/SpotifyConstants.tsx'; /* Metro dependency 6868 */
import * as SpotifyUtilsModule from '../../spotify/SpotifyUtils.tsx'; /* Metro dependency 10217 */
function _fun79435(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:6, offset: 0x01e5426d, size: 506 bytes, params: 8, frame: 26
const env0_0 = require;
const closure = function() {
return Linking.canOpenURL('' + SPOTIFY_APP_PROTOCOL + ':');
};
const closure2 = function() {
var Identifier = importAll(dependencyMap[9]).getConstants().Identifier;
var HTTP = require(dependencyMap[10]).HTTP;
var object = {};
object.url = SpotifyEndpoints.INSTALL_ATTRIBUTION(Identifier);
object.rejectWithError = true;
HTTP.get(object);
};
const openUrl_794422 = openUrl_79442;
const openTrack2 = openTrack;
const openArtist2 = openArtist;
const openAlbum2 = openAlbum;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
let PureComponent = value.PureComponent;
const value5 = _fun79455(PureComponent);
PureComponent = value.PureComponent;
const value6 = _fun79460(PureComponent);
PureComponent = value.PureComponent;
value = _fun79467(PureComponent);
(FileImportTrackerModule).fileFinishedImporting('modules/now_playing/native/UserActivitySpotify.tsx');
exports.canOpenSpotifyUrl = closure;
exports.attributeInstall = closure2;
exports.openUrl = openUrl_794422;
exports.openTrack = openTrack2;
exports.openArtist = openArtist2;
exports.openAlbum = openAlbum2;
exports.SpotifyPlayButton = SpotifyPlayButton;
exports.SpotifyTrack = value5;
exports.SpotifyArtists = value6;
exports.SpotifyAlbum = value;
function _callSuper_79436(a0, a1, a2) { // fn#79436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:297, offset: 0x01e54467, size: 100 bytes, params: 4, frame: 20
var r0;
var Reflect;
let value = a2;
const value3 = Module00017(a1);
if (_isNativeReflectConstruct_79437()) {
Reflect = global.Reflect;
value = Reflect.construct(value3, value || [], Module00017(a0).constructor);
r0 = value;
} else {
value = value3.apply(a0, value);
r0 = value;
}
return PossibleConstructorReturn(a0, r0);
}
function _isNativeReflectConstruct_79437() { // fn#79437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:428, offset: 0x01e544cb, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_79437_isNativeReflectConstruct = function() {
return !!result;
})();
}
function openUrl_79442(a0, a1, a2) { // fn#79442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:816, offset: 0x01e545c5, size: 137 bytes, params: 4, frame: 20
var r0;
var defaultImport;
var value;
if (a0) {
value = Linking.openURL(SpotifyEndpoints.PLAYER_OPEN(a1, a2, true, 'mobile'));
value = value.catch(function() {
});
r0 = value;
} else {
defaultImport = importDefault(3853) /* metro dependency 3853: Linking */;
r0 = defaultImport.openURL(SpotifyEndpoints.WEB_OPEN(a1, a2, 'mobile'));
}
return r0;
}
function openTrack({sync_id}) { // fn#79444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:950, offset: 0x01e5464e, size: 65 bytes, params: 2, frame: 13
let value = canOpenSpotifyUrl();
value = value.then(function(a0) {
var openUrl_79442Binding = openUrl_79442;
var TRACK = SpotifyResourceTypes.TRACK;
return openUrl_79442Binding(a0, TRACK, sync_id);
});
value.catch(function() {
});
}
function openArtist(a0, a1, a2) { // fn#79447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1056, offset: 0x01e546b5, size: 73 bytes, params: 4, frame: 13
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
let value = canOpenSpotifyUrl();
value = value.then(_fun79448);
value.catch(function() {
});
function _fun79448(a0) { // fn#79448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1109, offset: 0x01e546fe, size: 76 bytes, params: 2, frame: 14
var environment;
const env0_0 = a0;
let value = environment.__proto__;
const getSpotifyMetadataFromActivity = (SpotifyUtilsModule).getSpotifyMetadataFromActivity;
value = Reflect.apply(getSpotifyMetadataFromActivity, value, [env0_0, require]);
return value.then(_fun79449);
function _fun79449({artist_ids}) { // fn#79449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1163, offset: 0x01e5474a, size: 55 bytes, params: 2, frame: 15
const property = artist_ids[importDefault];
const openUrl_79442Binding = openUrl_79442;
const binding = env0_0;
const ARTIST = SpotifyResourceTypes.ARTIST;
return openUrl_79442Binding(binding, ARTIST, property);
}
}
}
function openAlbum(a0, a1) { // fn#79451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1243, offset: 0x01e54781, size: 66 bytes, params: 3, frame: 13
const env0_0 = a0;
const env0_1 = a1;
let value = canOpenSpotifyUrl();
value = value.then(_fun79452);
value.catch(function() {
});
function _fun79452(a0) { // fn#79452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1293, offset: 0x01e547c3, size: 76 bytes, params: 2, frame: 14
var environment;
const env0_0 = a0;
let value = environment.__proto__;
const getSpotifyMetadataFromActivity = (SpotifyUtilsModule).getSpotifyMetadataFromActivity;
value = Reflect.apply(getSpotifyMetadataFromActivity, value, [env0_0, require]);
return value.then(_fun79453);
function _fun79453({album_id}) { // fn#79453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1347, offset: 0x01e5480f, size: 44 bytes, params: 2, frame: 15
const openUrl_79442Binding = openUrl_79442;
const binding = env0_0;
const ALBUM = SpotifyResourceTypes.ALBUM;
return openUrl_79442Binding(binding, ALBUM, album_id);
}
}
}
function _fun79455(a0) { // fn#79455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1410, offset: 0x01e5483b, size: 72 bytes, params: 2, frame: 15
const SpotifyTrack2 = SpotifyTrack;
Inherits(SpotifyTrack2, a0);
return CreateClass(SpotifyTrack2, [{key: 'render', value: value_79458}]);
function SpotifyTrack(a0) { // fn#79456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1422, offset: 0x01e54883, size: 79 bytes, params: 2, frame: 18
let value = copyRestArgs(0, undefined);
env1_4(this, SpotifyTrack);
const _callSuper_79436Binding = _callSuper_79436;
const items2 = [];
arraySpread(items2, value, 0, undefined);
value = _callSuper_79436Binding(this, SpotifyTrack, items2);
value.handleOpenSpotifyTrack = handleOpenSpotifyTrack;
return value;
function handleOpenSpotifyTrack() { // fn#79457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1548, owner: SpotifyTrack.handleOpenSpotifyTrack, offset: 0x01e548d2, size: 34 bytes, params: 1, frame: 11
openTrack(env0_0.props.activity);
}
}
function value_79458() { // fn#79458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1645, offset: 0x01e548f4, size: 95 bytes, params: 1, frame: 15
const props = this.props;
const text = props.text;
const env0_1 = props.onPress;
const LegacyText = (NativeModule).LegacyText;
return (
<LegacyText onPress={onPress_79459} suppressHighlighting>
{text}
</LegacyText>
);
function value_79458OnPress() { // fn#79459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1732, owner: value_79458.onPress, offset: 0x01e54953, size: 41 bytes, params: 1, frame: 10
if (onPress != null) {
onPress();
}
env0_0.handleOpenSpotifyTrack();
}
}
}
function _fun79460(a0) { // fn#79460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1842, offset: 0x01e5497c, size: 99 bytes, params: 2, frame: 16
const SpotifyArtists2 = SpotifyArtists;
Inherits(SpotifyArtists2, a0);
return CreateClass(SpotifyArtists2, [{key: 'renderLink', value: value_79463}, {key: 'render', value: value_79465}]);
function SpotifyArtists(a0) { // fn#79461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1854, offset: 0x01e549df, size: 79 bytes, params: 2, frame: 18
let value = copyRestArgs(0, undefined);
env1_4(this, SpotifyArtists);
const _callSuper_79436Binding = _callSuper_79436;
const items2 = [];
arraySpread(items2, value, 0, undefined);
value = _callSuper_79436Binding(this, SpotifyArtists, items2);
value.handleOpenSpotifyArtist = handleOpenSpotifyArtist;
return value;
function handleOpenSpotifyArtist(a0) { // fn#79462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:1987, owner: SpotifyArtists.handleOpenSpotifyArtist, offset: 0x01e54a2e, size: 44 bytes, params: 2, frame: 15
const props = env0_0.props;
const openArtistBinding = openArtist;
const activity = props.activity;
const userId = props.userId;
openArtistBinding(activity, userId, a0);
}
}
function value_79463(a0, a1, a2) { // fn#79463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2111, offset: 0x01e54a5a, size: 160 bytes, params: 4, frame: 20
var environment;
const env0_1 = a1;
const env0_2 = this.props.onPress;
const value = environment.__proto__;
const LegacyText = (NativeModule).LegacyText;
const LegacyText2 = (NativeModule).LegacyText;
const items2 = [
<LegacyText2 onPress={onPress_79464} suppressHighlighting>
{a0}
</LegacyText2>,
];
items2[1] = a2 ? '' : ', ';
return (
<LegacyText key={a1}>
{items2}
</LegacyText>
);
function value_79463OnPress() { // fn#79464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2223, owner: value_79463.onPress, offset: 0x01e54afa, size: 46 bytes, params: 1, frame: 11
if (onPress != null) {
onPress();
}
env0_0.handleOpenSpotifyArtist(require);
}
}
function value_79465() { // fn#79465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2348, offset: 0x01e54b28, size: 118 bytes, params: 1, frame: 16
const value = this.props.artists.split('; ');
const env0_1 = value.length - 1;
const LegacyText = (NativeModule).LegacyText;
return (
<LegacyText>
{value.map(_fun79466)}
</LegacyText>
);
function _fun79466(a0, a1) { // fn#79466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2455, offset: 0x01e54b9e, size: 38 bytes, params: 3, frame: 15
return env0_0.renderLink(a0, a1, a1 === env0_1);
}
}
}
function _fun79467(a0) { // fn#79467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2517, offset: 0x01e54bc4, size: 72 bytes, params: 2, frame: 15
const SpotifyAlbum2 = SpotifyAlbum;
Inherits(SpotifyAlbum2, a0);
return CreateClass(SpotifyAlbum2, [{key: 'render', value: value_79470}]);
function SpotifyAlbum(a0) { // fn#79468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2529, offset: 0x01e54c0c, size: 79 bytes, params: 2, frame: 18
let value = copyRestArgs(0, undefined);
env1_4(this, SpotifyAlbum);
const _callSuper_79436Binding = _callSuper_79436;
const items2 = [];
arraySpread(items2, value, 0, undefined);
value = _callSuper_79436Binding(this, SpotifyAlbum, items2);
value.handleOpenSpotifyAlbum = handleOpenSpotifyAlbum;
return value;
function handleOpenSpotifyAlbum() { // fn#79469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2655, owner: SpotifyAlbum.handleOpenSpotifyAlbum, offset: 0x01e54c5b, size: 40 bytes, params: 1, frame: 13
const props = env0_0.props;
const openAlbumBinding = openAlbum;
const activity = props.activity;
const userId = props.userId;
openAlbumBinding(activity, userId);
}
}
function value_79470() { // fn#79470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:2769, offset: 0x01e54c83, size: 79 bytes, params: 1, frame: 15
const LegacyText = (NativeModule).LegacyText;
return (
<LegacyText onPress={this.handleOpenSpotifyAlbum} suppressHighlighting>
{this.props.text}
</LegacyText>
);
}
}
function SpotifyPlayButton({activity, style}) { // fn#79471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:3191, offset: 0x01e54cd2, size: 225 bytes, params: 2, frame: 23
const Button = (ButtonNativeModule).Button;
const object2 = {};
const Button2 = (ButtonNativeModule).Button;
const Icon = Button2.Icon;
object2.icon = <Icon source={importDefault(8381) /* metro dependency 8381 */} />;
const intl = (IndexNativeModule).intl;
const formatToPlainString = intl.formatToPlainString;
const LEgD7t = (IndexNativeModule).t.LEgD7t;
object2.text = Reflect.apply(formatToPlainString, intl, [LEgD7t, {platform: activity.name}]);
object2.size = 'sm';
object2.onPress = onPress_79472;
object2.grow = true;
return (
<View style={style}>
<Button {...object2} />
</View>
);
function SpotifyPlayButtonOnPress() { // fn#79472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:3429, owner: SpotifyPlayButton.onPress, offset: 0x01e54db3, size: 69 bytes, params: 1, frame: 13
var environment;
const env0_0 = activity.sync_id;
let value = environment.__proto__;
value = canOpenSpotifyUrl();
value = value.then(_fun79473);
value.catch(function() {
});
function _fun79473(a0) { // fn#79473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10402:3476, offset: 0x01e54df8, size: 132 bytes, params: 2, frame: 16
var environment;
var r0;
var defaultImport;
let value = environment.__proto__.__proto__;
if (a0) {
value = Linking.openURL(SpotifyEndpoints.PLAYER_OPEN(SpotifyResourceTypes.TRACK, sync_id));
value = value.catch(function() {
});
r0 = value;
} else {
attributeInstall();
defaultImport = importDefault(3853) /* metro dependency 3853: Linking */;
r0 = defaultImport.openURL(SpotifyEndpoints.APP_STORE);
}
return r0;
}
}
}
}
global.__d(_fun79435, 10216, [6, 7, 15, 17, 18, 31, 27, 6868, 33, 1582, 507, 3853, 10217, 4578, 8381, 1244, 1305,
2]) /* metro module 10216, dependencies: [6, 7, 15, 17, 18, 31, 27, 6868, 33, 1582, 507, 3853, 10217, 4578, 8381, 1244, 1305, 2] */;