var
/
www
/
html
/
servotec-doerpen
/
wp-includes
/
js
/
dist
| uid:33
undo-manager.js
[X]
"use strict"; var wp; (wp ||= {}).undoManager = (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/is-shallow-equal var require_is_shallow_equal = __commonJS({ "package-external:@wordpress/is-shallow-equal"(exports, module) { module.exports = window.wp.isShallowEqual; } }); // packages/undo-manager/build-module/index.mjs var index_exports = {}; __export(index_exports, { createUndoManager: () => createUndoManager }); var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1); function mergeHistoryChanges(changes1, changes2) { const newChanges = { ...changes1 }; Object.entries(changes2).forEach(([key, value]) => { if (newChanges[key]) { newChanges[key] = { ...newChanges[key], to: value.to }; } else { newChanges[key] = value; } }); return newChanges; } var addHistoryChangesIntoRecord = (record, changes) => { const existingChangesIndex = record?.findIndex( ({ id: recordIdentifier }) => { return typeof recordIdentifier === "string" ? recordIdentifier === changes.id : (0, import_is_shallow_equal.isShallowEqual)(recordIdentifier, changes.id); } ); const nextRecord = [...record]; if (existingChangesIndex !== -1) { nextRecord[existingChangesIndex] = { id: changes.id, changes: mergeHistoryChanges( nextRecord[existingChangesIndex].changes, changes.changes ) }; } else { nextRecord.push(changes); } return nextRecord; }; function createUndoManager() { let history = []; let stagedRecord = []; let offset = 0; const dropPendingRedos = () => { history = history.slice(0, offset || void 0); offset = 0; }; const appendStagedRecordToLatestHistoryRecord = () => { const index = history.length === 0 ? 0 : history.length - 1; let latestRecord = history[index] ?? []; stagedRecord.forEach((changes) => { latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); }); stagedRecord = []; history[index] = latestRecord; }; const isRecordEmpty = (record) => { const filteredRecord = record.filter(({ changes }) => { return Object.values(changes).some( ({ from, to }) => typeof from !== "function" && typeof to !== "function" && !(0, import_is_shallow_equal.isShallowEqual)(from, to) ); }); return !filteredRecord.length; }; return { addRecord(record, isStaged = false) { const isEmpty = !record || isRecordEmpty(record); if (isStaged) { if (isEmpty) { return; } record.forEach((changes) => { stagedRecord = addHistoryChangesIntoRecord( stagedRecord, changes ); }); } else { dropPendingRedos(); if (stagedRecord.length) { appendStagedRecordToLatestHistoryRecord(); } if (isEmpty) { return; } history.push(record); } }, undo() { if (stagedRecord.length) { dropPendingRedos(); appendStagedRecordToLatestHistoryRecord(); } const undoRecord = history[history.length - 1 + offset]; if (!undoRecord) { return; } offset -= 1; return undoRecord; }, redo() { const redoRecord = history[history.length + offset]; if (!redoRecord) { return; } offset += 1; return redoRecord; }, hasUndo() { return !!history[history.length - 1 + offset]; }, hasRedo() { return !!history[history.length + offset]; } }; } return __toCommonJS(index_exports); })();
development/
-
O
R
D
script-modules/
-
O
R
D
vendor/
-
O
R
D
autop.js
9.7K
V
E
R
D
base-styles.js
48
V
E
R
D
block-serialization-default-parser.js
6.5K
V
E
R
D
block-serialization-default-parser.min.js
2.4K
V
E
R
D
block-serialization-spec-parser.js
50.5K
V
E
R
D
block-serialization-spec-parser.min.js
10.4K
V
E
R
D
blocks.js
381.1K
V
E
R
D
commands.min.js
63.1K
V
E
R
D
core-commands.js
28.7K
V
E
R
D
core-commands.min.js
11.9K
V
E
R
D
core-data.js
612K
V
E
R
D
core-data.min.js
210.5K
V
E
R
D
customize-widgets.min.js
36.6K
V
E
R
D
date.js
176.3K
V
E
R
D
deprecated.js
3K
V
E
R
D
dom-ready.js
1.5K
V
E
R
D
dom.min.js
12.7K
V
E
R
D
escape-html.js
2.3K
V
E
R
D
format-library.min.js
28.9K
V
E
R
D
hooks.js
12K
V
E
R
D
i18n.js
15.3K
V
E
R
D
i18n.min.js
5.6K
V
E
R
D
is-shallow-equal.min.js
1.1K
V
E
R
D
keyboard-shortcuts.js
9.7K
V
E
R
D
keyboard-shortcuts.min.js
3.4K
V
E
R
D
list-reusable-blocks.js
13.1K
V
E
R
D
list-reusable-blocks.min.js
5.2K
V
E
R
D
media-utils.min.js
237.6K
V
E
R
D
nux.js
10.3K
V
E
R
D
nux.min.js
4K
V
E
R
D
plugins.min.js
4.8K
V
E
R
D
primitives.js
5.1K
V
E
R
D
private-apis.min.js
2.7K
V
E
R
D
react-i18n.js
3.9K
V
E
R
D
react-i18n.min.js
1.5K
V
E
R
D
redux-routine.js
24.7K
V
E
R
D
redux-routine.min.js
9.6K
V
E
R
D
reusable-blocks.min.js
7.2K
V
E
R
D
router.min.js
14.1K
V
E
R
D
style-engine.js
17.6K
V
E
R
D
theme.min.js
56.1K
V
E
R
D
token-list.js
6.1K
V
E
R
D
token-list.min.js
1.6K
V
E
R
D
undo-manager.js
5.3K
V
E
R
D
undo-manager.min.js
1.7K
V
E
R
D
upload-media.min.js
23.1K
V
E
R
D
viewport.js
6.6K
V
E
R
D
viewport.min.js
2.2K
V
E
R
D
warning.js
1.5K
V
E
R
D
widgets.min.js
20.8K
V
E
R
D
wordcount.min.js
2.4K
V
E
R
D