decord/source/lib/uploader/UploadTargets.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

64 lines
2.5 KiB
TypeScript

// Module ID: 5174
// Function ID: 5175
// Name: getCreateAttachmentURL
// Dependencies: [1957, 1074, 5134, 5129, 5175, 5177, 2]
// Exports: getUploadTarget
// Module 5174 (getCreateAttachmentURL)
import items from "items" /* 5129 */;
import getUploadFileSizeSumAll from "getUploadFileSizeSum" /* 5134 */;
import getCreateAttachmentURLDefault from "getCreateAttachmentURL" /* 5175 */;
import getCreateAttachmentURLDefault2 from "getCreateAttachmentURL" /* 5177 */;
import closure_4 from "ensureGuildLoaded" /* 1957 */;
import ME from "ME" /* 1074 */;
require = arg1;
({ Endpoints: c5, MAX_UPLOAD_COUNT: closure_6 } = ME);
class MessageAttachmentUploadTarget {
}
const prototype = MessageAttachmentUploadTarget.prototype;
prototype["getCreateAttachmentURL"] = function getCreateAttachmentURL(arg0) {
return closure_5.MESSAGE_CREATE_ATTACHMENT_UPLOAD(arg0);
};
prototype["getDeleteUploadURL"] = function getDeleteUploadURL(arg0) {
return closure_5.MESSAGE_DELETE_UPLOAD(arg0);
};
prototype["getMaxFileSize"] = function getMaxFileSize(arg0) {
basicChannel = basicChannel.getBasicChannel(arg0);
let guild_id;
if (basicChannel != null) {
guild_id = basicChannel.guild_id;
}
return getUploadFileSizeSumAll.maxFileSize(guild_id);
};
prototype["getMaxAttachmentsCount"] = function getMaxAttachmentsCount() {
return closure_6;
};
prototype["getMaxTotalAttachmentSize"] = function getMaxTotalAttachmentSize() {
return items.getMaxTotalAttachmentSize({ location: "MessageAttachmentUploadTarget" });
};
Object.defineProperty(prototype, "shouldReactNativeCompressUploads", {
get: function shouldReactNativeCompressUploads() {
return true;
},
set: undefined
});
const obj = { MESSAGE_ATTACHMENT: 0, [0]: "MESSAGE_ATTACHMENT", GUILD_PRODUCT_ATTACHMENT: 1, [1]: "GUILD_PRODUCT_ATTACHMENT", GRAVITY_ATTACHMENT: 2, [2]: "GRAVITY_ATTACHMENT" };
const result = require("set").fileFinishedImporting("lib/uploader/UploadTargets.tsx");
export const UploadTargets = obj;
export const getUploadTarget = function getUploadTarget(target) {
if (obj.GUILD_PRODUCT_ATTACHMENT === target) {
const tmp14 = new getCreateAttachmentURLDefault();
return tmp14;
} else if (tmp.GRAVITY_ATTACHMENT === target) {
const tmp8 = new getCreateAttachmentURLDefault2();
return tmp8;
} else {
const MESSAGE_ATTACHMENT = tmp.MESSAGE_ATTACHMENT;
if (typeof MessageAttachmentUploadTarget !== "function") {
HermesBuiltin.throwTypeError();
}
return Object.create(MessageAttachmentUploadTarget.prototype);
}
};