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

205 lines
5.6 KiB
JavaScript

// Metro module 6285 (f6286).
import { MessageType, MESSAGE_TYPE, reflectionMergePartial, UnknownFieldHandler, WireType } from "./Module1307";
import { ThemeAwareAsset } from "./Module6278";
import { CTAButton } from "./Module6270";
import { HelpArticle } from "./Module6269";
import { LocalizedString } from "./Module6268";
import { $callWithNewTarget } from "../_hermes/prelude";
function $mk78219($env) {
return () => ThemeAwareAsset;
}
function $mk78220($env) {
return () => CTAButton;
}
function $mk78221($env) {
return () => HelpArticle;
}
function $mk78222($env) {
return () => LocalizedString;
}
function $mk78223($env) {
return () => LocalizedString;
}
let c4001_3;
let env4001;
const r3 = env4001 = {};
class PremiumTabPopover$Type extends MessageType {
constructor() {
const r1 = env4001;
const r2 = [{
no: 1,
name: "header",
kind: "scalar",
T: 9
}, {
no: 2,
name: "body",
kind: "scalar",
T: 9
}, {
no: 3,
name: "asset",
kind: "message",
T: $mk78219(r1)
}, {
no: 4,
name: "button",
kind: "message",
T: $mk78220(r1)
}, {
no: 5,
name: "help_article_id",
kind: "scalar",
T: 9
}, {
no: 6,
name: "help_article",
kind: "message",
T: $mk78221(r1)
}, {
no: 7,
name: "header_localized",
kind: "message",
T: $mk78222(r1)
}, {
no: 8,
name: "body_localized",
kind: "message",
T: $mk78223(r1)
}];
super("discord_protos.premium_marketing.v1.PremiumTabPopover", r2);
}
create(a0) {
const r1 = {
header: "",
body: "",
helpArticleId: ""
};
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 r11 = a3 == null ? this.create() : a3;
const r14 = a0.pos + a1;
while (a0.pos < r14) {
const [r25, r24] = a0.tag();
if (r25 === 1) {
r11.header = a0.string();
} else if (r25 === 2) {
r11.body = a0.string();
} else if (r25 === 3) {
r11.asset = ThemeAwareAsset.internalBinaryRead(a0, a0.uint32(), a2, r11.asset);
} else if (r25 === 4) {
r11.button = CTAButton.internalBinaryRead(a0, a0.uint32(), a2, r11.button);
} else if (r25 === 5) {
r11.helpArticleId = a0.string();
} else if (r25 === 6) {
r11.helpArticle = HelpArticle.internalBinaryRead(a0, a0.uint32(), a2, r11.helpArticle);
} else if (r25 === 7) {
r11.headerLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r11.headerLocalized);
} else if (r25 === 8) {
r11.bodyLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r11.bodyLocalized);
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r25} (wire type ${r24}) for ${this.typeName}`);
}
const r40 = a0.skip(r24);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r11, r25, r24, r40);
}
}
}
return r11;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.header !== "") {
a1.tag(1, WireType.LengthDelimited).string(a0.header);
}
if (a0.body !== "") {
a1.tag(2, WireType.LengthDelimited).string(a0.body);
}
if (a0.asset) {
ThemeAwareAsset.internalBinaryWrite(a0.asset, a1.tag(3, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.button) {
CTAButton.internalBinaryWrite(a0.button, a1.tag(4, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.helpArticleId !== "") {
a1.tag(5, WireType.LengthDelimited).string(a0.helpArticleId);
}
if (a0.helpArticle) {
HelpArticle.internalBinaryWrite(a0.helpArticle, a1.tag(6, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.headerLocalized) {
LocalizedString.internalBinaryWrite(a0.headerLocalized, a1.tag(7, WireType.LengthDelimited).fork(), a2).join();
}
if (a0.bodyLocalized) {
LocalizedString.internalBinaryWrite(a0.bodyLocalized, a1.tag(8, 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;
}
}
c4001_3 = PremiumTabPopover$Type;
const prototypeOf = Object.getPrototypeOf(PremiumTabPopover$Type);
const r33 = [{
no: 1,
name: "header",
kind: "scalar",
T: 9
}, {
no: 2,
name: "body",
kind: "scalar",
T: 9
}, {
no: 3,
name: "asset",
kind: "message",
T: $mk78219(r3)
}, {
no: 4,
name: "button",
kind: "message",
T: $mk78220(r3)
}, {
no: 5,
name: "help_article_id",
kind: "scalar",
T: 9
}, {
no: 6,
name: "help_article",
kind: "message",
T: $mk78221(r3)
}, {
no: 7,
name: "header_localized",
kind: "message",
T: $mk78222(r3)
}, {
no: 8,
name: "body_localized",
kind: "message",
T: $mk78223(r3)
}];
const r45 = Object.create(PremiumTabPopover$Type.prototype);
const r46 = $callWithNewTarget(prototypeOf, r45, PremiumTabPopover$Type, "discord_protos.premium_marketing.v1.PremiumTabPopover", r33);
export const PremiumTabPopover = r46 instanceof Object ? r46 : r45;