var _a;
import { createSlice } from '@reduxjs/toolkit';
import { createSelector } from 'reselect';
export var initialState = {
    partnerKey: undefined,
    partnerAddress: undefined,
    communityAddress: undefined,
    partnerMode: false,
    community: undefined,
    mode: 'light',
};
export var swAuthSlice = createSlice({
    name: 'swAuth',
    initialState: initialState,
    reducers: {
        setPartnerKey: function (state, action) {
            state.partnerKey = action.payload;
        },
        setPartnerAddress: function (state, action) {
            state.partnerAddress = action.payload;
        },
        setCommunity: function (state, action) {
            state.community = action.payload;
        },
        setPartnerMode: function (state, action) {
            state.partnerMode = action.payload;
        },
    },
});
export var setPartnerKey = (_a = swAuthSlice.actions, _a.setPartnerKey), setCommunity = _a.setCommunity, setPartnerMode = _a.setPartnerMode;
export var currentPartnerKey = createSelector(function (state) { return state.swAuth.partnerKey; }, function (currentKey) { return currentKey; });
export var currentCommunity = createSelector(function (state) { return state.swAuth.community; }, function (comm) { return comm; });
export var partnerMode = createSelector(function (state) { return state.swAuth.partnerMode; }, function (isPartner) { return isPartner; });
export var swData = createSelector(function (state) {
    return {
        community: state.swAuth.community,
        partnerMode: state.swAuth.partnerMode,
        partnerKey: state.swAuth.partnerKey,
        disableCreateNewUser: state.swUI.disableCreateNewUser,
    };
}, function (data) { return data; });
export default swAuthSlice.reducer;
