kollapsminoriteten/wp-includes/js/dist/preferences-persistence.js

546 lines
17 KiB
JavaScript
Raw Permalink Normal View History

2024-04-17 11:32:24 +02:00
/******/ (() => { // webpackBootstrap
2022-12-15 17:47:31 +01:00
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
2024-04-17 11:32:24 +02:00
/******/ (() => {
2022-12-15 17:47:31 +01:00
/******/ // getDefaultExport function for compatibility with non-harmony modules
2024-04-17 11:32:24 +02:00
/******/ __webpack_require__.n = (module) => {
2022-12-15 17:47:31 +01:00
/******/ var getter = module && module.__esModule ?
2024-04-17 11:32:24 +02:00
/******/ () => (module['default']) :
/******/ () => (module);
2022-12-15 17:47:31 +01:00
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
2024-04-17 11:32:24 +02:00
/******/ })();
2022-12-15 17:47:31 +01:00
/******/
/******/ /* webpack/runtime/define property getters */
2024-04-17 11:32:24 +02:00
/******/ (() => {
2022-12-15 17:47:31 +01:00
/******/ // define getter functions for harmony exports
2024-04-17 11:32:24 +02:00
/******/ __webpack_require__.d = (exports, definition) => {
2022-12-15 17:47:31 +01:00
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
2024-04-17 11:32:24 +02:00
/******/ })();
2022-12-15 17:47:31 +01:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2024-04-17 11:32:24 +02:00
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
2022-12-15 17:47:31 +01:00
/******/
/******/ /* webpack/runtime/make namespace object */
2024-04-17 11:32:24 +02:00
/******/ (() => {
2022-12-15 17:47:31 +01:00
/******/ // define __esModule on exports
2024-04-17 11:32:24 +02:00
/******/ __webpack_require__.r = (exports) => {
2022-12-15 17:47:31 +01:00
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
2024-04-17 11:32:24 +02:00
/******/ })();
2022-12-15 17:47:31 +01:00
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
2024-04-17 11:32:24 +02:00
__unstableCreatePersistenceLayer: () => (/* binding */ __unstableCreatePersistenceLayer),
create: () => (/* reexport */ create)
2022-12-15 17:47:31 +01:00
});
2025-04-25 12:30:07 +02:00
;// external ["wp","apiFetch"]
2024-04-17 11:32:24 +02:00
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
2022-12-15 17:47:31 +01:00
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/create/debounce-async.js
2022-12-15 17:47:31 +01:00
function debounceAsync(func, delayMS) {
let timeoutId;
let activePromise;
2023-09-26 10:33:34 +02:00
return async function debounced(...args) {
2022-12-15 17:47:31 +01:00
if (!activePromise && !timeoutId) {
return new Promise((resolve, reject) => {
2023-09-26 10:33:34 +02:00
activePromise = func(...args).then((...thenArgs) => {
resolve(...thenArgs);
2025-12-12 13:15:55 +01:00
}).catch((error) => {
2022-12-15 17:47:31 +01:00
reject(error);
}).finally(() => {
activePromise = null;
});
});
}
if (activePromise) {
await activePromise;
2023-12-07 09:44:11 +01:00
}
2022-12-15 17:47:31 +01:00
if (timeoutId) {
clearTimeout(timeoutId);
timeoutId = null;
2023-12-07 09:44:11 +01:00
}
2022-12-15 17:47:31 +01:00
return new Promise((resolve, reject) => {
timeoutId = setTimeout(() => {
2023-09-26 10:33:34 +02:00
activePromise = func(...args).then((...thenArgs) => {
resolve(...thenArgs);
2025-12-12 13:15:55 +01:00
}).catch((error) => {
2022-12-15 17:47:31 +01:00
reject(error);
}).finally(() => {
activePromise = null;
timeoutId = null;
});
}, delayMS);
});
};
}
2025-12-12 13:15:55 +01:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/create/index.js
2023-12-07 09:44:11 +01:00
2022-12-15 17:47:31 +01:00
const EMPTY_OBJECT = {};
const localStorage = window.localStorage;
2023-09-26 10:33:34 +02:00
function create({
preloadedData,
2025-12-12 13:15:55 +01:00
localStorageRestoreKey = "WP_PREFERENCES_RESTORE_DATA",
2023-09-26 10:33:34 +02:00
requestDebounceMS = 2500
} = {}) {
2022-12-15 17:47:31 +01:00
let cache = preloadedData;
const debouncedApiFetch = debounceAsync((external_wp_apiFetch_default()), requestDebounceMS);
async function get() {
if (cache) {
return cache;
}
const user = await external_wp_apiFetch_default()({
2025-12-12 13:15:55 +01:00
path: "/wp/v2/users/me?context=edit"
2022-12-15 17:47:31 +01:00
});
2023-09-26 10:33:34 +02:00
const serverData = user?.meta?.persisted_preferences;
2025-12-12 13:15:55 +01:00
const localData = JSON.parse(
localStorage.getItem(localStorageRestoreKey)
);
2023-09-26 10:33:34 +02:00
const serverTimestamp = Date.parse(serverData?._modified) || 0;
2023-12-07 09:44:11 +01:00
const localTimestamp = Date.parse(localData?._modified) || 0;
2022-12-15 17:47:31 +01:00
if (serverData && serverTimestamp >= localTimestamp) {
cache = serverData;
} else if (localData) {
cache = localData;
} else {
cache = EMPTY_OBJECT;
}
return cache;
}
function set(newData) {
2023-12-07 09:44:11 +01:00
const dataWithTimestamp = {
...newData,
2025-12-12 13:15:55 +01:00
_modified: (/* @__PURE__ */ new Date()).toISOString()
2022-12-15 17:47:31 +01:00
};
2023-12-07 09:44:11 +01:00
cache = dataWithTimestamp;
2025-12-12 13:15:55 +01:00
localStorage.setItem(
localStorageRestoreKey,
JSON.stringify(dataWithTimestamp)
);
2022-12-15 17:47:31 +01:00
debouncedApiFetch({
2025-12-12 13:15:55 +01:00
path: "/wp/v2/users/me",
method: "PUT",
2022-12-15 17:47:31 +01:00
// `keepalive` will still send the request in the background,
// even when a browser unload event might interrupt it.
// This should hopefully make things more resilient.
// This does have a size limit of 64kb, but the data is usually
// much less.
keepalive: true,
data: {
meta: {
persisted_preferences: dataWithTimestamp
}
}
2025-12-12 13:15:55 +01:00
}).catch(() => {
});
2022-12-15 17:47:31 +01:00
}
return {
get,
set
};
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-feature-preferences.js
2022-12-15 17:47:31 +01:00
function moveFeaturePreferences(state, sourceStoreName) {
2025-12-12 13:15:55 +01:00
const preferencesStoreName = "core/preferences";
const interfaceStoreName = "core/interface";
2023-09-26 10:33:34 +02:00
const interfaceFeatures = state?.[interfaceStoreName]?.preferences?.features?.[sourceStoreName];
const sourceFeatures = state?.[sourceStoreName]?.preferences?.features;
2022-12-15 17:47:31 +01:00
const featuresToMigrate = interfaceFeatures ? interfaceFeatures : sourceFeatures;
if (!featuresToMigrate) {
return state;
}
2023-12-07 09:44:11 +01:00
const existingPreferences = state?.[preferencesStoreName]?.preferences;
2023-09-26 10:33:34 +02:00
if (existingPreferences?.[sourceStoreName]) {
2022-12-15 17:47:31 +01:00
return state;
}
let updatedInterfaceState;
if (interfaceFeatures) {
2023-09-26 10:33:34 +02:00
const otherInterfaceState = state?.[interfaceStoreName];
const otherInterfaceScopes = state?.[interfaceStoreName]?.preferences?.features;
2022-12-15 17:47:31 +01:00
updatedInterfaceState = {
2023-12-07 09:44:11 +01:00
[interfaceStoreName]: {
...otherInterfaceState,
2022-12-15 17:47:31 +01:00
preferences: {
2023-12-07 09:44:11 +01:00
features: {
...otherInterfaceScopes,
2025-12-12 13:15:55 +01:00
[sourceStoreName]: void 0
2022-12-15 17:47:31 +01:00
}
}
}
};
}
let updatedSourceState;
if (sourceFeatures) {
2023-09-26 10:33:34 +02:00
const otherSourceState = state?.[sourceStoreName];
const sourcePreferences = state?.[sourceStoreName]?.preferences;
2022-12-15 17:47:31 +01:00
updatedSourceState = {
2023-12-07 09:44:11 +01:00
[sourceStoreName]: {
...otherSourceState,
preferences: {
...sourcePreferences,
2025-12-12 13:15:55 +01:00
features: void 0
2022-12-15 17:47:31 +01:00
}
}
};
2023-12-07 09:44:11 +01:00
}
return {
...state,
2022-12-15 17:47:31 +01:00
[preferencesStoreName]: {
2023-12-07 09:44:11 +01:00
preferences: {
...existingPreferences,
2022-12-15 17:47:31 +01:00
[sourceStoreName]: featuresToMigrate
}
},
...updatedInterfaceState,
...updatedSourceState
};
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js
2022-12-15 17:47:31 +01:00
function moveThirdPartyFeaturePreferencesToPreferences(state) {
2025-12-12 13:15:55 +01:00
const interfaceStoreName = "core/interface";
const preferencesStoreName = "core/preferences";
2023-09-26 10:33:34 +02:00
const interfaceScopes = state?.[interfaceStoreName]?.preferences?.features;
2022-12-15 17:47:31 +01:00
const interfaceScopeKeys = interfaceScopes ? Object.keys(interfaceScopes) : [];
2023-09-26 10:33:34 +02:00
if (!interfaceScopeKeys?.length) {
2022-12-15 17:47:31 +01:00
return state;
}
2025-12-12 13:15:55 +01:00
return interfaceScopeKeys.reduce(function(convertedState, scope) {
if (scope.startsWith("core")) {
2022-12-15 17:47:31 +01:00
return convertedState;
}
2023-09-26 10:33:34 +02:00
const featuresToMigrate = interfaceScopes?.[scope];
2022-12-15 17:47:31 +01:00
if (!featuresToMigrate) {
return convertedState;
}
2023-09-26 10:33:34 +02:00
const existingMigratedData = convertedState?.[preferencesStoreName]?.preferences?.[scope];
2022-12-15 17:47:31 +01:00
if (existingMigratedData) {
return convertedState;
}
2023-09-26 10:33:34 +02:00
const otherPreferencesScopes = convertedState?.[preferencesStoreName]?.preferences;
const otherInterfaceState = convertedState?.[interfaceStoreName];
const otherInterfaceScopes = convertedState?.[interfaceStoreName]?.preferences?.features;
2023-12-07 09:44:11 +01:00
return {
...convertedState,
2022-12-15 17:47:31 +01:00
[preferencesStoreName]: {
2023-12-07 09:44:11 +01:00
preferences: {
...otherPreferencesScopes,
2022-12-15 17:47:31 +01:00
[scope]: featuresToMigrate
}
},
2023-12-07 09:44:11 +01:00
[interfaceStoreName]: {
...otherInterfaceState,
2022-12-15 17:47:31 +01:00
preferences: {
2023-12-07 09:44:11 +01:00
features: {
...otherInterfaceScopes,
2025-12-12 13:15:55 +01:00
[scope]: void 0
2022-12-15 17:47:31 +01:00
}
}
}
};
}, state);
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-individual-preference.js
2025-12-12 13:15:55 +01:00
const identity = (arg) => arg;
function moveIndividualPreferenceToPreferences(state, { from: sourceStoreName, to: scope }, key, convert = identity) {
const preferencesStoreName = "core/preferences";
2023-12-07 09:44:11 +01:00
const sourcePreference = state?.[sourceStoreName]?.preferences?.[key];
2025-12-12 13:15:55 +01:00
if (sourcePreference === void 0) {
2022-12-15 17:47:31 +01:00
return state;
}
2023-12-07 09:44:11 +01:00
const targetPreference = state?.[preferencesStoreName]?.preferences?.[scope]?.[key];
2022-12-15 17:47:31 +01:00
if (targetPreference) {
return state;
}
2023-09-26 10:33:34 +02:00
const otherScopes = state?.[preferencesStoreName]?.preferences;
const otherPreferences = state?.[preferencesStoreName]?.preferences?.[scope];
const otherSourceState = state?.[sourceStoreName];
2023-12-07 09:44:11 +01:00
const allSourcePreferences = state?.[sourceStoreName]?.preferences;
2025-12-12 13:15:55 +01:00
const convertedPreferences = convert({ [key]: sourcePreference });
2023-12-07 09:44:11 +01:00
return {
...state,
2022-12-15 17:47:31 +01:00
[preferencesStoreName]: {
2023-12-07 09:44:11 +01:00
preferences: {
...otherScopes,
[scope]: {
...otherPreferences,
2022-12-15 17:47:31 +01:00
...convertedPreferences
}
}
},
2023-12-07 09:44:11 +01:00
[sourceStoreName]: {
...otherSourceState,
preferences: {
...allSourcePreferences,
2025-12-12 13:15:55 +01:00
[key]: void 0
2022-12-15 17:47:31 +01:00
}
}
};
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-interface-enable-items.js
2022-12-15 17:47:31 +01:00
function moveInterfaceEnableItems(state) {
2025-12-12 13:15:55 +01:00
const interfaceStoreName = "core/interface";
const preferencesStoreName = "core/preferences";
2023-12-07 09:44:11 +01:00
const sourceEnableItems = state?.[interfaceStoreName]?.enableItems;
2022-12-15 17:47:31 +01:00
if (!sourceEnableItems) {
return state;
}
2025-12-12 13:15:55 +01:00
const allPreferences = state?.[preferencesStoreName]?.preferences ?? {};
const sourceComplementaryAreas = sourceEnableItems?.singleEnableItems?.complementaryArea ?? {};
const preferencesWithConvertedComplementaryAreas = Object.keys(
sourceComplementaryAreas
).reduce((accumulator, scope) => {
2023-12-07 09:44:11 +01:00
const data = sourceComplementaryAreas[scope];
2023-09-26 10:33:34 +02:00
if (accumulator?.[scope]?.complementaryArea) {
2022-12-15 17:47:31 +01:00
return accumulator;
}
2023-12-07 09:44:11 +01:00
return {
...accumulator,
[scope]: {
...accumulator[scope],
2022-12-15 17:47:31 +01:00
complementaryArea: data
}
};
2023-12-07 09:44:11 +01:00
}, allPreferences);
2025-12-12 13:15:55 +01:00
const sourcePinnedItems = sourceEnableItems?.multipleEnableItems?.pinnedItems ?? {};
const allConvertedData = Object.keys(sourcePinnedItems).reduce(
(accumulator, scope) => {
const data = sourcePinnedItems[scope];
if (accumulator?.[scope]?.pinnedItems) {
return accumulator;
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
return {
...accumulator,
[scope]: {
...accumulator[scope],
pinnedItems: data
}
};
},
preferencesWithConvertedComplementaryAreas
);
2022-12-15 17:47:31 +01:00
const otherInterfaceItems = state[interfaceStoreName];
2023-12-07 09:44:11 +01:00
return {
...state,
2022-12-15 17:47:31 +01:00
[preferencesStoreName]: {
preferences: allConvertedData
},
2023-12-07 09:44:11 +01:00
[interfaceStoreName]: {
...otherInterfaceItems,
2025-12-12 13:15:55 +01:00
enableItems: void 0
2022-12-15 17:47:31 +01:00
}
};
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/convert-edit-post-panels.js
2022-12-15 17:47:31 +01:00
function convertEditPostPanels(preferences) {
2025-12-12 13:15:55 +01:00
const panels = preferences?.panels ?? {};
return Object.keys(panels).reduce(
(convertedData, panelName) => {
const panel = panels[panelName];
if (panel?.enabled === false) {
convertedData.inactivePanels.push(panelName);
}
if (panel?.opened === true) {
convertedData.openPanels.push(panelName);
}
return convertedData;
},
{ inactivePanels: [], openPanels: [] }
);
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/legacy-local-storage-data/index.js
2022-12-15 17:47:31 +01:00
2023-12-07 09:44:11 +01:00
2022-12-15 17:47:31 +01:00
function getLegacyData(userId) {
const key = `WP_DATA_USER_${userId}`;
const unparsedData = window.localStorage.getItem(key);
return JSON.parse(unparsedData);
}
function convertLegacyData(data) {
if (!data) {
return;
2023-12-07 09:44:11 +01:00
}
2025-12-12 13:15:55 +01:00
data = moveFeaturePreferences(data, "core/edit-widgets");
data = moveFeaturePreferences(data, "core/customize-widgets");
data = moveFeaturePreferences(data, "core/edit-post");
data = moveFeaturePreferences(data, "core/edit-site");
2023-12-07 09:44:11 +01:00
data = moveThirdPartyFeaturePreferencesToPreferences(data);
data = moveInterfaceEnableItems(data);
2025-12-12 13:15:55 +01:00
data = moveIndividualPreferenceToPreferences(
data,
{ from: "core/edit-post", to: "core/edit-post" },
"hiddenBlockTypes"
);
data = moveIndividualPreferenceToPreferences(
data,
{ from: "core/edit-post", to: "core/edit-post" },
"editorMode"
);
data = moveIndividualPreferenceToPreferences(
data,
{ from: "core/edit-post", to: "core/edit-post" },
"panels",
convertEditPostPanels
);
data = moveIndividualPreferenceToPreferences(
data,
{ from: "core/editor", to: "core" },
"isPublishSidebarEnabled"
);
data = moveIndividualPreferenceToPreferences(
data,
{ from: "core/edit-post", to: "core" },
"isPublishSidebarEnabled"
);
data = moveIndividualPreferenceToPreferences(
data,
{ from: "core/edit-site", to: "core/edit-site" },
"editorMode"
);
return data?.["core/preferences"]?.preferences;
2022-12-15 17:47:31 +01:00
}
function convertLegacyLocalStorageData(userId) {
const data = getLegacyData(userId);
return convertLegacyData(data);
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/preferences-package-data/convert-complementary-areas.js
2022-12-15 17:47:31 +01:00
function convertComplementaryAreas(state) {
return Object.keys(state).reduce((stateAccumulator, scope) => {
2023-12-07 09:44:11 +01:00
const scopeData = state[scope];
2023-09-26 10:33:34 +02:00
if (scopeData?.complementaryArea) {
2025-12-12 13:15:55 +01:00
const updatedScopeData = { ...scopeData };
2022-12-15 17:47:31 +01:00
delete updatedScopeData.complementaryArea;
updatedScopeData.isComplementaryAreaVisible = true;
stateAccumulator[scope] = updatedScopeData;
return stateAccumulator;
}
return stateAccumulator;
}, state);
}
2024-04-17 11:32:24 +02:00
2025-12-12 13:15:55 +01:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/preferences-package-data/convert-editor-settings.js
2024-04-17 11:32:24 +02:00
function convertEditorSettings(data) {
let newData = data;
2025-12-12 13:15:55 +01:00
const settingsToMoveToCore = [
"allowRightClickOverrides",
"distractionFree",
"editorMode",
"fixedToolbar",
"focusMode",
"hiddenBlockTypes",
"inactivePanels",
"keepCaretInsideBlock",
"mostUsedBlocks",
"openPanels",
"showBlockBreadcrumbs",
"showIconLabels",
"showListViewByDefault",
"isPublishSidebarEnabled",
"isComplementaryAreaVisible",
"pinnedItems"
];
settingsToMoveToCore.forEach((setting) => {
if (data?.["core/edit-post"]?.[setting] !== void 0) {
2024-04-17 11:32:24 +02:00
newData = {
...newData,
core: {
...newData?.core,
2025-12-12 13:15:55 +01:00
[setting]: data["core/edit-post"][setting]
2024-04-17 11:32:24 +02:00
}
};
2025-12-12 13:15:55 +01:00
delete newData["core/edit-post"][setting];
2024-04-17 11:32:24 +02:00
}
2025-12-12 13:15:55 +01:00
if (data?.["core/edit-site"]?.[setting] !== void 0) {
delete newData["core/edit-site"][setting];
2024-04-17 11:32:24 +02:00
}
});
2025-12-12 13:15:55 +01:00
if (Object.keys(newData?.["core/edit-post"] ?? {})?.length === 0) {
delete newData["core/edit-post"];
2024-04-17 11:32:24 +02:00
}
2025-12-12 13:15:55 +01:00
if (Object.keys(newData?.["core/edit-site"] ?? {})?.length === 0) {
delete newData["core/edit-site"];
2024-04-17 11:32:24 +02:00
}
return newData;
}
2025-12-12 13:15:55 +01:00
2025-04-25 12:30:07 +02:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/migrations/preferences-package-data/index.js
2022-12-15 17:47:31 +01:00
2024-04-17 11:32:24 +02:00
2022-12-15 17:47:31 +01:00
function convertPreferencesPackageData(data) {
2024-04-17 11:32:24 +02:00
let newData = convertComplementaryAreas(data);
newData = convertEditorSettings(newData);
return newData;
2022-12-15 17:47:31 +01:00
}
2025-12-12 13:15:55 +01:00
;// ./node_modules/@wordpress/preferences-persistence/build-module/index.js
2022-12-15 17:47:31 +01:00
2023-12-07 09:44:11 +01:00
2022-12-15 17:47:31 +01:00
function __unstableCreatePersistenceLayer(serverData, userId) {
const localStorageRestoreKey = `WP_PREFERENCES_USER_${userId}`;
2025-12-12 13:15:55 +01:00
const localData = JSON.parse(
window.localStorage.getItem(localStorageRestoreKey)
);
2022-12-15 17:47:31 +01:00
const serverModified = Date.parse(serverData && serverData._modified) || 0;
const localModified = Date.parse(localData && localData._modified) || 0;
let preloadedData;
if (serverData && serverModified >= localModified) {
preloadedData = convertPreferencesPackageData(serverData);
} else if (localData) {
preloadedData = convertPreferencesPackageData(localData);
} else {
preloadedData = convertLegacyLocalStorageData(userId);
}
return create({
preloadedData,
localStorageRestoreKey
});
}
2025-12-12 13:15:55 +01:00
2022-12-15 17:47:31 +01:00
(window.wp = window.wp || {}).preferencesPersistence = __webpack_exports__;
/******/ })()
;