import { ActivityLogItem } from '../api/type';
import { BusinessFile, CUSTOM_FIELD_CONFIG_TYPE, OptionValue } from './zdesk.type';
export type ConfigStore = {
    language: 'th' | 'en';
    theme: 'light' | 'dark';
    businessId: string | null;
    shopId: string | null;
    accessToken: string | null;
    isProduction: boolean;
    timeZone: string | null;
    translationSettings: TranslateSettings;
    isNotConnected: boolean;
    isZwiz: boolean;
    connectionList: TConnection[];
    memberList: ChannelMember[];
    zrmzApiUrl: string | null;
    openChatByFilter: OpenChatByFilter | null;
    package: TPackageConfig | null;
    isShowWarningNotification: boolean;
    zwizSyncMessage: boolean;
};
export type ChannelMember = {
    channel_member_role: {
        id: number;
        name: string;
    };
    email_validation_status: {
        id: number;
        status_description: string;
    };
    id: string;
    member_account: {
        first_name?: string | null;
        last_name?: string | null;
        picture_url?: string | null;
        telephone_no?: string | null;
    };
    member_login_data: {
        email: string;
        username?: string;
    };
    channel_member_id: string;
    invitation_expired_at?: Date | string | null;
    is_current_admin?: boolean;
};
export type TranslateSettings = {
    is_auto: boolean;
    target_language: string | null;
    exclude_languages: string[];
};
export type OpenChatByFilter = {
    user_id: string;
    connection_id: string;
    channel: ChannelType;
};
type BaseConnection = {
    id: string;
    name: string;
    token_status: boolean;
    is_locked: boolean;
    created_at: Date;
    created_by: string;
    last_updated_at: Date;
    last_updated_by: string;
};
type LineConnection = BaseConnection & {
    type: 'line';
    channel_id: string;
    picture_url: string | null;
};
type FacebookConnection = BaseConnection & {
    type: 'facebook';
    page_id: string;
};
type InstagramConnection = BaseConnection & {
    type: 'instagram';
    instagram_id: string;
    username: string;
    picture_url: string | null;
};
type ZwizConnection = BaseConnection & {
    type: 'zwiz';
    bot_id: string;
    picture_url: string | null;
    channels: ZwizChannel[];
    platform: 'enterprise' | 'sme';
    zwiz_package_data?: TZwizPackageData;
};
export type TZwizPackage = 'free' | 'premium' | 'advanced' | 'business';
export type TZwizPackageInfo = {
    package_data: TZwizPackageData;
    is_locked: boolean;
};
export type TZwizPackageData = {
    package_name: TZwizPackage;
    remaining_days: number;
    zrmz?: TAppInfo;
    zerva?: TAppInfo;
};
export type TAppInfo = {
    business_id: string | null;
    shop_id: string | null;
};
export type ZwizChannel = {
    channel: ChannelType;
    channel_id: string;
    channel_name: string;
    id: string;
    token_status: boolean;
};
export type TConnection = LineConnection | FacebookConnection | InstagramConnection | ZwizConnection;
export type ChannelType = 'zignal' | 'line' | 'facebook' | 'instagram' | 'tiktok' | 'whatsapp' | 'group';
export type TChatItem = {
    id: string;
    channel: ChannelType;
    connection: ChatConnection;
    type: SenderType;
    user?: ChatUser;
    group?: ChatGroup;
    tags: TTagOrStatusItem[];
    summarize_messages: TTagOrStatusItem[];
    pin: boolean;
    spam: boolean;
    last_message: string | null;
    last_message_at: Date | null;
    last_message_admin_id: string | null;
    last_message_role: string | null;
    language: string | null;
    mark_as_unread: boolean;
    is_unread: boolean;
    created_at: Date;
    updated_at: Date;
};
export type TSearchChatItem = {
    id: string;
    channel: ChannelType;
    connection: ChatConnection;
    type: SenderType;
    user?: ChatUser;
    group?: ChatGroup;
    result_messages: ResultChatMessage[];
    last_message: string | null;
    last_message_at: Date | null;
    created_at: Date;
    updated_at: Date;
};
export type ResultChatMessage = {
    id: string;
    text: string;
    message_at: Date;
    created_at: Date;
    updated_at: Date;
};
export type ChatConnectionType = 'line' | 'facebook' | 'instagram' | 'tiktok' | 'whatsapp' | 'zwiz';
export type ChatConnection = {
    type: ChatConnectionType;
    id: string;
    name: string;
    picture_url?: string | null;
    zwiz_connection?: {
        id: string;
        name: string;
    };
};
export type ChatUser = {
    id: string;
    name: string;
    nickname: string;
    picture_url: string;
    phone_number?: string | string[] | null;
    email?: string | string[] | null;
    note?: string | null;
};
export type ChatGroup = {
    id: string;
    name: string;
    nickname: string;
    picture_url: string;
    phone_number?: string | string[] | null;
    email?: string | string[] | null;
    note?: string | null;
};
export type ChatRead = {
    id: string;
    name: string;
    picture_url: string;
    read_at: Date;
};
export type SenderType = 'user' | 'group' | 'admin' | 'system' | 'connection';
export type TextMessage = {
    id: string;
    messageId: string;
    senderType: SenderType;
    senderId: string;
    type: 'text';
    text: string;
    replyMessage?: ChatMessageItem | null;
    createdAt?: Date;
    updatedAt?: Date;
};
export type ChatMessageReader = {
    id: string;
    name: string;
    picture_url: string;
    read_at: Date;
};
export type MessageElement = {
    title: string;
    buttons: MessageElementButton[];
};
export type MessageElementButton = {
    id: string;
    text: string;
    type: string | 'REPLY';
};
export type MessageAttachment = {
    type: MessageAttachmentType;
    title?: string;
    payload?: MessageAttachmentPayload;
    file?: FileMessage;
};
export type MessageAttachmentType = 'image' | 'video' | 'audio' | 'file' | 'ig_reel' | 'story_mention' | 'template';
export type MessageAttachmentPayload = {
    url?: string;
    template_type?: 'button' | 'generic';
    text?: string;
    elements?: MessageAttachmentPayloadElement[];
    buttons?: MessageAttachmentPayloadButton[];
    generic?: {
        elements?: MessageAttachmentPayloadElement[];
    };
    icon?: string;
    fileType?: string;
    mimeType?: string;
    extension?: string;
};
export type MessageAttachmentPayloadElement = {
    title?: string;
    subtitle?: string;
    image_url?: string;
    buttons?: MessageAttachmentPayloadButton[];
};
export type MessageAttachmentPayloadButton = {
    type?: 'web_url' | 'postback' | 'phone_number';
    title?: string;
    payload?: string;
    url?: string;
};
export type MessageType = 'text' | 'image' | 'video' | 'audio' | 'file' | 'files' | 'location' | 'sticker' | 'summarized_chat' | 'activity_log' | 'zwiz_user_event' | 'attachments' | 'menu_list' | 'button' | 'flex' | 'imagemap' | 'interactive' | 'referral' | 'feed' | 'media_expired' | 'zpt-answered' | 'zpt-unanswered' | 'zpt-debug' | 'zwiz-broadcast' | 'zwiz-broadcast-mm' | 'follow' | 'unfollow' | 'unsupported' | 'qa_button_card' | 'postback';
export type InteractivePayload = {
    type: string;
    header?: {
        type: string;
        image?: {
            link: string;
        };
    };
    body?: {
        text: string;
    };
    footer?: {
        text: string;
    };
    action?: {
        buttons?: InteractiveButton[];
        button?: string;
        sections?: InteractiveSection[];
    };
};
export type InteractiveButton = {
    type: string;
    reply: {
        id: string;
        title: string;
    };
};
export type InteractiveSection = {
    title?: string;
    rows?: InteractiveRow[];
};
export type InteractiveRow = {
    id: string;
    title: string;
    description?: string;
};
export type TReferralAdsContext = {
    ad_title?: string;
    post_id?: string;
    photo_url?: string;
};
export type TReferral = {
    source: string;
    type: string;
    ad_id?: string;
    ads_context_data?: TReferralAdsContext;
};
export type TFeed = {
    post: {
        status_type: string;
        is_published: boolean;
        updated_time: string;
        permalink_url: string;
        promotion_status: string;
        id: string;
    };
    message: string;
    post_id: string;
    comment_id: string;
    created_time: number;
    item: string;
    parent_id: string;
    verb: string;
};
export type ChatMessageItem = {
    id?: string;
    message_id?: string;
    sender: ChatSender;
    created_at: Date;
    updated_at: Date;
    message_at: Date;
    text: string;
    type?: MessageType;
    event_type?: MessageType;
    stickerId?: string;
    reply_message?: ChatMessageItem | null;
    attachments?: MessageAttachment[];
    template?: ChatMessageTemplate;
    elements?: MessageElement;
    altText?: string;
    baseUrl?: string;
    baseSize?: {
        width: number;
        height: number;
    };
    contents?: any;
    error_data?: MessageError | string;
    action?: 'add' | 'remove' | 'change';
    item?: ActivityLogItem;
    from?: ActivityLogItem;
    to?: ActivityLogItem;
    translatedText?: string;
    isSending?: boolean;
    menu_list?: QuickMessageTemplateMenuListItem[];
    buttons?: QuickMessageTemplateButton[];
    event_name?: BillingItemEvent;
    value?: number | string;
    currency?: string;
    file?: FileMessage;
    files?: FileMessage[];
    isTranslateFromInput?: boolean;
    interactive?: InteractivePayload;
    sticker?: ChatSticker;
    referral?: TReferral;
    feed?: TFeed;
    location?: TLocation;
    mention?: TMention;
    follow?: {
        isUnblocked: boolean;
    };
    postback?: {
        data: string;
    };
};
export type TMention = {
    mentionees: TMentionee[];
};
export type TMentionee = {
    index: number;
    length: number;
    type: TMentioneeType;
    user_id?: string;
};
export type TMentioneeType = 'all' | 'connection' | 'user';
export type TLocation = {
    address: string;
    latitude: number;
    longitude: number;
};
export type FileMessage = {
    id: string;
    name: string;
    url: string;
    mime_type: string;
    created_at?: Date;
    status?: 'uploading' | 'uploaded' | 'upload_failed';
};
export type ChatSticker = {
    url: string;
};
export type SearchChatMessageItem = {
    id: string;
    text: string;
    message_at: Date;
    created_at: Date;
    updated_at: Date;
};
export type MessageError = {
    message?: string;
    error?: {
        message?: string;
    } | string;
    errorMessage?: string;
};
export type ChatSender = {
    id?: string;
    type: SenderType;
    name?: string;
    nickname?: string;
    picture_url?: string | null;
    display_name?: string;
    display_img?: string;
};
export type ReplyMessageItem = {
    type?: MessageType;
    event_type?: MessageType;
    text?: string;
    url?: string;
    filename?: string;
    mimeType?: string;
    replyMessageId?: string;
    replyMessage?: ChatMessageItem | null;
    attachments?: MessageAttachment[];
    buttons?: QuickMessageTemplateButton[];
    menu_list?: QuickMessageTemplateMenuListItem[];
    packageId?: string;
    stickerId?: string;
    fileId?: string;
    sticker?: ChatSticker;
    mention?: TMention;
    follow?: {
        isUnblocked: boolean;
    };
};
export type ChatMessageTemplate = {
    type?: 'carousel' | 'image_carousel' | 'buttons';
    altText?: string;
    text?: string;
    thumbnailImageUrl?: string;
    columns?: ChatMessageTemplateColumn[];
    actions?: ChatMessageTemplateAction[];
};
export type ChatMessageTemplateColumn = {
    thumbnailImageUrl?: string;
    title?: string;
    text?: string;
    actions?: ChatMessageTemplateAction[];
};
export type ChatMessageTemplateAction = {
    type?: string;
    label?: QuickMessageTemplateButtonAction;
    text?: string;
    uri?: string;
    data?: string;
};
export type MenuListItem = {
    iconName?: string;
    subIconName?: string;
    label: string;
    value: string;
    onClick?: () => void;
};
export type QuickMessageLibraryFile = {
    id: string;
    file_type: 'image' | 'file';
    name: string;
    url?: string;
    size: number;
    file?: FileMessage;
    created_at: string;
    created_by: string;
    last_updated_at?: string;
    last_updated_by?: string;
    isSelected?: boolean;
};
export type TTagOrStatusItem = {
    id?: string;
    sequence?: number;
    name: string;
    color?: string;
    iconName?: string;
    subIconName?: string;
    label?: string;
    value?: string;
};
export type ItemType = TTagOrStatusItem & {
    disabled?: boolean;
};
export type UserAddress = {
    name?: string;
    phone_number?: string;
    address: string;
    district: string;
    sub_district: string;
    subdistrict?: string;
    province: string;
    zip_code: string;
};
export type UserSession = {
    [key: string]: string;
};
export type UserItem = {
    id: string;
    channel: ChannelType;
    user_id?: string;
    picture_url?: string | null;
    name: string;
    nickname: string;
    email?: string | string[] | null;
    phone_number?: string | string[] | null;
    address?: UserAddress | null;
    gender?: string | null;
    locale: string;
    note?: string | null;
    status?: TTagOrStatusItem | null;
    tags: TTagOrStatusItem[];
    last_active_at: Date;
    created_at: Date;
    created_by: string;
    last_updated_at: Date;
    last_updated_by: string;
    summarized_message?: UserSummarizedMessage | null;
    match_users?: MatchUserItem[];
    zignal_user_id?: string;
    associated_users?: AssociatedUser[];
    context?: string;
    summarize_messages: TTagOrStatusItem[];
    session?: UserSession | null;
};
export type UserSummarizedMessage = {
    text: string;
    created_at: Date;
};
export type MatchUserItem = {
    id: string;
    confidence: number;
    reason: string | null;
    channel: ChannelType;
    user: UserItem;
};
export type AssociatedUser = {
    id: string;
    session_id: string;
    channel: ChannelType;
    picture_url: string | null;
    name: string;
    nickname: string;
    connection: ChatConnection;
};
export type MatchUser = {
    id: string;
    name: string;
    picture_url: string | null;
    email: string | null;
    phone_number: string | null;
    address: string | null;
    gender: string | null;
    locale: string;
};
export type QuickMessageTemplateContentType = 'text' | 'button' | 'image' | 'menu_list' | 'video' | 'file';
export type QuickMessageTemplateButtonAction = 'text' | 'url' | 'tel';
export type QuickMessageTemplateButton = {
    id: string;
    action_type: QuickMessageTemplateButtonAction;
    text?: string;
    action?: string;
    sequence?: number;
};
export type QuickMessageTemplateMenuListItem = {
    id: string;
    file_url?: string;
    file?: FileMessage;
    file_id?: string;
    title?: string;
    description?: string;
    buttons: QuickMessageTemplateButton[];
    sequence?: number;
};
export type QuickMessageTemplateContent = {
    id: string;
    type: QuickMessageTemplateContentType;
    text?: string;
    buttons: QuickMessageTemplateButton[];
    file_url?: string;
    file?: FileMessage;
    menu_list: QuickMessageTemplateMenuListItem[];
    sequence?: number;
};
export type QuickMessageTemplate = {
    id: string;
    title: string;
    contents: QuickMessageTemplateContent[];
    created_at?: string | Date | null;
    created_by?: string | null;
    last_updated_at: string | Date;
    last_updated_by: string | null;
    isExpanded?: boolean;
};
export type BillingItemEvent = 'ViewContent' | 'AddToCart' | 'Purchase' | 'LeadSubmitted';
export type BillingItem = {
    id?: string;
    event_name: BillingItemEvent;
    value?: number | string;
    currency?: string;
    is_create_purchase_order?: boolean;
};
export type TFileItem = {
    type: string;
    mime?: string;
    extension?: string;
    icon?: string;
};
export type TValueType = string | string[] | UserAddress | QuickMessageLibraryFile[] | OptionValue[] | BusinessFile[];
export type TDialogType = 'input' | 'textarea' | 'full_address' | 'order_address' | CUSTOM_FIELD_CONFIG_TYPE;
export type ShowDialog = {
    open: boolean;
    type?: TDialogType;
    label?: string;
    field?: string;
    value?: TValueType;
    required?: boolean;
    options?: OptionValue[];
    ticketId?: number;
    limit?: number;
};
export declare enum EnumPackage {
    FREE = "free",
    LITE = "lite",
    PLUS = "plus",
    ENTERPRISE = "enterprise"
}
export type TPackageConfig = {
    name?: EnumPackage;
    level?: number;
    remainingDays?: number;
    maxChannel: number;
    maxAdmin?: number;
    maxStorage: number | null;
    maxTemplateMessage: number;
    maxChatHistory: number | null;
};
export type TEventChatSocket = {
    sessionId: string;
    from?: string;
} & Partial<TChatItem>;
export {};
