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

122 lines
3.2 KiB
JavaScript

// Metro module 6278 (f6279).
import { MessageType, MESSAGE_TYPE, reflectionMergePartial, UnknownFieldHandler, WireType } from "./Module1307";
import { $callWithNewTarget } from "../_hermes/prelude";
class ThemeAwareAsset$Type extends MessageType {
constructor() {
const r2 = [{
no: 1,
name: "light_url",
kind: "scalar",
T: 9
}, {
no: 2,
name: "dark_url",
kind: "scalar",
T: 9
}, {
no: 3,
name: "light_static_url",
kind: "scalar",
T: 9
}, {
no: 4,
name: "dark_static_url",
kind: "scalar",
T: 9
}];
super("discord_protos.premium_marketing.v1.ThemeAwareAsset", r2);
}
create(a0) {
const r1 = {
lightUrl: "",
darkUrl: "",
lightStaticUrl: "",
darkStaticUrl: ""
};
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 r7 = a3 == null ? this.create() : a3;
const r10 = a0.pos + a1;
while (a0.pos < r10) {
const [r21, r20] = a0.tag();
if (r21 === 1) {
r7.lightUrl = a0.string();
} else if (r21 === 2) {
r7.darkUrl = a0.string();
} else if (r21 === 3) {
r7.lightStaticUrl = a0.string();
} else if (r21 === 4) {
r7.darkStaticUrl = a0.string();
} else {
let readUnknownField = a2.readUnknownField;
if (readUnknownField === "throw") {
throw new globalThis.globalThis.Error(`Unknown field ${r21} (wire type ${r20}) for ${this.typeName}`);
}
const r36 = a0.skip(r20);
if (readUnknownField !== false) {
if (readUnknownField === true) {
readUnknownField = UnknownFieldHandler.onRead;
}
readUnknownField(this.typeName, r7, r21, r20, r36);
}
}
}
return r7;
}
internalBinaryWrite(a0, a1, a2) {
if (a0.lightUrl !== "") {
a1.tag(1, WireType.LengthDelimited).string(a0.lightUrl);
}
if (a0.darkUrl !== "") {
a1.tag(2, WireType.LengthDelimited).string(a0.darkUrl);
}
if (a0.lightStaticUrl !== "") {
a1.tag(3, WireType.LengthDelimited).string(a0.lightStaticUrl);
}
if (a0.darkStaticUrl !== "") {
a1.tag(4, WireType.LengthDelimited).string(a0.darkStaticUrl);
}
let writeUnknownFields = a2.writeUnknownFields;
if (writeUnknownFields !== false) {
if (writeUnknownFields == 1) {
writeUnknownFields = UnknownFieldHandler.onWrite;
}
writeUnknownFields(this.typeName, a0, a1);
}
return a1;
}
}
const prototypeOf = Object.getPrototypeOf(ThemeAwareAsset$Type);
const r32 = [{
no: 1,
name: "light_url",
kind: "scalar",
T: 9
}, {
no: 2,
name: "dark_url",
kind: "scalar",
T: 9
}, {
no: 3,
name: "light_static_url",
kind: "scalar",
T: 9
}, {
no: 4,
name: "dark_static_url",
kind: "scalar",
T: 9
}];
const r36 = Object.create(ThemeAwareAsset$Type.prototype);
const r37 = $callWithNewTarget(prototypeOf, r36, ThemeAwareAsset$Type, "discord_protos.premium_marketing.v1.ThemeAwareAsset", r32);
export const ThemeAwareAsset = r37 instanceof Object ? r37 : r36;