Files
discord-decomp/_bundle/Module6274.js
T
2026-11-01 12:12:55 +02:00

222 lines
5.9 KiB
JavaScript

// Metro module 6274 (f6275).
import { MessageType, MESSAGE_TYPE, reflectionMergePartial, UnknownFieldHandler, WireType } from "./Module1307";
import { CTAButton } from "./Module6270";
import { DismissibleContent } from "./Module1358";
import { HelpArticle } from "./Module6269";
import { LocalizedString } from "./Module6268";
import { $callWithNewTarget } from "../_hermes/prelude";
function $mk78180($env) {
return () => CTAButton;
}
function $mk78181($env) {
return () => ["discord_protos.discord_users.v1.DismissibleContent", DismissibleContent];
}
function $mk78182($env) {
return () => HelpArticle;
}
function $mk78183($env) {
return () => LocalizedString;
}
function $mk78184($env) {
return () => LocalizedString;
}
let c3990_3;
let env3990;
const r3 = env3990 = {};
class MobileBottomSheet$Type extends MessageType {
constructor() {
const r1 = env3990;
const r2 = [{
no: 1,
name: "asset_url",
kind: "scalar",
T: 9
}, {
no: 2,
name: "header",
kind: "scalar",
T: 9
}, {
no: 3,
name: "body",
kind: "scalar",
T: 9
}, {
no: 4,
name: "help_article_id",
kind: "scalar",
T: 9
}, {
no: 5,
name: "button",
kind: "message",
T: $mk78180(r1)
}, {
no: 6,
name: "dismissible_content",
kind: "enum",
T: $mk78181(r1)
}, {
no: 7,
name: "help_article",
kind: "message",
T: $mk78182(r1)
}, {
no: 8,
name: "header_localized",
kind: "message",
T: $mk78183(r1)
}, {
no: 9,
name: "body_localized",
kind: "message",
T: $mk78184(r1)
}];
super("discord_protos.premium_marketing.v1.MobileBottomSheet", r2);
}
create(a0) {
const r1 = {
assetUrl: "",
header: "",
body: "",
helpArticleId: "",
dismissibleContent: 0
};
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
enumerable: false,
value: this
});
if (a0 !== void 0) {
reflectionMergePartial(this, r1, a0);
}
return r1;
}
internalBinaryRead(a0, a1, a2, a3) {
const r12 = a3 == null ? this.create() : a3;
const r15 = a0.pos + a1;
while (a0.pos < r15) {
const [r26, r25] = a0.tag();
if (r26 === 1) {
r12.assetUrl = a0.string();
} else if (r26 === 2) {
r12.header = a0.string();
} else if (r26 === 3) {
r12.body = a0.string();
} else if (r26 === 4) {
r12.helpArticleId = a0.string();
} else if (r26 === 5) {
r12.button = CTAButton.internalBinaryRead(a0, a0.uint32(), a2, r12.button);
} else if (r26 === 6) {
r12.dismissibleContent = a0.int32();
} else if (r26 === 7) {
r12.helpArticle = HelpArticle.internalBinaryRead(a0, a0.uint32(), a2, r12.helpArticle);
} else if (r26 === 8) {
r12.headerLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r12.headerLocalized);
} else if (r26 === 9) {
r12.bodyLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r12.bodyLocalized);
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r26} (wire type ${r25}) for ${this.typeName}`);
}
const r41 = a0.skip(r25);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r12, r26, r25, r41);
}
}
}
return r12;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.assetUrl !== "") {
a1.tag(1, WireType.LengthDelimited).string(a0.assetUrl);
}
if (a0.header !== "") {
a1.tag(2, WireType.LengthDelimited).string(a0.header);
}
if (a0.body !== "") {
a1.tag(3, WireType.LengthDelimited).string(a0.body);
}
if (a0.helpArticleId !== "") {
a1.tag(4, WireType.LengthDelimited).string(a0.helpArticleId);
}
if (a0.button) {
CTAButton.internalBinaryWrite(a0.button, a1.tag(5, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.dismissibleContent !== 0) {
a1.tag(6, WireType.Varint).int32(a0.dismissibleContent);
}
if (a0.helpArticle) {
HelpArticle.internalBinaryWrite(a0.helpArticle, a1.tag(7, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.headerLocalized) {
LocalizedString.internalBinaryWrite(a0.headerLocalized, a1.tag(8, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.bodyLocalized) {
LocalizedString.internalBinaryWrite(a0.bodyLocalized, a1.tag(9, WireType.LengthDelimited).fork(), a2).join();
}
let writeUnknownFields = a2.writeUnknownFields;
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
c3990_3 = MobileBottomSheet$Type;
const prototypeOf = Object.getPrototypeOf(MobileBottomSheet$Type);
const r33 = [{
no: 1,
name: "asset_url",
kind: "scalar",
T: 9
}, {
no: 2,
name: "header",
kind: "scalar",
T: 9
}, {
no: 3,
name: "body",
kind: "scalar",
T: 9
}, {
no: 4,
name: "help_article_id",
kind: "scalar",
T: 9
}, {
no: 5,
name: "button",
kind: "message",
T: $mk78180(r3)
}, {
no: 6,
name: "dismissible_content",
kind: "enum",
T: $mk78181(r3)
}, {
no: 7,
name: "help_article",
kind: "message",
T: $mk78182(r3)
}, {
no: 8,
name: "header_localized",
kind: "message",
T: $mk78183(r3)
}, {
no: 9,
name: "body_localized",
kind: "message",
T: $mk78184(r3)
}];
const r46 = Object.create(MobileBottomSheet$Type.prototype);
const r47 = $callWithNewTarget(prototypeOf, r46, MobileBottomSheet$Type, "discord_protos.premium_marketing.v1.MobileBottomSheet", r33);
export const MobileBottomSheet = r47 instanceof Object ? r47 : r46;