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,QAAQ,2CAA4C,SACjE,aAAa,QAAQ,4CAA6C,SAClE,aAAa,QAAQ,+CAAgD,SACrE,aAAa,QAAQ,4BAA6B,SAClD,aAAa,QAAQ,qCAAsC,SAC3D,aAAa,QAAQ,gCAAiC,SACtD,aAAa,QAAQ,6BAA8B,SACnD,aAAa,QAAQ,4BAA6B,SAClD,aAAa,QAAQ,+BAAgC,SACrD,aAAa,QAAQ,6BAA8B,SACnD,aAAa,QAAQ,oCAAqC,SAC1D,aAAa,QAAQ,+BAAgC","file":"/npm/xbox-message@0.2.1/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/xbox-message@0.2.1/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.XboxMessage = exports.PartContentType = exports.MessageType = exports.ConversationType = exports.PayloadType = exports.ChannelType = void 0;\nconst tiny_typed_emitter_1 = require(\"tiny-typed-emitter\");\nconst prismarine_auth_1 = require(\"prismarine-auth\");\nvar ChannelType;\n(function (ChannelType) {\n    ChannelType[\"System\"] = \"System\";\n    ChannelType[\"GroupMessage\"] = \"GroupMessage\";\n    ChannelType[\"XboxMessage\"] = \"XboxMessage\";\n})(ChannelType || (exports.ChannelType = ChannelType = {}));\nvar PayloadType;\n(function (PayloadType) {\n    PayloadType[\"ContentMessage\"] = \"ContentMessage\";\n    PayloadType[\"SetHorizon\"] = \"SetHorizon\";\n    PayloadType[\"JoinChatChannel\"] = \"JoinChatChannel\";\n})(PayloadType || (exports.PayloadType = PayloadType = {}));\nvar ConversationType;\n(function (ConversationType) {\n    ConversationType[\"Group\"] = \"Group\";\n    ConversationType[\"OneToOne\"] = \"OneToOne\";\n})(ConversationType || (exports.ConversationType = ConversationType = {}));\nvar MessageType;\n(function (MessageType) {\n    MessageType[\"WhoAmI\"] = \"WhoAmI\";\n    MessageType[\"JoinChannel\"] = \"JoinChannel\";\n    MessageType[\"LeaveChannel\"] = \"LeaveChannel\";\n    MessageType[\"UserInfo\"] = \"UserInfo\";\n    MessageType[\"BasicText\"] = \"BasicText\";\n    MessageType[\"Horizons\"] = \"Horizons\";\n    MessageType[\"XboxMessage\"] = \"XboxMessage\";\n    MessageType[\"NoOp\"] = \"NoOp\";\n})(MessageType || (exports.MessageType = MessageType = {}));\nvar PartContentType;\n(function (PartContentType) {\n    PartContentType[\"Text\"] = \"text\";\n    PartContentType[\"Weblink\"] = \"weblink\";\n    PartContentType[\"Image\"] = \"image\";\n    PartContentType[\"FeedItem\"] = \"feedItem\";\n    PartContentType[\"WeblinkMedia\"] = \"weblinkMedia\";\n    PartContentType[\"Voice\"] = \"voice\";\n    PartContentType[\"DirectMention\"] = \"directMention\";\n})(PartContentType || (exports.PartContentType = PartContentType = {}));\nconst rest_1 = require(\"./rest\");\nconst ws_1 = require(\"./ws\");\nconst UserManager_1 = require(\"./classes/managers/UserManager\");\nconst ConversationManager_1 = require(\"./classes/managers/ConversationManager\");\nconst GroupManager_1 = require(\"./classes/managers/GroupManager\");\nclass XboxMessage extends tiny_typed_emitter_1.TypedEmitter {\n    constructor(options) {\n        var _a;\n        super();\n        this.user = null;\n        this.authflow = (_a = options === null || options === void 0 ? void 0 : options.authflow) !== null && _a !== void 0 ? _a : new prismarine_auth_1.Authflow(options === null || options === void 0 ? void 0 : options.cacheIdentifier, options === null || options === void 0 ? void 0 : options.cachePath, { flow: 'sisu', authTitle: prismarine_auth_1.Titles.XboxAppIOS, deviceType: 'iOS' });\n        this.rest = new rest_1.Rest(this);\n        this.users = new UserManager_1.UserManager(this);\n        this.conversations = new ConversationManager_1.ConversationManager(this);\n        this.groups = new GroupManager_1.GroupManager(this);\n        this.ws = new ws_1.WebsocketManager(this);\n    }\n    connect() {\n        return __awaiter(this, void 0, void 0, function* () {\n            const xbl = yield this.authflow.getXboxToken();\n            this.user = yield this.users.fetch(xbl.userXUID);\n            const [groups, conversations] = yield Promise.all([\n                this.rest.getGroups(),\n                this.rest.getConversations(),\n            ]);\n            for (const group of groups.groups) {\n                this.groups.add(group);\n            }\n            for (const conversation of conversations.conversations) {\n                this.conversations.add(conversation);\n            }\n            const userIds = Array.from(new Set(conversations.conversations.flatMap(c => c.participants)));\n            if (userIds.length > 0) {\n                yield this.users.fetchMany(userIds);\n            }\n            yield this.ws.connect();\n        });\n    }\n    destroy() {\n        return __awaiter(this, arguments, void 0, function* (resume = false) {\n            yield this.ws.destroy(resume);\n        });\n    }\n}\nexports.XboxMessage = XboxMessage;\n__exportStar(require(\"./ws\"), exports);\n__exportStar(require(\"./rest\"), exports);\n__exportStar(require(\"./classes/errors/XboxMessageError\"), exports);\n__exportStar(require(\"./classes/managers/UserManager\"), exports);\n__exportStar(require(\"./classes/managers/ConversationManager\"), exports);\n__exportStar(require(\"./classes/managers/GroupManager\"), exports);\n__exportStar(require(\"./classes/managers/MessageManager\"), exports);\n__exportStar(require(\"./classes/MessagePayload\"), exports);\n__exportStar(require(\"./classes/MessageEntity\"), exports);\n__exportStar(require(\"./classes/Message\"), exports);\n__exportStar(require(\"./classes/User\"), exports);\n__exportStar(require(\"./classes/Group\"), exports);\n__exportStar(require(\"./classes/Conversation/BaseConversation\"), exports);\n__exportStar(require(\"./classes/Conversation/GroupConversation\"), exports);\n__exportStar(require(\"./classes/Conversation/OneToOneConversation\"), exports);\n__exportStar(require(\"./classes/Parts/BasePart\"), exports);\n__exportStar(require(\"./classes/Parts/DirectMentionPart\"), exports);\n__exportStar(require(\"./classes/Parts/FeedItemPart\"), exports);\n__exportStar(require(\"./classes/Parts/ImagePart\"), exports);\n__exportStar(require(\"./classes/Parts/TextPart\"), exports);\n__exportStar(require(\"./classes/Parts/UnknownPart\"), exports);\n__exportStar(require(\"./classes/Parts/VoicePart\"), exports);\n__exportStar(require(\"./classes/Parts/WeblinkMediaPart\"), exports);\n__exportStar(require(\"./classes/Parts/WeblinkPart\"), exports);\n"]}