import { ClipboardPasteTarget, Model, Style, UID, Zone } from "../../src";
import { AutofillStore } from "../../src/components/autofill/autofill_store";
import { getClipboardDataPositions } from "../../src/helpers/clipboard/clipboard_helpers";
import { toCartesian, toXC } from "../../src/helpers/coordinates";
import { deepEquals } from "../../src/helpers/misc";
import { toZone } from "../../src/helpers/zones";
import { clipboardHandlersRegistries } from "../../src/registries/clipboardHandlersRegistries";
import { ClipboardStore } from "../../src/stores/clipboard_store";
import {
  addColumns,
  addRows,
  deleteCells,
  deleteColumns,
  deleteRows,
  getStyle,
  insertCells,
  merge,
  moveColumns,
  moveRows,
  setCellContent,
  setFormatting,
  setSelection,
  unMerge,
} from "../test_helpers";
import { target } from "../test_helpers/helpers";
import { makeStoreWithModel } from "../test_helpers/stores";

const ALIGN_STYLE: Style = { align: "left" };
const FCOLOR_STYLE = { fillColor: "#abcdef" };
const FCOLOR_STYLE2 = { fillColor: "#a1b2c3" };
const VALIGN_STYLE: Style = { verticalAlign: "top" };
const BOLD_STYLE = { bold: true };
const ITALIC_STYLE = { italic: true };
const FONTSIZE_STYLE = { fontSize: 20 };
const TCOLOR_STYLE = { textColor: "#123456" };
const ROTATION_STYLE = { rotation: 90 };
const MULTI_STYLE = { fillColor: "#abcdef", fontSize: 13, italic: true };
const INVERSE_MULTI_STYLE = { fillColor: "", fontSize: 10, italic: false };

const TEST_STYLES = [
  ALIGN_STYLE,
  FCOLOR_STYLE,
  VALIGN_STYLE,
  BOLD_STYLE,
  ITALIC_STYLE,
  FONTSIZE_STYLE,
  TCOLOR_STYLE,
  ROTATION_STYLE,
  MULTI_STYLE,
];

function getCellStyle(model: Model, xc: string, sheetId: UID = model.getters.getActiveSheetId()) {
  return model.getters.getCellStyle({ sheetId, ...toCartesian(xc) });
}

function setStyle(
  model: Model,
  target: Zone[],
  style: Style | undefined,
  sheetId = model.getters.getActiveSheetId()
) {
  return model.dispatch("SET_FORMATTING", {
    sheetId,
    target,
    style,
  });
}

describe("Default Plugin: Style", () => {
  let model: Model;
  let sheetId: UID;
  beforeEach(() => {
    model = new Model({
      sheets: [{ id: "sh1", colNumber: 25, rowNumber: 20 }],
    });
    const { container } = makeStoreWithModel(model, AutofillStore);
    container.get(ClipboardStore);
    sheetId = model.getters.getActiveSheetId();
  });

  const COL = (col) => {
    return { left: col, right: col, top: 0, bottom: 20 };
  };
  const ROW = (row) => {
    return { left: 0, right: 25, top: row, bottom: row };
  };
  const SHEET = { left: 0, right: 25, top: 0, bottom: 20 };

  describe.each(TEST_STYLES)("Style : %s", (style) => {
    test("Can set style on sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], style);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(style);
      expect(getCellStyle(model, "D5")).toEqual(style);
    });

    test("Can set style on row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 0, 2)], style);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(style);
      expect(getCellStyle(model, "D2")).toEqual(style);
      expect(getCellStyle(model, "D5")).toEqual({});
    });

    test("Can set style on col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 0, 2)], style);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(style);
      expect(getCellStyle(model, "B5")).toEqual(style);
      expect(getCellStyle(model, "D5")).toEqual({});
    });
  });

  describe.each([
    [ALIGN_STYLE, BOLD_STYLE],
    [ITALIC_STYLE, ITALIC_STYLE],
    [FCOLOR_STYLE, FCOLOR_STYLE2],
    [MULTI_STYLE, ITALIC_STYLE],
    [FONTSIZE_STYLE, MULTI_STYLE],
  ] as [Style, Style][])("Defaults Combination", (style1, style2) => {
    test("Row after sheet", () => {
      const sheetStyle = style1;
      const rowStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle);
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "A2")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Row after col", () => {
      const colStyle = style1;
      const rowStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle);
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual(colStyle);
      expect(getCellStyle(model, "A2")).toEqual(rowStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Row after row", () => {
      const rowStyle = style1;
      const rowStyle2 = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle);
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle2);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual({});
      expect(getCellStyle(model, "A2")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Row after cell", () => {
      const rowStyle = style2;
      const cellStyle = style1;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [toZone("B2")], cellStyle);

      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle);
      expect(model.getters.getCells(sheetId).length).toBe(
        deepEquals(intersectionStyle, rowStyle) ? 0 : 1
      );

      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual({});
      expect(getCellStyle(model, "A2")).toEqual(rowStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Col after sheet", () => {
      const sheetStyle = style1;
      const colStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle);
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B1")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "A2")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Col after col", () => {
      const colStyle = style1;
      const colStyle2 = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle);
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle2);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Col after row", () => {
      const rowStyle = style1;
      const colStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle);
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle);

      // Check if all keys in rowStyle are the same as the one in intersectionStyle
      expect(model.getters.getCells(sheetId).length).toBe(
        deepEquals(intersectionStyle, { ...intersectionStyle, ...rowStyle }) ? 0 : 1
      );
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual(colStyle);
      expect(getCellStyle(model, "A2")).toEqual(rowStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Col after cell", () => {
      const colStyle = style2;
      const cellStyle = style1;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [toZone("B2")], cellStyle);
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle);

      expect(model.getters.getCells(sheetId).length).toBe(
        !deepEquals(colStyle, intersectionStyle) ? 1 : 0
      );
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual(colStyle);
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Sheet after sheet", () => {
      const sheetStyle = style1;
      const sheetStyle2 = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle);
      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle2);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "B1")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "A2")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Sheet after col", () => {
      const colStyle = style1;
      const sheetStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle);
      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B1")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "A2")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Sheet after row", () => {
      const rowStyle = style1;
      const sheetStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle);
      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle);

      expect(model.getters.getCells(sheetId).length).toBe(0);
      expect(getCellStyle(model, "A1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "A2")).toEqual(intersectionStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Sheet after cell", () => {
      const cellStyle = style1;
      const sheetStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [toZone("B2")], cellStyle);
      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle);

      expect(model.getters.getCells(sheetId).length).toBe(
        !deepEquals(sheetStyle, intersectionStyle) ? 1 : 0
      );
      expect(getCellStyle(model, "A1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "A2")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Cell after sheet", () => {
      const sheetStyle = style1;
      const cellStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getSheetZone(sheetId)], sheetStyle);
      setStyle(model, [toZone("B2")], cellStyle);

      expect(model.getters.getCells(sheetId).length).toBe(
        deepEquals(sheetStyle, intersectionStyle) ? 0 : 1
      );
      expect(getCellStyle(model, "A1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B1")).toEqual(sheetStyle);
      expect(getCellStyle(model, "A2")).toEqual(sheetStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Cell after col", () => {
      const colStyle = style1;
      const cellStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], colStyle);
      setStyle(model, [toZone("B2")], cellStyle);

      expect(model.getters.getCells(sheetId).length).toBe(
        deepEquals(colStyle, intersectionStyle) ? 0 : 1
      );
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual(colStyle);
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });

    test("Cell after row", () => {
      const rowStyle = style1;
      const cellStyle = style2;
      const intersectionStyle = { ...style1, ...style2 };

      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], rowStyle);
      setStyle(model, [toZone("B2")], cellStyle);

      expect(model.getters.getCells(sheetId).length).toBe(
        deepEquals(rowStyle, intersectionStyle) ? 0 : 1
      );
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "B1")).toEqual({});
      expect(getCellStyle(model, "A2")).toEqual(rowStyle);
      expect(getCellStyle(model, "B2")).toEqual(intersectionStyle);
    });
  });

  test("Editing default on a new sheet", () => {
    const zone = { left: 0, right: 0, top: 0, bottom: 14 };
    setStyle(model, [zone], BOLD_STYLE);
    expect(getCellStyle(model, "A1")).toEqual(BOLD_STYLE);
    expect(getCellStyle(model, "A15")).toEqual(BOLD_STYLE);
    expect(getCellStyle(model, "A16")).toEqual({ bold: false });
    expect(getCellStyle(model, "A20")).toEqual({ bold: false });
  });

  describe("Sheet Manipulation: Add Column", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      addColumns(model, "after", "A", 1);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      addColumns(model, "after", "A", 1);
      expect(getCellStyle(model, "B2")).toEqual({});
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);

      addColumns(model, "after", "C", 1);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "D2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      addColumns(model, "after", "A", 1);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });
  });

  describe("Sheet Manipulation: Remove Column", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      deleteColumns(model, ["A"]);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      deleteColumns(model, ["A"]);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual({});
      expect(model.getters.getCells(sheetId).length).toBe(0);

      deleteColumns(model, ["A"]);
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(getCellStyle(model, "B2")).toEqual({});
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      deleteColumns(model, ["A"]);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });
  });

  describe("Sheet Manipulation: Move Column", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      moveColumns(model, "D", ["A"], "after");
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "D2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      moveColumns(model, "D", ["A"], "after");
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual({});
      expect(getCellStyle(model, "D2")).toEqual({});
      expect(model.getters.getCells(sheetId).length).toBe(0);

      moveColumns(model, "D", ["A"], "after");
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(getCellStyle(model, "B2")).toEqual({});
      expect(getCellStyle(model, "D2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      moveColumns(model, "D", ["A"], "after");
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "D2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });
  });

  describe("Sheet Manipulation: Add Row", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      addRows(model, "after", 0, 1);
      expect(getCellStyle(model, "B2")).toEqual({});
      expect(getCellStyle(model, "B3")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);

      addRows(model, "after", 2, 1);
      expect(getCellStyle(model, "B3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B4")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      addRows(model, "after", 0, 1);
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      addRows(model, "after", 0, 1);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });
  });

  describe("Sheet Manipulation: Remove Row", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      deleteRows(model, [0]);
      expect(getCellStyle(model, "A1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(model.getters.getCells(sheetId).length).toBe(0);

      deleteRows(model, [0]);
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);
      deleteRows(model, [0]);
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);
      deleteRows(model, [0]);
      expect(getCellStyle(model, "A1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
    });
  });

  describe("Sheet Manipulation: Move Row", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      moveRows(model, 3, [0], "after");
      expect(getCellStyle(model, "A1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(getCellStyle(model, "A4")).toEqual({});
      expect(model.getters.getCells(sheetId).length).toBe(0);

      moveRows(model, 3, [0], "after");
      expect(getCellStyle(model, "A1")).toEqual({});
      expect(getCellStyle(model, "A2")).toEqual({});
      expect(getCellStyle(model, "A4")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      moveRows(model, 3, [0], "after");
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B4")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(1);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      moveRows(model, 3, [0], "after");
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "D2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(0);
    });
  });

  describe("Sheet Manipulation: Delete Cell Up", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      deleteCells(model, "B1", "up");
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      deleteCells(model, "B1", "up");
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B20")).toEqual(INVERSE_MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(1);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      deleteCells(model, "B1", "up");
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B20")).toEqual(INVERSE_MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(1);
    });
  });

  describe("Sheet Manipulation: Delete Cell Left", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      deleteCells(model, "A2", "left");
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "Y2")).toEqual(INVERSE_MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(1);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      deleteCells(model, "A2", "left");
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(1);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      deleteCells(model, "A2", "left");
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "Y2")).toEqual(INVERSE_MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(1);
    });
  });

  describe("Sheet Manipulation: Insert Cell Down", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      insertCells(model, "B2", "down");
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "B3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      insertCells(model, "B2", "down");
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "B3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B20")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      insertCells(model, "B2", "down");
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "B3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B20")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });
  });

  describe("Sheet Manipulation: Insert Cell Right", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);

      insertCells(model, "B2", "right");
      expect(getCellStyle(model, "A2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "Z2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);

      insertCells(model, "B2", "right");
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(1);
    });

    test("Default Sheet", () => {
      setStyle(model, [model.getters.getSheetZone(sheetId)], MULTI_STYLE);

      insertCells(model, "B2", "right");
      expect(getCellStyle(model, "B1")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(INVERSE_MULTI_STYLE);
      expect(getCellStyle(model, "B3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "Z2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });
  });

  describe("Merge: Merge into unmerge propagate style", () => {
    test("Default Row", () => {
      setStyle(model, [model.getters.getRowsZone(sheetId, 1, 1)], MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C3")).toEqual({});
      expect(getCellStyle(model, "C4")).toEqual({});

      merge(model, "C2:C4");
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C4")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);

      unMerge(model, "C2:C4");
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C3")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C4")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });

    test("Default Col", () => {
      setStyle(model, [model.getters.getColsZone(sheetId, 1, 1)], MULTI_STYLE);
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual({});
      expect(getCellStyle(model, "D2")).toEqual({});

      merge(model, "B2:D2");
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "D2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);

      unMerge(model, "B2:D2");
      expect(getCellStyle(model, "B2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "C2")).toEqual(MULTI_STYLE);
      expect(getCellStyle(model, "D2")).toEqual(MULTI_STYLE);
      expect(model.getters.getCells(sheetId).length).toBe(2);
    });
  });

  test.each([
    [[COL(2), MULTI_STYLE]],
    [[ROW(2), MULTI_STYLE]],
    [[SHEET, MULTI_STYLE]],
    [
      [ROW(2), FCOLOR_STYLE2],
      [COL(2), FCOLOR_STYLE],
    ],
    [
      [COL(2), FCOLOR_STYLE],
      [ROW(2), FCOLOR_STYLE2],
    ],
    [
      [SHEET, ITALIC_STYLE],
      [COL(2), FCOLOR_STYLE],
      [ROW(2), BOLD_STYLE],
    ],
  ] as [Zone, Style][][])("Clipboard : copy partial sheet", (...commands) => {
    const handlers = clipboardHandlersRegistries.cellHandlers
      .getAll()
      .map((handler) => new handler(model.getters, model.dispatch));

    for (const command of commands) {
      setStyle(model, [command[0]], command[1]);
    }

    const gridState: Style[][] = [[]];
    for (let col = 1; col < 4; col++) {
      gridState.push([]);
      for (let row = 1; row < 4; row++) {
        gridState[col][row] = getCellStyle(model, toXC(col, row));
      }
    }
    gridState.push([]);

    let copiedData = {};
    const clipboardData = getClipboardDataPositions(sheetId, [toZone("B2:D4")]);
    for (const handler of handlers) {
      copiedData = { ...copiedData, ...handler.copy(clipboardData, false) };
    }

    model.dispatch("CLEAR_FORMATTING", {
      sheetId,
      target: [model.getters.getSheetZone(sheetId)],
    });

    const pasteTarget: ClipboardPasteTarget = { sheetId: "sh2", zones: target("B2") };
    for (const handler of handlers) {
      handler.paste(pasteTarget, copiedData, { isCutOperation: false });
    }

    expect(getCellStyle(model, toXC(0, 0))).toEqual({});
    expect(getCellStyle(model, toXC(0, 1))).toEqual({});
    expect(getCellStyle(model, toXC(0, 2))).toEqual({});
    expect(getCellStyle(model, toXC(0, 3))).toEqual({});
    expect(getCellStyle(model, toXC(0, 4))).toEqual({});

    expect(getCellStyle(model, toXC(1, 0))).toEqual({});
    expect(getCellStyle(model, toXC(1, 1))).toEqual(gridState[1][1]);
    expect(getCellStyle(model, toXC(1, 2))).toEqual(gridState[1][2]);
    expect(getCellStyle(model, toXC(1, 3))).toEqual(gridState[1][3]);
    expect(getCellStyle(model, toXC(1, 4))).toEqual({});

    expect(getCellStyle(model, toXC(2, 0))).toEqual({});
    expect(getCellStyle(model, toXC(2, 1))).toEqual(gridState[2][1]);
    expect(getCellStyle(model, toXC(2, 2))).toEqual(gridState[2][2]);
    expect(getCellStyle(model, toXC(2, 3))).toEqual(gridState[2][3]);
    expect(getCellStyle(model, toXC(2, 4))).toEqual({});

    expect(getCellStyle(model, toXC(3, 0))).toEqual({});
    expect(getCellStyle(model, toXC(3, 1))).toEqual(gridState[3][1]);
    expect(getCellStyle(model, toXC(3, 2))).toEqual(gridState[3][2]);
    expect(getCellStyle(model, toXC(3, 3))).toEqual(gridState[3][3]);
    expect(getCellStyle(model, toXC(3, 4))).toEqual({});

    expect(getCellStyle(model, toXC(4, 0))).toEqual({});
    expect(getCellStyle(model, toXC(4, 1))).toEqual({});
    expect(getCellStyle(model, toXC(4, 2))).toEqual({});
    expect(getCellStyle(model, toXC(4, 3))).toEqual({});
    expect(getCellStyle(model, toXC(4, 4))).toEqual({});
  });

  test.each([
    [[COL(2), MULTI_STYLE]],
    [[ROW(2), MULTI_STYLE]],
    [[SHEET, MULTI_STYLE]],
    [
      [ROW(2), FCOLOR_STYLE2],
      [COL(2), FCOLOR_STYLE],
    ],
    [
      [COL(2), FCOLOR_STYLE],
      [ROW(2), FCOLOR_STYLE2],
    ],
    [
      [SHEET, ITALIC_STYLE],
      [COL(2), FCOLOR_STYLE],
      [ROW(2), BOLD_STYLE],
    ],
  ] as [Zone, Style][][])("Clipboard : cut partial sheet", (...commands) => {
    const handlers = clipboardHandlersRegistries.cellHandlers
      .getAll()
      .map((handler) => new handler(model.getters, model.dispatch));

    for (const command of commands) {
      setStyle(model, [command[0]], command[1]);
    }

    const gridState: Style[][] = [];
    for (let col = 1; col < 4; col++) {
      gridState.push([]);
      for (let row = 1; row < 4; row++) {
        gridState[col - 1][row - 1] = getCellStyle(model, toXC(col, row));
      }
    }

    let copiedData = {};
    const clipboardData = getClipboardDataPositions(sheetId, [toZone("B2:D4")]);
    for (const handler of handlers) {
      copiedData = { ...copiedData, ...handler.copy(clipboardData, true) };
    }

    const pasteTarget: ClipboardPasteTarget = { sheetId: "sh2", zones: target("F6") };
    for (const handler of handlers) {
      handler.paste(pasteTarget, copiedData, { isCutOperation: true });
    }

    for (let col = 1; col < 4; col++) {
      for (let row = 1; row < 4; row++) {
        expect(getCellStyle(model, toXC(col, row))).toEqual({});
      }
    }
    expect(getCellStyle(model, toXC(5, 5))).toEqual(gridState[0][0]);
    expect(getCellStyle(model, toXC(5, 6))).toEqual(gridState[0][1]);
    expect(getCellStyle(model, toXC(5, 7))).toEqual(gridState[0][2]);

    expect(getCellStyle(model, toXC(6, 5))).toEqual(gridState[1][0]);
    expect(getCellStyle(model, toXC(6, 6))).toEqual(gridState[1][1]);
    expect(getCellStyle(model, toXC(6, 7))).toEqual(gridState[1][2]);

    expect(getCellStyle(model, toXC(7, 5))).toEqual(gridState[2][0]);
    expect(getCellStyle(model, toXC(7, 6))).toEqual(gridState[2][1]);
    expect(getCellStyle(model, toXC(7, 7))).toEqual(gridState[2][2]);
  });

  test.each([
    [[COL(2), MULTI_STYLE]],
    [[ROW(2), MULTI_STYLE]],
    [[SHEET, MULTI_STYLE]],
    [
      [ROW(2), FCOLOR_STYLE2],
      [COL(2), FCOLOR_STYLE],
    ],
    [
      [COL(2), FCOLOR_STYLE],
      [ROW(2), FCOLOR_STYLE2],
    ],
    [
      [SHEET, ITALIC_STYLE],
      [COL(2), FCOLOR_STYLE],
      [ROW(2), BOLD_STYLE],
    ],
  ] as [Zone, Style][][])("Clipboard : copy whole sheet", (...commands) => {
    const handlers = clipboardHandlersRegistries.cellHandlers
      .getAll()
      .map((handler) => new handler(model.getters, model.dispatch));

    for (const command of commands) {
      setStyle(model, [command[0]], command[1]);
    }

    const gridState: Style[][] = [[]];
    for (let col = 1; col < 4; col++) {
      gridState.push([]);
      for (let row = 1; row < 4; row++) {
        gridState[col][row] = getCellStyle(model, toXC(col, row));
      }
    }
    gridState.push([]);

    let copiedData = {};
    const clipboardData = getClipboardDataPositions(sheetId, [toZone("A1:Y20")]);
    for (const handler of handlers) {
      copiedData = { ...copiedData, ...handler.copy(clipboardData, false) };
    }

    model.dispatch("CLEAR_FORMATTING", {
      sheetId,
      target: [model.getters.getSheetZone(sheetId)],
    });

    const pasteTarget: ClipboardPasteTarget = { sheetId: "sh2", zones: target("A1") };
    for (const handler of handlers) {
      handler.paste(pasteTarget, copiedData, { isCutOperation: false });
    }

    expect(getCellStyle(model, toXC(1, 1))).toEqual(gridState[1][1]);
    expect(getCellStyle(model, toXC(1, 2))).toEqual(gridState[1][2]);
    expect(getCellStyle(model, toXC(1, 3))).toEqual(gridState[1][3]);

    expect(getCellStyle(model, toXC(2, 1))).toEqual(gridState[2][1]);
    expect(getCellStyle(model, toXC(2, 2))).toEqual(gridState[2][2]);
    expect(getCellStyle(model, toXC(2, 3))).toEqual(gridState[2][3]);

    expect(getCellStyle(model, toXC(3, 1))).toEqual(gridState[3][1]);
    expect(getCellStyle(model, toXC(3, 2))).toEqual(gridState[3][2]);
    expect(getCellStyle(model, toXC(3, 3))).toEqual(gridState[3][3]);
  });

  test.each([
    [[COL(2), MULTI_STYLE]],
    [[ROW(2), MULTI_STYLE]],
    [[SHEET, MULTI_STYLE]],
    [
      [ROW(2), FCOLOR_STYLE2],
      [COL(2), FCOLOR_STYLE],
    ],
    [
      [COL(2), FCOLOR_STYLE],
      [ROW(2), FCOLOR_STYLE2],
    ],
    [
      [SHEET, ITALIC_STYLE],
      [COL(2), FCOLOR_STYLE],
      [ROW(2), BOLD_STYLE],
    ],
  ] as [Zone, Style][][])("Import Export does not create extra cells", (...commands) => {
    for (const command of commands) {
      setStyle(model, [command[0]], command[1]);
    }

    const modelImport = new Model(model.exportData());

    expect(getCellStyle(model, toXC(1, 1))).toEqual(getCellStyle(modelImport, toXC(1, 1)));
    expect(getCellStyle(model, toXC(2, 1))).toEqual(getCellStyle(modelImport, toXC(2, 1)));
    expect(getCellStyle(model, toXC(3, 1))).toEqual(getCellStyle(modelImport, toXC(3, 1)));

    expect(getCellStyle(model, toXC(1, 2))).toEqual(getCellStyle(modelImport, toXC(1, 2)));
    expect(getCellStyle(model, toXC(2, 2))).toEqual(getCellStyle(modelImport, toXC(2, 2)));
    expect(getCellStyle(model, toXC(3, 2))).toEqual(getCellStyle(modelImport, toXC(3, 2)));

    expect(getCellStyle(model, toXC(1, 3))).toEqual(getCellStyle(modelImport, toXC(1, 3)));
    expect(getCellStyle(model, toXC(2, 3))).toEqual(getCellStyle(modelImport, toXC(2, 3)));
    expect(getCellStyle(model, toXC(3, 3))).toEqual(getCellStyle(modelImport, toXC(3, 3)));

    expect(model.getters.getCells(sheetId).length).toBe(
      modelImport.getters.getCells(sheetId).length
    );
  });

  test.each([FCOLOR_STYLE, MULTI_STYLE])("Autofill default style from row", (style) => {
    model.dispatch("SET_FORMATTING", {
      sheetId,
      target: [model.getters.getRowsZone(sheetId, 1, 1)],
      style,
    });

    setSelection(model, ["B2"]);
    model.dispatch("AUTOFILL_SELECT", toCartesian("B4"));
    model.dispatch("AUTOFILL");

    expect(getCellStyle(model, "B3")).toEqual(style);
    expect(getCellStyle(model, "B4")).toEqual(style);
  });

  test.each([FCOLOR_STYLE, MULTI_STYLE])("Autofill default style from col", (style) => {
    model.dispatch("SET_FORMATTING", {
      sheetId,
      target: [model.getters.getColsZone(sheetId, 1, 1)],
      style,
    });

    setSelection(model, ["B2"]);
    model.dispatch("AUTOFILL_SELECT", toCartesian("D2"));
    model.dispatch("AUTOFILL");

    expect(getCellStyle(model, "C2")).toEqual(style);
    expect(getCellStyle(model, "D2")).toEqual(style);
  });

  test("Cell not impacted by the default style have an empty style by default", () => {
    model.dispatch("SET_FORMATTING", {
      sheetId,
      target: [model.getters.getColsZone(sheetId, 1, 1)],
      style: { bold: true, fillColor: "#FF0000" },
    });
    expect(getCellStyle(model, "A1")).toStrictEqual({});
  });
});

describe("Default Plugin: setRowsStyle preserves cells outside the zone", () => {
  // A zone spanning >50% of columns triggers setRowsStyle (stored as rowDefault).
  // Cells in the same rows but OUTSIDE the zone's column range must have their
  // old effective style preserved as an explicit cell style so that the new rowDefault
  // does not visually affect them.

  test("cells outside the zone column range keep their col-default style after setRowsStyle", () => {
    // 10 cols, 20 rows: zone cols 0-5 (6/10 = 60% > 50%) triggers setRowsStyle
    const model = new Model({ sheets: [{ id: "sh1", colNumber: 10, rowNumber: 20 }] });
    const sheetId = model.getters.getActiveSheetId();

    setStyle(model, [model.getters.getColsZone(sheetId, 8, 8)], FCOLOR_STYLE);

    // Multi-row zone: rows 0-2 ensures zone.bottom > zone.top so the reversed-args bug fires
    setStyle(model, [{ left: 0, right: 5, top: 0, bottom: 2 }], FCOLOR_STYLE2);

    // Cells inside the zone get the new style
    expect(getCellStyle(model, "A1")).toEqual(FCOLOR_STYLE2);
    expect(getCellStyle(model, "F3")).toEqual(FCOLOR_STYLE2);

    // Col I (col 8) is outside the zone; rows 0-2 must keep the colDefault, not FCOLOR_STYLE2
    expect(getCellStyle(model, "I1")).toEqual(FCOLOR_STYLE);
    expect(getCellStyle(model, "I2")).toEqual(FCOLOR_STYLE);
    expect(getCellStyle(model, "I3")).toEqual(FCOLOR_STYLE);
  });
});

describe("inserting headers next to a header holding a default", () => {
  test("the copied cell style is not dropped by the default of the shifted column", () => {
    const model = new Model();
    setCellContent(model, "A1", "hello");
    setFormatting(model, "A1", { bold: true });
    setFormatting(model, "B1:B100", { bold: true });

    addColumns(model, "after", "A", 1);

    expect(getStyle(model, "B1")).toMatchObject({ bold: true });
  });

  test("the copied cell style is not dropped by the default of the shifted row", () => {
    const model = new Model();
    setCellContent(model, "A1", "hello");
    setFormatting(model, "A1", { bold: true });
    setFormatting(model, "A2:Z2", { bold: true });

    addRows(model, "after", 0, 1);

    expect(getStyle(model, "A2")).toMatchObject({ bold: true });
  });
});
