@mxenabled/connect-widget 0.17.3 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -9527,7 +9527,36 @@ const initialState$5 = {
9527
9527
  const configSlice = createSlice({
9528
9528
  name: "config",
9529
9529
  initialState: initialState$5,
9530
- reducers: {},
9530
+ reducers: {
9531
+ stepUpToVerification: (state) => {
9532
+ if (state.mode === AGG_MODE) {
9533
+ state.include_transactions = true;
9534
+ }
9535
+ state.mode = VERIFY_MODE;
9536
+ if (Array.isArray(state.use_cases)) {
9537
+ state.use_cases.push("MONEY_MOVEMENT");
9538
+ } else {
9539
+ state.use_cases = ["MONEY_MOVEMENT"];
9540
+ }
9541
+ },
9542
+ stepUpToAggregation: (state) => {
9543
+ state.include_transactions = true;
9544
+ if (Array.isArray(state.use_cases)) {
9545
+ state.use_cases.push("PFM");
9546
+ } else {
9547
+ state.use_cases = ["PFM"];
9548
+ }
9549
+ },
9550
+ stepUpReset: (state) => {
9551
+ const initialValuesObject = convertInitialValuesToObject(state._initialValues);
9552
+ return {
9553
+ ...state,
9554
+ include_transactions: initialValuesObject?.include_transactions ?? initialState$5.include_transactions,
9555
+ mode: initialValuesObject?.mode ?? initialState$5.mode,
9556
+ use_cases: initialValuesObject?.use_cases ?? initialState$5.use_cases
9557
+ };
9558
+ }
9559
+ },
9531
9560
  extraReducers(builder) {
9532
9561
  builder.addCase(
9533
9562
  ActionTypes$2.LOAD_CONNECT,
@@ -9591,6 +9620,13 @@ const getProductDeterminedMode = (config) => {
9591
9620
  return null;
9592
9621
  }
9593
9622
  };
9623
+ const convertInitialValuesToObject = (initialValues) => {
9624
+ try {
9625
+ return JSON.parse(initialValues);
9626
+ } catch (error) {
9627
+ return {};
9628
+ }
9629
+ };
9594
9630
  const configSlice$1 = configSlice.reducer;
9595
9631
 
9596
9632
  const initialState$4 = {