"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.undoEditing = void 0;
var immer_1 = require("immer");
var lodash_es_1 = require("lodash-es");
function undoEditing(editing) {
    var lastUndo = lodash_es_1.last(editing.undoPatches);
    if (!lastUndo) {
        return editing;
    }
    var next = immer_1.applyPatches(editing.sceneMap, lastUndo.patches);
    return {
        sceneMap: next,
        undoPatches: editing.undoPatches.slice(0, editing.undoPatches.length - 1)
    };
}
exports.undoEditing = undoEditing;
//# sourceMappingURL=undoEditing.js.map