"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamNotifications = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const stream_notification_1 = require("../components/stream-notification");
const pin_notification_1 = require("../components/stream-notification/pin-notification");
const teleport_notification_1 = require("../components/stream-notification/teleport-notification");
exports.StreamNotifications = {
    pinnedComment: (params) => {
        stream_notification_1.streamNotification.show({
            id: "pinned-comment",
            render: (isExiting, onDismiss) => {
                return react_1.default.createElement(pin_notification_1.PinnedCommentNotification, {
                    pinnedComment: params.pinnedComment,
                    onDismiss: () => onDismiss("user"),
                    onUnpin: () => {
                        params.onUnpin?.();
                        onDismiss("user");
                    },
                });
            },
            duration: 0, // manually dismissed or auto-dismissed by TTL
            onDismiss: params.onDismiss,
        });
    },
    pinnedCommentDismiss: () => {
        stream_notification_1.streamNotification.hide("pinned-comment");
    },
    teleport: (params) => {
        stream_notification_1.streamNotification.show({
            id: "teleport",
            render: (isExiting, onDismiss, startTime) => {
                return react_1.default.createElement(teleport_notification_1.TeleportNotification, {
                    targetHandle: params.targetHandle,
                    countdown: params.countdown,
                    canCancel: params.canCancel,
                    startTime: startTime,
                    onDismiss: onDismiss,
                });
            },
            duration: 0, // manually dismissed by countdown or user cancel
            variant: "warning",
            onDismiss: params.onDismiss,
        });
    },
    teleportCancelled: () => {
        stream_notification_1.streamNotification.hide("teleport");
    },
    teleportNow: (targetHandle) => {
        stream_notification_1.streamNotification.show({
            id: "teleport-now",
            message: `Teleporting to @${targetHandle}...`,
            duration: 2,
            variant: "info",
        });
    },
    activate: (message) => {
        stream_notification_1.streamNotification.show({
            id: "stream-activate",
            message: message,
            duration: 3,
            variant: "info",
        });
    },
};
//# sourceMappingURL=stream-notifications.js.map