'use strict';

var utils = require('./utils-ByWMmAEg.js');
var quickMessage = require('./quick-message-DIxFV-j6.js');

function setupLanguage(lang) {
    if (utils.instance.language !== lang) {
        utils.instance.changeLanguage(lang);
    }
    utils.configStore.set('language', lang);
    quickMessage.setDayjsLocale(lang);
}
function setupTheme(theme) {
    utils.configStore.set('theme', theme);
}
function setupBusinessId(businessId) {
    utils.configStore.set('businessId', businessId || null);
}
function setupShopId(shopId) {
    utils.configStore.set('shopId', shopId || null);
}
function setupAccessToken(accessToken) {
    utils.configStore.set('accessToken', accessToken || null);
}
function setupIsProduction(isProduction) {
    let value = false;
    if (typeof isProduction === 'boolean') {
        value = isProduction;
    }
    else if (typeof isProduction === 'string') {
        value = isProduction.toLowerCase() === 'true';
    }
    utils.configStore.set('isProduction', value);
}
function setupTimeZone(timeZone) {
    let _timeZone = timeZone;
    if (!timeZone || timeZone === 'null') {
        _timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
    }
    utils.configStore.set('timeZone', _timeZone);
    if (_timeZone) {
        quickMessage.setDayjsTimeZone(_timeZone);
    }
}
function setupTranslationSettings(translationSettings) {
    utils.configStore.set('translationSettings', translationSettings);
}
function setupIsNotConnected(isNotConnected) {
    let value = false;
    if (typeof isNotConnected === 'boolean') {
        value = isNotConnected;
    }
    else if (typeof isNotConnected === 'string') {
        value = isNotConnected.toLowerCase() === 'true';
    }
    utils.configStore.set('isNotConnected', value);
}
function setupIsZwiz(isZwiz) {
    let value = false;
    if (typeof isZwiz === 'boolean') {
        value = isZwiz;
    }
    else if (typeof isZwiz === 'string') {
        value = isZwiz.toLowerCase() === 'true';
    }
    utils.configStore.set('isZwiz', value);
}
function setupConnectionList(connectionList) {
    utils.configStore.set('connectionList', connectionList);
}
function setupMemberList(memberList) {
    utils.configStore.set('memberList', memberList);
}
function setupZrmzApiUrl(zrmzApiUrl) {
    utils.configStore.set('zrmzApiUrl', zrmzApiUrl);
}
function setupOpenChatByFilter(openChatByFilter) {
    utils.configStore.set('openChatByFilter', openChatByFilter);
}
function setupPackage(_package) {
    utils.configStore.set('package', _package);
}
function setupIsShowWarningNotification(isShowWarning) {
    let value = false;
    if (isShowWarning === undefined)
        return;
    if (typeof isShowWarning === 'boolean') {
        value = isShowWarning;
    }
    else if (typeof isShowWarning === 'string') {
        value = isShowWarning.toLowerCase() === 'true';
    }
    utils.configStore.set('isShowWarningNotification', value);
}
function setupZwizSyncMessage(zwizSyncMessage) {
    let value = false;
    if (zwizSyncMessage === undefined)
        return;
    if (typeof zwizSyncMessage === 'boolean') {
        value = zwizSyncMessage;
    }
    else if (typeof zwizSyncMessage === 'string') {
        value = zwizSyncMessage.toLowerCase() === 'true';
    }
    utils.configStore.set('zwizSyncMessage', value);
}

exports.setupAccessToken = setupAccessToken;
exports.setupBusinessId = setupBusinessId;
exports.setupConnectionList = setupConnectionList;
exports.setupIsNotConnected = setupIsNotConnected;
exports.setupIsProduction = setupIsProduction;
exports.setupIsShowWarningNotification = setupIsShowWarningNotification;
exports.setupIsZwiz = setupIsZwiz;
exports.setupLanguage = setupLanguage;
exports.setupMemberList = setupMemberList;
exports.setupOpenChatByFilter = setupOpenChatByFilter;
exports.setupPackage = setupPackage;
exports.setupShopId = setupShopId;
exports.setupTheme = setupTheme;
exports.setupTimeZone = setupTimeZone;
exports.setupTranslationSettings = setupTranslationSettings;
exports.setupZrmzApiUrl = setupZrmzApiUrl;
exports.setupZwizSyncMessage = setupZwizSyncMessage;
