Preview: block-library.js
Size: 2.19 MB
/home/zcziejy/ryadselyen/dist/block-library.js
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 3533:
/***/ ((module) => {
"use strict";
module.exports = window["wp"]["latexToMathml"];
/***/ }),
/***/ 7734:
/***/ ((module) => {
"use strict";
// do not edit .js files directly - edit src/index.jst
var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if ((a instanceof Map) && (b instanceof Map)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
for (i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
return true;
}
if ((a instanceof Set) && (b instanceof Set)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
return true;
}
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (a[i] !== b[i]) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};
/***/ }),
/***/ 9681:
/***/ ((module) => {
var characterMap = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"Ấ": "A",
"Ắ": "A",
"Ẳ": "A",
"Ẵ": "A",
"Ặ": "A",
"Æ": "AE",
"Ầ": "A",
"Ằ": "A",
"Ȃ": "A",
"Ả": "A",
"Ạ": "A",
"Ẩ": "A",
"Ẫ": "A",
"Ậ": "A",
"Ç": "C",
"Ḉ": "C",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"Ế": "E",
"Ḗ": "E",
"Ề": "E",
"Ḕ": "E",
"Ḝ": "E",
"Ȇ": "E",
"Ẻ": "E",
"Ẽ": "E",
"Ẹ": "E",
"Ể": "E",
"Ễ": "E",
"Ệ": "E",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"Ḯ": "I",
"Ȋ": "I",
"Ỉ": "I",
"Ị": "I",
"Ð": "D",
"Ñ": "N",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"Ố": "O",
"Ṍ": "O",
"Ṓ": "O",
"Ȏ": "O",
"Ỏ": "O",
"Ọ": "O",
"Ổ": "O",
"Ỗ": "O",
"Ộ": "O",
"Ờ": "O",
"Ở": "O",
"Ỡ": "O",
"Ớ": "O",
"Ợ": "O",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"Ủ": "U",
"Ụ": "U",
"Ử": "U",
"Ữ": "U",
"Ự": "U",
"Ý": "Y",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"ấ": "a",
"ắ": "a",
"ẳ": "a",
"ẵ": "a",
"ặ": "a",
"æ": "ae",
"ầ": "a",
"ằ": "a",
"ȃ": "a",
"ả": "a",
"ạ": "a",
"ẩ": "a",
"ẫ": "a",
"ậ": "a",
"ç": "c",
"ḉ": "c",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"ế": "e",
"ḗ": "e",
"ề": "e",
"ḕ": "e",
"ḝ": "e",
"ȇ": "e",
"ẻ": "e",
"ẽ": "e",
"ẹ": "e",
"ể": "e",
"ễ": "e",
"ệ": "e",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"ḯ": "i",
"ȋ": "i",
"ỉ": "i",
"ị": "i",
"ð": "d",
"ñ": "n",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"ố": "o",
"ṍ": "o",
"ṓ": "o",
"ȏ": "o",
"ỏ": "o",
"ọ": "o",
"ổ": "o",
"ỗ": "o",
"ộ": "o",
"ờ": "o",
"ở": "o",
"ỡ": "o",
"ớ": "o",
"ợ": "o",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"ủ": "u",
"ụ": "u",
"ử": "u",
"ữ": "u",
"ự": "u",
"ý": "y",
"ÿ": "y",
"Ā": "A",
"ā": "a",
"Ă": "A",
"ă": "a",
"Ą": "A",
"ą": "a",
"Ć": "C",
"ć": "c",
"Ĉ": "C",
"ĉ": "c",
"Ċ": "C",
"ċ": "c",
"Č": "C",
"č": "c",
"C̆": "C",
"c̆": "c",
"Ď": "D",
"ď": "d",
"Đ": "D",
"đ": "d",
"Ē": "E",
"ē": "e",
"Ĕ": "E",
"ĕ": "e",
"Ė": "E",
"ė": "e",
"Ę": "E",
"ę": "e",
"Ě": "E",
"ě": "e",
"Ĝ": "G",
"Ǵ": "G",
"ĝ": "g",
"ǵ": "g",
"Ğ": "G",
"ğ": "g",
"Ġ": "G",
"ġ": "g",
"Ģ": "G",
"ģ": "g",
"Ĥ": "H",
"ĥ": "h",
"Ħ": "H",
"ħ": "h",
"Ḫ": "H",
"ḫ": "h",
"Ĩ": "I",
"ĩ": "i",
"Ī": "I",
"ī": "i",
"Ĭ": "I",
"ĭ": "i",
"Į": "I",
"į": "i",
"İ": "I",
"ı": "i",
"IJ": "IJ",
"ij": "ij",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"Ḱ": "K",
"ḱ": "k",
"K̆": "K",
"k̆": "k",
"Ĺ": "L",
"ĺ": "l",
"Ļ": "L",
"ļ": "l",
"Ľ": "L",
"ľ": "l",
"Ŀ": "L",
"ŀ": "l",
"Ł": "l",
"ł": "l",
"Ḿ": "M",
"ḿ": "m",
"M̆": "M",
"m̆": "m",
"Ń": "N",
"ń": "n",
"Ņ": "N",
"ņ": "n",
"Ň": "N",
"ň": "n",
"ʼn": "n",
"N̆": "N",
"n̆": "n",
"Ō": "O",
"ō": "o",
"Ŏ": "O",
"ŏ": "o",
"Ő": "O",
"ő": "o",
"Œ": "OE",
"œ": "oe",
"P̆": "P",
"p̆": "p",
"Ŕ": "R",
"ŕ": "r",
"Ŗ": "R",
"ŗ": "r",
"Ř": "R",
"ř": "r",
"R̆": "R",
"r̆": "r",
"Ȓ": "R",
"ȓ": "r",
"Ś": "S",
"ś": "s",
"Ŝ": "S",
"ŝ": "s",
"Ş": "S",
"Ș": "S",
"ș": "s",
"ş": "s",
"Š": "S",
"š": "s",
"Ţ": "T",
"ţ": "t",
"ț": "t",
"Ț": "T",
"Ť": "T",
"ť": "t",
"Ŧ": "T",
"ŧ": "t",
"T̆": "T",
"t̆": "t",
"Ũ": "U",
"ũ": "u",
"Ū": "U",
"ū": "u",
"Ŭ": "U",
"ŭ": "u",
"Ů": "U",
"ů": "u",
"Ű": "U",
"ű": "u",
"Ų": "U",
"ų": "u",
"Ȗ": "U",
"ȗ": "u",
"V̆": "V",
"v̆": "v",
"Ŵ": "W",
"ŵ": "w",
"Ẃ": "W",
"ẃ": "w",
"X̆": "X",
"x̆": "x",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Y̆": "Y",
"y̆": "y",
"Ź": "Z",
"ź": "z",
"Ż": "Z",
"ż": "z",
"Ž": "Z",
"ž": "z",
"ſ": "s",
"ƒ": "f",
"Ơ": "O",
"ơ": "o",
"Ư": "U",
"ư": "u",
"Ǎ": "A",
"ǎ": "a",
"Ǐ": "I",
"ǐ": "i",
"Ǒ": "O",
"ǒ": "o",
"Ǔ": "U",
"ǔ": "u",
"Ǖ": "U",
"ǖ": "u",
"Ǘ": "U",
"ǘ": "u",
"Ǚ": "U",
"ǚ": "u",
"Ǜ": "U",
"ǜ": "u",
"Ứ": "U",
"ứ": "u",
"Ṹ": "U",
"ṹ": "u",
"Ǻ": "A",
"ǻ": "a",
"Ǽ": "AE",
"ǽ": "ae",
"Ǿ": "O",
"ǿ": "o",
"Þ": "TH",
"þ": "th",
"Ṕ": "P",
"ṕ": "p",
"Ṥ": "S",
"ṥ": "s",
"X́": "X",
"x́": "x",
"Ѓ": "Г",
"ѓ": "г",
"Ќ": "К",
"ќ": "к",
"A̋": "A",
"a̋": "a",
"E̋": "E",
"e̋": "e",
"I̋": "I",
"i̋": "i",
"Ǹ": "N",
"ǹ": "n",
"Ồ": "O",
"ồ": "o",
"Ṑ": "O",
"ṑ": "o",
"Ừ": "U",
"ừ": "u",
"Ẁ": "W",
"ẁ": "w",
"Ỳ": "Y",
"ỳ": "y",
"Ȁ": "A",
"ȁ": "a",
"Ȅ": "E",
"ȅ": "e",
"Ȉ": "I",
"ȉ": "i",
"Ȍ": "O",
"ȍ": "o",
"Ȑ": "R",
"ȑ": "r",
"Ȕ": "U",
"ȕ": "u",
"B̌": "B",
"b̌": "b",
"Č̣": "C",
"č̣": "c",
"Ê̌": "E",
"ê̌": "e",
"F̌": "F",
"f̌": "f",
"Ǧ": "G",
"ǧ": "g",
"Ȟ": "H",
"ȟ": "h",
"J̌": "J",
"ǰ": "j",
"Ǩ": "K",
"ǩ": "k",
"M̌": "M",
"m̌": "m",
"P̌": "P",
"p̌": "p",
"Q̌": "Q",
"q̌": "q",
"Ř̩": "R",
"ř̩": "r",
"Ṧ": "S",
"ṧ": "s",
"V̌": "V",
"v̌": "v",
"W̌": "W",
"w̌": "w",
"X̌": "X",
"x̌": "x",
"Y̌": "Y",
"y̌": "y",
"A̧": "A",
"a̧": "a",
"B̧": "B",
"b̧": "b",
"Ḑ": "D",
"ḑ": "d",
"Ȩ": "E",
"ȩ": "e",
"Ɛ̧": "E",
"ɛ̧": "e",
"Ḩ": "H",
"ḩ": "h",
"I̧": "I",
"i̧": "i",
"Ɨ̧": "I",
"ɨ̧": "i",
"M̧": "M",
"m̧": "m",
"O̧": "O",
"o̧": "o",
"Q̧": "Q",
"q̧": "q",
"U̧": "U",
"u̧": "u",
"X̧": "X",
"x̧": "x",
"Z̧": "Z",
"z̧": "z",
"й":"и",
"Й":"И",
"ё":"е",
"Ё":"Е",
};
var chars = Object.keys(characterMap).join('|');
var allAccents = new RegExp(chars, 'g');
var firstAccent = new RegExp(chars, '');
function matcher(match) {
return characterMap[match];
}
var removeAccents = function(string) {
return string.replace(allAccents, matcher);
};
var hasAccents = function(string) {
return !!string.match(firstAccent);
};
module.exports = removeAccents;
module.exports.has = hasAccents;
module.exports.remove = removeAccents;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/create fake namespace object */
/******/ (() => {
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ var leafPrototypes;
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 16: return value when it's Promise-like
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = this(value);
/******/ if(mode & 8) return value;
/******/ if(typeof value === 'object' && value) {
/******/ if((mode & 4) && value.__esModule) return value;
/******/ if((mode & 16) && typeof value.then === 'function') return value;
/******/ }
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ var def = {};
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ }
/******/ def['default'] = () => (value);
/******/ __webpack_require__.d(ns, def);
/******/ return ns;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ 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] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
__experimentalGetCoreBlocks: () => (/* binding */ __experimentalGetCoreBlocks),
__experimentalRegisterExperimentalCoreBlocks: () => (/* binding */ __experimentalRegisterExperimentalCoreBlocks),
privateApis: () => (/* reexport */ privateApis),
registerCoreBlocks: () => (/* binding */ registerCoreBlocks)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/accordion/index.js
var accordion_namespaceObject = {};
__webpack_require__.r(accordion_namespaceObject);
__webpack_require__.d(accordion_namespaceObject, {
init: () => (init),
metadata: () => (block_namespaceObject),
name: () => (accordion_name),
settings: () => (settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/accordion-item/index.js
var accordion_item_namespaceObject = {};
__webpack_require__.r(accordion_item_namespaceObject);
__webpack_require__.d(accordion_item_namespaceObject, {
init: () => (accordion_item_init),
metadata: () => (accordion_item_block_namespaceObject),
name: () => (accordion_item_name),
settings: () => (accordion_item_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/accordion-heading/index.js
var accordion_heading_namespaceObject = {};
__webpack_require__.r(accordion_heading_namespaceObject);
__webpack_require__.d(accordion_heading_namespaceObject, {
init: () => (accordion_heading_init),
metadata: () => (accordion_heading_block_namespaceObject),
name: () => (accordion_heading_name),
settings: () => (accordion_heading_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/accordion-panel/index.js
var accordion_panel_namespaceObject = {};
__webpack_require__.r(accordion_panel_namespaceObject);
__webpack_require__.d(accordion_panel_namespaceObject, {
init: () => (accordion_panel_init),
metadata: () => (accordion_panel_block_namespaceObject),
name: () => (accordion_panel_name),
settings: () => (accordion_panel_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js
var archives_namespaceObject = {};
__webpack_require__.r(archives_namespaceObject);
__webpack_require__.d(archives_namespaceObject, {
init: () => (archives_init),
metadata: () => (archives_block_namespaceObject),
name: () => (archives_name),
settings: () => (archives_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js
var avatar_namespaceObject = {};
__webpack_require__.r(avatar_namespaceObject);
__webpack_require__.d(avatar_namespaceObject, {
init: () => (avatar_init),
metadata: () => (avatar_block_namespaceObject),
name: () => (avatar_name),
settings: () => (avatar_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js
var build_module_audio_namespaceObject = {};
__webpack_require__.r(build_module_audio_namespaceObject);
__webpack_require__.d(build_module_audio_namespaceObject, {
init: () => (audio_init),
metadata: () => (audio_block_namespaceObject),
name: () => (audio_name),
settings: () => (audio_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/breadcrumbs/index.js
var build_module_breadcrumbs_namespaceObject = {};
__webpack_require__.r(build_module_breadcrumbs_namespaceObject);
__webpack_require__.d(build_module_breadcrumbs_namespaceObject, {
init: () => (breadcrumbs_init),
metadata: () => (breadcrumbs_block_namespaceObject),
name: () => (breadcrumbs_name),
settings: () => (breadcrumbs_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js
var build_module_button_namespaceObject = {};
__webpack_require__.r(build_module_button_namespaceObject);
__webpack_require__.d(build_module_button_namespaceObject, {
init: () => (button_init),
metadata: () => (button_block_namespaceObject),
name: () => (button_name),
settings: () => (button_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js
var build_module_buttons_namespaceObject = {};
__webpack_require__.r(build_module_buttons_namespaceObject);
__webpack_require__.d(build_module_buttons_namespaceObject, {
init: () => (buttons_init),
metadata: () => (buttons_block_namespaceObject),
name: () => (buttons_name),
settings: () => (buttons_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js
var build_module_calendar_namespaceObject = {};
__webpack_require__.r(build_module_calendar_namespaceObject);
__webpack_require__.d(build_module_calendar_namespaceObject, {
init: () => (calendar_init),
metadata: () => (calendar_block_namespaceObject),
name: () => (calendar_name),
settings: () => (calendar_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js
var categories_namespaceObject = {};
__webpack_require__.r(categories_namespaceObject);
__webpack_require__.d(categories_namespaceObject, {
init: () => (categories_init),
metadata: () => (categories_block_namespaceObject),
name: () => (categories_name),
settings: () => (categories_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js
var freeform_namespaceObject = {};
__webpack_require__.r(freeform_namespaceObject);
__webpack_require__.d(freeform_namespaceObject, {
init: () => (freeform_init),
metadata: () => (freeform_block_namespaceObject),
name: () => (freeform_name),
settings: () => (freeform_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js
var build_module_code_namespaceObject = {};
__webpack_require__.r(build_module_code_namespaceObject);
__webpack_require__.d(build_module_code_namespaceObject, {
init: () => (code_init),
metadata: () => (code_block_namespaceObject),
name: () => (code_name),
settings: () => (code_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js
var build_module_column_namespaceObject = {};
__webpack_require__.r(build_module_column_namespaceObject);
__webpack_require__.d(build_module_column_namespaceObject, {
init: () => (column_init),
metadata: () => (column_block_namespaceObject),
name: () => (column_name),
settings: () => (column_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js
var build_module_columns_namespaceObject = {};
__webpack_require__.r(build_module_columns_namespaceObject);
__webpack_require__.d(build_module_columns_namespaceObject, {
init: () => (columns_init),
metadata: () => (columns_block_namespaceObject),
name: () => (columns_name),
settings: () => (columns_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments/index.js
var comments_namespaceObject = {};
__webpack_require__.r(comments_namespaceObject);
__webpack_require__.d(comments_namespaceObject, {
init: () => (comments_init),
metadata: () => (comments_block_namespaceObject),
name: () => (comments_name),
settings: () => (comments_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js
var build_module_comment_author_avatar_namespaceObject = {};
__webpack_require__.r(build_module_comment_author_avatar_namespaceObject);
__webpack_require__.d(build_module_comment_author_avatar_namespaceObject, {
init: () => (comment_author_avatar_init),
metadata: () => (comment_author_avatar_block_namespaceObject),
name: () => (comment_author_avatar_name),
settings: () => (comment_author_avatar_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
var build_module_comment_author_name_namespaceObject = {};
__webpack_require__.r(build_module_comment_author_name_namespaceObject);
__webpack_require__.d(build_module_comment_author_name_namespaceObject, {
init: () => (comment_author_name_init),
metadata: () => (comment_author_name_block_namespaceObject),
name: () => (comment_author_name_name),
settings: () => (comment_author_name_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
var build_module_comment_content_namespaceObject = {};
__webpack_require__.r(build_module_comment_content_namespaceObject);
__webpack_require__.d(build_module_comment_content_namespaceObject, {
init: () => (comment_content_init),
metadata: () => (comment_content_block_namespaceObject),
name: () => (comment_content_name),
settings: () => (comment_content_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
var comment_date_namespaceObject = {};
__webpack_require__.r(comment_date_namespaceObject);
__webpack_require__.d(comment_date_namespaceObject, {
init: () => (comment_date_init),
metadata: () => (comment_date_block_namespaceObject),
name: () => (comment_date_name),
settings: () => (comment_date_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
var build_module_comment_edit_link_namespaceObject = {};
__webpack_require__.r(build_module_comment_edit_link_namespaceObject);
__webpack_require__.d(build_module_comment_edit_link_namespaceObject, {
init: () => (comment_edit_link_init),
metadata: () => (comment_edit_link_block_namespaceObject),
name: () => (comment_edit_link_name),
settings: () => (comment_edit_link_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
var build_module_comment_reply_link_namespaceObject = {};
__webpack_require__.r(build_module_comment_reply_link_namespaceObject);
__webpack_require__.d(build_module_comment_reply_link_namespaceObject, {
init: () => (comment_reply_link_init),
metadata: () => (comment_reply_link_block_namespaceObject),
name: () => (comment_reply_link_name),
settings: () => (comment_reply_link_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
var comment_template_namespaceObject = {};
__webpack_require__.r(comment_template_namespaceObject);
__webpack_require__.d(comment_template_namespaceObject, {
init: () => (comment_template_init),
metadata: () => (comment_template_block_namespaceObject),
name: () => (comment_template_name),
settings: () => (comment_template_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
var comments_pagination_previous_namespaceObject = {};
__webpack_require__.r(comments_pagination_previous_namespaceObject);
__webpack_require__.d(comments_pagination_previous_namespaceObject, {
init: () => (comments_pagination_previous_init),
metadata: () => (comments_pagination_previous_block_namespaceObject),
name: () => (comments_pagination_previous_name),
settings: () => (comments_pagination_previous_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
var comments_pagination_namespaceObject = {};
__webpack_require__.r(comments_pagination_namespaceObject);
__webpack_require__.d(comments_pagination_namespaceObject, {
init: () => (comments_pagination_init),
metadata: () => (comments_pagination_block_namespaceObject),
name: () => (comments_pagination_name),
settings: () => (comments_pagination_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
var comments_pagination_next_namespaceObject = {};
__webpack_require__.r(comments_pagination_next_namespaceObject);
__webpack_require__.d(comments_pagination_next_namespaceObject, {
init: () => (comments_pagination_next_init),
metadata: () => (comments_pagination_next_block_namespaceObject),
name: () => (comments_pagination_next_name),
settings: () => (comments_pagination_next_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
var comments_pagination_numbers_namespaceObject = {};
__webpack_require__.r(comments_pagination_numbers_namespaceObject);
__webpack_require__.d(comments_pagination_numbers_namespaceObject, {
init: () => (comments_pagination_numbers_init),
metadata: () => (comments_pagination_numbers_block_namespaceObject),
name: () => (comments_pagination_numbers_name),
settings: () => (comments_pagination_numbers_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
var comments_title_namespaceObject = {};
__webpack_require__.r(comments_title_namespaceObject);
__webpack_require__.d(comments_title_namespaceObject, {
init: () => (comments_title_init),
metadata: () => (comments_title_block_namespaceObject),
name: () => (comments_title_name),
settings: () => (comments_title_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js
var build_module_cover_namespaceObject = {};
__webpack_require__.r(build_module_cover_namespaceObject);
__webpack_require__.d(build_module_cover_namespaceObject, {
init: () => (cover_init),
metadata: () => (cover_block_namespaceObject),
name: () => (cover_name),
settings: () => (cover_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/details/index.js
var build_module_details_namespaceObject = {};
__webpack_require__.r(build_module_details_namespaceObject);
__webpack_require__.d(build_module_details_namespaceObject, {
init: () => (details_init),
metadata: () => (details_block_namespaceObject),
name: () => (details_name),
settings: () => (details_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js
var embed_namespaceObject = {};
__webpack_require__.r(embed_namespaceObject);
__webpack_require__.d(embed_namespaceObject, {
init: () => (embed_init),
metadata: () => (embed_block_namespaceObject),
name: () => (embed_name),
settings: () => (embed_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js
var build_module_file_namespaceObject = {};
__webpack_require__.r(build_module_file_namespaceObject);
__webpack_require__.d(build_module_file_namespaceObject, {
init: () => (file_init),
metadata: () => (file_block_namespaceObject),
name: () => (file_name),
settings: () => (file_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form/index.js
var build_module_form_namespaceObject = {};
__webpack_require__.r(build_module_form_namespaceObject);
__webpack_require__.d(build_module_form_namespaceObject, {
init: () => (form_init),
metadata: () => (form_block_namespaceObject),
name: () => (form_name),
settings: () => (form_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-input/index.js
var form_input_namespaceObject = {};
__webpack_require__.r(form_input_namespaceObject);
__webpack_require__.d(form_input_namespaceObject, {
init: () => (form_input_init),
metadata: () => (form_input_block_namespaceObject),
name: () => (form_input_name),
settings: () => (form_input_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js
var form_submit_button_namespaceObject = {};
__webpack_require__.r(form_submit_button_namespaceObject);
__webpack_require__.d(form_submit_button_namespaceObject, {
init: () => (form_submit_button_init),
metadata: () => (form_submit_button_block_namespaceObject),
name: () => (form_submit_button_name),
settings: () => (form_submit_button_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js
var form_submission_notification_namespaceObject = {};
__webpack_require__.r(form_submission_notification_namespaceObject);
__webpack_require__.d(form_submission_notification_namespaceObject, {
init: () => (form_submission_notification_init),
metadata: () => (form_submission_notification_block_namespaceObject),
name: () => (form_submission_notification_name),
settings: () => (form_submission_notification_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js
var build_module_gallery_namespaceObject = {};
__webpack_require__.r(build_module_gallery_namespaceObject);
__webpack_require__.d(build_module_gallery_namespaceObject, {
init: () => (gallery_init),
metadata: () => (gallery_block_namespaceObject),
name: () => (gallery_name),
settings: () => (gallery_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js
var build_module_group_namespaceObject = {};
__webpack_require__.r(build_module_group_namespaceObject);
__webpack_require__.d(build_module_group_namespaceObject, {
init: () => (group_init),
metadata: () => (group_block_namespaceObject),
name: () => (group_name),
settings: () => (group_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js
var build_module_heading_namespaceObject = {};
__webpack_require__.r(build_module_heading_namespaceObject);
__webpack_require__.d(build_module_heading_namespaceObject, {
init: () => (heading_init),
metadata: () => (heading_block_namespaceObject),
name: () => (heading_name),
settings: () => (heading_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js
var home_link_namespaceObject = {};
__webpack_require__.r(home_link_namespaceObject);
__webpack_require__.d(home_link_namespaceObject, {
init: () => (home_link_init),
metadata: () => (home_link_block_namespaceObject),
name: () => (home_link_name),
settings: () => (home_link_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js
var build_module_html_namespaceObject = {};
__webpack_require__.r(build_module_html_namespaceObject);
__webpack_require__.d(build_module_html_namespaceObject, {
init: () => (html_init),
metadata: () => (html_block_namespaceObject),
name: () => (html_name),
settings: () => (html_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js
var build_module_image_namespaceObject = {};
__webpack_require__.r(build_module_image_namespaceObject);
__webpack_require__.d(build_module_image_namespaceObject, {
init: () => (image_init),
metadata: () => (image_block_namespaceObject),
name: () => (image_name),
settings: () => (image_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
var latest_comments_namespaceObject = {};
__webpack_require__.r(latest_comments_namespaceObject);
__webpack_require__.d(latest_comments_namespaceObject, {
init: () => (latest_comments_init),
metadata: () => (latest_comments_block_namespaceObject),
name: () => (latest_comments_name),
settings: () => (latest_comments_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
var latest_posts_namespaceObject = {};
__webpack_require__.r(latest_posts_namespaceObject);
__webpack_require__.d(latest_posts_namespaceObject, {
init: () => (latest_posts_init),
metadata: () => (latest_posts_block_namespaceObject),
name: () => (latest_posts_name),
settings: () => (latest_posts_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js
var build_module_list_namespaceObject = {};
__webpack_require__.r(build_module_list_namespaceObject);
__webpack_require__.d(build_module_list_namespaceObject, {
init: () => (list_init),
metadata: () => (list_block_namespaceObject),
name: () => (list_name),
settings: () => (list_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/math/index.js
var build_module_math_namespaceObject = {};
__webpack_require__.r(build_module_math_namespaceObject);
__webpack_require__.d(build_module_math_namespaceObject, {
init: () => (math_init),
metadata: () => (math_block_namespaceObject),
name: () => (math_name),
settings: () => (math_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list-item/index.js
var build_module_list_item_namespaceObject = {};
__webpack_require__.r(build_module_list_item_namespaceObject);
__webpack_require__.d(build_module_list_item_namespaceObject, {
init: () => (list_item_init),
metadata: () => (list_item_block_namespaceObject),
name: () => (list_item_name),
settings: () => (list_item_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
var loginout_namespaceObject = {};
__webpack_require__.r(loginout_namespaceObject);
__webpack_require__.d(loginout_namespaceObject, {
init: () => (loginout_init),
metadata: () => (loginout_block_namespaceObject),
name: () => (loginout_name),
settings: () => (loginout_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
var media_text_namespaceObject = {};
__webpack_require__.r(media_text_namespaceObject);
__webpack_require__.d(media_text_namespaceObject, {
init: () => (media_text_init),
metadata: () => (media_text_block_namespaceObject),
name: () => (media_text_name),
settings: () => (media_text_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js
var missing_namespaceObject = {};
__webpack_require__.r(missing_namespaceObject);
__webpack_require__.d(missing_namespaceObject, {
init: () => (missing_init),
metadata: () => (missing_block_namespaceObject),
name: () => (missing_name),
settings: () => (missing_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js
var build_module_more_namespaceObject = {};
__webpack_require__.r(build_module_more_namespaceObject);
__webpack_require__.d(build_module_more_namespaceObject, {
init: () => (more_init),
metadata: () => (more_block_namespaceObject),
name: () => (more_name),
settings: () => (more_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
var build_module_navigation_namespaceObject = {};
__webpack_require__.r(build_module_navigation_namespaceObject);
__webpack_require__.d(build_module_navigation_namespaceObject, {
init: () => (navigation_init),
metadata: () => (navigation_block_namespaceObject),
name: () => (navigation_name),
settings: () => (navigation_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
var navigation_link_namespaceObject = {};
__webpack_require__.r(navigation_link_namespaceObject);
__webpack_require__.d(navigation_link_namespaceObject, {
init: () => (navigation_link_init),
metadata: () => (navigation_link_block_namespaceObject),
name: () => (navigation_link_name),
settings: () => (navigation_link_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
var navigation_submenu_namespaceObject = {};
__webpack_require__.r(navigation_submenu_namespaceObject);
__webpack_require__.d(navigation_submenu_namespaceObject, {
init: () => (navigation_submenu_init),
metadata: () => (navigation_submenu_block_namespaceObject),
name: () => (navigation_submenu_name),
settings: () => (navigation_submenu_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
var nextpage_namespaceObject = {};
__webpack_require__.r(nextpage_namespaceObject);
__webpack_require__.d(nextpage_namespaceObject, {
init: () => (nextpage_init),
metadata: () => (nextpage_block_namespaceObject),
name: () => (nextpage_name),
settings: () => (nextpage_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
var pattern_namespaceObject = {};
__webpack_require__.r(pattern_namespaceObject);
__webpack_require__.d(pattern_namespaceObject, {
init: () => (pattern_init),
metadata: () => (pattern_block_namespaceObject),
name: () => (pattern_name),
settings: () => (pattern_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
var page_list_namespaceObject = {};
__webpack_require__.r(page_list_namespaceObject);
__webpack_require__.d(page_list_namespaceObject, {
init: () => (page_list_init),
metadata: () => (page_list_block_namespaceObject),
name: () => (page_list_name),
settings: () => (page_list_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js
var page_list_item_namespaceObject = {};
__webpack_require__.r(page_list_item_namespaceObject);
__webpack_require__.d(page_list_item_namespaceObject, {
init: () => (page_list_item_init),
metadata: () => (page_list_item_block_namespaceObject),
name: () => (page_list_item_name),
settings: () => (page_list_item_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
var build_module_paragraph_namespaceObject = {};
__webpack_require__.r(build_module_paragraph_namespaceObject);
__webpack_require__.d(build_module_paragraph_namespaceObject, {
init: () => (paragraph_init),
metadata: () => (paragraph_block_namespaceObject),
name: () => (paragraph_name),
settings: () => (paragraph_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
var build_module_post_author_namespaceObject = {};
__webpack_require__.r(build_module_post_author_namespaceObject);
__webpack_require__.d(build_module_post_author_namespaceObject, {
init: () => (post_author_init),
metadata: () => (post_author_block_namespaceObject),
name: () => (post_author_name),
settings: () => (post_author_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js
var post_author_name_namespaceObject = {};
__webpack_require__.r(post_author_name_namespaceObject);
__webpack_require__.d(post_author_name_namespaceObject, {
init: () => (post_author_name_init),
metadata: () => (post_author_name_block_namespaceObject),
name: () => (post_author_name_name),
settings: () => (post_author_name_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js
var post_author_biography_namespaceObject = {};
__webpack_require__.r(post_author_biography_namespaceObject);
__webpack_require__.d(post_author_biography_namespaceObject, {
init: () => (post_author_biography_init),
metadata: () => (post_author_biography_block_namespaceObject),
name: () => (post_author_biography_name),
settings: () => (post_author_biography_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js
var post_comment_namespaceObject = {};
__webpack_require__.r(post_comment_namespaceObject);
__webpack_require__.d(post_comment_namespaceObject, {
init: () => (post_comment_init),
metadata: () => (post_comment_block_namespaceObject),
name: () => (post_comment_name),
settings: () => (post_comment_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js
var build_module_post_comments_count_namespaceObject = {};
__webpack_require__.r(build_module_post_comments_count_namespaceObject);
__webpack_require__.d(build_module_post_comments_count_namespaceObject, {
init: () => (post_comments_count_init),
metadata: () => (post_comments_count_block_namespaceObject),
name: () => (post_comments_count_name),
settings: () => (post_comments_count_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js
var build_module_post_comments_form_namespaceObject = {};
__webpack_require__.r(build_module_post_comments_form_namespaceObject);
__webpack_require__.d(build_module_post_comments_form_namespaceObject, {
init: () => (post_comments_form_init),
metadata: () => (post_comments_form_block_namespaceObject),
name: () => (post_comments_form_name),
settings: () => (post_comments_form_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js
var post_comments_link_namespaceObject = {};
__webpack_require__.r(post_comments_link_namespaceObject);
__webpack_require__.d(post_comments_link_namespaceObject, {
init: () => (post_comments_link_init),
metadata: () => (post_comments_link_block_namespaceObject),
name: () => (post_comments_link_name),
settings: () => (post_comments_link_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
var build_module_post_content_namespaceObject = {};
__webpack_require__.r(build_module_post_content_namespaceObject);
__webpack_require__.d(build_module_post_content_namespaceObject, {
init: () => (post_content_init),
metadata: () => (post_content_block_namespaceObject),
name: () => (post_content_name),
settings: () => (post_content_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
var build_module_post_date_namespaceObject = {};
__webpack_require__.r(build_module_post_date_namespaceObject);
__webpack_require__.d(build_module_post_date_namespaceObject, {
init: () => (post_date_init),
metadata: () => (post_date_block_namespaceObject),
name: () => (post_date_name),
settings: () => (post_date_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
var build_module_post_excerpt_namespaceObject = {};
__webpack_require__.r(build_module_post_excerpt_namespaceObject);
__webpack_require__.d(build_module_post_excerpt_namespaceObject, {
init: () => (post_excerpt_init),
metadata: () => (post_excerpt_block_namespaceObject),
name: () => (post_excerpt_name),
settings: () => (post_excerpt_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
var build_module_post_featured_image_namespaceObject = {};
__webpack_require__.r(build_module_post_featured_image_namespaceObject);
__webpack_require__.d(build_module_post_featured_image_namespaceObject, {
init: () => (post_featured_image_init),
metadata: () => (post_featured_image_block_namespaceObject),
name: () => (post_featured_image_name),
settings: () => (post_featured_image_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
var post_navigation_link_namespaceObject = {};
__webpack_require__.r(post_navigation_link_namespaceObject);
__webpack_require__.d(post_navigation_link_namespaceObject, {
init: () => (post_navigation_link_init),
metadata: () => (post_navigation_link_block_namespaceObject),
name: () => (post_navigation_link_name),
settings: () => (post_navigation_link_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
var post_template_namespaceObject = {};
__webpack_require__.r(post_template_namespaceObject);
__webpack_require__.d(post_template_namespaceObject, {
init: () => (post_template_init),
metadata: () => (post_template_block_namespaceObject),
name: () => (post_template_name),
settings: () => (post_template_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
var build_module_post_terms_namespaceObject = {};
__webpack_require__.r(build_module_post_terms_namespaceObject);
__webpack_require__.d(build_module_post_terms_namespaceObject, {
init: () => (post_terms_init),
metadata: () => (post_terms_block_namespaceObject),
name: () => (post_terms_name),
settings: () => (post_terms_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js
var post_time_to_read_namespaceObject = {};
__webpack_require__.r(post_time_to_read_namespaceObject);
__webpack_require__.d(post_time_to_read_namespaceObject, {
init: () => (post_time_to_read_init),
metadata: () => (post_time_to_read_block_namespaceObject),
name: () => (post_time_to_read_name),
settings: () => (post_time_to_read_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
var post_title_namespaceObject = {};
__webpack_require__.r(post_title_namespaceObject);
__webpack_require__.d(post_title_namespaceObject, {
init: () => (post_title_init),
metadata: () => (post_title_block_namespaceObject),
name: () => (post_title_name),
settings: () => (post_title_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
var build_module_preformatted_namespaceObject = {};
__webpack_require__.r(build_module_preformatted_namespaceObject);
__webpack_require__.d(build_module_preformatted_namespaceObject, {
init: () => (preformatted_init),
metadata: () => (preformatted_block_namespaceObject),
name: () => (preformatted_name),
settings: () => (preformatted_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
var build_module_pullquote_namespaceObject = {};
__webpack_require__.r(build_module_pullquote_namespaceObject);
__webpack_require__.d(build_module_pullquote_namespaceObject, {
init: () => (pullquote_init),
metadata: () => (pullquote_block_namespaceObject),
name: () => (pullquote_name),
settings: () => (pullquote_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js
var query_namespaceObject = {};
__webpack_require__.r(query_namespaceObject);
__webpack_require__.d(query_namespaceObject, {
init: () => (query_init),
metadata: () => (query_block_namespaceObject),
name: () => (query_name),
settings: () => (query_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js
var query_no_results_namespaceObject = {};
__webpack_require__.r(query_no_results_namespaceObject);
__webpack_require__.d(query_no_results_namespaceObject, {
init: () => (query_no_results_init),
metadata: () => (query_no_results_block_namespaceObject),
name: () => (query_no_results_name),
settings: () => (query_no_results_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
var build_module_query_pagination_namespaceObject = {};
__webpack_require__.r(build_module_query_pagination_namespaceObject);
__webpack_require__.d(build_module_query_pagination_namespaceObject, {
init: () => (query_pagination_init),
metadata: () => (query_pagination_block_namespaceObject),
name: () => (query_pagination_name),
settings: () => (query_pagination_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
var build_module_query_pagination_next_namespaceObject = {};
__webpack_require__.r(build_module_query_pagination_next_namespaceObject);
__webpack_require__.d(build_module_query_pagination_next_namespaceObject, {
init: () => (query_pagination_next_init),
metadata: () => (query_pagination_next_block_namespaceObject),
name: () => (query_pagination_next_name),
settings: () => (query_pagination_next_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
var build_module_query_pagination_numbers_namespaceObject = {};
__webpack_require__.r(build_module_query_pagination_numbers_namespaceObject);
__webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, {
init: () => (query_pagination_numbers_init),
metadata: () => (query_pagination_numbers_block_namespaceObject),
name: () => (query_pagination_numbers_name),
settings: () => (query_pagination_numbers_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
var build_module_query_pagination_previous_namespaceObject = {};
__webpack_require__.r(build_module_query_pagination_previous_namespaceObject);
__webpack_require__.d(build_module_query_pagination_previous_namespaceObject, {
init: () => (query_pagination_previous_init),
metadata: () => (query_pagination_previous_block_namespaceObject),
name: () => (query_pagination_previous_name),
settings: () => (query_pagination_previous_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
var query_title_namespaceObject = {};
__webpack_require__.r(query_title_namespaceObject);
__webpack_require__.d(query_title_namespaceObject, {
init: () => (query_title_init),
metadata: () => (query_title_block_namespaceObject),
name: () => (query_title_name),
settings: () => (query_title_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-total/index.js
var query_total_namespaceObject = {};
__webpack_require__.r(query_total_namespaceObject);
__webpack_require__.d(query_total_namespaceObject, {
init: () => (query_total_init),
metadata: () => (query_total_block_namespaceObject),
name: () => (query_total_name),
settings: () => (query_total_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js
var build_module_quote_namespaceObject = {};
__webpack_require__.r(build_module_quote_namespaceObject);
__webpack_require__.d(build_module_quote_namespaceObject, {
init: () => (quote_init),
metadata: () => (quote_block_namespaceObject),
name: () => (quote_name),
settings: () => (quote_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js
var build_module_block_namespaceObject = {};
__webpack_require__.r(build_module_block_namespaceObject);
__webpack_require__.d(build_module_block_namespaceObject, {
init: () => (block_init),
metadata: () => (block_block_namespaceObject),
name: () => (block_name),
settings: () => (block_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js
var read_more_namespaceObject = {};
__webpack_require__.r(read_more_namespaceObject);
__webpack_require__.d(read_more_namespaceObject, {
init: () => (read_more_init),
metadata: () => (read_more_block_namespaceObject),
name: () => (read_more_name),
settings: () => (read_more_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js
var build_module_rss_namespaceObject = {};
__webpack_require__.r(build_module_rss_namespaceObject);
__webpack_require__.d(build_module_rss_namespaceObject, {
init: () => (rss_init),
metadata: () => (rss_block_namespaceObject),
name: () => (rss_name),
settings: () => (rss_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js
var build_module_search_namespaceObject = {};
__webpack_require__.r(build_module_search_namespaceObject);
__webpack_require__.d(build_module_search_namespaceObject, {
init: () => (search_init),
metadata: () => (search_block_namespaceObject),
name: () => (search_name),
settings: () => (search_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js
var build_module_separator_namespaceObject = {};
__webpack_require__.r(build_module_separator_namespaceObject);
__webpack_require__.d(build_module_separator_namespaceObject, {
init: () => (separator_init),
metadata: () => (separator_block_namespaceObject),
name: () => (separator_name),
settings: () => (separator_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
var build_module_shortcode_namespaceObject = {};
__webpack_require__.r(build_module_shortcode_namespaceObject);
__webpack_require__.d(build_module_shortcode_namespaceObject, {
init: () => (shortcode_init),
metadata: () => (shortcode_block_namespaceObject),
name: () => (shortcode_name),
settings: () => (shortcode_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
var build_module_site_logo_namespaceObject = {};
__webpack_require__.r(build_module_site_logo_namespaceObject);
__webpack_require__.d(build_module_site_logo_namespaceObject, {
init: () => (site_logo_init),
metadata: () => (site_logo_block_namespaceObject),
name: () => (site_logo_name),
settings: () => (site_logo_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
var site_tagline_namespaceObject = {};
__webpack_require__.r(site_tagline_namespaceObject);
__webpack_require__.d(site_tagline_namespaceObject, {
init: () => (site_tagline_init),
metadata: () => (site_tagline_block_namespaceObject),
name: () => (site_tagline_name),
settings: () => (site_tagline_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
var site_title_namespaceObject = {};
__webpack_require__.r(site_title_namespaceObject);
__webpack_require__.d(site_title_namespaceObject, {
init: () => (site_title_init),
metadata: () => (site_title_block_namespaceObject),
name: () => (site_title_name),
settings: () => (site_title_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
var social_link_namespaceObject = {};
__webpack_require__.r(social_link_namespaceObject);
__webpack_require__.d(social_link_namespaceObject, {
init: () => (social_link_init),
metadata: () => (social_link_block_namespaceObject),
name: () => (social_link_name),
settings: () => (social_link_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
var social_links_namespaceObject = {};
__webpack_require__.r(social_links_namespaceObject);
__webpack_require__.d(social_links_namespaceObject, {
init: () => (social_links_init),
metadata: () => (social_links_block_namespaceObject),
name: () => (social_links_name),
settings: () => (social_links_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
var spacer_namespaceObject = {};
__webpack_require__.r(spacer_namespaceObject);
__webpack_require__.d(spacer_namespaceObject, {
init: () => (spacer_init),
metadata: () => (spacer_block_namespaceObject),
name: () => (spacer_name),
settings: () => (spacer_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js
var build_module_table_namespaceObject = {};
__webpack_require__.r(build_module_table_namespaceObject);
__webpack_require__.d(build_module_table_namespaceObject, {
init: () => (table_init),
metadata: () => (table_block_namespaceObject),
name: () => (table_name),
settings: () => (table_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js
var build_module_table_of_contents_namespaceObject = {};
__webpack_require__.r(build_module_table_of_contents_namespaceObject);
__webpack_require__.d(build_module_table_of_contents_namespaceObject, {
init: () => (table_of_contents_init),
metadata: () => (table_of_contents_block_namespaceObject),
name: () => (table_of_contents_name),
settings: () => (table_of_contents_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
var tag_cloud_namespaceObject = {};
__webpack_require__.r(tag_cloud_namespaceObject);
__webpack_require__.d(tag_cloud_namespaceObject, {
init: () => (tag_cloud_init),
metadata: () => (tag_cloud_block_namespaceObject),
name: () => (tag_cloud_name),
settings: () => (tag_cloud_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
var template_part_namespaceObject = {};
__webpack_require__.r(template_part_namespaceObject);
__webpack_require__.d(template_part_namespaceObject, {
init: () => (template_part_init),
metadata: () => (template_part_block_namespaceObject),
name: () => (template_part_name),
settings: () => (template_part_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-count/index.js
var build_module_term_count_namespaceObject = {};
__webpack_require__.r(build_module_term_count_namespaceObject);
__webpack_require__.d(build_module_term_count_namespaceObject, {
init: () => (term_count_init),
metadata: () => (term_count_block_namespaceObject),
name: () => (term_count_name),
settings: () => (term_count_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
var build_module_term_description_namespaceObject = {};
__webpack_require__.r(build_module_term_description_namespaceObject);
__webpack_require__.d(build_module_term_description_namespaceObject, {
init: () => (term_description_init),
metadata: () => (term_description_block_namespaceObject),
name: () => (term_description_name),
settings: () => (term_description_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-name/index.js
var build_module_term_name_namespaceObject = {};
__webpack_require__.r(build_module_term_name_namespaceObject);
__webpack_require__.d(build_module_term_name_namespaceObject, {
init: () => (term_name_init),
metadata: () => (term_name_block_namespaceObject),
name: () => (term_name_name),
settings: () => (term_name_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/terms-query/index.js
var terms_query_namespaceObject = {};
__webpack_require__.r(terms_query_namespaceObject);
__webpack_require__.d(terms_query_namespaceObject, {
init: () => (terms_query_init),
metadata: () => (terms_query_block_namespaceObject),
name: () => (terms_query_name),
settings: () => (terms_query_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-template/index.js
var term_template_namespaceObject = {};
__webpack_require__.r(term_template_namespaceObject);
__webpack_require__.d(term_template_namespaceObject, {
init: () => (term_template_init),
metadata: () => (term_template_block_namespaceObject),
name: () => (term_template_name),
settings: () => (term_template_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
var text_columns_namespaceObject = {};
__webpack_require__.r(text_columns_namespaceObject);
__webpack_require__.d(text_columns_namespaceObject, {
init: () => (text_columns_init),
metadata: () => (text_columns_block_namespaceObject),
name: () => (text_columns_name),
settings: () => (text_columns_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js
var build_module_verse_namespaceObject = {};
__webpack_require__.r(build_module_verse_namespaceObject);
__webpack_require__.d(build_module_verse_namespaceObject, {
init: () => (verse_init),
metadata: () => (verse_block_namespaceObject),
name: () => (verse_name),
settings: () => (verse_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js
var build_module_video_namespaceObject = {};
__webpack_require__.r(build_module_video_namespaceObject);
__webpack_require__.d(build_module_video_namespaceObject, {
init: () => (video_init),
metadata: () => (video_block_namespaceObject),
name: () => (video_name),
settings: () => (video_settings)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/footnotes/index.js
var footnotes_namespaceObject = {};
__webpack_require__.r(footnotes_namespaceObject);
__webpack_require__.d(footnotes_namespaceObject, {
init: () => (footnotes_init),
metadata: () => (footnotes_block_namespaceObject),
name: () => (footnotes_name),
settings: () => (footnotes_settings)
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// external ["wp","serverSideRender"]
const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"];
var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject);
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","blob"]
const external_wp_blob_namespaceObject = window["wp"]["blob"];
;// external ["wp","coreData"]
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// ./node_modules/@wordpress/block-library/build-module/utils/hooks.js
function useCanEditEntity(kind, name, recordId) {
return (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_coreData_namespaceObject.store).canUser("update", {
kind,
name,
id: recordId
}),
[kind, name, recordId]
);
}
function useUploadMediaFromBlobURL(args = {}) {
const latestArgsRef = (0,external_wp_element_namespaceObject.useRef)(args);
const hasUploadStartedRef = (0,external_wp_element_namespaceObject.useRef)(false);
const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
latestArgsRef.current = args;
});
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasUploadStartedRef.current) {
return;
}
if (!latestArgsRef.current.url || !(0,external_wp_blob_namespaceObject.isBlobURL)(latestArgsRef.current.url)) {
return;
}
const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(latestArgsRef.current.url);
if (!file) {
return;
}
const { url, allowedTypes, onChange, onError } = latestArgsRef.current;
const { mediaUpload } = getSettings();
if (!mediaUpload) {
return;
}
hasUploadStartedRef.current = true;
mediaUpload({
filesList: [file],
allowedTypes,
onFileChange: ([media]) => {
if ((0,external_wp_blob_namespaceObject.isBlobURL)(media?.url)) {
return;
}
(0,external_wp_blob_namespaceObject.revokeBlobURL)(url);
onChange(media);
hasUploadStartedRef.current = false;
},
onError: (message) => {
(0,external_wp_blob_namespaceObject.revokeBlobURL)(url);
onError(message);
hasUploadStartedRef.current = false;
}
});
}, [getSettings]);
}
function useDefaultAvatar() {
const { avatarURL: defaultAvatarUrl } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
const { __experimentalDiscussionSettings } = getSettings();
return __experimentalDiscussionSettings;
});
return defaultAvatarUrl;
}
function useToolsPanelDropdownMenuProps() {
const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)("medium", "<");
return !isMobile ? {
popoverProps: {
placement: "left-start",
// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)
offset: 259
}
} : {};
}
;// ./node_modules/@wordpress/block-library/build-module/accordion/edit.js
const ACCORDION_BLOCK_NAME = "core/accordion-item";
const ACCORDION_HEADING_BLOCK_NAME = "core/accordion-heading";
const ACCORDION_BLOCK = {
name: ACCORDION_BLOCK_NAME
};
function Edit({
attributes: {
autoclose,
iconPosition,
showIcon,
headingLevel,
levelOptions
},
clientId,
setAttributes,
isSelected: isSingleSelected
}) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const { getBlockOrder } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
role: "group"
});
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const { updateBlockAttributes, insertBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
const isContentOnlyMode = blockEditingMode === "contentOnly";
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: [[ACCORDION_BLOCK_NAME]],
defaultBlock: ACCORDION_BLOCK,
directInsert: true,
templateInsertUpdatesSelection: true
});
const addAccordionItemBlock = () => {
const newAccordionItem = (0,external_wp_blocks_namespaceObject.createBlock)(ACCORDION_BLOCK_NAME, {}, [
(0,external_wp_blocks_namespaceObject.createBlock)(ACCORDION_HEADING_BLOCK_NAME, {
level: headingLevel
}),
(0,external_wp_blocks_namespaceObject.createBlock)("core/accordion-panel", {})
]);
insertBlock(newAccordionItem, void 0, clientId);
};
const updateHeadingLevel = (newHeadingLevel) => {
const innerBlockClientIds = getBlockOrder(clientId);
const accordionHeaderClientIds = [];
innerBlockClientIds.forEach((contentClientId) => {
const headerClientIds = getBlockOrder(contentClientId);
accordionHeaderClientIds.push(...headerClientIds);
});
registry.batch(() => {
setAttributes({ headingLevel: newHeadingLevel });
updateBlockAttributes(accordionHeaderClientIds, {
level: newHeadingLevel
});
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isSingleSelected && !isContentOnlyMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.HeadingLevelDropdown,
{
value: headingLevel,
options: levelOptions,
onChange: updateHeadingLevel
}
) }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: addAccordionItemBlock, children: (0,external_wp_i18n_namespaceObject.__)("Add item") }) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
autoclose: false,
showIcon: true,
iconPosition: "right"
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Auto-close"),
isShownByDefault: true,
hasValue: () => !!autoclose,
onDeselect: () => setAttributes({ autoclose: false }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
isBlock: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Auto-close"),
onChange: (value) => {
setAttributes({
autoclose: value
});
},
checked: autoclose,
help: (0,external_wp_i18n_namespaceObject.__)(
"Automatically close accordions when a new one is opened."
)
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Show icon"),
isShownByDefault: true,
hasValue: () => !showIcon,
onDeselect: () => setAttributes({ showIcon: true }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
isBlock: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show icon"),
onChange: (value) => {
setAttributes({
showIcon: value,
iconPosition: value ? iconPosition : "right"
});
},
checked: showIcon,
help: (0,external_wp_i18n_namespaceObject.__)(
"Display a plus icon next to the accordion header."
)
}
)
}
),
showIcon && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Icon Position"),
isShownByDefault: true,
hasValue: () => iconPosition !== "right",
onDeselect: () => setAttributes({ iconPosition: "right" }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
isBlock: true,
label: (0,external_wp_i18n_namespaceObject.__)("Icon Position"),
value: iconPosition,
onChange: (value) => {
setAttributes({ iconPosition: value });
},
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
label: (0,external_wp_i18n_namespaceObject.__)("Left"),
value: "left"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
label: (0,external_wp_i18n_namespaceObject.__)("Right"),
value: "right"
}
)
]
}
)
}
)
]
}
) }, "setting"),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion/save.js
function save() {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
role: "group"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps) });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion/block.json
const block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/accordion","title":"Accordion","category":"design","description":"Displays a foldable layout that groups content in collapsible sections.","example":{},"supports":{"anchor":true,"html":false,"align":["wide","full"],"background":{"backgroundImage":true,"backgroundSize":true,"__experimentalDefaultControls":{"backgroundImage":true}},"color":{"background":true,"gradients":true},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"spacing":{"padding":true,"margin":["top","bottom"],"blockGap":true},"shadow":true,"layout":true,"ariaLabel":true,"interactivity":true,"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"contentRole":true},"attributes":{"iconPosition":{"type":"string","default":"right"},"showIcon":{"type":"boolean","default":true},"autoclose":{"type":"boolean","default":false},"headingLevel":{"type":"number","default":3},"levelOptions":{"type":"array"}},"providesContext":{"core/accordion-icon-position":"iconPosition","core/accordion-show-icon":"showIcon","core/accordion-heading-level":"headingLevel"},"allowedBlocks":["core/accordion-item"],"textdomain":"default","viewScriptModule":"@wordpress/block-library/accordion/view"}');
;// ./node_modules/@wordpress/block-library/build-module/utils/init-block.js
function initBlock(block) {
if (!block) {
return;
}
const { metadata, settings, name } = block;
return (0,external_wp_blocks_namespaceObject.registerBlockType)({ name, ...metadata }, settings);
}
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/block-library/build-module/accordion/icon.js
var icon_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.5 9.25L9.5 9.25L9.5 7.75L19.5 7.75L19.5 9.25Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.5 6L8.5 8.5L4.5 11L4.5 6Z", fill: "currentColor" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.5 16.25L9.5 16.25L9.5 14.75L19.5 14.75L19.5 16.25Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.5 13L8.5 15.5L4.5 18L4.5 13Z", fill: "currentColor" })
] });
;// ./node_modules/@wordpress/block-library/build-module/accordion/index.js
const { name: accordion_name } = block_namespaceObject;
const settings = {
icon: icon_default,
example: {
innerBlocks: [
{
name: "core/accordion-item",
innerBlocks: [
{
name: "core/accordion-heading",
attributes: {
title: (0,external_wp_i18n_namespaceObject.__)(
"Lorem ipsum dolor sit amet, consectetur."
)
}
}
]
},
{
name: "core/accordion-item",
innerBlocks: [
{
name: "core/accordion-heading",
attributes: {
title: (0,external_wp_i18n_namespaceObject.__)(
"Suspendisse commodo lacus, interdum et."
)
}
}
]
}
]
},
edit: Edit,
save: save
};
const init = () => initBlock({ name: accordion_name, metadata: block_namespaceObject, settings });
;// ./node_modules/clsx/dist/clsx.mjs
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
;// ./node_modules/@wordpress/block-library/build-module/accordion-item/edit.js
function edit_Edit({
attributes,
clientId,
setAttributes,
context
}) {
const { openByDefault } = attributes;
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const { isSelected, getBlockOrder } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
isBlockSelected,
hasSelectedInnerBlock,
getBlockOrder: getBlockOrderSelector
} = select(external_wp_blockEditor_namespaceObject.store);
return {
isSelected: isBlockSelected(clientId) || hasSelectedInnerBlock(clientId, true),
getBlockOrder: getBlockOrderSelector
};
},
[clientId]
);
const contentBlockClientId = getBlockOrder(clientId)[1];
const { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (contentBlockClientId) {
__unstableMarkNextChangeAsNotPersistent();
updateBlockAttributes(contentBlockClientId, {
isSelected
});
}
}, [
isSelected,
contentBlockClientId,
__unstableMarkNextChangeAsNotPersistent,
updateBlockAttributes
]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
"is-open": openByDefault || isSelected
})
});
const headingLevel = context && context["core/accordion-heading-level"];
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: [
[
"core/accordion-heading",
headingLevel ? { level: headingLevel } : {}
],
[
"core/accordion-panel",
{
openByDefault
}
]
],
templateLock: "all",
directInsert: true,
templateInsertUpdatesSelection: true
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({ openByDefault: false });
if (contentBlockClientId) {
updateBlockAttributes(contentBlockClientId, {
openByDefault: false
});
}
},
dropdownMenuProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Open by default"),
isShownByDefault: true,
hasValue: () => !!openByDefault,
onDeselect: () => {
setAttributes({ openByDefault: false });
if (contentBlockClientId) {
updateBlockAttributes(contentBlockClientId, {
openByDefault: false
});
}
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Open by default"),
__nextHasNoMarginBottom: true,
onChange: (value) => {
setAttributes({
openByDefault: value
});
if (contentBlockClientId) {
updateBlockAttributes(
contentBlockClientId,
{
openByDefault: value
}
);
}
},
checked: openByDefault,
help: (0,external_wp_i18n_namespaceObject.__)(
"Accordion content will be displayed by default."
)
}
)
}
)
}
) }, "setting"),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion-item/save.js
function save_save({ attributes }) {
const { openByDefault } = attributes;
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: dist_clsx({
"is-open": openByDefault
})
});
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion-item/block.json
const accordion_item_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/accordion-item","title":"Accordion Item","category":"design","description":"Wraps the heading and panel in one unit.","parent":["core/accordion"],"allowedBlocks":["core/accordion-heading","core/accordion-panel"],"supports":{"html":false,"color":{"background":true,"gradients":true},"interactivity":true,"spacing":{"margin":["top","bottom"],"blockGap":true},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"shadow":true,"layout":{"allowEditing":false},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"contentRole":true},"attributes":{"openByDefault":{"type":"boolean","default":false}},"textdomain":"default","style":"wp-block-accordion-item"}');
;// ./node_modules/@wordpress/block-library/build-module/accordion-item/icon.js
var icon_icon_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.5 9.5L9.5 9.5L9.5 8L19.5 8L19.5 9.5Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.5 13L9.5 13L9.5 11.5L19.5 11.5L19.5 13Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.5 16.3999L9.5 16.3999L9.5 14.8999L19.5 14.8999L19.5 16.3999Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.5 6.25L8.5 8.75L4.5 11.25L4.5 6.25Z", fill: "currentColor" })
] });
;// ./node_modules/@wordpress/block-library/build-module/accordion-item/index.js
const { name: accordion_item_name } = accordion_item_block_namespaceObject;
const accordion_item_settings = {
icon: icon_icon_default,
edit: edit_Edit,
save: save_save
};
const accordion_item_init = () => initBlock({ name: accordion_item_name, metadata: accordion_item_block_namespaceObject, settings: accordion_item_settings });
;// ./node_modules/@wordpress/block-library/build-module/accordion-heading/edit.js
function accordion_heading_edit_Edit({ attributes, setAttributes, context }) {
const { title } = attributes;
const {
"core/accordion-icon-position": iconPosition,
"core/accordion-show-icon": showIcon,
"core/accordion-heading-level": headingLevel
} = context;
const TagName = "h" + headingLevel;
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (iconPosition !== void 0 && showIcon !== void 0) {
setAttributes({
iconPosition,
showIcon
});
}
}, [iconPosition, showIcon, setAttributes]);
const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)(
"typography.fluid",
"layout"
);
const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, {
typography: {
fluid: fluidTypographySettings
},
layout: {
wideSize: layout?.wideSize
}
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"button",
{
className: "wp-block-accordion-heading__toggle",
style: spacingProps.style,
tabIndex: "-1",
children: [
showIcon && iconPosition === "left" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "wp-block-accordion-heading__toggle-icon",
"aria-hidden": "true",
children: "+"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText,
{
withoutInteractiveFormatting: true,
disableLineBreaks: true,
tagName: "span",
value: title,
onChange: (newTitle) => setAttributes({ title: newTitle }),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Accordion title"),
className: "wp-block-accordion-heading__toggle-title",
style: {
letterSpacing: typographyProps.style.letterSpacing,
textDecoration: typographyProps.style.textDecoration
}
}
),
showIcon && iconPosition === "right" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "wp-block-accordion-heading__toggle-icon",
"aria-hidden": "true",
children: "+"
}
)
]
}
) });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion-heading/save.js
function accordion_heading_save_save({ attributes }) {
const { level, title, iconPosition, showIcon } = attributes;
const TagName = "h" + (level || 3);
const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes);
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"button",
{
className: "wp-block-accordion-heading__toggle",
style: spacingProps.style,
children: [
showIcon && iconPosition === "left" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "wp-block-accordion-heading__toggle-icon",
"aria-hidden": "true",
children: "+"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
className: "wp-block-accordion-heading__toggle-title",
tagName: "span",
value: title,
style: {
letterSpacing: typographyProps.style.letterSpacing,
textDecoration: typographyProps.style.textDecoration
}
}
),
showIcon && iconPosition === "right" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "wp-block-accordion-heading__toggle-icon",
"aria-hidden": "true",
children: "+"
}
)
]
}
) });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion-heading/block.json
const accordion_heading_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/accordion-heading","title":"Accordion Heading","category":"design","description":"Displays a heading that toggles the accordion panel.","parent":["core/accordion-item"],"usesContext":["core/accordion-icon-position","core/accordion-show-icon","core/accordion-heading-level"],"supports":{"anchor":true,"color":{"background":true,"gradients":true},"align":false,"interactivity":true,"spacing":{"padding":true,"__experimentalDefaultControls":{"padding":true},"__experimentalSkipSerialization":true,"__experimentalSelector":".wp-block-accordion-heading__toggle"},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"typography":{"__experimentalSkipSerialization":["textDecoration","letterSpacing"],"fontSize":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true,"fontFamily":true}},"shadow":true,"visibility":false,"lock":false},"selectors":{"typography":{"letterSpacing":".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title","textDecoration":".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title"}},"attributes":{"openByDefault":{"type":"boolean","default":false},"title":{"type":"rich-text","source":"rich-text","selector":".wp-block-accordion-heading__toggle-title","role":"content"},"level":{"type":"number"},"iconPosition":{"type":"string","enum":["left","right"],"default":"right"},"showIcon":{"type":"boolean","default":true}},"textdomain":"default"}');
;// ./node_modules/@wordpress/block-library/build-module/accordion-heading/icon.js
var accordion_heading_icon_icon_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.5 12.75L9.5 12.75L9.5 11.25L19.5 11.25L19.5 12.75Z",
fill: "currentColor"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.5 9.5L8.5 12L4.5 14.5L4.5 9.5Z", fill: "currentColor" })
] });
;// ./node_modules/@wordpress/block-library/build-module/accordion-heading/deprecated.js
const v1 = {
attributes: {
openByDefault: {
type: "boolean",
default: false
},
title: {
type: "rich-text",
source: "rich-text",
selector: ".wp-block-accordion-heading__toggle-title",
role: "content"
},
level: {
type: "number"
},
iconPosition: {
type: "string",
enum: ["left", "right"],
default: "right"
},
showIcon: {
type: "boolean",
default: true
}
},
supports: {
anchor: true,
color: {
background: true,
gradients: true
},
align: false,
interactivity: true,
spacing: {
padding: true,
__experimentalDefaultControls: {
padding: true
},
__experimentalSkipSerialization: true,
__experimentalSelector: ".wp-block-accordion-heading__toggle"
},
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
radius: true,
style: true,
width: true
}
},
typography: {
fontSize: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true,
fontFamily: true
}
},
shadow: true,
visibility: false
},
save({ attributes }) {
const { level, title, iconPosition, showIcon } = attributes;
const TagName = "h" + (level || 3);
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"button",
{
className: "wp-block-accordion-heading__toggle",
style: spacingProps.style,
children: [
showIcon && iconPosition === "left" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "wp-block-accordion-heading__toggle-icon",
"aria-hidden": "true",
children: "+"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
className: "wp-block-accordion-heading__toggle-title",
tagName: "span",
value: title
}
),
showIcon && iconPosition === "right" && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: "wp-block-accordion-heading__toggle-icon",
"aria-hidden": "true",
children: "+"
}
)
]
}
) });
}
};
var deprecated_default = [v1];
;// ./node_modules/@wordpress/block-library/build-module/accordion-heading/index.js
const { name: accordion_heading_name } = accordion_heading_block_namespaceObject;
const accordion_heading_settings = {
icon: accordion_heading_icon_icon_default,
edit: accordion_heading_edit_Edit,
save: accordion_heading_save_save,
deprecated: deprecated_default
};
const accordion_heading_init = () => initBlock({ name: accordion_heading_name, metadata: accordion_heading_block_namespaceObject, settings: accordion_heading_settings });
;// ./node_modules/@wordpress/block-library/build-module/accordion-panel/edit.js
function accordion_panel_edit_Edit({ attributes }) {
const { allowedBlocks, templateLock, openByDefault, isSelected } = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
"aria-hidden": !isSelected && !openByDefault,
role: "region"
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
allowedBlocks,
template: [["core/paragraph", {}]],
templateLock
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion-panel/save.js
function accordion_panel_save_save() {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
role: "region"
});
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps });
}
;// ./node_modules/@wordpress/block-library/build-module/accordion-panel/block.json
const accordion_panel_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/accordion-panel","title":"Accordion Panel","category":"design","description":"Contains the hidden or revealed content beneath the heading.","parent":["core/accordion-item"],"supports":{"html":false,"color":{"background":true,"gradients":true},"interactivity":true,"spacing":{"padding":true,"blockGap":true,"__experimentalDefaultControls":{"padding":true,"blockGap":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"shadow":true,"layout":{"allowEditing":false},"visibility":false,"contentRole":true,"allowedBlocks":true,"lock":false},"attributes":{"templateLock":{"type":["string","boolean"],"enum":["all","insert","contentOnly",false],"default":false},"openByDefault":{"type":"boolean","default":false},"isSelected":{"type":"boolean","default":false}},"textdomain":"default","style":"wp-block-accordion-panel"}');
;// ./node_modules/@wordpress/block-library/build-module/accordion-panel/icon.js
var accordion_panel_icon_icon_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M8.10417 6.00024H6.5C5.39543 6.00024 4.5 6.89567 4.5 8.00024V10.3336H6V8.00024C6 7.7241 6.22386 7.50024 6.5 7.50024H8.10417V6.00024ZM4.5 13.6669V16.0002C4.5 17.1048 5.39543 18.0002 6.5 18.0002H8.10417V16.5002H6.5C6.22386 16.5002 6 16.2764 6 16.0002V13.6669H4.5ZM10.3958 6.00024V7.50024H13.6042V6.00024H10.3958ZM15.8958 6.00024V7.50024H17.5C17.7761 7.50024 18 7.7241 18 8.00024V10.3336H19.5V8.00024C19.5 6.89567 18.6046 6.00024 17.5 6.00024H15.8958ZM19.5 13.6669H18V16.0002C18 16.2764 17.7761 16.5002 17.5 16.5002H15.8958V18.0002H17.5C18.6046 18.0002 19.5 17.1048 19.5 16.0002V13.6669ZM13.6042 18.0002V16.5002H10.3958V18.0002H13.6042Z",
fill: "currentColor"
}
) });
;// ./node_modules/@wordpress/block-library/build-module/accordion-panel/index.js
const { name: accordion_panel_name } = accordion_panel_block_namespaceObject;
const accordion_panel_settings = {
icon: accordion_panel_icon_icon_default,
edit: accordion_panel_edit_Edit,
save: accordion_panel_save_save
};
const accordion_panel_init = () => initBlock({ name: accordion_panel_name, metadata: accordion_panel_block_namespaceObject, settings: accordion_panel_settings });
;// ./node_modules/@wordpress/icons/build-module/library/archive.js
var archive_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z"
}
) });
;// ./node_modules/@wordpress/block-library/build-module/archives/block.json
const archives_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/archives","title":"Archives","category":"widgets","description":"Display a date archive of your posts.","textdomain":"default","attributes":{"displayAsDropdown":{"type":"boolean","default":false},"showLabel":{"type":"boolean","default":true},"showPostCounts":{"type":"boolean","default":false},"type":{"type":"string","default":"monthly"}},"supports":{"align":true,"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true},"html":false,"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"interactivity":{"clientNavigation":true}},"editorStyle":"wp-block-archives-editor"}');
;// ./node_modules/@wordpress/block-library/build-module/archives/edit.js
function ArchivesEdit({ attributes, setAttributes }) {
const { showLabel, showPostCounts, displayAsDropdown, type } = attributes;
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
displayAsDropdown: false,
showLabel: true,
showPostCounts: false,
type: "monthly"
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Display as dropdown"),
isShownByDefault: true,
hasValue: () => displayAsDropdown,
onDeselect: () => setAttributes({ displayAsDropdown: false }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Display as dropdown"),
checked: displayAsDropdown,
onChange: () => setAttributes({
displayAsDropdown: !displayAsDropdown
})
}
)
}
),
displayAsDropdown && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Show label"),
isShownByDefault: true,
hasValue: () => !showLabel,
onDeselect: () => setAttributes({ showLabel: true }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show label"),
checked: showLabel,
onChange: () => setAttributes({
showLabel: !showLabel
})
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Show post counts"),
isShownByDefault: true,
hasValue: () => showPostCounts,
onDeselect: () => setAttributes({ showPostCounts: false }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show post counts"),
checked: showPostCounts,
onChange: () => setAttributes({
showPostCounts: !showPostCounts
})
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Group by"),
isShownByDefault: true,
hasValue: () => type !== "monthly",
onDeselect: () => setAttributes({ type: "monthly" }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Group by"),
options: [
{ label: (0,external_wp_i18n_namespaceObject.__)("Year"), value: "yearly" },
{ label: (0,external_wp_i18n_namespaceObject.__)("Month"), value: "monthly" },
{ label: (0,external_wp_i18n_namespaceObject.__)("Week"), value: "weekly" },
{ label: (0,external_wp_i18n_namespaceObject.__)("Day"), value: "daily" }
],
value: type,
onChange: (value) => setAttributes({ type: value })
}
)
}
)
]
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
(external_wp_serverSideRender_default()),
{
block: "core/archives",
skipBlockSupportAttributes: true,
attributes
}
) }) })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/archives/index.js
const { name: archives_name } = archives_block_namespaceObject;
const archives_settings = {
icon: archive_default,
example: {},
edit: ArchivesEdit
};
const archives_init = () => initBlock({ name: archives_name, metadata: archives_block_namespaceObject, settings: archives_settings });
;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js
var comment_author_avatar_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/block-library/build-module/avatar/block.json
const avatar_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/avatar","title":"Avatar","category":"theme","description":"Add a user’s avatar.","textdomain":"default","attributes":{"userId":{"type":"number"},"size":{"type":"number","default":96},"isLink":{"type":"boolean","default":false},"linkTarget":{"type":"string","default":"_self"}},"usesContext":["postType","postId","commentId"],"supports":{"html":false,"align":true,"alignWide":false,"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"__experimentalBorder":{"__experimentalSkipSerialization":true,"radius":true,"width":true,"color":true,"style":true,"__experimentalDefaultControls":{"radius":true}},"color":{"text":false,"background":false},"filter":{"duotone":true},"interactivity":{"clientNavigation":true}},"selectors":{"border":".wp-block-avatar img","filter":{"duotone":".wp-block-avatar img"}},"editorStyle":"wp-block-avatar-editor","style":"wp-block-avatar"}');
;// external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js
function getAvatarSizes(sizes) {
const minSize = sizes ? sizes[0] : 24;
const maxSize = sizes ? sizes[sizes.length - 1] : 96;
const maxSizeBuffer = Math.floor(maxSize * 2.5);
return {
minSize,
maxSize: maxSizeBuffer
};
}
function useCommentAvatar({ commentId }) {
const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
"root",
"comment",
"author_avatar_urls",
commentId
);
const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
"root",
"comment",
"author_name",
commentId
);
const avatarUrls = avatars ? Object.values(avatars) : null;
const sizes = avatars ? Object.keys(avatars) : null;
const { minSize, maxSize } = getAvatarSizes(sizes);
const defaultAvatar = useDefaultAvatar();
return {
src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
minSize,
maxSize,
alt: authorName ? (
// translators: %s: Author name.
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("%s Avatar"), authorName)
) : (0,external_wp_i18n_namespaceObject.__)("Default Avatar")
};
}
function useUserAvatar({ userId, postId, postType }) {
const { authorDetails } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getEditedEntityRecord, getUser } = select(external_wp_coreData_namespaceObject.store);
if (userId) {
return {
authorDetails: getUser(userId)
};
}
const _authorId = getEditedEntityRecord(
"postType",
postType,
postId
)?.author;
return {
authorDetails: _authorId ? getUser(_authorId) : null
};
},
[postType, postId, userId]
);
const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null;
const sizes = authorDetails?.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null;
const { minSize, maxSize } = getAvatarSizes(sizes);
const defaultAvatar = useDefaultAvatar();
return {
src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar,
minSize,
maxSize,
alt: authorDetails ? (
// translators: %s: Author name.
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("%s Avatar"), authorDetails?.name)
) : (0,external_wp_i18n_namespaceObject.__)("Default Avatar")
};
}
;// external ["wp","htmlEntities"]
const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
;// ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js
const AUTHORS_QUERY = {
who: "authors",
per_page: 100,
_fields: "id,name",
context: "view"
};
function UserControl({ value, onChange }) {
const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)("");
const { authors, isLoading } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getUsers, isResolving } = select(external_wp_coreData_namespaceObject.store);
const query = { ...AUTHORS_QUERY };
if (filterValue) {
query.search = filterValue;
query.search_columns = ["name"];
}
return {
authors: getUsers(query),
isLoading: isResolving("getUsers", [query])
};
},
[filterValue]
);
const options = (0,external_wp_element_namespaceObject.useMemo)(() => {
return (authors ?? []).map((author) => {
return {
value: author.id,
label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(author.name)
};
});
}, [authors]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ComboboxControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("User"),
help: (0,external_wp_i18n_namespaceObject.__)(
"Select the avatar user to display, if it is blank it will use the post/page author."
),
value,
onChange,
options,
onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(setFilterValue, 300),
isLoading
}
);
}
;// ./node_modules/@wordpress/block-library/build-module/avatar/edit.js
const AvatarInspectorControls = ({
setAttributes,
avatar,
attributes,
selectUser
}) => {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
size: 96,
isLink: false,
linkTarget: "_self",
userId: void 0
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Image size"),
isShownByDefault: true,
hasValue: () => attributes?.size !== 96,
onDeselect: () => setAttributes({ size: 96 }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Image size"),
onChange: (newSize) => setAttributes({
size: newSize
}),
min: avatar.minSize,
max: avatar.maxSize,
initialPosition: attributes?.size,
value: attributes?.size
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Link to user profile"),
isShownByDefault: true,
hasValue: () => attributes?.isLink,
onDeselect: () => setAttributes({ isLink: false }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Link to user profile"),
onChange: () => setAttributes({ isLink: !attributes.isLink }),
checked: attributes.isLink
}
)
}
),
attributes.isLink && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Open in new tab"),
isShownByDefault: true,
hasValue: () => attributes?.linkTarget !== "_self",
onDeselect: () => setAttributes({ linkTarget: "_self" }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Open in new tab"),
onChange: (value) => setAttributes({
linkTarget: value ? "_blank" : "_self"
}),
checked: attributes.linkTarget === "_blank"
}
)
}
),
selectUser && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("User"),
isShownByDefault: true,
hasValue: () => !!attributes?.userId,
onDeselect: () => setAttributes({ userId: void 0 }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
UserControl,
{
value: attributes?.userId,
onChange: (value) => {
setAttributes({
userId: value
});
}
}
)
}
)
]
}
) });
};
const ResizableAvatar = ({
setAttributes,
attributes,
avatar,
blockProps,
isSelected
}) => {
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)(
(0,external_wp_url_namespaceObject.removeQueryArgs)(avatar?.src, ["s"]),
{
s: attributes?.size * 2
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ResizableBox,
{
size: {
width: attributes.size,
height: attributes.size
},
showHandle: isSelected,
onResizeStop: (event, direction, elt, delta) => {
setAttributes({
size: parseInt(
attributes.size + (delta.height || delta.width),
10
)
});
},
lockAspectRatio: true,
enable: {
top: false,
right: !(0,external_wp_i18n_namespaceObject.isRTL)(),
bottom: true,
left: (0,external_wp_i18n_namespaceObject.isRTL)()
},
minWidth: avatar.minSize,
maxWidth: avatar.maxSize,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
src: doubledSizedSrc,
alt: avatar.alt,
className: dist_clsx(
"avatar",
"avatar-" + attributes.size,
"photo",
"wp-block-avatar__image",
borderProps.className
),
style: borderProps.style
}
)
}
) });
};
const CommentEdit = ({ attributes, context, setAttributes, isSelected }) => {
const { commentId } = context;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const avatar = useCommentAvatar({ commentId });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AvatarInspectorControls,
{
avatar,
setAttributes,
attributes,
selectUser: false
}
),
attributes.isLink ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
href: "#avatar-pseudo-link",
className: "wp-block-avatar__link",
onClick: (event) => event.preventDefault(),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResizableAvatar,
{
attributes,
avatar,
blockProps,
isSelected,
setAttributes
}
)
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResizableAvatar,
{
attributes,
avatar,
blockProps,
isSelected,
setAttributes
}
)
] });
};
const UserEdit = ({ attributes, context, setAttributes, isSelected }) => {
const { postId, postType } = context;
const avatar = useUserAvatar({
userId: attributes?.userId,
postId,
postType
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
AvatarInspectorControls,
{
selectUser: true,
attributes,
avatar,
setAttributes
}
),
attributes.isLink ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
href: "#avatar-pseudo-link",
className: "wp-block-avatar__link",
onClick: (event) => event.preventDefault(),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResizableAvatar,
{
attributes,
avatar,
blockProps,
isSelected,
setAttributes
}
)
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResizableAvatar,
{
attributes,
avatar,
blockProps,
isSelected,
setAttributes
}
)
] });
};
function avatar_edit_Edit(props) {
if (props?.context?.commentId || props?.context?.commentId === null) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentEdit, { ...props });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(UserEdit, { ...props });
}
;// ./node_modules/@wordpress/block-library/build-module/avatar/index.js
const { name: avatar_name } = avatar_block_namespaceObject;
const avatar_settings = {
icon: comment_author_avatar_default,
edit: avatar_edit_Edit,
example: {}
};
const avatar_init = () => initBlock({ name: avatar_name, metadata: avatar_block_namespaceObject, settings: avatar_settings });
;// ./node_modules/@wordpress/icons/build-module/library/audio.js
var audio_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" }) });
;// ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js
var deprecated_deprecated_default = [
{
attributes: {
src: {
type: "string",
source: "attribute",
selector: "audio",
attribute: "src"
},
caption: {
type: "string",
source: "html",
selector: "figcaption"
},
id: {
type: "number"
},
autoplay: {
type: "boolean",
source: "attribute",
selector: "audio",
attribute: "autoplay"
},
loop: {
type: "boolean",
source: "attribute",
selector: "audio",
attribute: "loop"
},
preload: {
type: "string",
source: "attribute",
selector: "audio",
attribute: "preload"
}
},
supports: {
align: true
},
save({ attributes }) {
const { autoplay, caption, loop, preload, src } = attributes;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"audio",
{
controls: "controls",
src,
autoPlay: autoplay,
loop,
preload
}
),
!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "figcaption",
value: caption
}
)
] });
}
}
];
;// external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// ./node_modules/memize/dist/index.js
/**
* Memize options object.
*
* @typedef MemizeOptions
*
* @property {number} [maxSize] Maximum size of the cache.
*/
/**
* Internal cache entry.
*
* @typedef MemizeCacheNode
*
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
* @property {?MemizeCacheNode|undefined} [next] Next node.
* @property {Array<*>} args Function arguments for cache
* entry.
* @property {*} val Function result.
*/
/**
* Properties of the enhanced function for controlling cache.
*
* @typedef MemizeMemoizedFunction
*
* @property {()=>void} clear Clear the cache.
*/
/**
* Accepts a function to be memoized, and returns a new memoized function, with
* optional options.
*
* @template {(...args: any[]) => any} F
*
* @param {F} fn Function to memoize.
* @param {MemizeOptions} [options] Options object.
*
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
*/
function memize(fn, options) {
var size = 0;
/** @type {?MemizeCacheNode|undefined} */
var head;
/** @type {?MemizeCacheNode|undefined} */
var tail;
options = options || {};
function memoized(/* ...args */) {
var node = head,
len = arguments.length,
args,
i;
searchCache: while (node) {
// Perform a shallow equality test to confirm that whether the node
// under test is a candidate for the arguments passed. Two arrays
// are shallowly equal if their length matches and each entry is
// strictly equal between the two sets. Avoid abstracting to a
// function which could incur an arguments leaking deoptimization.
// Check whether node arguments match arguments length
if (node.args.length !== arguments.length) {
node = node.next;
continue;
}
// Check whether node arguments match arguments values
for (i = 0; i < len; i++) {
if (node.args[i] !== arguments[i]) {
node = node.next;
continue searchCache;
}
}
// At this point we can assume we've found a match
// Surface matched node to head if not already
if (node !== head) {
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
if (node === tail) {
tail = node.prev;
}
// Adjust siblings to point to each other. If node was tail,
// this also handles new tail's empty `next` assignment.
/** @type {MemizeCacheNode} */ (node.prev).next = node.next;
if (node.next) {
node.next.prev = node.prev;
}
node.next = head;
node.prev = null;
/** @type {MemizeCacheNode} */ (head).prev = node;
head = node;
}
// Return immediately
return node.val;
}
// No cached value found. Continue to insertion phase:
// Create a copy of arguments (avoid leaking deoptimization)
args = new Array(len);
for (i = 0; i < len; i++) {
args[i] = arguments[i];
}
node = {
args: args,
// Generate the result from original function
val: fn.apply(null, args),
};
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
if (head) {
head.prev = node;
node.next = head;
} else {
// If no head, follows that there's no tail (at initial or reset)
tail = node;
}
// Trim tail if we're reached max size and are pending cache insertion
if (size === /** @type {MemizeOptions} */ (options).maxSize) {
tail = /** @type {MemizeCacheNode} */ (tail).prev;
/** @type {MemizeCacheNode} */ (tail).next = null;
} else {
size++;
}
head = node;
return node.val;
}
memoized.clear = function () {
head = null;
tail = null;
size = 0;
};
// Ignore reason: There's not a clear solution to create an intersection of
// the function with additional properties, where the goal is to retain the
// function signature of the incoming argument and add control properties
// on the return value.
// @ts-ignore
return memoized;
}
;// ./node_modules/@wordpress/block-library/build-module/embed/block.json
const embed_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/embed","title":"Embed","category":"embed","description":"Add a block that displays content pulled from other sites, like Twitter or YouTube.","textdomain":"default","attributes":{"url":{"type":"string","role":"content"},"caption":{"type":"rich-text","source":"rich-text","selector":"figcaption","role":"content"},"type":{"type":"string","role":"content"},"providerNameSlug":{"type":"string","role":"content"},"allowResponsive":{"type":"boolean","default":true},"responsive":{"type":"boolean","default":false,"role":"content"},"previewable":{"type":"boolean","default":true,"role":"content"}},"supports":{"align":true,"spacing":{"margin":true},"interactivity":{"clientNavigation":true}},"editorStyle":"wp-block-embed-editor","style":"wp-block-embed"}');
;// ./node_modules/@wordpress/block-library/build-module/embed/constants.js
const ASPECT_RATIOS = [
// Common video resolutions.
{ ratio: "2.33", className: "wp-embed-aspect-21-9" },
{ ratio: "2.00", className: "wp-embed-aspect-18-9" },
{ ratio: "1.78", className: "wp-embed-aspect-16-9" },
{ ratio: "1.33", className: "wp-embed-aspect-4-3" },
// Vertical video and instagram square video support.
{ ratio: "1.00", className: "wp-embed-aspect-1-1" },
{ ratio: "0.56", className: "wp-embed-aspect-9-16" },
{ ratio: "0.50", className: "wp-embed-aspect-1-2" }
];
const WP_EMBED_TYPE = "wp-embed";
;// external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// ./node_modules/@wordpress/block-library/build-module/lock-unlock.js
const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/block-library"
);
;// ./node_modules/@wordpress/block-library/build-module/embed/util.js
const { name: DEFAULT_EMBED_BLOCK } = embed_block_namespaceObject;
const { kebabCase } = unlock(external_wp_components_namespaceObject.privateApis);
const getEmbedInfoByProvider = (provider) => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(
({ name }) => name === provider
);
const matchesPatterns = (url, patterns = []) => patterns.some((pattern) => url.match(pattern));
const findMoreSuitableBlock = (url) => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(
({ patterns }) => matchesPatterns(url, patterns)
);
const isFromWordPress = (html) => html && html.includes('class="wp-embedded-content"');
const getPhotoHtml = (photo) => {
const imageUrl = photo.url || photo.thumbnail_url;
const photoPreview = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: imageUrl, alt: photo.title, width: "100%" }) });
return (0,external_wp_element_namespaceObject.renderToString)(photoPreview);
};
const createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => {
const { preview, attributes = {} } = props;
const { url, providerNameSlug, type, ...restAttributes } = attributes;
if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) {
return;
}
const matchedBlock = findMoreSuitableBlock(url);
const isCurrentBlockWP = providerNameSlug === "wordpress" || type === WP_EMBED_TYPE;
const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug);
if (shouldCreateNewBlock) {
return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
url,
...restAttributes,
...matchedBlock.attributes
});
}
const wpVariation = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(
({ name }) => name === "wordpress"
);
if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
return;
}
return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
url,
...wpVariation.attributes,
// By now we have the preview, but when the new block first renders, it
// won't have had all the attributes set, and so won't get the correct
// type and it won't render correctly. So, we pass through the current attributes
// here so that the initial render works when we switch to the WordPress
// block. This only affects the WordPress block because it can't be
// rendered in the usual Sandbox (it has a sandbox of its own) and it
// relies on the preview to set the correct render type.
...attributesFromPreview
});
};
const hasAspectRatioClass = (existingClassNames) => {
if (!existingClassNames) {
return false;
}
return ASPECT_RATIOS.some(
({ className }) => existingClassNames.includes(className)
);
};
const removeAspectRatioClasses = (existingClassNames) => {
if (!existingClassNames) {
return existingClassNames;
}
const aspectRatioClassNames = ASPECT_RATIOS.reduce(
(accumulator, { className }) => {
accumulator.push(className);
return accumulator;
},
["wp-has-aspect-ratio"]
);
let outputClassNames = existingClassNames;
for (const className of aspectRatioClassNames) {
outputClassNames = outputClassNames.replace(className, "");
}
return outputClassNames.trim();
};
function getClassNames(html, existingClassNames, allowResponsive = true) {
if (!allowResponsive) {
return removeAspectRatioClasses(existingClassNames);
}
const previewDocument = document.implementation.createHTMLDocument("");
previewDocument.body.innerHTML = html;
const iframe = previewDocument.body.querySelector("iframe");
if (iframe && iframe.height && iframe.width) {
const aspectRatio = (iframe.width / iframe.height).toFixed(2);
for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) {
const potentialRatio = ASPECT_RATIOS[ratioIndex];
if (aspectRatio >= potentialRatio.ratio) {
const ratioDiff = aspectRatio - potentialRatio.ratio;
if (ratioDiff > 0.1) {
return removeAspectRatioClasses(existingClassNames);
}
return dist_clsx(
removeAspectRatioClasses(existingClassNames),
potentialRatio.className,
"wp-has-aspect-ratio"
);
}
}
}
return existingClassNames;
}
function fallback(url, onReplace) {
const link = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: url, children: url });
onReplace(
(0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", { content: (0,external_wp_element_namespaceObject.renderToString)(link) })
);
}
const getAttributesFromPreview = memize(
(preview, title, currentClassNames, isResponsive, allowResponsive = true) => {
if (!preview) {
return {};
}
const attributes = {};
let { type = "rich" } = preview;
const { html, provider_name: providerName } = preview;
const providerNameSlug = kebabCase(
(providerName || title).toLowerCase()
);
if (isFromWordPress(html)) {
type = WP_EMBED_TYPE;
}
if (html || "photo" === type) {
attributes.type = type;
attributes.providerNameSlug = providerNameSlug;
}
if (hasAspectRatioClass(currentClassNames)) {
return attributes;
}
attributes.className = getClassNames(
html,
currentClassNames,
isResponsive && allowResponsive
);
return attributes;
}
);
const getMergedAttributesWithPreview = (currentAttributes, preview, title, isResponsive) => {
const { allowResponsive, className } = currentAttributes;
return {
...currentAttributes,
...getAttributesFromPreview(
preview,
title,
className,
isResponsive,
allowResponsive
)
};
};
;// ./node_modules/@wordpress/icons/build-module/library/caption.js
var caption_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M6 5.5h12a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5ZM4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6Zm4 10h2v-1.5H8V16Zm5 0h-2v-1.5h2V16Zm1 0h2v-1.5h-2V16Z"
}
) });
;// ./node_modules/@wordpress/block-library/build-module/utils/caption.js
function Caption({
attributeKey = "caption",
attributes,
setAttributes,
isSelected,
insertBlocksAfter,
placeholder = (0,external_wp_i18n_namespaceObject.__)("Add caption"),
label = (0,external_wp_i18n_namespaceObject.__)("Caption text"),
showToolbarButton = true,
excludeElementClassName,
className,
readOnly,
tagName = "figcaption",
addLabel = (0,external_wp_i18n_namespaceObject.__)("Add caption"),
removeLabel = (0,external_wp_i18n_namespaceObject.__)("Remove caption"),
icon = caption_default,
...props
}) {
const caption = attributes[attributeKey];
const prevCaption = (0,external_wp_compose_namespaceObject.usePrevious)(caption);
const { PrivateRichText: RichText } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const isCaptionEmpty = RichText.isEmpty(caption);
const isPrevCaptionEmpty = RichText.isEmpty(prevCaption);
const [showCaption, setShowCaption] = (0,external_wp_element_namespaceObject.useState)(!isCaptionEmpty);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isCaptionEmpty && isPrevCaptionEmpty) {
setShowCaption(true);
}
}, [isCaptionEmpty, isPrevCaptionEmpty]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected && isCaptionEmpty) {
setShowCaption(false);
}
}, [isSelected, isCaptionEmpty]);
const ref = (0,external_wp_element_namespaceObject.useCallback)(
(node) => {
if (node && isCaptionEmpty) {
node.focus();
}
},
[isCaptionEmpty]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
showToolbarButton && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
onClick: () => {
setShowCaption(!showCaption);
if (showCaption && caption) {
setAttributes({
[attributeKey]: void 0
});
}
},
icon,
isPressed: showCaption,
label: showCaption ? removeLabel : addLabel
}
) }),
showCaption && (!RichText.isEmpty(caption) || isSelected) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
RichText,
{
identifier: attributeKey,
tagName,
className: dist_clsx(
className,
excludeElementClassName ? "" : (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)("caption")
),
ref,
"aria-label": label,
placeholder,
value: caption,
onChange: (value) => setAttributes({ [attributeKey]: value }),
inlineToolbar: true,
__unstableOnSplitAtEnd: () => insertBlocksAfter(
(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())
),
readOnly,
...props
}
)
] });
}
;// ./node_modules/@wordpress/block-library/build-module/audio/edit.js
const ALLOWED_MEDIA_TYPES = ["audio"];
function AudioEdit({
attributes,
className,
setAttributes,
onReplace,
isSelected: isSingleSelected,
insertBlocksAfter
}) {
const { id, autoplay, loop, preload, src } = attributes;
const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob);
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
const hasNonContentControls = blockEditingMode === "default";
useUploadMediaFromBlobURL({
url: temporaryURL,
allowedTypes: ALLOWED_MEDIA_TYPES,
onChange: onSelectAudio,
onError: onUploadError
});
function toggleAttribute(attribute) {
return (newValue) => {
setAttributes({ [attribute]: newValue });
};
}
function onSelectURL(newSrc) {
if (newSrc !== src) {
const embedBlock = createUpgradedEmbedBlock({
attributes: { url: newSrc }
});
if (void 0 !== embedBlock && onReplace) {
onReplace(embedBlock);
return;
}
setAttributes({ src: newSrc, id: void 0, blob: void 0 });
setTemporaryURL();
}
}
const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
function onUploadError(message) {
createErrorNotice(message, { type: "snackbar" });
}
function getAutoplayHelp(checked) {
return checked ? (0,external_wp_i18n_namespaceObject.__)("Autoplay may cause usability issues for some users.") : null;
}
function onSelectAudio(media) {
if (!media || !media.url) {
setAttributes({
src: void 0,
id: void 0,
caption: void 0,
blob: void 0
});
setTemporaryURL();
return;
}
if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
setTemporaryURL(media.url);
return;
}
setAttributes({
blob: void 0,
src: media.url,
id: media.id,
caption: media.caption
});
setTemporaryURL();
}
const classes = dist_clsx(className, {
"is-transient": !!temporaryURL
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes
});
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
if (!src && !temporaryURL) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.MediaPlaceholder,
{
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: audio_default }),
onSelect: onSelectAudio,
onSelectURL,
accept: "audio/*",
allowedTypes: ALLOWED_MEDIA_TYPES,
value: attributes,
onError: onUploadError
}
) });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
isSingleSelected && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.MediaReplaceFlow,
{
mediaId: id,
mediaURL: src,
allowedTypes: ALLOWED_MEDIA_TYPES,
accept: "audio/*",
onSelect: onSelectAudio,
onSelectURL,
onError: onUploadError,
onReset: () => onSelectAudio(void 0)
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
autoplay: false,
loop: false,
preload: void 0
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Autoplay"),
isShownByDefault: true,
hasValue: () => !!autoplay,
onDeselect: () => setAttributes({
autoplay: false
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Autoplay"),
onChange: toggleAttribute("autoplay"),
checked: !!autoplay,
help: getAutoplayHelp
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Loop"),
isShownByDefault: true,
hasValue: () => !!loop,
onDeselect: () => setAttributes({
loop: false
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Loop"),
onChange: toggleAttribute("loop"),
checked: !!loop
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Preload"),
isShownByDefault: true,
hasValue: () => !!preload,
onDeselect: () => setAttributes({
preload: void 0
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject._x)(
"Preload",
"noun; Audio block parameter"
),
value: preload || "",
onChange: (value) => setAttributes({
preload: value || void 0
}),
options: [
{ value: "", label: (0,external_wp_i18n_namespaceObject.__)("Browser default") },
{ value: "auto", label: (0,external_wp_i18n_namespaceObject.__)("Auto") },
{ value: "metadata", label: (0,external_wp_i18n_namespaceObject.__)("Metadata") },
{
value: "none",
label: (0,external_wp_i18n_namespaceObject._x)("None", "Preload value")
}
]
}
)
}
)
]
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...blockProps, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { isDisabled: !isSingleSelected, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { controls: "controls", src: src ?? temporaryURL }) }),
!!temporaryURL && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Caption,
{
attributes,
setAttributes,
isSelected: isSingleSelected,
insertBlocksAfter,
label: (0,external_wp_i18n_namespaceObject.__)("Audio caption text"),
showToolbarButton: isSingleSelected && hasNonContentControls
}
)
] })
] });
}
var edit_default = AudioEdit;
;// ./node_modules/@wordpress/block-library/build-module/audio/block.json
const audio_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/audio","title":"Audio","category":"media","description":"Embed a simple audio player.","keywords":["music","sound","podcast","recording"],"textdomain":"default","attributes":{"blob":{"type":"string","role":"local"},"src":{"type":"string","source":"attribute","selector":"audio","attribute":"src","role":"content"},"caption":{"type":"rich-text","source":"rich-text","selector":"figcaption","role":"content"},"id":{"type":"number","role":"content"},"autoplay":{"type":"boolean","source":"attribute","selector":"audio","attribute":"autoplay"},"loop":{"type":"boolean","source":"attribute","selector":"audio","attribute":"loop"},"preload":{"type":"string","source":"attribute","selector":"audio","attribute":"preload"}},"supports":{"anchor":true,"align":true,"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"interactivity":{"clientNavigation":true}},"editorStyle":"wp-block-audio-editor","style":"wp-block-audio"}');
;// ./node_modules/@wordpress/block-library/build-module/audio/save.js
function audio_save_save({ attributes }) {
const { autoplay, caption, loop, preload, src } = attributes;
return src && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"audio",
{
controls: "controls",
src,
autoPlay: autoplay,
loop,
preload
}
),
!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "figcaption",
value: caption,
className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)(
"caption"
)
}
)
] });
}
;// ./node_modules/@wordpress/block-library/build-module/audio/transforms.js
const transforms = {
from: [
{
type: "files",
isMatch(files) {
return files.length === 1 && files[0].type.indexOf("audio/") === 0;
},
transform(files) {
const file = files[0];
const block = (0,external_wp_blocks_namespaceObject.createBlock)("core/audio", {
blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
});
return block;
}
},
{
type: "shortcode",
tag: "audio",
attributes: {
src: {
type: "string",
shortcode: ({
named: { src, mp3, m4a, ogg, wav, wma }
}) => {
return src || mp3 || m4a || ogg || wav || wma;
}
},
loop: {
type: "string",
shortcode: ({ named: { loop } }) => {
return loop;
}
},
autoplay: {
type: "string",
shortcode: ({ named: { autoplay } }) => {
return autoplay;
}
},
preload: {
type: "string",
shortcode: ({ named: { preload } }) => {
return preload;
}
}
}
}
]
};
var transforms_default = transforms;
;// ./node_modules/@wordpress/block-library/build-module/audio/index.js
const { name: audio_name } = audio_block_namespaceObject;
const audio_settings = {
icon: audio_default,
example: {
attributes: {
src: "https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"
},
viewportWidth: 350
},
transforms: transforms_default,
deprecated: deprecated_deprecated_default,
edit: edit_default,
save: audio_save_save
};
const audio_init = () => initBlock({ name: audio_name, metadata: audio_block_namespaceObject, settings: audio_settings });
;// ./node_modules/@wordpress/icons/build-module/library/breadcrumbs.js
var breadcrumbs_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 13.5h3v-3H4v3Zm6-3.5 2 2-2 2 1 1 3-3-3-3-1 1Zm7 .5v3h3v-3h-3Z" }) });
;// ./node_modules/@wordpress/block-library/build-module/breadcrumbs/block.json
const breadcrumbs_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/breadcrumbs","title":"Breadcrumbs","__experimental":true,"category":"theme","description":"Display a breadcrumb trail for hierarchical post types or based on taxonomy terms.","textdomain":"default","attributes":{"type":{"type":"string","default":"auto","enum":["auto","postWithTerms","postWithAncestors"]},"separator":{"type":"string","default":"/"},"showHomeLink":{"type":"boolean","default":true}},"usesContext":["postId","postType","templateSlug"],"supports":{"html":false,"spacing":{"margin":true,"padding":true},"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":false,"color":true,"width":true,"style":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true}},"style":"wp-block-breadcrumbs"}');
;// ./node_modules/@wordpress/block-library/build-module/breadcrumbs/edit.js
const separatorDefaultValue = "/";
const typeDefaultValue = "auto";
const BREADCRUMB_TYPES = {
auto: {
help: (0,external_wp_i18n_namespaceObject.__)(
"Try to automatically determine the best type of breadcrumb for the template."
)
},
postWithAncestors: {
help: (0,external_wp_i18n_namespaceObject.__)(
"Shows breadcrumbs based on post hierarchy. Only works for hierarchical post types."
),
placeholderItems: [(0,external_wp_i18n_namespaceObject.__)("Ancestor"), (0,external_wp_i18n_namespaceObject.__)("Parent")]
},
postWithTerms: {
help: (0,external_wp_i18n_namespaceObject.__)(
"Shows breadcrumbs based on taxonomy terms. Chooses the first taxonomy with assigned terms and includes ancestors if the taxonomy is hierarchical."
),
placeholderItems: [(0,external_wp_i18n_namespaceObject.__)("Category")]
}
};
function BreadcrumbEdit({
attributes,
setAttributes,
context: { postId, postType, templateSlug }
}) {
const { separator, showHomeLink, type } = attributes;
const { post, isPostTypeHierarchical, hasTermsAssigned, isLoading } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!postType) {
return {};
}
const _post = select(external_wp_coreData_namespaceObject.store).getEntityRecord(
"postType",
postType,
postId
);
const postTypeObject = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
const postTypeHasTaxonomies = postTypeObject && postTypeObject.taxonomies.length;
let taxonomies;
if (postTypeHasTaxonomies) {
taxonomies = select(external_wp_coreData_namespaceObject.store).getTaxonomies({
type: postType,
per_page: -1
});
}
return {
post: _post,
isPostTypeHierarchical: postTypeObject?.hierarchical,
hasTermsAssigned: _post && (taxonomies || []).filter(
({ visibility }) => visibility?.publicly_queryable
).some((taxonomy) => {
return !!_post[taxonomy.rest_base]?.length;
}),
isLoading: !_post || !postTypeObject || postTypeHasTaxonomies && !taxonomies
};
},
[postType, postId]
);
const [invalidationKey, setInvalidationKey] = (0,external_wp_element_namespaceObject.useState)(0);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setInvalidationKey((c) => c + 1);
}, [post]);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const { content } = (0,external_wp_serverSideRender_namespaceObject.useServerSideRender)({
attributes,
skipBlockSupportAttributes: true,
block: "core/breadcrumbs",
urlQueryArgs: { post_id: postId, invalidationKey }
});
if (isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) });
}
let breadcrumbsType;
const isSpecificSupportedTypeSet = [
"postWithAncestors",
"postWithTerms"
].includes(type);
if (isSpecificSupportedTypeSet) {
breadcrumbsType = type;
} else {
breadcrumbsType = isPostTypeHierarchical ? "postWithAncestors" : "postWithTerms";
}
let placeholder = null;
const showPlaceholder = !postId || !postType || // When `templateSlug` is set only show placeholder if the post type is not.
// This is needed because when we are showing the template in post editor we
// want to show the real breadcrumbs if we have the post type.
templateSlug && !postType || breadcrumbsType === "postWithAncestors" && !isPostTypeHierarchical || breadcrumbsType === "postWithTerms" && !hasTermsAssigned;
if (showPlaceholder) {
const placeholderItems = [
showHomeLink && (0,external_wp_i18n_namespaceObject.__)("Home"),
// For now if we are adding this in a template show a generic placeholder.
...templateSlug && !isSpecificSupportedTypeSet ? [(0,external_wp_i18n_namespaceObject.__)("Page")] : BREADCRUMB_TYPES[breadcrumbsType].placeholderItems
].filter(Boolean);
placeholder = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"nav",
{
style: {
"--separator": `'${separator}'`
},
inert: "true",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("ol", { children: [
placeholderItems.map((text, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: `#breadcrumbs-pseudo-link-${index}`, children: text }) }, index)),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-current": "page", children: (0,external_wp_i18n_namespaceObject.__)("Current") }) })
] })
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
separator: separatorDefaultValue,
showHomeLink: true,
type: typeDefaultValue
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Type"),
isShownByDefault: true,
hasValue: () => type !== typeDefaultValue,
onDeselect: () => setAttributes({
type: typeDefaultValue
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Type"),
value: type,
onChange: (value) => setAttributes({ type: value }),
options: [
{
label: (0,external_wp_i18n_namespaceObject.__)("Auto"),
value: "auto"
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Post with ancestors"),
value: "postWithAncestors"
},
{
label: (0,external_wp_i18n_namespaceObject.__)("Post with terms"),
value: "postWithTerms"
}
],
help: BREADCRUMB_TYPES[type].help
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Show home link"),
isShownByDefault: true,
hasValue: () => !showHomeLink,
onDeselect: () => setAttributes({
showHomeLink: true
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show home link"),
onChange: (value) => setAttributes({ showHomeLink: value }),
checked: showHomeLink
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Separator"),
isShownByDefault: true,
hasValue: () => separator !== separatorDefaultValue,
onDeselect: () => setAttributes({
separator: separatorDefaultValue
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
autoComplete: "off",
label: (0,external_wp_i18n_namespaceObject.__)("Separator"),
value: separator,
onChange: (value) => setAttributes({ separator: value }),
onBlur: () => {
if (!separator) {
setAttributes({
separator: separatorDefaultValue
});
}
}
}
)
}
)
]
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: showPlaceholder ? placeholder : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { inert: "true", children: content }) })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/breadcrumbs/index.js
const { name: breadcrumbs_name } = breadcrumbs_block_namespaceObject;
const breadcrumbs_settings = {
icon: breadcrumbs_default,
edit: BreadcrumbEdit
};
const breadcrumbs_init = () => initBlock({ name: breadcrumbs_name, metadata: breadcrumbs_block_namespaceObject, settings: breadcrumbs_settings });
;// ./node_modules/@wordpress/icons/build-module/library/button.js
var button_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) });
;// ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js
const { cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function migrate_font_family_default(attributes) {
if (!attributes?.style?.typography?.fontFamily) {
return attributes;
}
const { fontFamily, ...typography } = attributes.style.typography;
return {
...attributes,
style: cleanEmptyObject({
...attributes.style,
typography
}),
fontFamily: fontFamily.split("|").pop()
};
}
;// ./node_modules/@wordpress/block-library/build-module/button/deprecated.js
const migrateBorderRadius = (attributes) => {
const { borderRadius, ...newAttributes } = attributes;
const oldBorderRadius = [
borderRadius,
newAttributes.style?.border?.radius
].find((possibleBorderRadius) => {
return typeof possibleBorderRadius === "number" && possibleBorderRadius !== 0;
});
if (!oldBorderRadius) {
return newAttributes;
}
return {
...newAttributes,
style: {
...newAttributes.style,
border: {
...newAttributes.style?.border,
radius: `${oldBorderRadius}px`
}
}
};
};
function migrateAlign(attributes) {
if (!attributes.align) {
return attributes;
}
const { align, ...otherAttributes } = attributes;
return {
...otherAttributes,
className: dist_clsx(
otherAttributes.className,
`align${attributes.align}`
)
};
}
const migrateCustomColorsAndGradients = (attributes) => {
if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) {
return attributes;
}
const style = { color: {} };
if (attributes.customTextColor) {
style.color.text = attributes.customTextColor;
}
if (attributes.customBackgroundColor) {
style.color.background = attributes.customBackgroundColor;
}
if (attributes.customGradient) {
style.color.gradient = attributes.customGradient;
}
const {
customTextColor,
customBackgroundColor,
customGradient,
...restAttributes
} = attributes;
return {
...restAttributes,
style
};
};
const oldColorsMigration = (attributes) => {
const { color, textColor, ...restAttributes } = {
...attributes,
customTextColor: attributes.textColor && "#" === attributes.textColor[0] ? attributes.textColor : void 0,
customBackgroundColor: attributes.color && "#" === attributes.color[0] ? attributes.color : void 0
};
return migrateCustomColorsAndGradients(restAttributes);
};
const blockAttributes = {
url: {
type: "string",
source: "attribute",
selector: "a",
attribute: "href"
},
title: {
type: "string",
source: "attribute",
selector: "a",
attribute: "title"
},
text: {
type: "string",
source: "html",
selector: "a"
}
};
const v12 = {
attributes: {
tagName: {
type: "string",
enum: ["a", "button"],
default: "a"
},
type: {
type: "string",
default: "button"
},
textAlign: {
type: "string"
},
url: {
type: "string",
source: "attribute",
selector: "a",
attribute: "href"
},
title: {
type: "string",
source: "attribute",
selector: "a,button",
attribute: "title",
role: "content"
},
text: {
type: "rich-text",
source: "rich-text",
selector: "a,button",
role: "content"
},
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target",
role: "content"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel",
role: "content"
},
placeholder: {
type: "string"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
gradient: {
type: "string"
},
width: {
type: "number"
}
},
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalWritingMode: true,
__experimentalDefaultControls: {
fontSize: true
}
},
reusable: false,
shadow: {
__experimentalSkipSerialization: true
},
spacing: {
__experimentalSkipSerialization: true,
padding: ["horizontal", "vertical"],
__experimentalDefaultControls: {
padding: true
}
},
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true,
__experimentalSkipSerialization: true,
__experimentalDefaultControls: {
color: true,
radius: true,
style: true,
width: true
}
},
__experimentalSelector: ".wp-block-button__link",
interactivity: {
clientNavigation: true
}
},
save({ attributes, className }) {
const {
tagName,
type,
textAlign,
fontSize,
linkTarget,
rel,
style,
text,
title,
url,
width
} = attributes;
const TagName = tagName || "a";
const isButtonTag = "button" === TagName;
const buttonType = type || "button";
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes);
const buttonClasses = dist_clsx(
"wp-block-button__link",
colorProps.className,
borderProps.className,
{
[`has-text-align-${textAlign}`]: textAlign,
// For backwards compatibility add style that isn't provided via
// block support.
"no-border-radius": style?.border?.radius === 0
},
(0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)("button")
);
const buttonStyle = {
...borderProps.style,
...colorProps.style,
...spacingProps.style,
...shadowProps.style
};
const wrapperClasses = dist_clsx(className, {
[`has-custom-width wp-block-button__width-${width}`]: width,
[`has-custom-font-size`]: fontSize || style?.typography?.fontSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: TagName,
type: isButtonTag ? buttonType : null,
className: buttonClasses,
href: isButtonTag ? null : url,
title,
style: buttonStyle,
value: text,
target: isButtonTag ? null : linkTarget,
rel: isButtonTag ? null : rel
}
) });
}
};
const v11 = {
attributes: {
url: {
type: "string",
source: "attribute",
selector: "a",
attribute: "href"
},
title: {
type: "string",
source: "attribute",
selector: "a",
attribute: "title"
},
text: {
type: "string",
source: "html",
selector: "a"
},
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
gradient: {
type: "string"
},
width: {
type: "number"
}
},
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true,
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
typography: {
fontSize: true,
__experimentalFontFamily: true,
__experimentalDefaultControls: {
fontSize: true
}
},
reusable: false,
spacing: {
__experimentalSkipSerialization: true,
padding: ["horizontal", "vertical"],
__experimentalDefaultControls: {
padding: true
}
},
__experimentalBorder: {
radius: true,
__experimentalSkipSerialization: true,
__experimentalDefaultControls: {
radius: true
}
},
__experimentalSelector: ".wp-block-button__link"
},
save({ attributes, className }) {
const { fontSize, linkTarget, rel, style, text, title, url, width } = attributes;
if (!text) {
return null;
}
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
const buttonClasses = dist_clsx(
"wp-block-button__link",
colorProps.className,
borderProps.className,
{
// For backwards compatibility add style that isn't provided via
// block support.
"no-border-radius": style?.border?.radius === 0
}
);
const buttonStyle = {
...borderProps.style,
...colorProps.style,
...spacingProps.style
};
const wrapperClasses = dist_clsx(className, {
[`has-custom-width wp-block-button__width-${width}`]: width,
[`has-custom-font-size`]: fontSize || style?.typography?.fontSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
) });
}
};
const v10 = {
attributes: {
url: {
type: "string",
source: "attribute",
selector: "a",
attribute: "href"
},
title: {
type: "string",
source: "attribute",
selector: "a",
attribute: "title"
},
text: {
type: "string",
source: "html",
selector: "a"
},
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
gradient: {
type: "string"
},
width: {
type: "number"
}
},
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true,
gradients: true
},
typography: {
fontSize: true,
__experimentalFontFamily: true
},
reusable: false,
spacing: {
__experimentalSkipSerialization: true,
padding: ["horizontal", "vertical"],
__experimentalDefaultControls: {
padding: true
}
},
__experimentalBorder: {
radius: true,
__experimentalSkipSerialization: true
},
__experimentalSelector: ".wp-block-button__link"
},
save({ attributes, className }) {
const { fontSize, linkTarget, rel, style, text, title, url, width } = attributes;
if (!text) {
return null;
}
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
const buttonClasses = dist_clsx(
"wp-block-button__link",
colorProps.className,
borderProps.className,
{
// For backwards compatibility add style that isn't provided via
// block support.
"no-border-radius": style?.border?.radius === 0
}
);
const buttonStyle = {
...borderProps.style,
...colorProps.style,
...spacingProps.style
};
const wrapperClasses = dist_clsx(className, {
[`has-custom-width wp-block-button__width-${width}`]: width,
[`has-custom-font-size`]: fontSize || style?.typography?.fontSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
) });
},
migrate: migrate_font_family_default,
isEligible({ style }) {
return style?.typography?.fontFamily;
}
};
const deprecated = [
v12,
v11,
v10,
{
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true,
gradients: true
},
typography: {
fontSize: true,
__experimentalFontFamily: true
},
reusable: false,
__experimentalSelector: ".wp-block-button__link"
},
attributes: {
...blockAttributes,
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
gradient: {
type: "string"
},
width: {
type: "number"
}
},
isEligible({ style }) {
return typeof style?.border?.radius === "number";
},
save({ attributes, className }) {
const {
fontSize,
linkTarget,
rel,
style,
text,
title,
url,
width
} = attributes;
if (!text) {
return null;
}
const borderRadius = style?.border?.radius;
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const buttonClasses = dist_clsx(
"wp-block-button__link",
colorProps.className,
{
"no-border-radius": style?.border?.radius === 0
}
);
const buttonStyle = {
borderRadius: borderRadius ? borderRadius : void 0,
...colorProps.style
};
const wrapperClasses = dist_clsx(className, {
[`has-custom-width wp-block-button__width-${width}`]: width,
[`has-custom-font-size`]: fontSize || style?.typography?.fontSize
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
) });
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family_default, migrateBorderRadius)
},
{
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true
},
reusable: false,
__experimentalSelector: ".wp-block-button__link"
},
attributes: {
...blockAttributes,
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
},
borderRadius: {
type: "number"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
gradient: {
type: "string"
},
style: {
type: "object"
},
width: {
type: "number"
}
},
save({ attributes, className }) {
const { borderRadius, linkTarget, rel, text, title, url, width } = attributes;
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const buttonClasses = dist_clsx(
"wp-block-button__link",
colorProps.className,
{
"no-border-radius": borderRadius === 0
}
);
const buttonStyle = {
borderRadius: borderRadius ? borderRadius + "px" : void 0,
...colorProps.style
};
const wrapperClasses = dist_clsx(className, {
[`has-custom-width wp-block-button__width-${width}`]: width
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
) });
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family_default, migrateBorderRadius)
},
{
supports: {
anchor: true,
align: true,
alignWide: false,
color: {
__experimentalSkipSerialization: true
},
reusable: false,
__experimentalSelector: ".wp-block-button__link"
},
attributes: {
...blockAttributes,
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
},
borderRadius: {
type: "number"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
gradient: {
type: "string"
},
style: {
type: "object"
},
width: {
type: "number"
}
},
save({ attributes, className }) {
const { borderRadius, linkTarget, rel, text, title, url, width } = attributes;
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const buttonClasses = dist_clsx(
"wp-block-button__link",
colorProps.className,
{
"no-border-radius": borderRadius === 0
}
);
const buttonStyle = {
borderRadius: borderRadius ? borderRadius + "px" : void 0,
...colorProps.style
};
const wrapperClasses = dist_clsx(className, {
[`has-custom-width wp-block-button__width-${width}`]: width
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
) });
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family_default, migrateBorderRadius)
},
{
supports: {
align: true,
alignWide: false,
color: { gradients: true }
},
attributes: {
...blockAttributes,
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
},
borderRadius: {
type: "number"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
gradient: {
type: "string"
},
style: {
type: "object"
}
},
save({ attributes }) {
const { borderRadius, linkTarget, rel, text, title, url } = attributes;
const buttonClasses = dist_clsx("wp-block-button__link", {
"no-border-radius": borderRadius === 0
});
const buttonStyle = {
borderRadius: borderRadius ? borderRadius + "px" : void 0
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
);
},
migrate: migrateBorderRadius
},
{
supports: {
align: true,
alignWide: false
},
attributes: {
...blockAttributes,
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
},
borderRadius: {
type: "number"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
customBackgroundColor: {
type: "string"
},
customTextColor: {
type: "string"
},
customGradient: {
type: "string"
},
gradient: {
type: "string"
}
},
isEligible: (attributes) => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient || !!attributes.align,
migrate: (0,external_wp_compose_namespaceObject.compose)(
migrateBorderRadius,
migrateCustomColorsAndGradients,
migrateAlign
),
save({ attributes }) {
const {
backgroundColor,
borderRadius,
customBackgroundColor,
customTextColor,
customGradient,
linkTarget,
gradient,
rel,
text,
textColor,
title,
url
} = attributes;
const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)("color", textColor);
const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)("background-color", backgroundColor);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const buttonClasses = dist_clsx("wp-block-button__link", {
"has-text-color": textColor || customTextColor,
[textClass]: textClass,
"has-background": backgroundColor || customBackgroundColor || customGradient || gradient,
[backgroundClass]: backgroundClass,
"no-border-radius": borderRadius === 0,
[gradientClass]: gradientClass
});
const buttonStyle = {
background: customGradient ? customGradient : void 0,
backgroundColor: backgroundClass || customGradient || gradient ? void 0 : customBackgroundColor,
color: textClass ? void 0 : customTextColor,
borderRadius: borderRadius ? borderRadius + "px" : void 0
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
) });
}
},
{
attributes: {
...blockAttributes,
align: {
type: "string",
default: "none"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
customBackgroundColor: {
type: "string"
},
customTextColor: {
type: "string"
},
linkTarget: {
type: "string",
source: "attribute",
selector: "a",
attribute: "target"
},
rel: {
type: "string",
source: "attribute",
selector: "a",
attribute: "rel"
},
placeholder: {
type: "string"
}
},
isEligible(attribute) {
return attribute.className && attribute.className.includes("is-style-squared");
},
migrate(attributes) {
let newClassName = attributes.className;
if (newClassName) {
newClassName = newClassName.replace(/is-style-squared[\s]?/, "").trim();
}
return migrateBorderRadius(
migrateCustomColorsAndGradients({
...attributes,
className: newClassName ? newClassName : void 0,
borderRadius: 0
})
);
},
save({ attributes }) {
const {
backgroundColor,
customBackgroundColor,
customTextColor,
linkTarget,
rel,
text,
textColor,
title,
url
} = attributes;
const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)("color", textColor);
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
backgroundColor
);
const buttonClasses = dist_clsx("wp-block-button__link", {
"has-text-color": textColor || customTextColor,
[textClass]: textClass,
"has-background": backgroundColor || customBackgroundColor,
[backgroundClass]: backgroundClass
});
const buttonStyle = {
backgroundColor: backgroundClass ? void 0 : customBackgroundColor,
color: textClass ? void 0 : customTextColor
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text,
target: linkTarget,
rel
}
) });
}
},
{
attributes: {
...blockAttributes,
align: {
type: "string",
default: "none"
},
backgroundColor: {
type: "string"
},
textColor: {
type: "string"
},
customBackgroundColor: {
type: "string"
},
customTextColor: {
type: "string"
}
},
migrate: oldColorsMigration,
save({ attributes }) {
const {
url,
text,
title,
backgroundColor,
textColor,
customBackgroundColor,
customTextColor
} = attributes;
const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)("color", textColor);
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
backgroundColor
);
const buttonClasses = dist_clsx("wp-block-button__link", {
"has-text-color": textColor || customTextColor,
[textClass]: textClass,
"has-background": backgroundColor || customBackgroundColor,
[backgroundClass]: backgroundClass
});
const buttonStyle = {
backgroundColor: backgroundClass ? void 0 : customBackgroundColor,
color: textClass ? void 0 : customTextColor
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: buttonClasses,
href: url,
title,
style: buttonStyle,
value: text
}
) });
}
},
{
attributes: {
...blockAttributes,
color: {
type: "string"
},
textColor: {
type: "string"
},
align: {
type: "string",
default: "none"
}
},
save({ attributes }) {
const { url, text, title, align, color, textColor } = attributes;
const buttonStyle = {
backgroundColor: color,
color: textColor
};
const linkClass = "wp-block-button__link";
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `align${align}`, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
className: linkClass,
href: url,
title,
style: buttonStyle,
value: text
}
) });
},
migrate: oldColorsMigration
},
{
attributes: {
...blockAttributes,
color: {
type: "string"
},
textColor: {
type: "string"
},
align: {
type: "string",
default: "none"
}
},
save({ attributes }) {
const { url, text, title, align, color, textColor } = attributes;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: `align${align}`,
style: { backgroundColor: color },
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "a",
href: url,
title,
style: { color: textColor },
value: text
}
)
}
);
},
migrate: oldColorsMigration
}
];
var button_deprecated_deprecated_default = deprecated;
;// ./node_modules/@wordpress/block-library/build-module/button/constants.js
const NEW_TAB_REL = "noreferrer noopener";
const NEW_TAB_TARGET = "_blank";
const NOFOLLOW_REL = "nofollow";
;// ./node_modules/@wordpress/block-library/build-module/button/get-updated-link-attributes.js
function getUpdatedLinkAttributes({
rel = "",
url = "",
opensInNewTab,
nofollow
}) {
let newLinkTarget;
let updatedRel = rel;
if (opensInNewTab) {
newLinkTarget = NEW_TAB_TARGET;
updatedRel = updatedRel?.includes(NEW_TAB_REL) ? updatedRel : updatedRel + ` ${NEW_TAB_REL}`;
} else {
const relRegex = new RegExp(`\\b${NEW_TAB_REL}\\s*`, "g");
updatedRel = updatedRel?.replace(relRegex, "").trim();
}
if (nofollow) {
updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : (updatedRel + ` ${NOFOLLOW_REL}`).trim();
} else {
const relRegex = new RegExp(`\\b${NOFOLLOW_REL}\\s*`, "g");
updatedRel = updatedRel?.replace(relRegex, "").trim();
}
return {
url: (0,external_wp_url_namespaceObject.prependHTTP)(url),
linkTarget: newLinkTarget,
rel: updatedRel || void 0
};
}
;// ./node_modules/@wordpress/block-library/build-module/utils/remove-anchor-tag.js
function removeAnchorTag(value) {
return value.toString().replace(/<\/?a[^>]*>/g, "");
}
;// external ["wp","keycodes"]
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// ./node_modules/@wordpress/icons/build-module/library/link.js
var link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
;// ./node_modules/@wordpress/icons/build-module/library/link-off.js
var link_off_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) });
;// ./node_modules/@wordpress/block-library/build-module/button/edit.js
const { HTMLElementControl } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const LINK_SETTINGS = [
...external_wp_blockEditor_namespaceObject.LinkControl.DEFAULT_LINK_SETTINGS,
{
id: "nofollow",
title: (0,external_wp_i18n_namespaceObject.__)("Mark as nofollow")
}
];
function useEnter(props) {
const { replaceBlocks, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const { getBlock, getBlockRootClientId, getBlockIndex } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const propsRef = (0,external_wp_element_namespaceObject.useRef)(props);
propsRef.current = props;
return (0,external_wp_compose_namespaceObject.useRefEffect)((element) => {
function onKeyDown(event) {
if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
return;
}
const { content, clientId } = propsRef.current;
if (content.length) {
return;
}
event.preventDefault();
const topParentListBlock = getBlock(
getBlockRootClientId(clientId)
);
const blockIndex = getBlockIndex(clientId);
const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({
...topParentListBlock,
innerBlocks: topParentListBlock.innerBlocks.slice(
0,
blockIndex
)
});
const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)());
const after = topParentListBlock.innerBlocks.slice(
blockIndex + 1
);
const tail = after.length ? [
(0,external_wp_blocks_namespaceObject.cloneBlock)({
...topParentListBlock,
innerBlocks: after
})
] : [];
replaceBlocks(
topParentListBlock.clientId,
[head, middle, ...tail],
1
);
selectionChange(middle.clientId);
}
element.addEventListener("keydown", onKeyDown);
return () => {
element.removeEventListener("keydown", onKeyDown);
};
}, []);
}
function WidthPanel({ selectedWidth, setAttributes }) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => setAttributes({ width: void 0 }),
dropdownMenuProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
isShownByDefault: true,
hasValue: () => !!selectedWidth,
onDeselect: () => setAttributes({ width: void 0 }),
__nextHasNoMarginBottom: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
value: selectedWidth,
onChange: (newWidth) => setAttributes({ width: newWidth }),
isBlock: true,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
children: [25, 50, 75, 100].map((widthValue) => {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: widthValue,
label: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %d: Percentage value. */
(0,external_wp_i18n_namespaceObject.__)("%d%%"),
widthValue
)
},
widthValue
);
})
}
)
}
)
}
);
}
function ButtonEdit(props) {
const {
attributes,
setAttributes,
className,
isSelected,
onReplace,
mergeBlocks,
clientId,
context
} = props;
const {
tagName,
textAlign,
linkTarget,
placeholder,
rel,
style,
text,
url,
width,
metadata
} = attributes;
const TagName = tagName || "a";
function onKeyDown(event) {
if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, "k")) {
startEditing(event);
} else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, "k")) {
unlink();
richTextRef.current?.focus();
}
}
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes);
const ref = (0,external_wp_element_namespaceObject.useRef)();
const richTextRef = (0,external_wp_element_namespaceObject.useRef)();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]),
onKeyDown
});
const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)();
const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false);
const isURLSet = !!url;
const opensInNewTab = linkTarget === NEW_TAB_TARGET;
const nofollow = !!rel?.includes(NOFOLLOW_REL);
const isLinkTag = "a" === TagName;
const {
createPageEntity,
userCanCreatePages,
lockUrlControls = false
} = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
if (!isSelected) {
return {};
}
const _settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(
metadata?.bindings?.url?.source
);
return {
createPageEntity: _settings.__experimentalCreatePageEntity,
userCanCreatePages: _settings.__experimentalUserCanCreatePages,
lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({
select,
context,
args: metadata?.bindings?.url?.args
})
};
},
[context, isSelected, metadata?.bindings?.url]
);
async function handleCreate(pageTitle) {
const page = await createPageEntity({
title: pageTitle,
status: "draft"
});
return {
id: page.id,
type: page.type,
title: page.title.rendered,
url: page.link,
kind: "post-type"
};
}
function createButtonText(searchTerm) {
return (0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: search term. */
(0,external_wp_i18n_namespaceObject.__)("Create page: <mark>%s</mark>"),
searchTerm
),
{ mark: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) }
);
}
function startEditing(event) {
event.preventDefault();
setIsEditingURL(true);
}
function unlink() {
setAttributes({
url: void 0,
linkTarget: void 0,
rel: void 0
});
setIsEditingURL(false);
}
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected) {
setIsEditingURL(false);
}
}, [isSelected]);
const linkValue = (0,external_wp_element_namespaceObject.useMemo)(
() => ({ url, opensInNewTab, nofollow }),
[url, opensInNewTab, nofollow]
);
const useEnterRef = useEnter({ content: text, clientId });
const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, richTextRef]);
const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)(
"typography.fluid",
"layout"
);
const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, {
typography: {
fluid: fluidTypographySettings
},
layout: {
wideSize: layout?.wideSize
}
});
const hasNonContentControls = blockEditingMode === "default";
const hasBlockControls = hasNonContentControls || isLinkTag && !lockUrlControls;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...blockProps,
className: dist_clsx(blockProps.className, {
[`has-custom-width wp-block-button__width-${width}`]: width
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText,
{
ref: mergedRef,
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Button text"),
placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)("Add text\u2026"),
value: text,
onChange: (value) => setAttributes({
text: removeAnchorTag(value)
}),
withoutInteractiveFormatting: true,
className: dist_clsx(
className,
"wp-block-button__link",
colorProps.className,
borderProps.className,
typographyProps.className,
{
[`has-text-align-${textAlign}`]: textAlign,
// For backwards compatibility add style that isn't
// provided via block support.
"no-border-radius": style?.border?.radius === 0,
[`has-custom-font-size`]: blockProps.style.fontSize
},
(0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)("button")
),
style: {
...borderProps.style,
...colorProps.style,
...spacingProps.style,
...shadowProps.style,
...typographyProps.style,
writingMode: void 0
},
onReplace,
onMerge: mergeBlocks,
identifier: "text"
}
)
}
),
hasBlockControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [
hasNonContentControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.AlignmentControl,
{
value: textAlign,
onChange: (nextAlign) => {
setAttributes({ textAlign: nextAlign });
}
}
),
isLinkTag && !lockUrlControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
name: "link",
icon: !isURLSet ? link_default : link_off_default,
title: !isURLSet ? (0,external_wp_i18n_namespaceObject.__)("Link") : (0,external_wp_i18n_namespaceObject.__)("Unlink"),
shortcut: !isURLSet ? external_wp_keycodes_namespaceObject.displayShortcut.primary("k") : external_wp_keycodes_namespaceObject.displayShortcut.primaryShift("k"),
onClick: !isURLSet ? startEditing : unlink,
isActive: isURLSet
}
)
] }),
isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Popover,
{
placement: "bottom",
onClose: () => {
setIsEditingURL(false);
richTextRef.current?.focus();
},
anchor: popoverAnchor,
focusOnMount: isEditingURL ? "firstElement" : false,
__unstableSlotName: "__unstable-block-tools-after",
shift: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.LinkControl,
{
value: linkValue,
onChange: ({
url: newURL,
opensInNewTab: newOpensInNewTab,
nofollow: newNofollow
}) => setAttributes(
getUpdatedLinkAttributes({
rel,
url: newURL,
opensInNewTab: newOpensInNewTab,
nofollow: newNofollow
})
),
onRemove: () => {
unlink();
richTextRef.current?.focus();
},
forceIsEditingLink: isEditingURL,
settings: LINK_SETTINGS,
createSuggestion: createPageEntity && handleCreate,
withCreateSuggestion: userCanCreatePages,
createSuggestionButtonText: createButtonText
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
WidthPanel,
{
selectedWidth: width,
setAttributes
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
HTMLElementControl,
{
tagName,
onChange: (value) => setAttributes({ tagName: value }),
options: [
{ label: (0,external_wp_i18n_namespaceObject.__)("Default (<a>)"), value: "a" },
{ label: "<button>", value: "button" }
]
}
),
isLinkTag && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Link relation"),
help: (0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."
),
{
a: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" })
}
),
value: rel || "",
onChange: (newRel) => setAttributes({ rel: newRel })
}
)
] })
] });
}
var edit_edit_default = ButtonEdit;
;// ./node_modules/@wordpress/block-library/build-module/button/block.json
const button_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/button","title":"Button","category":"design","parent":["core/buttons"],"description":"Prompt visitors to take action with a button-style link.","keywords":["link"],"textdomain":"default","attributes":{"tagName":{"type":"string","enum":["a","button"],"default":"a"},"type":{"type":"string","default":"button"},"textAlign":{"type":"string"},"url":{"type":"string","source":"attribute","selector":"a","attribute":"href","role":"content"},"title":{"type":"string","source":"attribute","selector":"a,button","attribute":"title","role":"content"},"text":{"type":"rich-text","source":"rich-text","selector":"a,button","role":"content"},"linkTarget":{"type":"string","source":"attribute","selector":"a","attribute":"target","role":"content"},"rel":{"type":"string","source":"attribute","selector":"a","attribute":"rel","role":"content"},"placeholder":{"type":"string"},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"gradient":{"type":"string"},"width":{"type":"number"}},"supports":{"anchor":true,"splitting":true,"align":false,"alignWide":false,"color":{"__experimentalSkipSerialization":true,"gradients":true,"__experimentalDefaultControls":{"background":true,"text":true}},"typography":{"__experimentalSkipSerialization":["fontSize","lineHeight","fontFamily","fontWeight","fontStyle","textTransform","textDecoration","letterSpacing"],"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalWritingMode":true,"__experimentalDefaultControls":{"fontSize":true}},"reusable":false,"shadow":{"__experimentalSkipSerialization":true},"spacing":{"__experimentalSkipSerialization":true,"padding":["horizontal","vertical"],"__experimentalDefaultControls":{"padding":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalSkipSerialization":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"interactivity":{"clientNavigation":true}},"styles":[{"name":"fill","label":"Fill","isDefault":true},{"name":"outline","label":"Outline"}],"editorStyle":"wp-block-button-editor","style":"wp-block-button","selectors":{"root":".wp-block-button .wp-block-button__link","typography":{"writingMode":".wp-block-button"}}}');
;// ./node_modules/@wordpress/block-library/build-module/button/save.js
function button_save_save({ attributes, className }) {
const {
tagName,
type,
textAlign,
fontSize,
linkTarget,
rel,
style,
text,
title,
url,
width
} = attributes;
const TagName = tagName || "a";
const isButtonTag = "button" === TagName;
const buttonType = type || "button";
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes);
const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes);
const buttonClasses = dist_clsx(
"wp-block-button__link",
colorProps.className,
borderProps.className,
typographyProps.className,
{
[`has-text-align-${textAlign}`]: textAlign,
// For backwards compatibility add style that isn't provided via
// block support.
"no-border-radius": style?.border?.radius === 0,
[`has-custom-font-size`]: fontSize || style?.typography?.fontSize
},
(0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)("button")
);
const buttonStyle = {
...borderProps.style,
...colorProps.style,
...spacingProps.style,
...shadowProps.style,
...typographyProps.style,
writingMode: void 0
};
const wrapperClasses = dist_clsx(className, {
[`has-custom-width wp-block-button__width-${width}`]: width
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: TagName,
type: isButtonTag ? buttonType : null,
className: buttonClasses,
href: isButtonTag ? null : url,
title,
style: buttonStyle,
value: text,
target: isButtonTag ? null : linkTarget,
rel: isButtonTag ? null : rel
}
) });
}
;// ./node_modules/@wordpress/block-library/build-module/button/index.js
const { name: button_name } = button_block_namespaceObject;
const button_settings = {
icon: button_default,
example: {
attributes: {
className: "is-style-fill",
text: (0,external_wp_i18n_namespaceObject.__)("Call to action")
}
},
edit: edit_edit_default,
save: button_save_save,
deprecated: button_deprecated_deprecated_default,
merge: (a, { text = "" }) => ({
...a,
text: (a.text || "") + text
})
};
const button_init = () => initBlock({ name: button_name, metadata: button_block_namespaceObject, settings: button_settings });
;// ./node_modules/@wordpress/icons/build-module/library/buttons.js
var buttons_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z" }) });
;// ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js
const migrateWithLayout = (attributes) => {
if (!!attributes.layout) {
return attributes;
}
const { contentJustification, orientation, ...updatedAttributes } = attributes;
if (contentJustification || orientation) {
Object.assign(updatedAttributes, {
layout: {
type: "flex",
...contentJustification && {
justifyContent: contentJustification
},
...orientation && { orientation }
}
});
}
return updatedAttributes;
};
const deprecated_deprecated = [
{
attributes: {
contentJustification: {
type: "string"
},
orientation: {
type: "string",
default: "horizontal"
}
},
supports: {
anchor: true,
align: ["wide", "full"],
__experimentalExposeControlsToChildren: true,
spacing: {
blockGap: true,
margin: ["top", "bottom"],
__experimentalDefaultControls: {
blockGap: true
}
}
},
isEligible: ({ contentJustification, orientation }) => !!contentJustification || !!orientation,
migrate: migrateWithLayout,
save({ attributes: { contentJustification, orientation } }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: dist_clsx({
[`is-content-justification-${contentJustification}`]: contentJustification,
"is-vertical": orientation === "vertical"
})
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})
}
);
}
},
{
supports: {
align: ["center", "left", "right"],
anchor: true
},
save() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) });
},
isEligible({ align }) {
return align && ["center", "left", "right"].includes(align);
},
migrate(attributes) {
return migrateWithLayout({
...attributes,
align: void 0,
// Floating Buttons blocks shouldn't have been supported in the
// first place. Most users using them probably expected them to
// act like content justification controls, so these blocks are
// migrated to use content justification.
// As for center-aligned Buttons blocks, the content justification
// equivalent will create an identical end result in most cases.
contentJustification: attributes.align
});
}
}
];
var buttons_deprecated_deprecated_default = deprecated_deprecated;
;// external ["wp","richText"]
const external_wp_richText_namespaceObject = window["wp"]["richText"];
;// ./node_modules/@wordpress/block-library/build-module/utils/get-transformed-attributes.js
function getTransformedAttributes(attributes, newBlockName, bindingsCallback = null) {
if (!attributes) {
return void 0;
}
const newBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(newBlockName);
if (!newBlockType) {
return void 0;
}
const transformedAttributes = {};
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(newBlockType, "anchor") && attributes.anchor) {
transformedAttributes.anchor = attributes.anchor;
}
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(newBlockType, "ariaLabel") && attributes.ariaLabel) {
transformedAttributes.ariaLabel = attributes.ariaLabel;
}
if (attributes.metadata) {
const transformedMetadata = [];
if (bindingsCallback) {
transformedMetadata.push("id", "bindings");
}
if (transformedMetadata.length > 0) {
const newMetadata = Object.entries(attributes.metadata).reduce(
(obj, [prop, value]) => {
if (!transformedMetadata.includes(prop)) {
return obj;
}
obj[prop] = prop === "bindings" ? bindingsCallback(value) : value;
return obj;
},
{}
);
if (Object.keys(newMetadata).length > 0) {
transformedAttributes.metadata = newMetadata;
}
}
}
if (Object.keys(transformedAttributes).length === 0) {
return void 0;
}
return transformedAttributes;
}
;// ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js
const transforms_transforms = {
from: [
{
type: "block",
isMultiBlock: true,
blocks: ["core/button"],
transform: (buttons) => (
// Creates the buttons block.
(0,external_wp_blocks_namespaceObject.createBlock)(
"core/buttons",
{},
// Loop the selected buttons.
buttons.map(
(attributes) => (
// Create singular button in the buttons block.
(0,external_wp_blocks_namespaceObject.createBlock)("core/button", attributes)
)
)
)
)
},
{
type: "block",
isMultiBlock: true,
blocks: ["core/paragraph"],
transform: (buttons) => (
// Creates the buttons block.
(0,external_wp_blocks_namespaceObject.createBlock)(
"core/buttons",
{},
// Loop the selected buttons.
buttons.map((attributes) => {
const { content } = attributes;
const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, content);
const text = element.innerText || "";
const link = element.querySelector("a");
const url = link?.getAttribute("href");
return (0,external_wp_blocks_namespaceObject.createBlock)("core/button", {
...attributes,
...getTransformedAttributes(
attributes,
"core/button",
({ content: contentBinding }) => ({
text: contentBinding
})
),
text,
url
});
})
)
),
isMatch: (paragraphs) => {
return paragraphs.every((attributes) => {
const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(
document,
attributes.content
);
const text = element.innerText || "";
const links = element.querySelectorAll("a");
return text.length <= 30 && links.length <= 1;
});
}
}
]
};
var transforms_transforms_default = transforms_transforms;
;// ./node_modules/@wordpress/block-library/build-module/buttons/edit.js
const DEFAULT_BLOCK = {
name: "core/button",
attributesToCopy: [
"backgroundColor",
"border",
"className",
"fontFamily",
"fontSize",
"gradient",
"style",
"textColor",
"width"
]
};
function ButtonsEdit({ attributes, className }) {
const { fontSize, layout, style } = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx(className, {
"has-custom-font-size": fontSize || style?.typography?.fontSize
})
});
const { hasButtonVariations } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const buttonVariations = select(external_wp_blocks_namespaceObject.store).getBlockVariations(
"core/button",
"inserter"
);
return {
hasButtonVariations: buttonVariations.length > 0
};
}, []);
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
defaultBlock: DEFAULT_BLOCK,
// This check should be handled by the `Inserter` internally to be consistent across all blocks that use it.
directInsert: !hasButtonVariations,
template: [["core/button"]],
templateInsertUpdatesSelection: true,
orientation: layout?.orientation ?? "horizontal"
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps });
}
var buttons_edit_edit_default = ButtonsEdit;
;// ./node_modules/@wordpress/block-library/build-module/buttons/block.json
const buttons_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/buttons","title":"Buttons","category":"design","allowedBlocks":["core/button"],"description":"Prompt visitors to take action with a group of button-style links.","keywords":["link"],"textdomain":"default","supports":{"anchor":true,"align":["wide","full"],"html":false,"__experimentalExposeControlsToChildren":true,"color":{"gradients":true,"text":false,"__experimentalDefaultControls":{"background":true}},"spacing":{"blockGap":["horizontal","vertical"],"padding":true,"margin":["top","bottom"],"__experimentalDefaultControls":{"blockGap":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"layout":{"allowSwitching":false,"allowInheriting":false,"default":{"type":"flex"}},"interactivity":{"clientNavigation":true},"contentRole":true},"editorStyle":"wp-block-buttons-editor","style":"wp-block-buttons"}');
;// ./node_modules/@wordpress/block-library/build-module/buttons/save.js
function buttons_save_save({ attributes, className }) {
const { fontSize, style } = attributes;
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: dist_clsx(className, {
"has-custom-font-size": fontSize || style?.typography?.fontSize
})
});
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps });
}
;// ./node_modules/@wordpress/block-library/build-module/buttons/index.js
const { name: buttons_name } = buttons_block_namespaceObject;
const buttons_settings = {
icon: buttons_default,
example: {
attributes: {
layout: {
type: "flex",
justifyContent: "center"
}
},
innerBlocks: [
{
name: "core/button",
attributes: { text: (0,external_wp_i18n_namespaceObject.__)("Find out more") }
},
{
name: "core/button",
attributes: { text: (0,external_wp_i18n_namespaceObject.__)("Contact us") }
}
]
},
deprecated: buttons_deprecated_deprecated_default,
transforms: transforms_transforms_default,
edit: buttons_edit_edit_default,
save: buttons_save_save
};
const buttons_init = () => initBlock({ name: buttons_name, metadata: buttons_block_namespaceObject, settings: buttons_settings });
;// ./node_modules/@wordpress/icons/build-module/library/calendar.js
var calendar_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" }) });
;// ./node_modules/@wordpress/block-library/build-module/calendar/block.json
const calendar_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/calendar","title":"Calendar","category":"widgets","description":"A calendar of your site’s posts.","keywords":["posts","archive"],"textdomain":"default","attributes":{"month":{"type":"integer"},"year":{"type":"integer"}},"supports":{"align":true,"html":false,"color":{"link":true,"__experimentalSkipSerialization":["text","background"],"__experimentalDefaultControls":{"background":true,"text":true},"__experimentalSelector":"table, th"},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true}},"style":"wp-block-calendar"}');
;// ./node_modules/@wordpress/block-library/build-module/calendar/edit.js
const getYearMonth = memize((date) => {
if (!date) {
return {};
}
const dateObj = new Date(date);
return {
year: dateObj.getFullYear(),
month: dateObj.getMonth() + 1
};
});
function CalendarEdit({ attributes }) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const { date, hasPosts, hasPostsResolved } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getEntityRecords, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store);
const singlePublishedPostQuery = {
status: "publish",
per_page: 1
};
const posts = getEntityRecords(
"postType",
"post",
singlePublishedPostQuery
);
const postsResolved = hasFinishedResolution("getEntityRecords", [
"postType",
"post",
singlePublishedPostQuery
]);
let _date;
const editorSelectors = select("core/editor");
if (editorSelectors) {
const postType = editorSelectors.getEditedPostAttribute("type");
if (postType === "post") {
_date = editorSelectors.getEditedPostAttribute("date");
}
}
return {
date: _date,
hasPostsResolved: postsResolved,
hasPosts: postsResolved && posts?.length === 1
};
}, []);
if (!hasPosts) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: calendar_default, label: (0,external_wp_i18n_namespaceObject.__)("Calendar"), children: !hasPostsResolved ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)("No published posts found.") }) });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
(external_wp_serverSideRender_default()),
{
block: "core/calendar",
attributes: { ...attributes, ...getYearMonth(date) }
}
) }) });
}
;// ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js
const calendar_transforms_transforms = {
from: [
{
type: "block",
blocks: ["core/archives"],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)("core/calendar")
}
],
to: [
{
type: "block",
blocks: ["core/archives"],
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)("core/archives")
}
]
};
var calendar_transforms_transforms_default = calendar_transforms_transforms;
;// ./node_modules/@wordpress/block-library/build-module/calendar/index.js
const { name: calendar_name } = calendar_block_namespaceObject;
const calendar_settings = {
icon: calendar_default,
example: {},
edit: CalendarEdit,
transforms: calendar_transforms_transforms_default
};
const calendar_init = () => initBlock({ name: calendar_name, metadata: calendar_block_namespaceObject, settings: calendar_settings });
;// ./node_modules/@wordpress/icons/build-module/library/category.js
var category_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",
fillRule: "evenodd",
clipRule: "evenodd"
}
) });
;// ./node_modules/@wordpress/block-library/build-module/categories/block.json
const categories_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/categories","title":"Terms List","category":"widgets","description":"Display a list of all terms of a given taxonomy.","keywords":["categories"],"textdomain":"default","attributes":{"taxonomy":{"type":"string","default":"category"},"displayAsDropdown":{"type":"boolean","default":false},"showHierarchy":{"type":"boolean","default":false},"showPostCounts":{"type":"boolean","default":false},"showOnlyTopLevel":{"type":"boolean","default":false},"showEmpty":{"type":"boolean","default":false},"label":{"type":"string","role":"content"},"showLabel":{"type":"boolean","default":true}},"usesContext":["enhancedPagination"],"supports":{"align":true,"html":false,"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"editorStyle":"wp-block-categories-editor","style":"wp-block-categories"}');
;// ./node_modules/@wordpress/icons/build-module/library/pin.js
var pin_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" }) });
;// ./node_modules/@wordpress/block-library/build-module/categories/edit.js
function CategoriesEdit({
attributes: {
displayAsDropdown,
showHierarchy,
showPostCounts,
showOnlyTopLevel,
showEmpty,
label,
showLabel,
taxonomy: taxonomySlug
},
setAttributes,
className,
clientId
}) {
const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, "blocks-category-select");
const { records: allTaxonomies, isResolvingTaxonomies } = (0,external_wp_coreData_namespaceObject.useEntityRecords)(
"root",
"taxonomy",
{ per_page: -1 }
);
const taxonomies = allTaxonomies?.filter((t) => t.visibility.public);
const taxonomy = taxonomies?.find((t) => t.slug === taxonomySlug);
const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical;
const query = { per_page: -1, hide_empty: !showEmpty, context: "view" };
if (isHierarchicalTaxonomy && showOnlyTopLevel) {
query.parent = 0;
}
const { records: categories, isResolving } = (0,external_wp_coreData_namespaceObject.useEntityRecords)(
"taxonomy",
taxonomySlug,
query
);
const { createWarningNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const showRedirectionPreventedNotice = (event) => {
event.preventDefault();
createWarningNotice((0,external_wp_i18n_namespaceObject.__)("Links are disabled in the editor."), {
id: `block-library/core/categories/redirection-prevented/${clientId}`,
type: "snackbar"
});
};
const getCategoriesList = (parentId) => {
if (!categories?.length) {
return [];
}
if (parentId === null) {
return categories;
}
return categories.filter(({ parent }) => parent === parentId);
};
const toggleAttribute = (attributeName) => (newValue) => setAttributes({ [attributeName]: newValue });
const renderCategoryName = (name) => !name ? (0,external_wp_i18n_namespaceObject.__)("(Untitled)") : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(name).trim();
const renderCategoryList = () => {
const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null;
const categoriesList = getCategoriesList(parentId);
return categoriesList.map(
(category) => renderCategoryListItem(category)
);
};
const renderCategoryListItem = (category) => {
const childCategories = getCategoriesList(category.id);
const { id, link, count, name } = category;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: `cat-item cat-item-${id}`, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: link, onClick: showRedirectionPreventedNotice, children: renderCategoryName(name) }),
showPostCounts && ` (${count})`,
isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "children", children: childCategories.map(
(childCategory) => renderCategoryListItem(childCategory)
) })
] }, id);
};
const renderCategoryDropdown = () => {
const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null;
const categoriesList = getCategoriesList(parentId);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
showLabel ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText,
{
className: "wp-block-categories__label",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Label text"),
placeholder: taxonomy?.name,
withoutInteractiveFormatting: true,
value: label,
onChange: (html) => setAttributes({ label: html })
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "label", htmlFor: selectId, children: label ? label : taxonomy?.name }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("select", { id: selectId, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: taxonomy's singular name */
(0,external_wp_i18n_namespaceObject.__)("Select %s"),
taxonomy?.labels?.singular_name
) }),
categoriesList.map(
(category) => renderCategoryDropdownItem(category, 0)
)
] })
] });
};
const renderCategoryDropdownItem = (category, level) => {
const { id, count, name } = category;
const childCategories = getCategoriesList(id);
return [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("option", { className: `level-${level}`, children: [
Array.from({ length: level * 3 }).map(() => "\xA0"),
renderCategoryName(name),
showPostCounts && ` (${count})`
] }, id),
isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && childCategories.map(
(childCategory) => renderCategoryDropdownItem(childCategory, level + 1)
)
];
};
const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? "ul" : "div";
const classes = dist_clsx(className, {
"wp-block-categories-list": !!categories?.length && !displayAsDropdown && !isResolving,
"wp-block-categories-dropdown": !!categories?.length && displayAsDropdown && !isResolving
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes
});
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
taxonomy: "category",
displayAsDropdown: false,
showHierarchy: false,
showPostCounts: false,
showOnlyTopLevel: false,
showEmpty: false,
showLabel: true
});
},
dropdownMenuProps,
children: [
Array.isArray(taxonomies) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => {
return taxonomySlug !== "category";
},
label: (0,external_wp_i18n_namespaceObject.__)("Taxonomy"),
onDeselect: () => {
setAttributes({ taxonomy: "category" });
},
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SelectControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Taxonomy"),
options: taxonomies.map((t) => ({
label: t.name,
value: t.slug
})),
value: taxonomySlug,
onChange: (selectedTaxonomy) => setAttributes({
taxonomy: selectedTaxonomy
})
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!displayAsDropdown,
label: (0,external_wp_i18n_namespaceObject.__)("Display as dropdown"),
onDeselect: () => setAttributes({ displayAsDropdown: false }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Display as dropdown"),
checked: displayAsDropdown,
onChange: toggleAttribute("displayAsDropdown")
}
)
}
),
displayAsDropdown && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !showLabel,
label: (0,external_wp_i18n_namespaceObject.__)("Show label"),
onDeselect: () => setAttributes({ showLabel: true }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
className: "wp-block-categories__indentation",
label: (0,external_wp_i18n_namespaceObject.__)("Show label"),
checked: showLabel,
onChange: toggleAttribute("showLabel")
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!showPostCounts,
label: (0,external_wp_i18n_namespaceObject.__)("Show post counts"),
onDeselect: () => setAttributes({ showPostCounts: false }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show post counts"),
checked: showPostCounts,
onChange: toggleAttribute("showPostCounts")
}
)
}
),
isHierarchicalTaxonomy && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!showOnlyTopLevel,
label: (0,external_wp_i18n_namespaceObject.__)("Show only top level terms"),
onDeselect: () => setAttributes({ showOnlyTopLevel: false }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show only top level terms"),
checked: showOnlyTopLevel,
onChange: toggleAttribute(
"showOnlyTopLevel"
)
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!showEmpty,
label: (0,external_wp_i18n_namespaceObject.__)("Show empty terms"),
onDeselect: () => setAttributes({ showEmpty: false }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show empty terms"),
checked: showEmpty,
onChange: toggleAttribute("showEmpty")
}
)
}
),
isHierarchicalTaxonomy && !showOnlyTopLevel && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => !!showHierarchy,
label: (0,external_wp_i18n_namespaceObject.__)("Show hierarchy"),
onDeselect: () => setAttributes({ showHierarchy: false }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show hierarchy"),
checked: showHierarchy,
onChange: toggleAttribute("showHierarchy")
}
)
}
)
]
}
) }),
isResolving && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: pin_default, label: (0,external_wp_i18n_namespaceObject.__)("Terms"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }),
!isResolving && categories?.length === 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: taxonomy.labels.no_terms }),
!isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())
] });
}
;// ./node_modules/@wordpress/block-library/build-module/categories/variations.js
const variations = [
{
name: "terms",
title: (0,external_wp_i18n_namespaceObject.__)("Terms List"),
icon: category_default,
attributes: {
// We need to set an attribute here that will be set when inserting the block.
// We cannot leave this empty, as that would be interpreted as the default value,
// which is `category` -- for which we're defining a distinct variation below,
// for backwards compatibility reasons.
// The logical fallback is thus the only other built-in and public taxonomy: Tags.
taxonomy: "post_tag"
},
isActive: (blockAttributes) => (
// This variation is used for any taxonomy other than `category`.
blockAttributes.taxonomy !== "category"
)
},
{
name: "categories",
title: (0,external_wp_i18n_namespaceObject.__)("Categories List"),
description: (0,external_wp_i18n_namespaceObject.__)("Display a list of all categories."),
icon: category_default,
attributes: {
taxonomy: "category"
},
isActive: ["taxonomy"],
// The following is needed to prevent "Terms List" from showing up twice in the inserter
// (once for the block, once for the variation). Fortunately, it does not collide with
// `categories` being the default value of the `taxonomy` attribute.
isDefault: true
}
];
var variations_default = variations;
;// ./node_modules/@wordpress/block-library/build-module/categories/index.js
const { name: categories_name } = categories_block_namespaceObject;
const categories_settings = {
icon: category_default,
example: {},
edit: CategoriesEdit,
variations: variations_default
};
const categories_init = () => initBlock({ name: categories_name, metadata: categories_block_namespaceObject, settings: categories_settings });
;// ./node_modules/@wordpress/icons/build-module/library/classic.js
var classic_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z" }) });
;// ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js
const ConvertToBlocksButton = ({ clientId }) => {
const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const block = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
},
[clientId]
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToolbarButton,
{
onClick: () => replaceBlocks(
block.clientId,
(0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: (0,external_wp_blocks_namespaceObject.serialize)(block) })
),
children: (0,external_wp_i18n_namespaceObject.__)("Convert to blocks")
}
);
};
var convert_to_blocks_button_default = ConvertToBlocksButton;
;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js
var fullscreen_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) });
;// ./node_modules/@wordpress/block-library/build-module/freeform/modal.js
function ModalAuxiliaryActions({ onClick, isModalFullScreen }) {
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)("small", "<");
if (isMobileViewport) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
onClick,
icon: fullscreen_default,
isPressed: isModalFullScreen,
label: isModalFullScreen ? (0,external_wp_i18n_namespaceObject.__)("Exit fullscreen") : (0,external_wp_i18n_namespaceObject.__)("Enter fullscreen")
}
);
}
function ClassicEdit(props) {
const styles = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles
);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const { baseURL, suffix, settings } = window.wpEditorL10n.tinymce;
window.tinymce.EditorManager.overrideDefaults({
base_url: baseURL,
suffix
});
window.wp.oldEditor.initialize(props.id, {
tinymce: {
...settings,
setup(editor) {
editor.on("init", () => {
const doc = editor.getDoc();
styles.forEach(({ css }) => {
const styleEl = doc.createElement("style");
styleEl.innerHTML = css;
doc.head.appendChild(styleEl);
});
});
}
}
});
return () => {
window.wp.oldEditor.remove(props.id);
};
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("textarea", { ...props });
}
function ModalEdit(props) {
const {
clientId,
attributes: { content },
setAttributes,
onReplace
} = props;
const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const [isModalFullScreen, setIsModalFullScreen] = (0,external_wp_element_namespaceObject.useState)(false);
const id = `editor-${clientId}`;
const onClose = () => content ? setOpen(false) : onReplace([]);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => setOpen(true), children: (0,external_wp_i18n_namespaceObject.__)("Edit") }) }) }),
content && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: content }),
(isOpen || !content) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Modal,
{
title: (0,external_wp_i18n_namespaceObject.__)("Classic Editor"),
onRequestClose: onClose,
shouldCloseOnClickOutside: false,
overlayClassName: "block-editor-freeform-modal",
isFullScreen: isModalFullScreen,
className: "block-editor-freeform-modal__content",
headerActions: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ModalAuxiliaryActions,
{
onClick: () => setIsModalFullScreen(!isModalFullScreen),
isModalFullScreen
}
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ClassicEdit, { id, defaultValue: content }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Flex,
{
className: "block-editor-freeform-modal__actions",
justify: "flex-end",
expanded: false,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "tertiary",
onClick: onClose,
children: (0,external_wp_i18n_namespaceObject.__)("Cancel")
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "primary",
onClick: () => {
setAttributes({
content: window.wp.oldEditor.getContent(
id
)
});
setOpen(false);
},
children: (0,external_wp_i18n_namespaceObject.__)("Save")
}
) })
]
}
)
]
}
)
] });
}
;// ./node_modules/@wordpress/block-library/build-module/freeform/edit.js
const { wp } = window;
function isTmceEmpty(editor) {
const body = editor.getBody();
if (body.childNodes.length > 1) {
return false;
} else if (body.childNodes.length === 0) {
return true;
}
if (body.childNodes[0].childNodes.length > 1) {
return false;
}
return /^\n?$/.test(body.innerText || body.textContent);
}
function FreeformEdit(props) {
const { clientId } = props;
const canRemove = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId),
[clientId]
);
const [isIframed, setIsIframed] = (0,external_wp_element_namespaceObject.useState)(false);
const ref = (0,external_wp_compose_namespaceObject.useRefEffect)((element) => {
setIsIframed(element.ownerDocument !== document);
}, []);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
canRemove && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(convert_to_blocks_button_default, { clientId }) }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref }), children: isIframed ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalEdit, { ...props }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ClassicEdit, { ...props }) })
] });
}
function edit_ClassicEdit({
clientId,
attributes: { content },
setAttributes,
onReplace
}) {
const { getMultiSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const didMountRef = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!didMountRef.current) {
return;
}
const editor = window.tinymce.get(`editor-${clientId}`);
if (!editor) {
return;
}
const currentContent = editor.getContent();
if (currentContent !== content) {
editor.setContent(content || "");
}
}, [clientId, content]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const { baseURL, suffix } = window.wpEditorL10n.tinymce;
didMountRef.current = true;
window.tinymce.EditorManager.overrideDefaults({
base_url: baseURL,
suffix
});
function onSetup(editor) {
let bookmark;
if (content) {
editor.on("loadContent", () => editor.setContent(content));
}
editor.on("blur", () => {
bookmark = editor.selection.getBookmark(2, true);
const scrollContainer = document.querySelector(
".interface-interface-skeleton__content"
);
const scrollPosition = scrollContainer.scrollTop;
if (!getMultiSelectedBlockClientIds()?.length) {
setAttributes({
content: editor.getContent()
});
}
editor.once("focus", () => {
if (bookmark) {
editor.selection.moveToBookmark(bookmark);
if (scrollContainer.scrollTop !== scrollPosition) {
scrollContainer.scrollTop = scrollPosition;
}
}
});
return false;
});
editor.on("mousedown touchstart", () => {
bookmark = null;
});
const debouncedOnChange = (0,external_wp_compose_namespaceObject.debounce)(() => {
const value = editor.getContent();
if (value !== editor._lastChange) {
editor._lastChange = value;
setAttributes({
content: value
});
}
}, 250);
editor.on("Paste Change input Undo Redo", debouncedOnChange);
editor.on("remove", debouncedOnChange.cancel);
editor.on("keydown", (event) => {
if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, "z")) {
event.stopPropagation();
}
if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) {
onReplace([]);
event.preventDefault();
event.stopImmediatePropagation();
}
const { altKey } = event;
if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) {
event.stopPropagation();
}
});
editor.on("paste", (event) => {
event.stopPropagation();
});
editor.on("init", () => {
const rootNode = editor.getBody();
if (rootNode.ownerDocument.activeElement === rootNode) {
rootNode.blur();
editor.focus();
}
});
}
function initialize() {
const { settings } = window.wpEditorL10n.tinymce;
wp.oldEditor.initialize(`editor-${clientId}`, {
tinymce: {
...settings,
inline: true,
content_css: false,
fixed_toolbar_container: `#toolbar-${clientId}`,
setup: onSetup
}
});
}
function onReadyStateChange() {
if (document.readyState === "complete") {
initialize();
}
}
if (document.readyState === "complete") {
initialize();
} else {
document.addEventListener("readystatechange", onReadyStateChange);
}
return () => {
document.removeEventListener(
"readystatechange",
onReadyStateChange
);
wp.oldEditor.remove(`editor-${clientId}`);
didMountRef.current = false;
};
}, []);
function focus() {
const editor = window.tinymce.get(`editor-${clientId}`);
if (editor) {
editor.focus();
}
}
function onToolbarKeyDown(event) {
event.stopPropagation();
event.nativeEvent.stopImmediatePropagation();
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
id: `toolbar-${clientId}`,
className: "block-library-classic__toolbar",
onClick: focus,
"data-placeholder": (0,external_wp_i18n_namespaceObject.__)("Classic"),
onKeyDown: onToolbarKeyDown
},
"toolbar"
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
id: `editor-${clientId}`,
className: "wp-block-freeform block-library-rich-text__tinymce"
},
"editor"
)
] });
}
;// ./node_modules/@wordpress/block-library/build-module/freeform/block.json
const freeform_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/freeform","title":"Classic","category":"text","description":"Use the classic WordPress editor.","textdomain":"default","attributes":{"content":{"type":"string","source":"raw"}},"supports":{"html":false,"className":false,"customClassName":false,"lock":false,"reusable":false,"renaming":false,"visibility":false},"editorStyle":"wp-block-freeform-editor"}');
;// ./node_modules/@wordpress/block-library/build-module/freeform/save.js
function freeform_save_save({ attributes }) {
const { content } = attributes;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: content });
}
;// ./node_modules/@wordpress/block-library/build-module/freeform/index.js
const { name: freeform_name } = freeform_block_namespaceObject;
const freeform_settings = {
icon: classic_default,
edit: FreeformEdit,
save: freeform_save_save
};
const freeform_init = () => initBlock({ name: freeform_name, metadata: freeform_block_namespaceObject, settings: freeform_settings });
;// ./node_modules/@wordpress/icons/build-module/library/code.js
var code_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) });
;// ./node_modules/@wordpress/block-library/build-module/code/edit.js
function CodeEdit({
attributes,
setAttributes,
onRemove,
insertBlocksAfter,
mergeBlocks
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText,
{
tagName: "code",
identifier: "content",
value: attributes.content,
onChange: (content) => setAttributes({ content }),
onRemove,
onMerge: mergeBlocks,
placeholder: (0,external_wp_i18n_namespaceObject.__)("Write code\u2026"),
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Code"),
preserveWhiteSpace: true,
__unstablePastePlainText: true,
__unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
}
) });
}
;// ./node_modules/@wordpress/block-library/build-module/code/block.json
const code_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/code","title":"Code","category":"text","description":"Display code snippets that respect your spacing and tabs.","textdomain":"default","attributes":{"content":{"type":"rich-text","source":"rich-text","selector":"code","__unstablePreserveWhiteSpace":true,"role":"content"}},"supports":{"align":["wide"],"anchor":true,"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"spacing":{"margin":["top","bottom"],"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"width":true,"color":true}},"color":{"text":true,"background":true,"gradients":true,"__experimentalDefaultControls":{"background":true,"text":true}},"interactivity":{"clientNavigation":true}},"style":"wp-block-code"}');
;// ./node_modules/@wordpress/block-library/build-module/code/utils.js
function utils_escape(content) {
return (0,external_wp_compose_namespaceObject.pipe)(
escapeOpeningSquareBrackets,
escapeProtocolInIsolatedUrls
)(content || "");
}
function escapeOpeningSquareBrackets(content) {
return content.replace(/\[/g, "[");
}
function escapeProtocolInIsolatedUrls(content) {
return content.replace(
/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,
"$1//$2"
);
}
;// ./node_modules/@wordpress/block-library/build-module/code/save.js
function code_save_save({ attributes }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "code",
value: utils_escape(
typeof attributes.content === "string" ? attributes.content : attributes.content.toHTMLString({
preserveWhiteSpace: true
})
)
}
) });
}
;// ./node_modules/@wordpress/block-library/build-module/code/transforms.js
const code_transforms_transforms = {
from: [
{
type: "enter",
regExp: /^```$/,
transform: () => (0,external_wp_blocks_namespaceObject.createBlock)("core/code")
},
{
type: "block",
blocks: ["core/paragraph"],
transform: (attributes) => {
const { content } = attributes;
return (0,external_wp_blocks_namespaceObject.createBlock)("core/code", {
...attributes,
...getTransformedAttributes(attributes, "core/code"),
content
});
}
},
{
type: "block",
blocks: ["core/html"],
transform: (attributes) => {
const { content: text } = attributes;
return (0,external_wp_blocks_namespaceObject.createBlock)("core/code", {
...attributes,
...getTransformedAttributes(attributes, "core/code"),
// The HTML is plain text (with plain line breaks), so
// convert it to rich text.
content: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: (0,external_wp_richText_namespaceObject.create)({ text }) })
});
}
},
{
type: "raw",
isMatch: (node) => node.nodeName === "PRE" && node.children.length === 1 && node.firstChild.nodeName === "CODE",
schema: {
pre: {
children: {
code: {
children: {
"#text": {}
}
}
}
}
}
}
],
to: [
{
type: "block",
blocks: ["core/paragraph"],
transform: (attributes) => {
const { content } = attributes;
return (0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {
...getTransformedAttributes(attributes, "core/paragraph"),
content
});
}
}
]
};
var code_transforms_transforms_default = code_transforms_transforms;
;// ./node_modules/@wordpress/block-library/build-module/code/index.js
const { name: code_name } = code_block_namespaceObject;
const code_settings = {
icon: code_default,
example: {
attributes: {
/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
// translators: Preserve \n markers for line breaks
content: (0,external_wp_i18n_namespaceObject.__)(
"// A \u201Cblock\u201D is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );"
)
/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
}
},
merge(attributes, attributesToMerge) {
return {
content: attributes.content + "\n\n" + attributesToMerge.content
};
},
transforms: code_transforms_transforms_default,
edit: CodeEdit,
save: code_save_save
};
const code_init = () => initBlock({ name: code_name, metadata: code_block_namespaceObject, settings: code_settings });
;// ./node_modules/@wordpress/icons/build-module/library/column.js
var column_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z" }) });
;// ./node_modules/@wordpress/block-library/build-module/column/deprecated.js
const column_deprecated_deprecated = [
{
attributes: {
verticalAlignment: {
type: "string"
},
width: {
type: "number",
min: 0,
max: 100
}
},
isEligible({ width }) {
return isFinite(width);
},
migrate(attributes) {
return {
...attributes,
width: `${attributes.width}%`
};
},
save({ attributes }) {
const { verticalAlignment, width } = attributes;
const wrapperClasses = dist_clsx({
[`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
});
const style = { flexBasis: width + "%" };
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: wrapperClasses, style, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) });
}
}
];
var column_deprecated_deprecated_default = column_deprecated_deprecated;
;// ./node_modules/@wordpress/block-library/build-module/column/edit.js
function ColumnInspectorControls({ width, setAttributes }) {
const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ["%", "px", "em", "rem", "vw"]
});
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({ width: void 0 });
},
dropdownMenuProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => width !== void 0,
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
onDeselect: () => setAttributes({ width: void 0 }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Width"),
__unstableInputWidth: "calc(50% - 8px)",
__next40pxDefaultSize: true,
value: width || "",
onChange: (nextWidth) => {
nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth;
setAttributes({ width: nextWidth });
},
units
}
)
}
)
}
);
}
function ColumnEdit({
attributes: { verticalAlignment, width, templateLock, allowedBlocks },
setAttributes,
clientId
}) {
const classes = dist_clsx("block-core-columns", {
[`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
});
const { columnsIds, hasChildBlocks, rootClientId } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getBlockOrder, getBlockRootClientId } = select(external_wp_blockEditor_namespaceObject.store);
const rootId = getBlockRootClientId(clientId);
return {
hasChildBlocks: getBlockOrder(clientId).length > 0,
rootClientId: rootId,
columnsIds: getBlockOrder(rootId)
};
},
[clientId]
);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const updateAlignment = (value) => {
setAttributes({ verticalAlignment: value });
updateBlockAttributes(rootClientId, {
verticalAlignment: null
});
};
const widthWithUnit = Number.isFinite(width) ? width + "%" : width;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes,
style: widthWithUnit ? { flexBasis: widthWithUnit } : void 0
});
const columnsCount = columnsIds.length;
const currentColumnPosition = columnsIds.indexOf(clientId) + 1;
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */
(0,external_wp_i18n_namespaceObject.__)("%1$s (%2$d of %3$d)"),
blockProps["aria-label"],
currentColumnPosition,
columnsCount
);
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(
{ ...blockProps, "aria-label": label },
{
templateLock,
allowedBlocks,
renderAppender: hasChildBlocks ? void 0 : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar,
{
onChange: updateAlignment,
value: verticalAlignment,
controls: ["top", "center", "bottom", "stretch"]
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ColumnInspectorControls,
{
width,
setAttributes
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })
] });
}
var column_edit_edit_default = ColumnEdit;
;// ./node_modules/@wordpress/block-library/build-module/column/block.json
const column_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/column","title":"Column","category":"design","parent":["core/columns"],"description":"A single column within a columns block.","textdomain":"default","attributes":{"verticalAlignment":{"type":"string"},"width":{"type":"string"},"templateLock":{"type":["string","boolean"],"enum":["all","insert","contentOnly",false]}},"supports":{"__experimentalOnEnter":true,"anchor":true,"reusable":false,"html":false,"color":{"gradients":true,"heading":true,"button":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"shadow":true,"spacing":{"blockGap":true,"padding":true,"__experimentalDefaultControls":{"padding":true,"blockGap":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"layout":true,"interactivity":{"clientNavigation":true},"allowedBlocks":true}}');
;// ./node_modules/@wordpress/block-library/build-module/column/save.js
function column_save_save({ attributes }) {
const { verticalAlignment, width } = attributes;
const wrapperClasses = dist_clsx({
[`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
});
let style;
if (width && /\d/.test(width)) {
let flexBasis = Number.isFinite(width) ? width + "%" : width;
if (!Number.isFinite(width) && width?.endsWith("%")) {
const multiplier = 1e12;
flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + "%";
}
style = { flexBasis };
}
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: wrapperClasses,
style
});
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps });
}
;// ./node_modules/@wordpress/block-library/build-module/column/index.js
const { name: column_name } = column_block_namespaceObject;
const column_settings = {
icon: column_default,
edit: column_edit_edit_default,
save: column_save_save,
deprecated: column_deprecated_deprecated_default
};
const column_init = () => initBlock({ name: column_name, metadata: column_block_namespaceObject, settings: column_settings });
;// ./node_modules/@wordpress/icons/build-module/library/columns.js
var columns_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M15 7.5h-5v10h5v-10Zm1.5 0v10H19a.5.5 0 0 0 .5-.5V8a.5.5 0 0 0-.5-.5h-2.5ZM6 7.5h2.5v10H6a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5ZM6 6h13a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z"
}
) });
;// ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js
function getDeprecatedLayoutColumn(originalContent) {
let { doc } = getDeprecatedLayoutColumn;
if (!doc) {
doc = document.implementation.createHTMLDocument("");
getDeprecatedLayoutColumn.doc = doc;
}
let columnMatch;
doc.body.innerHTML = originalContent;
for (const classListItem of doc.body.firstChild.classList) {
if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) {
return Number(columnMatch[1]) - 1;
}
}
}
const migrateCustomColors = (attributes) => {
if (!attributes.customTextColor && !attributes.customBackgroundColor) {
return attributes;
}
const style = { color: {} };
if (attributes.customTextColor) {
style.color.text = attributes.customTextColor;
}
if (attributes.customBackgroundColor) {
style.color.background = attributes.customBackgroundColor;
}
const { customTextColor, customBackgroundColor, ...restAttributes } = attributes;
return {
...restAttributes,
style,
isStackedOnMobile: true
};
};
var columns_deprecated_deprecated_default = [
{
attributes: {
verticalAlignment: {
type: "string"
},
backgroundColor: {
type: "string"
},
customBackgroundColor: {
type: "string"
},
customTextColor: {
type: "string"
},
textColor: {
type: "string"
}
},
migrate: migrateCustomColors,
save({ attributes }) {
const {
verticalAlignment,
backgroundColor,
customBackgroundColor,
textColor,
customTextColor
} = attributes;
const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
backgroundColor
);
const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)("color", textColor);
const className = dist_clsx({
"has-background": backgroundColor || customBackgroundColor,
"has-text-color": textColor || customTextColor,
[backgroundClass]: backgroundClass,
[textClass]: textClass,
[`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
});
const style = {
backgroundColor: backgroundClass ? void 0 : customBackgroundColor,
color: textClass ? void 0 : customTextColor
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
className: className ? className : void 0,
style,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})
}
);
}
},
{
attributes: {
columns: {
type: "number",
default: 2
}
},
isEligible(attributes, innerBlocks) {
const isFastPassEligible = innerBlocks.some(
(innerBlock) => /layout-column-\d+/.test(innerBlock.originalContent)
);
if (!isFastPassEligible) {
return false;
}
return innerBlocks.some(
(innerBlock) => getDeprecatedLayoutColumn(innerBlock.originalContent) !== void 0
);
},
migrate(attributes, innerBlocks) {
const columns = innerBlocks.reduce((accumulator, innerBlock) => {
const { originalContent } = innerBlock;
let columnIndex = getDeprecatedLayoutColumn(originalContent);
if (columnIndex === void 0) {
columnIndex = 0;
}
if (!accumulator[columnIndex]) {
accumulator[columnIndex] = [];
}
accumulator[columnIndex].push(innerBlock);
return accumulator;
}, []);
const migratedInnerBlocks = columns.map(
(columnBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)("core/column", {}, columnBlocks)
);
const { columns: ignoredColumns, ...restAttributes } = attributes;
return [
{
...restAttributes,
isStackedOnMobile: true
},
migratedInnerBlocks
];
},
save({ attributes }) {
const { columns } = attributes;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `has-${columns}-columns`, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) });
}
},
{
attributes: {
columns: {
type: "number",
default: 2
}
},
migrate(attributes, innerBlocks) {
const { columns, ...restAttributes } = attributes;
attributes = {
...restAttributes,
isStackedOnMobile: true
};
return [attributes, innerBlocks];
},
save({ attributes }) {
const { verticalAlignment, columns } = attributes;
const wrapperClasses = dist_clsx(`has-${columns}-columns`, {
[`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: wrapperClasses, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) });
}
}
];
;// ./node_modules/@wordpress/block-library/build-module/columns/utils.js
const toWidthPrecision = (value) => {
const unitlessValue = parseFloat(value);
return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : void 0;
};
function getEffectiveColumnWidth(block, totalBlockCount) {
const { width = 100 / totalBlockCount } = block.attributes;
return toWidthPrecision(width);
}
function getTotalColumnsWidth(blocks, totalBlockCount = blocks.length) {
return blocks.reduce(
(sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount),
0
);
}
function getColumnWidths(blocks, totalBlockCount = blocks.length) {
return blocks.reduce((accumulator, block) => {
const width = getEffectiveColumnWidth(block, totalBlockCount);
return Object.assign(accumulator, { [block.clientId]: width });
}, {});
}
function getRedistributedColumnWidths(blocks, availableWidth, totalBlockCount = blocks.length) {
const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount);
return Object.fromEntries(
Object.entries(getColumnWidths(blocks, totalBlockCount)).map(
([clientId, width]) => {
const newWidth = availableWidth * width / totalWidth;
return [clientId, toWidthPrecision(newWidth)];
}
)
);
}
function hasExplicitPercentColumnWidths(blocks) {
return blocks.every((block) => {
const blockWidth = block.attributes.width;
return Number.isFinite(
blockWidth?.endsWith?.("%") ? parseFloat(blockWidth) : blockWidth
);
});
}
function getMappedColumnWidths(blocks, widths) {
return blocks.map((block) => ({
...block,
attributes: {
...block.attributes,
width: `${widths[block.clientId]}%`
}
}));
}
function getWidths(blocks, withParsing = true) {
return blocks.map((innerColumn) => {
const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length;
return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth;
});
}
function getWidthWithUnit(width, unit) {
width = 0 > parseFloat(width) ? "0" : width;
if (isPercentageUnit(unit)) {
width = Math.min(width, 100);
}
return `${width}${unit}`;
}
function isPercentageUnit(unit) {
return unit === "%";
}
;// ./node_modules/@wordpress/block-library/build-module/columns/edit.js
const edit_DEFAULT_BLOCK = {
name: "core/column"
};
function edit_ColumnInspectorControls({
clientId,
setAttributes,
isStackedOnMobile
}) {
const { count, canInsertColumnBlock, minCount } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { canInsertBlockType, canRemoveBlock, getBlockOrder } = select(external_wp_blockEditor_namespaceObject.store);
const blockOrder = getBlockOrder(clientId);
const preventRemovalBlockIndexes = blockOrder.reduce(
(acc, blockId, index) => {
if (!canRemoveBlock(blockId)) {
acc.push(index);
}
return acc;
},
[]
);
return {
count: blockOrder.length,
canInsertColumnBlock: canInsertBlockType(
"core/column",
clientId
),
minCount: Math.max(...preventRemovalBlockIndexes) + 1
};
},
[clientId]
);
const { getBlocks } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const { replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
function updateColumns(previousColumns, newColumns) {
let innerBlocks = getBlocks(clientId);
const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks);
const isAddingColumn = newColumns > previousColumns;
if (isAddingColumn && hasExplicitWidths) {
const newColumnWidth = toWidthPrecision(100 / newColumns);
const newlyAddedColumns = newColumns - previousColumns;
const widths = getRedistributedColumnWidths(
innerBlocks,
100 - newColumnWidth * newlyAddedColumns
);
innerBlocks = [
...getMappedColumnWidths(innerBlocks, widths),
...Array.from({
length: newlyAddedColumns
}).map(() => {
return (0,external_wp_blocks_namespaceObject.createBlock)("core/column", {
width: `${newColumnWidth}%`
});
})
];
} else if (isAddingColumn) {
innerBlocks = [
...innerBlocks,
...Array.from({
length: newColumns - previousColumns
}).map(() => {
return (0,external_wp_blocks_namespaceObject.createBlock)("core/column");
})
];
} else if (newColumns < previousColumns) {
innerBlocks = innerBlocks.slice(
0,
-(previousColumns - newColumns)
);
if (hasExplicitWidths) {
const widths = getRedistributedColumnWidths(innerBlocks, 100);
innerBlocks = getMappedColumnWidths(innerBlocks, widths);
}
}
replaceInnerBlocks(clientId, innerBlocks);
}
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
isStackedOnMobile: true
});
},
dropdownMenuProps,
children: [
canInsertColumnBlock && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, style: { gridColumn: "1 / -1" }, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Columns"),
value: count,
onChange: (value) => updateColumns(count, Math.max(minCount, value)),
min: Math.max(1, minCount),
max: Math.max(6, count)
}
),
count > 6 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)(
"This column count exceeds the recommended amount and may cause visual breakage."
) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Stack on mobile"),
isShownByDefault: true,
hasValue: () => isStackedOnMobile !== true,
onDeselect: () => setAttributes({
isStackedOnMobile: true
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Stack on mobile"),
checked: isStackedOnMobile,
onChange: () => setAttributes({
isStackedOnMobile: !isStackedOnMobile
})
}
)
}
)
]
}
);
}
function ColumnsEditContainer({ attributes, setAttributes, clientId }) {
const { isStackedOnMobile, verticalAlignment, templateLock } = attributes;
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const { getBlockOrder } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const classes = dist_clsx({
[`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
[`is-not-stacked-on-mobile`]: !isStackedOnMobile
});
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes
});
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
defaultBlock: edit_DEFAULT_BLOCK,
directInsert: true,
orientation: "horizontal",
renderAppender: false,
templateLock
});
function updateAlignment(newVerticalAlignment) {
const innerBlockClientIds = getBlockOrder(clientId);
registry.batch(() => {
setAttributes({ verticalAlignment: newVerticalAlignment });
updateBlockAttributes(innerBlockClientIds, {
verticalAlignment: newVerticalAlignment
});
});
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar,
{
onChange: updateAlignment,
value: verticalAlignment
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
edit_ColumnInspectorControls,
{
clientId,
setAttributes,
isStackedOnMobile
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })
] });
}
function Placeholder({ clientId, name, setAttributes }) {
const { blockType, defaultVariation, variations } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const {
getBlockVariations,
getBlockType,
getDefaultBlockVariation
} = select(external_wp_blocks_namespaceObject.store);
return {
blockType: getBlockType(name),
defaultVariation: getDefaultBlockVariation(name, "block"),
variations: getBlockVariations(name, "block")
};
},
[name]
);
const { replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker,
{
icon: blockType?.icon?.src,
label: blockType?.title,
variations,
instructions: (0,external_wp_i18n_namespaceObject.__)("Divide into columns. Select a layout:"),
onSelect: (nextVariation = defaultVariation) => {
if (nextVariation.attributes) {
setAttributes(nextVariation.attributes);
}
if (nextVariation.innerBlocks) {
replaceInnerBlocks(
clientId,
(0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(
nextVariation.innerBlocks
),
true
);
}
},
allowSkip: true
}
) });
}
const ColumnsEdit = (props) => {
const { clientId } = props;
const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0,
[clientId]
);
const Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props });
};
var columns_edit_edit_default = ColumnsEdit;
;// ./node_modules/@wordpress/block-library/build-module/columns/block.json
const columns_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/columns","title":"Columns","category":"design","allowedBlocks":["core/column"],"description":"Display content in multiple columns, with blocks added to each column.","textdomain":"default","attributes":{"verticalAlignment":{"type":"string"},"isStackedOnMobile":{"type":"boolean","default":true},"templateLock":{"type":["string","boolean"],"enum":["all","insert","contentOnly",false]}},"supports":{"anchor":true,"align":["wide","full"],"html":false,"color":{"gradients":true,"link":true,"heading":true,"button":true,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"blockGap":{"__experimentalDefault":"2em","sides":["horizontal","vertical"]},"margin":["top","bottom"],"padding":true,"__experimentalDefaultControls":{"padding":true,"blockGap":true}},"layout":{"allowSwitching":false,"allowInheriting":false,"allowEditing":false,"default":{"type":"flex","flexWrap":"nowrap"}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"shadow":true},"editorStyle":"wp-block-columns-editor","style":"wp-block-columns"}');
;// ./node_modules/@wordpress/block-library/build-module/columns/save.js
function columns_save_save({ attributes }) {
const { isStackedOnMobile, verticalAlignment } = attributes;
const className = dist_clsx({
[`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
[`is-not-stacked-on-mobile`]: !isStackedOnMobile
});
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className });
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps });
}
;// ./node_modules/@wordpress/block-library/build-module/columns/variations.js
const variations_variations = [
{
name: "one-column-full",
title: (0,external_wp_i18n_namespaceObject.__)("100"),
description: (0,external_wp_i18n_namespaceObject.__)("One column"),
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
width: "48",
height: "48",
viewBox: "0 0 48 48",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" })
}
),
innerBlocks: [["core/column"]],
scope: ["block"]
},
{
name: "two-columns-equal",
title: (0,external_wp_i18n_namespaceObject.__)("50 / 50"),
description: (0,external_wp_i18n_namespaceObject.__)("Two columns; equal split"),
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
width: "48",
height: "48",
viewBox: "0 0 48 48",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" })
}
),
isDefault: true,
innerBlocks: [["core/column"], ["core/column"]],
scope: ["block"]
},
{
name: "two-columns-one-third-two-thirds",
title: (0,external_wp_i18n_namespaceObject.__)("33 / 66"),
description: (0,external_wp_i18n_namespaceObject.__)("Two columns; one-third, two-thirds split"),
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
width: "48",
height: "48",
viewBox: "0 0 48 48",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z" })
}
),
innerBlocks: [
["core/column", { width: "33.33%" }],
["core/column", { width: "66.66%" }]
],
scope: ["block"]
},
{
name: "two-columns-two-thirds-one-third",
title: (0,external_wp_i18n_namespaceObject.__)("66 / 33"),
description: (0,external_wp_i18n_namespaceObject.__)("Two columns; two-thirds, one-third split"),
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
width: "48",
height: "48",
viewBox: "0 0 48 48",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z" })
}
),
innerBlocks: [
["core/column", { width: "66.66%" }],
["core/column", { width: "33.33%" }]
],
scope: ["block"]
},
{
name: "three-columns-equal",
title: (0,external_wp_i18n_namespaceObject.__)("33 / 33 / 33"),
description: (0,external_wp_i18n_namespaceObject.__)("Three columns; equal split"),
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
width: "48",
height: "48",
viewBox: "0 0 48 48",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z" })
}
),
innerBlocks: [
["core/column"],
["core/column"],
["core/column"]
],
scope: ["block"]
},
{
name: "three-columns-wider-center",
title: (0,external_wp_i18n_namespaceObject.__)("25 / 50 / 25"),
description: (0,external_wp_i18n_namespaceObject.__)("Three columns; wide center column"),
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.SVG,
{
xmlns: "http://www.w3.org/2000/svg",
width: "48",
height: "48",
viewBox: "0 0 48 48",
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z" })
}
),
innerBlocks: [
["core/column", { width: "25%" }],
["core/column", { width: "50%" }],
["core/column", { width: "25%" }]
],
scope: ["block"]
}
];
var variations_variations_default = variations_variations;
;// ./node_modules/@wordpress/block-library/build-module/columns/transforms.js
const MAXIMUM_SELECTED_BLOCKS = 6;
const columns_transforms_transforms = {
from: [
{
type: "block",
isMultiBlock: true,
blocks: ["*"],
__experimentalConvert: (blocks) => {
const columnWidth = +(100 / blocks.length).toFixed(2);
const innerBlocksTemplate = blocks.map(
({ name, attributes, innerBlocks }) => [
"core/column",
{ width: `${columnWidth}%` },
[[name, { ...attributes }, innerBlocks]]
]
);
return (0,external_wp_blocks_namespaceObject.createBlock)(
"core/columns",
{},
(0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)
);
},
isMatch: ({ length: selectedBlocksLength }, blocks) => {
if (blocks.length === 1 && blocks[0].name === "core/columns") {
return false;
}
return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS;
}
},
{
type: "block",
blocks: ["core/media-text"],
priority: 1,
transform: (attributes, innerBlocks) => {
const {
align,
backgroundColor,
textColor,
style,
mediaAlt: alt,
mediaId: id,
mediaPosition,
mediaSizeSlug: sizeSlug,
mediaType,
mediaUrl: url,
mediaWidth,
verticalAlignment
} = attributes;
let media;
if (mediaType === "image" || !mediaType) {
const imageAttrs = { id, alt, url, sizeSlug };
const linkAttrs = {
href: attributes.href,
linkClass: attributes.linkClass,
linkDestination: attributes.linkDestination,
linkTarget: attributes.linkTarget,
rel: attributes.rel
};
media = ["core/image", { ...imageAttrs, ...linkAttrs }];
} else {
media = ["core/video", { id, src: url }];
}
const innerBlocksTemplate = [
["core/column", { width: `${mediaWidth}%` }, [media]],
[
"core/column",
{ width: `${100 - mediaWidth}%` },
innerBlocks
]
];
if (mediaPosition === "right") {
innerBlocksTemplate.reverse();
}
return (0,external_wp_blocks_namespaceObject.createBlock)(
"core/columns",
{
align,
backgroundColor,
textColor,
style,
verticalAlignment
},
(0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)
);
}
}
],
ungroup: (attributes, innerBlocks) => innerBlocks.flatMap((innerBlock) => innerBlock.innerBlocks)
};
var columns_transforms_transforms_default = columns_transforms_transforms;
;// ./node_modules/@wordpress/block-library/build-module/columns/index.js
const { name: columns_name } = columns_block_namespaceObject;
const columns_settings = {
icon: columns_default,
variations: variations_variations_default,
example: {
viewportWidth: 782,
// Columns collapse "@media (max-width: 781px)".
innerBlocks: [
{
name: "core/column",
innerBlocks: [
{
name: "core/paragraph",
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis."
)
}
},
{
name: "core/image",
attributes: {
url: "https://s.w.org/images/core/5.3/Windbuchencom.jpg"
}
},
{
name: "core/paragraph",
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)(
"Suspendisse commodo neque lacus, a dictum orci interdum et."
)
}
}
]
},
{
name: "core/column",
innerBlocks: [
{
name: "core/paragraph",
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)(
"Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit."
)
}
},
{
name: "core/paragraph",
attributes: {
/* translators: example text. */
content: (0,external_wp_i18n_namespaceObject.__)(
"Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim."
)
}
}
]
}
]
},
deprecated: columns_deprecated_deprecated_default,
edit: columns_edit_edit_default,
save: columns_save_save,
transforms: columns_transforms_transforms_default
};
const columns_init = () => initBlock({ name: columns_name, metadata: columns_block_namespaceObject, settings: columns_settings });
;// ./node_modules/@wordpress/icons/build-module/library/post-comments.js
var post_comments_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comments/block.json
const comments_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comments","title":"Comments","category":"theme","description":"An advanced block that allows displaying post comments using different visual configurations.","textdomain":"default","attributes":{"tagName":{"type":"string","default":"div"},"legacy":{"type":"boolean","default":false}},"supports":{"align":["wide","full"],"html":false,"color":{"gradients":true,"heading":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"editorStyle":"wp-block-comments-editor","usesContext":["postId","postType"]}');
;// ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js
const deprecated_v1 = {
attributes: {
tagName: {
type: "string",
default: "div"
}
},
apiVersion: 3,
supports: {
align: ["wide", "full"],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
}
},
save({ attributes: { tagName: Tag } }) {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const { className } = blockProps;
const classes = className?.split(" ") || [];
const newClasses = classes?.filter(
(cls) => cls !== "wp-block-comments"
);
const newBlockProps = {
...blockProps,
className: newClasses.join(" ")
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...newBlockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) });
}
};
var comments_deprecated_deprecated_default = [deprecated_v1];
;// ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js
const { HTMLElementControl: comments_inspector_controls_HTMLElementControl } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function CommentsInspectorControls({
attributes: { tagName },
setAttributes
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
comments_inspector_controls_HTMLElementControl,
{
tagName,
onChange: (value) => setAttributes({ tagName: value }),
options: [
{ label: (0,external_wp_i18n_namespaceObject.__)("Default (<div>)"), value: "div" },
{ label: "<section>", value: "section" },
{ label: "<aside>", value: "aside" }
]
}
) }) });
}
;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js
const CommentsFormPlaceholder = () => {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsFormPlaceholder);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "comment-respond", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { className: "comment-reply-title", children: (0,external_wp_i18n_namespaceObject.__)("Leave a Reply") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"form",
{
noValidate: true,
className: "comment-form",
onSubmit: (event) => event.preventDefault(),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("label", { htmlFor: `comment-${instanceId}`, children: (0,external_wp_i18n_namespaceObject.__)("Comment") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"textarea",
{
id: `comment-${instanceId}`,
name: "comment",
cols: "45",
rows: "8",
readOnly: true
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "form-submit wp-block-button", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"input",
{
name: "submit",
type: "submit",
className: dist_clsx(
"wp-block-button__link",
(0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)("button")
),
label: (0,external_wp_i18n_namespaceObject.__)("Post Comment"),
value: (0,external_wp_i18n_namespaceObject.__)("Post Comment"),
"aria-disabled": "true"
}
) })
]
}
)
] });
};
const CommentsForm = ({ postId, postType }) => {
const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
"postType",
postType,
"comment_status",
postId
);
const isSiteEditor = postType === void 0 || postId === void 0;
const { defaultCommentStatus } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings
);
const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(
(select) => postType ? !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports.comments : false
);
if (!isSiteEditor && "open" !== commentStatus) {
if ("closed" === commentStatus) {
const actions = [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: () => setCommentStatus("open"),
variant: "primary",
children: (0,external_wp_i18n_namespaceObject._x)(
"Enable comments",
"action that affects the current post"
)
},
"enableComments"
)
];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { actions, children: (0,external_wp_i18n_namespaceObject.__)(
"Post Comments Form block: Comments are not enabled for this item."
) });
} else if (!postTypeSupportsComments) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Post type (i.e. "post", "page") */
(0,external_wp_i18n_namespaceObject.__)(
"Post Comments Form block: Comments are not enabled for this post type (%s)."
),
postType
) });
} else if ("open" !== defaultCommentStatus) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)(
"Post Comments Form block: Comments are not enabled."
) });
}
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsFormPlaceholder, {});
};
var form_default = CommentsForm;
;// ./node_modules/@wordpress/block-library/build-module/comments/edit/placeholder.js
function PostCommentsPlaceholder({ postType, postId }) {
let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)("postType", postType, "title", postId);
postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)("Post Title");
const { avatarURL } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-comments__legacy-placeholder", inert: "true", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
/* translators: %s: Post title. */
children: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("One response to %s"), postTitle)
}),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "navigation", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: [
"\xAB ",
(0,external_wp_i18n_namespaceObject.__)("Older Comments")
] }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: [
(0,external_wp_i18n_namespaceObject.__)("Newer Comments"),
" \xBB"
] }) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { className: "commentlist", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "comment even thread-even depth-1", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("article", { className: "comment-body", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("footer", { className: "comment-meta", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "comment-author vcard", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
alt: (0,external_wp_i18n_namespaceObject.__)("Commenter Avatar"),
src: avatarURL,
className: "avatar avatar-32 photo",
height: "32",
width: "32",
loading: "lazy"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("b", { className: "fn", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#top", className: "url", children: (0,external_wp_i18n_namespaceObject.__)("A WordPress Commenter") }) }),
" ",
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "says", children: [
(0,external_wp_i18n_namespaceObject.__)("says"),
":"
] })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "comment-metadata", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#top", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { dateTime: "2000-01-01T00:00:00+00:00", children: (0,external_wp_i18n_namespaceObject.__)("January 1, 2000 at 00:00 am") }) }),
" ",
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-link", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
className: "comment-edit-link",
href: "#top",
children: (0,external_wp_i18n_namespaceObject.__)("Edit")
}
) })
] })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "comment-content", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { children: [
(0,external_wp_i18n_namespaceObject.__)("Hi, this is a comment."),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}),
(0,external_wp_i18n_namespaceObject.__)(
"To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard."
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}),
(0,external_wp_element_namespaceObject.createInterpolateElement)(
(0,external_wp_i18n_namespaceObject.__)(
"Commenter avatars come from <a>Gravatar</a>."
),
{
a: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "https://gravatar.com/" })
)
}
)
] }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "reply", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
className: "comment-reply-link",
href: "#top",
"aria-label": (0,external_wp_i18n_namespaceObject.__)(
"Reply to A WordPress Commenter"
),
children: (0,external_wp_i18n_namespaceObject.__)("Reply")
}
) })
] }) }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "navigation", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: [
"\xAB ",
(0,external_wp_i18n_namespaceObject.__)("Older Comments")
] }) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: [
(0,external_wp_i18n_namespaceObject.__)("Newer Comments"),
" \xBB"
] }) })
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(form_default, { postId, postType })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-legacy.js
function CommentsLegacy({
attributes,
setAttributes,
context: { postType, postId }
}) {
const { textAlign } = attributes;
const actions = [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: () => void setAttributes({ legacy: false }),
variant: "primary",
children: (0,external_wp_i18n_namespaceObject.__)("Switch to editable mode")
},
"convert"
)
];
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.AlignmentControl,
{
value: textAlign,
onChange: (nextAlign) => {
setAttributes({ textAlign: nextAlign });
}
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { actions, children: (0,external_wp_i18n_namespaceObject.__)(
"Comments block: You\u2019re currently using the legacy version of the block. The following is just a placeholder - the final styling will likely look different. For a better representation and more customization options, switch the block to its editable mode."
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCommentsPlaceholder, { postId, postType })
] })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comments/edit/template.js
const TEMPLATE = [
["core/comments-title"],
[
"core/comment-template",
{},
[
[
"core/columns",
{},
[
[
"core/column",
{ width: "40px" },
[
[
"core/avatar",
{
size: 40,
style: {
border: { radius: "20px" }
}
}
]
]
],
[
"core/column",
{},
[
[
"core/comment-author-name",
{
fontSize: "small"
}
],
[
"core/group",
{
layout: { type: "flex" },
style: {
spacing: {
margin: {
top: "0px",
bottom: "0px"
}
}
}
},
[
[
"core/comment-date",
{
fontSize: "small"
}
],
[
"core/comment-edit-link",
{
fontSize: "small"
}
]
]
],
["core/comment-content"],
[
"core/comment-reply-link",
{
fontSize: "small"
}
]
]
]
]
]
]
],
["core/comments-pagination"],
["core/post-comments-form"]
];
var template_default = TEMPLATE;
;// ./node_modules/@wordpress/block-library/build-module/comments/edit/index.js
function CommentsEdit(props) {
const { attributes, setAttributes, clientId } = props;
const { tagName: TagName, legacy } = attributes;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: template_default
});
if (legacy) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsLegacy, { ...props });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommentsInspectorControls,
{
attributes,
setAttributes,
clientId
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comments/save.js
function comments_save_save({ attributes: { tagName: Tag, legacy } }) {
const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
return legacy ? null : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...innerBlocksProps });
}
;// ./node_modules/@wordpress/block-library/build-module/comments/index.js
const { name: comments_name } = comments_block_namespaceObject;
const comments_settings = {
icon: post_comments_default,
example: {},
edit: CommentsEdit,
save: comments_save_save,
deprecated: comments_deprecated_deprecated_default
};
const comments_init = () => initBlock({ name: comments_name, metadata: comments_block_namespaceObject, settings: comments_settings });
;// ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/block.json
const comment_author_avatar_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"__experimental":"fse","name":"core/comment-author-avatar","title":"Comment Author Avatar (deprecated)","category":"theme","ancestor":["core/comment-template"],"description":"This block is deprecated. Please use the Avatar block instead.","textdomain":"default","attributes":{"width":{"type":"number","default":96},"height":{"type":"number","default":96}},"usesContext":["commentId"],"supports":{"html":false,"inserter":false,"__experimentalBorder":{"radius":true,"width":true,"color":true,"style":true},"color":{"background":true,"text":false,"__experimentalDefaultControls":{"background":true}},"spacing":{"__experimentalSkipSerialization":true,"margin":true,"padding":true},"interactivity":{"clientNavigation":true}}}');
;// ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/edit.js
function comment_author_avatar_edit_Edit({
attributes,
context: { commentId },
setAttributes,
isSelected
}) {
const { height, width } = attributes;
const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
"root",
"comment",
"author_avatar_urls",
commentId
);
const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
"root",
"comment",
"author_name",
commentId
);
const avatarUrls = avatars ? Object.values(avatars) : null;
const sizes = avatars ? Object.keys(avatars) : null;
const minSize = sizes ? sizes[0] : 24;
const maxSize = sizes ? sizes[sizes.length - 1] : 96;
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
const maxSizeBuffer = Math.floor(maxSize * 2.5);
const { avatarURL } = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
const { __experimentalDiscussionSettings } = getSettings();
return __experimentalDiscussionSettings;
});
const inspectorControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)("Settings"), children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Image size"),
onChange: (newWidth) => setAttributes({
width: newWidth,
height: newWidth
}),
min: minSize,
max: maxSizeBuffer,
initialPosition: width,
value: width
}
) }) });
const resizableAvatar = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ResizableBox,
{
size: {
width,
height
},
showHandle: isSelected,
onResizeStop: (event, direction, elt, delta) => {
setAttributes({
height: parseInt(height + delta.height, 10),
width: parseInt(width + delta.width, 10)
});
},
lockAspectRatio: true,
enable: {
top: false,
right: !(0,external_wp_i18n_namespaceObject.isRTL)(),
bottom: true,
left: (0,external_wp_i18n_namespaceObject.isRTL)()
},
minWidth: minSize,
maxWidth: maxSizeBuffer,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL,
alt: `${authorName} ${(0,external_wp_i18n_namespaceObject.__)("Avatar")}`,
...blockProps
}
)
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
inspectorControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...spacingProps, children: resizableAvatar })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js
const { name: comment_author_avatar_name } = comment_author_avatar_block_namespaceObject;
const comment_author_avatar_settings = {
icon: comment_author_avatar_default,
edit: comment_author_avatar_edit_Edit
};
const comment_author_avatar_init = () => initBlock({ name: comment_author_avatar_name, metadata: comment_author_avatar_block_namespaceObject, settings: comment_author_avatar_settings });
;// ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js
var comment_author_name_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",
fillRule: "evenodd",
clipRule: "evenodd"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",
fillRule: "evenodd",
clipRule: "evenodd"
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, { cx: "12", cy: "9", r: "2", fillRule: "evenodd", clipRule: "evenodd" })
] });
;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/block.json
const comment_author_name_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comment-author-name","title":"Comment Author Name","category":"theme","ancestor":["core/comment-template"],"description":"Displays the name of the author of the comment.","textdomain":"default","attributes":{"isLink":{"type":"boolean","default":true},"linkTarget":{"type":"string","default":"_self"},"textAlign":{"type":"string"}},"usesContext":["commentId"],"supports":{"html":false,"spacing":{"margin":true,"padding":true},"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"style":"wp-block-comment-author-name"}');
;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js
function comment_author_name_edit_Edit({
attributes: { isLink, linkTarget, textAlign },
context: { commentId },
setAttributes
}) {
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
let displayName = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store);
const comment = getEntityRecord("root", "comment", commentId);
const authorName = comment?.author_name;
if (comment && !authorName) {
const user = getEntityRecord("root", "user", comment.author);
return user?.name ?? (0,external_wp_i18n_namespaceObject.__)("Anonymous");
}
return authorName ?? "";
},
[commentId]
);
const blockControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.AlignmentControl,
{
value: textAlign,
onChange: (newAlign) => setAttributes({ textAlign: newAlign })
}
) });
const inspectorControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
isLink: true,
linkTarget: "_self"
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Link to authors URL"),
isShownByDefault: true,
hasValue: () => !isLink,
onDeselect: () => setAttributes({
isLink: true
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Link to authors URL"),
onChange: () => setAttributes({ isLink: !isLink }),
checked: isLink
}
)
}
),
isLink && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Open in new tab"),
isShownByDefault: true,
hasValue: () => linkTarget !== "_self",
onDeselect: () => setAttributes({
linkTarget: "_self"
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Open in new tab"),
onChange: (value) => setAttributes({
linkTarget: value ? "_blank" : "_self"
}),
checked: linkTarget === "_blank"
}
)
}
)
]
}
) });
if (!commentId || !displayName) {
displayName = (0,external_wp_i18n_namespaceObject._x)("Comment Author", "block title");
}
const displayAuthor = isLink ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
href: "#comment-author-pseudo-link",
onClick: (event) => event.preventDefault(),
children: displayName
}
) : displayName;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
inspectorControls,
blockControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: displayAuthor })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js
const comment_author_name_deprecated_v1 = {
attributes: {
isLink: {
type: "boolean",
default: false
},
linkTarget: {
type: "string",
default: "_self"
}
},
supports: {
html: false,
color: {
gradients: true,
link: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true
}
},
save() {
return null;
},
migrate: migrate_font_family_default,
isEligible({ style }) {
return style?.typography?.fontFamily;
}
};
var comment_author_name_deprecated_deprecated_default = [comment_author_name_deprecated_v1];
;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js
const { name: comment_author_name_name } = comment_author_name_block_namespaceObject;
const comment_author_name_settings = {
icon: comment_author_name_default,
edit: comment_author_name_edit_Edit,
deprecated: comment_author_name_deprecated_deprecated_default,
example: {}
};
const comment_author_name_init = () => initBlock({ name: comment_author_name_name, metadata: comment_author_name_block_namespaceObject, settings: comment_author_name_settings });
;// ./node_modules/@wordpress/icons/build-module/library/comment-content.js
var comment_content_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_primitives_namespaceObject.Path,
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"
}
) });
;// ./node_modules/@wordpress/block-library/build-module/comment-content/block.json
const comment_content_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comment-content","title":"Comment Content","category":"theme","ancestor":["core/comment-template"],"description":"Displays the contents of a comment.","textdomain":"default","usesContext":["commentId"],"attributes":{"textAlign":{"type":"string"}},"supports":{"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}},"spacing":{"padding":["horizontal","vertical"],"__experimentalDefaultControls":{"padding":true}},"html":false},"style":"wp-block-comment-content"}');
;// ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js
function comment_content_edit_Edit({
setAttributes,
attributes: { textAlign },
context: { commentId }
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
"root",
"comment",
"content",
commentId
);
const blockControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.AlignmentControl,
{
value: textAlign,
onChange: (newAlign) => setAttributes({ textAlign: newAlign })
}
) });
if (!commentId || !content) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
blockControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject._x)("Comment Content", "block title") }) })
] });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
blockControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: content.rendered }, "html") }) })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comment-content/index.js
const { name: comment_content_name } = comment_content_block_namespaceObject;
const comment_content_settings = {
icon: comment_content_default,
edit: comment_content_edit_Edit,
example: {}
};
const comment_content_init = () => initBlock({ name: comment_content_name, metadata: comment_content_block_namespaceObject, settings: comment_content_settings });
;// ./node_modules/@wordpress/icons/build-module/library/post-date.js
var post_date_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z" })
] });
;// ./node_modules/@wordpress/block-library/build-module/comment-date/block.json
const comment_date_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comment-date","title":"Comment Date","category":"theme","ancestor":["core/comment-template"],"description":"Displays the date on which the comment was posted.","textdomain":"default","attributes":{"format":{"type":"string"},"isLink":{"type":"boolean","default":true}},"usesContext":["commentId"],"supports":{"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"style":"wp-block-comment-date"}');
;// external ["wp","date"]
const external_wp_date_namespaceObject = window["wp"]["date"];
;// ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js
function comment_date_edit_Edit({
attributes: { format, isLink },
context: { commentId },
setAttributes
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)("root", "comment", "date", commentId);
const [siteFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)(
"root",
"site",
"date_format"
);
const inspectorControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
format: void 0,
isLink: true
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Date format"),
hasValue: () => format !== void 0,
onDeselect: () => setAttributes({ format: void 0 }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker,
{
format,
defaultFormat: siteFormat,
onChange: (nextFormat) => setAttributes({ format: nextFormat })
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Link to comment"),
hasValue: () => !isLink,
onDeselect: () => setAttributes({ isLink: true }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Link to comment"),
onChange: () => setAttributes({ isLink: !isLink }),
checked: isLink
}
)
}
)
]
}
) });
if (!commentId || !date) {
date = (0,external_wp_i18n_namespaceObject._x)("Comment Date", "block title");
}
let commentDate = date instanceof Date ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { dateTime: (0,external_wp_date_namespaceObject.dateI18n)("c", date), children: format === "human-diff" ? (0,external_wp_date_namespaceObject.humanTimeDiff)(date) : (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date) }) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { children: date });
if (isLink) {
commentDate = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
href: "#comment-date-pseudo-link",
onClick: (event) => event.preventDefault(),
children: commentDate
}
);
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
inspectorControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: commentDate })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js
const comment_date_deprecated_v1 = {
attributes: {
format: {
type: "string"
},
isLink: {
type: "boolean",
default: false
}
},
supports: {
html: false,
color: {
gradients: true,
link: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true
}
},
save() {
return null;
},
migrate: migrate_font_family_default,
isEligible({ style }) {
return style?.typography?.fontFamily;
}
};
var comment_date_deprecated_deprecated_default = [comment_date_deprecated_v1];
;// ./node_modules/@wordpress/block-library/build-module/comment-date/index.js
const { name: comment_date_name } = comment_date_block_namespaceObject;
const comment_date_settings = {
icon: post_date_default,
edit: comment_date_edit_Edit,
deprecated: comment_date_deprecated_deprecated_default,
example: {}
};
const comment_date_init = () => initBlock({ name: comment_date_name, metadata: comment_date_block_namespaceObject, settings: comment_date_settings });
;// ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js
var comment_edit_link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comment-edit-link/block.json
const comment_edit_link_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comment-edit-link","title":"Comment Edit Link","category":"theme","ancestor":["core/comment-template"],"description":"Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.","textdomain":"default","usesContext":["commentId"],"attributes":{"linkTarget":{"type":"string","default":"_self"},"textAlign":{"type":"string"}},"supports":{"html":false,"color":{"link":true,"gradients":true,"text":false,"__experimentalDefaultControls":{"background":true,"link":true}},"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true}},"style":"wp-block-comment-edit-link"}');
;// ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js
function comment_edit_link_edit_Edit({
attributes: { linkTarget, textAlign },
setAttributes
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const blockControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.AlignmentControl,
{
value: textAlign,
onChange: (newAlign) => setAttributes({ textAlign: newAlign })
}
) });
const inspectorControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
linkTarget: "_self"
});
},
dropdownMenuProps,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Open in new tab"),
isShownByDefault: true,
hasValue: () => linkTarget === "_blank",
onDeselect: () => setAttributes({ linkTarget: "_self" }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Open in new tab"),
onChange: (value) => setAttributes({
linkTarget: value ? "_blank" : "_self"
}),
checked: linkTarget === "_blank"
}
)
}
)
}
) });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
blockControls,
inspectorControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
href: "#edit-comment-pseudo-link",
onClick: (event) => event.preventDefault(),
children: (0,external_wp_i18n_namespaceObject.__)("Edit")
}
) })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js
const { name: comment_edit_link_name } = comment_edit_link_block_namespaceObject;
const comment_edit_link_settings = {
icon: comment_edit_link_default,
edit: comment_edit_link_edit_Edit,
example: {}
};
const comment_edit_link_init = () => initBlock({ name: comment_edit_link_name, metadata: comment_edit_link_block_namespaceObject, settings: comment_edit_link_settings });
;// ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js
var comment_reply_link_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comment-reply-link/block.json
const comment_reply_link_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comment-reply-link","title":"Comment Reply Link","category":"theme","ancestor":["core/comment-template"],"description":"Displays a link to reply to a comment.","textdomain":"default","usesContext":["commentId"],"attributes":{"textAlign":{"type":"string"}},"supports":{"color":{"gradients":true,"link":true,"text":false,"__experimentalDefaultControls":{"background":true,"link":true}},"spacing":{"margin":true,"padding":true,"__experimentalDefaultControls":{"margin":false,"padding":false}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true},"html":false},"style":"wp-block-comment-reply-link"}');
;// ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js
function comment_reply_link_edit_Edit({ setAttributes, attributes: { textAlign } }) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const blockControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.AlignmentControl,
{
value: textAlign,
onChange: (newAlign) => setAttributes({ textAlign: newAlign })
}
) });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
blockControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"a",
{
href: "#comment-reply-pseudo-link",
onClick: (event) => event.preventDefault(),
children: (0,external_wp_i18n_namespaceObject.__)("Reply")
}
) })
] });
}
var comment_reply_link_edit_edit_default = comment_reply_link_edit_Edit;
;// ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js
const { name: comment_reply_link_name } = comment_reply_link_block_namespaceObject;
const comment_reply_link_settings = {
edit: comment_reply_link_edit_edit_default,
icon: comment_reply_link_default,
example: {}
};
const comment_reply_link_init = () => initBlock({ name: comment_reply_link_name, metadata: comment_reply_link_block_namespaceObject, settings: comment_reply_link_settings });
;// ./node_modules/@wordpress/icons/build-module/library/layout.js
var layout_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comment-template/block.json
const comment_template_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comment-template","title":"Comment Template","category":"design","parent":["core/comments"],"description":"Contains the block elements used to display a comment, like the title, date, author, avatar and more.","textdomain":"default","usesContext":["postId"],"supports":{"align":true,"html":false,"reusable":false,"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"style":"wp-block-comment-template"}');
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js
const MAX_COMMENTS_PER_PAGE = 100;
const useCommentQueryArgs = ({ postId }) => {
const queryArgs = {
status: "approve",
order: "asc",
context: "embed",
parent: 0,
_embed: "children"
};
const {
pageComments,
commentsPerPage,
defaultCommentsPage: defaultPage
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
const { __experimentalDiscussionSettings } = getSettings();
return __experimentalDiscussionSettings;
});
const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE;
const page = useDefaultPageIndex({
defaultPage,
postId,
perPage,
queryArgs
});
return (0,external_wp_element_namespaceObject.useMemo)(() => {
return page ? {
...queryArgs,
post: postId,
per_page: perPage,
page
} : null;
}, [postId, perPage, page]);
};
const useDefaultPageIndex = ({ defaultPage, postId, perPage, queryArgs }) => {
const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({});
const key = `${postId}_${perPage}`;
const page = defaultPages[key] || 0;
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (page || defaultPage !== "newest") {
return;
}
external_wp_apiFetch_default()({
path: (0,external_wp_url_namespaceObject.addQueryArgs)("/wp/v2/comments", {
...queryArgs,
post: postId,
per_page: perPage,
_fields: "id"
}),
method: "HEAD",
parse: false
}).then((res) => {
const pages = parseInt(res.headers.get("X-WP-TotalPages"));
setDefaultPages({
...defaultPages,
[key]: pages <= 1 ? 1 : pages
// If there are 0 pages, it means that there are no comments, but there is no 0th page.
});
}).catch(() => {
setDefaultPages({
...defaultPages,
[key]: 1
});
});
}, [defaultPage, postId, perPage, setDefaultPages]);
return defaultPage === "newest" ? page : 1;
};
const useCommentTree = (topLevelComments) => {
const commentTree = (0,external_wp_element_namespaceObject.useMemo)(
() => topLevelComments?.map(({ id, _embedded }) => {
const [children] = _embedded?.children || [[]];
return {
commentId: id,
children: children.map((child) => ({
commentId: child.id
}))
};
}),
[topLevelComments]
);
return commentTree;
};
;// ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js
const edit_TEMPLATE = [
["core/avatar"],
["core/comment-author-name"],
["core/comment-date"],
["core/comment-content"],
["core/comment-reply-link"],
["core/comment-edit-link"]
];
const getCommentsPlaceholder = ({
perPage,
pageComments,
threadComments,
threadCommentsDepth
}) => {
const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3);
const buildChildrenComment = (commentsLevel) => {
if (commentsLevel < commentsDepth) {
const nextLevel = commentsLevel + 1;
return [
{
commentId: -(commentsLevel + 3),
children: buildChildrenComment(nextLevel)
}
];
}
return [];
};
const placeholderComments = [
{ commentId: -1, children: buildChildrenComment(1) }
];
if ((!pageComments || perPage >= 2) && commentsDepth < 3) {
placeholderComments.push({
commentId: -2,
children: []
});
}
if ((!pageComments || perPage >= 3) && commentsDepth < 2) {
placeholderComments.push({
commentId: -3,
children: []
});
}
return placeholderComments;
};
function CommentTemplateInnerBlocks({
comment,
activeCommentId,
setActiveCommentId,
firstCommentId,
blocks
}) {
const { children, ...innerBlocksProps } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(
{},
{ template: edit_TEMPLATE }
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { ...innerBlocksProps, children: [
comment.commentId === (activeCommentId || firstCommentId) ? children : null,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
MemoizedCommentTemplatePreview,
{
blocks,
commentId: comment.commentId,
setActiveCommentId,
isHidden: comment.commentId === (activeCommentId || firstCommentId)
}
),
comment?.children?.length > 0 ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommentsList,
{
comments: comment.children,
activeCommentId,
setActiveCommentId,
blocks,
firstCommentId
}
) : null
] });
}
const CommentTemplatePreview = ({
blocks,
commentId,
setActiveCommentId,
isHidden
}) => {
const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
blocks
});
const handleOnClick = () => {
setActiveCommentId(commentId);
};
const style = {
display: isHidden ? "none" : void 0
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...blockPreviewProps,
tabIndex: 0,
role: "button",
style,
onClick: handleOnClick,
onKeyPress: handleOnClick
}
);
};
const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview);
const CommentsList = ({
comments,
blockProps,
activeCommentId,
setActiveCommentId,
blocks,
firstCommentId
}) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { ...blockProps, children: comments && comments.map(({ commentId, ...comment }, index) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.BlockContextProvider,
{
value: {
// If the commentId is negative it means that this comment is a
// "placeholder" and that the block is most likely being used in the
// site editor. In this case, we have to set the commentId to `null`
// because otherwise the (non-existent) comment with a negative ID
// would be requested from the REST API.
commentId: commentId < 0 ? null : commentId
},
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommentTemplateInnerBlocks,
{
comment: { commentId, ...comment },
activeCommentId,
setActiveCommentId,
blocks,
firstCommentId
}
)
},
comment.commentId || index
)) });
function CommentTemplateEdit({
clientId,
context: { postId }
}) {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)();
const {
commentOrder,
threadCommentsDepth,
threadComments,
commentsPerPage,
pageComments
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
return getSettings().__experimentalDiscussionSettings;
});
const commentQuery = useCommentQueryArgs({
postId
});
const { topLevelComments, blocks } = (0,external_wp_data_namespaceObject.useSelect)(
(select) => {
const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store);
const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store);
return {
// Request only top-level comments. Replies are embedded.
topLevelComments: commentQuery ? getEntityRecords("root", "comment", commentQuery) : null,
blocks: getBlocks(clientId)
};
},
[clientId, commentQuery]
);
let commentTree = useCommentTree(
// Reverse the order of top comments if needed.
commentOrder === "desc" && topLevelComments ? [...topLevelComments].reverse() : topLevelComments
);
if (!topLevelComments) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...blockProps, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) });
}
if (!postId) {
commentTree = getCommentsPlaceholder({
perPage: commentsPerPage,
pageComments,
threadComments,
threadCommentsDepth
});
}
if (!commentTree.length) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...blockProps, children: (0,external_wp_i18n_namespaceObject.__)("No results found.") });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommentsList,
{
comments: commentTree,
blockProps,
blocks,
activeCommentId,
setActiveCommentId,
firstCommentId: commentTree[0]?.commentId
}
);
}
;// ./node_modules/@wordpress/block-library/build-module/comment-template/save.js
function CommentTemplateSave() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {});
}
;// ./node_modules/@wordpress/block-library/build-module/comment-template/index.js
const { name: comment_template_name } = comment_template_block_namespaceObject;
const comment_template_settings = {
icon: layout_default,
edit: CommentTemplateEdit,
save: CommentTemplateSave
};
const comment_template_init = () => initBlock({ name: comment_template_name, metadata: comment_template_block_namespaceObject, settings: comment_template_settings });
;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
var query_pagination_previous_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/block.json
const comments_pagination_previous_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comments-pagination-previous","title":"Comments Previous Page","category":"theme","parent":["core/comments-pagination"],"description":"Displays the previous comment\'s page link.","textdomain":"default","attributes":{"label":{"type":"string"}},"usesContext":["postId","comments/paginationArrow"],"supports":{"reusable":false,"html":false,"color":{"gradients":true,"text":false,"__experimentalDefaultControls":{"background":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true}}}');
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js
const arrowMap = {
none: "",
arrow: "\u2190",
chevron: "\xAB"
};
function CommentsPaginationPreviousEdit({
attributes: { label },
setAttributes,
context: { "comments/paginationArrow": paginationArrow }
}) {
const displayArrow = arrowMap[paginationArrow];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"a",
{
href: "#comments-pagination-previous-pseudo-link",
onClick: (event) => event.preventDefault(),
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
children: [
displayArrow && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`,
children: displayArrow
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.PlainText,
{
__experimentalVersion: 2,
tagName: "span",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Older comments page link"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Older Comments"),
value: label,
onChange: (newLabel) => setAttributes({ label: newLabel })
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js
const { name: comments_pagination_previous_name } = comments_pagination_previous_block_namespaceObject;
const comments_pagination_previous_settings = {
icon: query_pagination_previous_default,
edit: CommentsPaginationPreviousEdit,
example: {
attributes: {
label: (0,external_wp_i18n_namespaceObject.__)("Older Comments")
}
}
};
const comments_pagination_previous_init = () => initBlock({ name: comments_pagination_previous_name, metadata: comments_pagination_previous_block_namespaceObject, settings: comments_pagination_previous_settings });
;// ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
var query_pagination_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/block.json
const comments_pagination_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comments-pagination","title":"Comments Pagination","category":"theme","parent":["core/comments"],"allowedBlocks":["core/comments-pagination-previous","core/comments-pagination-numbers","core/comments-pagination-next"],"description":"Displays a paginated navigation to next/previous set of comments, when applicable.","textdomain":"default","attributes":{"paginationArrow":{"type":"string","default":"none"}},"example":{"attributes":{"paginationArrow":"none"}},"providesContext":{"comments/paginationArrow":"paginationArrow"},"supports":{"align":true,"reusable":false,"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"layout":{"allowSwitching":false,"allowInheriting":false,"default":{"type":"flex"}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true}},"editorStyle":"wp-block-comments-pagination-editor","style":"wp-block-comments-pagination"}');
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js
function CommentsPaginationArrowControls({ value, onChange }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToggleGroupControl,
{
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Arrow"),
value,
onChange,
help: (0,external_wp_i18n_namespaceObject.__)(
"A decorative arrow appended to the next and previous comments link."
),
isBlock: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "none",
label: (0,external_wp_i18n_namespaceObject._x)(
"None",
"Arrow option for Comments Pagination Next/Previous blocks"
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "arrow",
label: (0,external_wp_i18n_namespaceObject._x)(
"Arrow",
"Arrow option for Comments Pagination Next/Previous blocks"
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToggleGroupControlOption,
{
value: "chevron",
label: (0,external_wp_i18n_namespaceObject._x)(
"Chevron",
"Arrow option for Comments Pagination Next/Previous blocks"
)
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js
const comments_pagination_edit_TEMPLATE = [
["core/comments-pagination-previous"],
["core/comments-pagination-numbers"],
["core/comments-pagination-next"]
];
function QueryPaginationEdit({
attributes: { paginationArrow },
setAttributes,
clientId
}) {
const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store);
const innerBlocks = getBlocks(clientId);
return innerBlocks?.find((innerBlock) => {
return [
"core/comments-pagination-previous",
"core/comments-pagination-next"
].includes(innerBlock.name);
});
}, []);
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: comments_pagination_edit_TEMPLATE
});
const pageComments = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
const { __experimentalDiscussionSettings } = getSettings();
return __experimentalDiscussionSettings?.pageComments;
}, []);
if (!pageComments) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)(
"Comments Pagination block: paging comments is disabled in the Discussion Settings"
) });
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
hasNextPreviousBlocks && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
dropdownMenuProps,
resetAll: () => setAttributes({ paginationArrow: "none" }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Arrow"),
hasValue: () => paginationArrow !== "none",
onDeselect: () => setAttributes({ paginationArrow: "none" }),
isShownByDefault: true,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CommentsPaginationArrowControls,
{
value: paginationArrow,
onChange: (value) => {
setAttributes({ paginationArrow: value });
}
}
)
}
)
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js
function comments_pagination_save_save() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {});
}
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js
const { name: comments_pagination_name } = comments_pagination_block_namespaceObject;
const comments_pagination_settings = {
icon: query_pagination_default,
edit: QueryPaginationEdit,
save: comments_pagination_save_save
};
const comments_pagination_init = () => initBlock({ name: comments_pagination_name, metadata: comments_pagination_block_namespaceObject, settings: comments_pagination_settings });
;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
var query_pagination_next_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/block.json
const comments_pagination_next_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comments-pagination-next","title":"Comments Next Page","category":"theme","parent":["core/comments-pagination"],"description":"Displays the next comment\'s page link.","textdomain":"default","attributes":{"label":{"type":"string"}},"usesContext":["postId","comments/paginationArrow"],"supports":{"reusable":false,"html":false,"color":{"gradients":true,"text":false,"__experimentalDefaultControls":{"background":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true}}}');
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js
const edit_arrowMap = {
none: "",
arrow: "\u2192",
chevron: "\xBB"
};
function CommentsPaginationNextEdit({
attributes: { label },
setAttributes,
context: { "comments/paginationArrow": paginationArrow }
}) {
const displayArrow = edit_arrowMap[paginationArrow];
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"a",
{
href: "#comments-pagination-next-pseudo-link",
onClick: (event) => event.preventDefault(),
...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.PlainText,
{
__experimentalVersion: 2,
tagName: "span",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Newer comments page link"),
placeholder: (0,external_wp_i18n_namespaceObject.__)("Newer Comments"),
value: label,
onChange: (newLabel) => setAttributes({ label: newLabel })
}
),
displayArrow && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`,
children: displayArrow
}
)
]
}
);
}
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js
const { name: comments_pagination_next_name } = comments_pagination_next_block_namespaceObject;
const comments_pagination_next_settings = {
icon: query_pagination_next_default,
edit: CommentsPaginationNextEdit,
example: {
attributes: {
label: (0,external_wp_i18n_namespaceObject.__)("Newer Comments")
}
}
};
const comments_pagination_next_init = () => initBlock({ name: comments_pagination_next_name, metadata: comments_pagination_next_block_namespaceObject, settings: comments_pagination_next_settings });
;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
var query_pagination_numbers_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/block.json
const comments_pagination_numbers_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comments-pagination-numbers","title":"Comments Page Numbers","category":"theme","parent":["core/comments-pagination"],"description":"Displays a list of page numbers for comments pagination.","textdomain":"default","usesContext":["postId"],"supports":{"reusable":false,"html":false,"color":{"gradients":true,"text":false,"__experimentalDefaultControls":{"background":true}},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true}}}');
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js
const PaginationItem = ({ content, tag: Tag = "a", extraClass = "" }) => Tag === "a" ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
Tag,
{
className: `page-numbers ${extraClass}`,
href: "#comments-pagination-numbers-pseudo-link",
onClick: (event) => event.preventDefault(),
children: content
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { className: `page-numbers ${extraClass}`, children: content });
function CommentsPaginationNumbersEdit() {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "1" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "2" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "3", tag: "span", extraClass: "current" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "4" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "5" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "...", tag: "span", extraClass: "dots" }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "8" })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js
const { name: comments_pagination_numbers_name } = comments_pagination_numbers_block_namespaceObject;
const comments_pagination_numbers_settings = {
icon: query_pagination_numbers_default,
edit: CommentsPaginationNumbersEdit,
example: {}
};
const comments_pagination_numbers_init = () => initBlock({ name: comments_pagination_numbers_name, metadata: comments_pagination_numbers_block_namespaceObject, settings: comments_pagination_numbers_settings });
;// ./node_modules/@wordpress/icons/build-module/library/title.js
var title_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z" }) });
;// ./node_modules/@wordpress/block-library/build-module/comments-title/block.json
const comments_title_block_namespaceObject = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"core/comments-title","title":"Comments Title","category":"theme","ancestor":["core/comments"],"description":"Displays a title with the number of comments.","textdomain":"default","usesContext":["postId","postType"],"attributes":{"textAlign":{"type":"string"},"showPostTitle":{"type":"boolean","default":true},"showCommentsCount":{"type":"boolean","default":true},"level":{"type":"number","default":2},"levelOptions":{"type":"array"}},"supports":{"anchor":false,"align":true,"html":false,"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true},"color":{"gradients":true,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true,"__experimentalFontFamily":true,"__experimentalFontStyle":true,"__experimentalFontWeight":true}},"interactivity":{"clientNavigation":true}}}');
;// ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js
function comments_title_edit_Edit({
attributes: {
textAlign,
showPostTitle,
showCommentsCount,
level,
levelOptions
},
setAttributes,
context: { postType, postId }
}) {
const TagName = "h" + level;
const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)("postType", postType, "title", postId);
const isSiteEditor = typeof postId === "undefined";
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: dist_clsx({
[`has-text-align-${textAlign}`]: textAlign
})
});
const {
threadCommentsDepth,
threadComments,
commentsPerPage,
pageComments
} = (0,external_wp_data_namespaceObject.useSelect)((select) => {
const { getSettings } = select(external_wp_blockEditor_namespaceObject.store);
return getSettings().__experimentalDiscussionSettings;
});
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (isSiteEditor) {
const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0;
const topLevelCommentsNumber = pageComments ? commentsPerPage : 3;
const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber);
setCommentsCount(Math.min(commentsNumber, 3));
return;
}
const currentPostId = postId;
external_wp_apiFetch_default()({
path: (0,external_wp_url_namespaceObject.addQueryArgs)("/wp/v2/comments", {
post: postId,
_fields: "id"
}),
method: "HEAD",
parse: false
}).then((res) => {
if (currentPostId === postId) {
setCommentsCount(
parseInt(res.headers.get("X-WP-Total"))
);
}
}).catch(() => {
setCommentsCount(0);
});
}, [postId]);
const blockControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.AlignmentControl,
{
value: textAlign,
onChange: (newAlign) => setAttributes({ textAlign: newAlign })
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.HeadingLevelDropdown,
{
value: level,
options: levelOptions,
onChange: (newLevel) => setAttributes({ level: newLevel })
}
)
] });
const inspectorControls = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
showPostTitle: true,
showCommentsCount: true
});
},
dropdownMenuProps,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Show post title"),
isShownByDefault: true,
hasValue: () => !showPostTitle,
onDeselect: () => setAttributes({ showPostTitle: true }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show post title"),
checked: showPostTitle,
onChange: (value) => setAttributes({ showPostTitle: value })
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Show comments count"),
isShownByDefault: true,
hasValue: () => !showCommentsCount,
onDeselect: () => setAttributes({ showCommentsCount: true }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Show comments count"),
checked: showCommentsCount,
onChange: (value) => setAttributes({ showCommentsCount: value })
}
)
}
)
]
}
) });
const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)("\u201CPost Title\u201D") : `"${rawTitle}"`;
let placeholder;
if (showCommentsCount && commentsCount !== void 0) {
if (showPostTitle) {
if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("One response to %s"), postTitle);
} else {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Number of comments, 2: Post title. */
(0,external_wp_i18n_namespaceObject._n)(
"%1$s response to %2$s",
"%1$s responses to %2$s",
commentsCount
),
commentsCount,
postTitle
);
}
} else if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.__)("One response");
} else {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Number of comments. */
(0,external_wp_i18n_namespaceObject._n)("%s response", "%s responses", commentsCount),
commentsCount
);
}
} else if (showPostTitle) {
if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Response to %s"), postTitle);
} else {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Responses to %s"), postTitle);
}
} else if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.__)("Response");
} else {
placeholder = (0,external_wp_i18n_namespaceObject.__)("Responses");
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
blockControls,
inspectorControls,
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: placeholder })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js
const { attributes, supports } = comments_title_block_namespaceObject;
var comments_title_deprecated_deprecated_default = [
{
attributes: {
...attributes,
singleCommentLabel: {
type: "string"
},
multipleCommentsLabel: {
type: "string"
}
},
supports,
migrate: (oldAttributes) => {
const {
singleCommentLabel,
multipleCommentsLabel,
...newAttributes
} = oldAttributes;
return newAttributes;
},
isEligible: ({ multipleCommentsLabel, singleCommentLabel }) => multipleCommentsLabel || singleCommentLabel,
save: () => null
}
];
;// ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
const { name: comments_title_name } = comments_title_block_namespaceObject;
const comments_title_settings = {
icon: title_default,
edit: comments_title_edit_Edit,
deprecated: comments_title_deprecated_deprecated_default,
example: {}
};
const comments_title_init = () => initBlock({ name: comments_title_name, metadata: comments_title_block_namespaceObject, settings: comments_title_settings });
;// ./node_modules/@wordpress/icons/build-module/library/cover.js
var cover_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z" }) });
;// ./node_modules/@wordpress/block-library/build-module/cover/shared.js
const POSITION_CLASSNAMES = {
"top left": "is-position-top-left",
"top center": "is-position-top-center",
"top right": "is-position-top-right",
"center left": "is-position-center-left",
"center center": "is-position-center-center",
center: "is-position-center-center",
"center right": "is-position-center-right",
"bottom left": "is-position-bottom-left",
"bottom center": "is-position-bottom-center",
"bottom right": "is-position-bottom-right"
};
const IMAGE_BACKGROUND_TYPE = "image";
const VIDEO_BACKGROUND_TYPE = "video";
const COVER_MIN_HEIGHT = 50;
const COVER_MAX_HEIGHT = 1e3;
const COVER_DEFAULT_HEIGHT = 300;
const DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 };
const shared_ALLOWED_MEDIA_TYPES = ["image", "video"];
function mediaPosition({ x, y } = DEFAULT_FOCAL_POINT) {
return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`;
}
function dimRatioToClass(ratio) {
return ratio === 50 || ratio === void 0 ? null : "has-background-dim-" + 10 * Math.round(ratio / 10);
}
function attributesFromMedia(media) {
if (!media || !media.url && !media.src) {
return {
url: void 0,
id: void 0
};
}
if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url);
}
let mediaType;
if (media.media_type) {
if (media.media_type === IMAGE_BACKGROUND_TYPE) {
mediaType = IMAGE_BACKGROUND_TYPE;
} else {
mediaType = VIDEO_BACKGROUND_TYPE;
}
} else if (media.type && (media.type === IMAGE_BACKGROUND_TYPE || media.type === VIDEO_BACKGROUND_TYPE)) {
mediaType = media.type;
} else {
return;
}
return {
url: media.url || media.src,
id: media.id,
alt: media?.alt,
backgroundType: mediaType,
...mediaType === VIDEO_BACKGROUND_TYPE ? { hasParallax: void 0 } : {}
};
}
function isContentPositionCenter(contentPosition) {
return !contentPosition || contentPosition === "center center" || contentPosition === "center";
}
function getPositionClassName(contentPosition) {
if (isContentPositionCenter(contentPosition)) {
return "";
}
return POSITION_CLASSNAMES[contentPosition];
}
;// ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js
function backgroundImageStyles(url) {
return url ? { backgroundImage: `url(${url})` } : {};
}
function dimRatioToClassV1(ratio) {
return ratio === 0 || ratio === 50 || !ratio ? null : "has-background-dim-" + 10 * Math.round(ratio / 10);
}
function migrateDimRatio(attributes) {
return {
...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio
};
}
function migrateTag(attributes) {
if (!attributes.tagName) {
attributes = {
...attributes,
tagName: "div"
};
}
return {
...attributes
};
}
const deprecated_blockAttributes = {
url: {
type: "string"
},
id: {
type: "number"
},
hasParallax: {
type: "boolean",
default: false
},
dimRatio: {
type: "number",
default: 50
},
overlayColor: {
type: "string"
},
customOverlayColor: {
type: "string"
},
backgroundType: {
type: "string",
default: "image"
},
focalPoint: {
type: "object"
}
};
const v8ToV11BlockAttributes = {
url: {
type: "string"
},
id: {
type: "number"
},
alt: {
type: "string",
source: "attribute",
selector: "img",
attribute: "alt",
default: ""
},
hasParallax: {
type: "boolean",
default: false
},
isRepeated: {
type: "boolean",
default: false
},
dimRatio: {
type: "number",
default: 100
},
overlayColor: {
type: "string"
},
customOverlayColor: {
type: "string"
},
backgroundType: {
type: "string",
default: "image"
},
focalPoint: {
type: "object"
},
minHeight: {
type: "number"
},
minHeightUnit: {
type: "string"
},
gradient: {
type: "string"
},
customGradient: {
type: "string"
},
contentPosition: {
type: "string"
},
isDark: {
type: "boolean",
default: true
},
allowedBlocks: {
type: "array"
},
templateLock: {
type: ["string", "boolean"],
enum: ["all", "insert", false]
}
};
const v12toV13BlockAttributes = {
...v8ToV11BlockAttributes,
useFeaturedImage: {
type: "boolean",
default: false
},
tagName: {
type: "string",
default: "div"
}
};
const v14BlockAttributes = {
...v12toV13BlockAttributes,
isUserOverlayColor: {
type: "boolean"
},
sizeSlug: {
type: "string"
},
alt: {
type: "string",
default: ""
}
};
const v7toV11BlockSupports = {
anchor: true,
align: true,
html: false,
spacing: {
padding: true,
__experimentalDefaultControls: {
padding: true
}
},
color: {
__experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
text: false,
background: false
}
};
const v12BlockSupports = {
...v7toV11BlockSupports,
spacing: {
padding: true,
margin: ["top", "bottom"],
blockGap: true,
__experimentalDefaultControls: {
padding: true,
blockGap: true
}
},
__experimentalBorder: {
color: true,
radius: true,
style: true,
width: true,
__experimentalDefaultControls: {
color: true,
radius: true,
style: true,
width: true
}
},
color: {
__experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
heading: true,
text: true,
background: false,
__experimentalSkipSerialization: ["gradients"],
enableContrastChecker: false
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true
}
},
layout: {
allowJustification: false
}
};
const v14BlockSupports = {
...v12BlockSupports,
shadow: true,
dimensions: {
aspectRatio: true
},
interactivity: {
clientNavigation: true
}
};
const v14 = {
attributes: v14BlockAttributes,
supports: v14BlockSupports,
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit,
tagName: Tag,
sizeSlug
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
minHeight: minHeight || void 0
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient ? customGradient : void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0
);
const backgroundImage = url ? `url(${url})` : void 0;
const backgroundPosition = mediaPosition(focalPoint);
const classes = dist_clsx(
{
"is-light": !isDark,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
const imgClasses = dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null,
{
[`size-${sizeSlug}`]: sizeSlug,
"has-parallax": hasParallax,
"is-repeated": isRepeated
}
);
const gradientValue = gradient || customGradient;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__background",
overlayColorClass,
dimRatioToClass(dimRatio),
{
"has-background-dim": dimRatio !== void 0,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
"wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0,
"has-background-gradient": gradientValue,
[gradientClass]: gradientClass
}
),
style: bgStyle
}
),
!useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: imgClasses,
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
role: alt ? "img" : void 0,
"aria-label": alt ? alt : void 0,
className: imgClasses,
style: { backgroundPosition, backgroundImage }
}
)),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: "wp-block-cover__inner-container"
})
}
)
] });
}
};
const v13 = {
attributes: v12toV13BlockAttributes,
supports: v12BlockSupports,
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit,
tagName: Tag
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
minHeight: minHeight || void 0
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient ? customGradient : void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0
);
const backgroundImage = url ? `url(${url})` : void 0;
const backgroundPosition = mediaPosition(focalPoint);
const classes = dist_clsx(
{
"is-light": !isDark,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
const imgClasses = dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null,
{
"has-parallax": hasParallax,
"is-repeated": isRepeated
}
);
const gradientValue = gradient || customGradient;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__background",
overlayColorClass,
dimRatioToClass(dimRatio),
{
"has-background-dim": dimRatio !== void 0,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
"wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0,
"has-background-gradient": gradientValue,
[gradientClass]: gradientClass
}
),
style: bgStyle
}
),
!useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: imgClasses,
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
role: "img",
className: imgClasses,
style: { backgroundPosition, backgroundImage }
}
)),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: "wp-block-cover__inner-container"
})
}
)
] });
}
};
const deprecated_v12 = {
attributes: v12toV13BlockAttributes,
supports: v12BlockSupports,
isEligible(attributes) {
return (attributes.customOverlayColor !== void 0 || attributes.overlayColor !== void 0) && attributes.isUserOverlayColor === void 0;
},
migrate(attributes) {
return {
...attributes,
isUserOverlayColor: true
};
},
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit,
tagName: Tag
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
minHeight: minHeight || void 0
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient ? customGradient : void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0
);
const backgroundImage = url ? `url(${url})` : void 0;
const backgroundPosition = mediaPosition(focalPoint);
const classes = dist_clsx(
{
"is-light": !isDark,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
const imgClasses = dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null,
{
"has-parallax": hasParallax,
"is-repeated": isRepeated
}
);
const gradientValue = gradient || customGradient;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__background",
overlayColorClass,
dimRatioToClass(dimRatio),
{
"has-background-dim": dimRatio !== void 0,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
"wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0,
"has-background-gradient": gradientValue,
[gradientClass]: gradientClass
}
),
style: bgStyle
}
),
!useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: imgClasses,
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
role: "img",
className: imgClasses,
style: { backgroundPosition, backgroundImage }
}
)),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: "wp-block-cover__inner-container"
})
}
)
] });
}
};
const deprecated_v11 = {
attributes: v8ToV11BlockAttributes,
supports: v7toV11BlockSupports,
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
minHeight: minHeight || void 0
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient ? customGradient : void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0
);
const backgroundImage = url ? `url(${url})` : void 0;
const backgroundPosition = mediaPosition(focalPoint);
const classes = dist_clsx(
{
"is-light": !isDark,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
const imgClasses = dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null,
{
"has-parallax": hasParallax,
"is-repeated": isRepeated
}
);
const gradientValue = gradient || customGradient;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__background",
overlayColorClass,
dimRatioToClass(dimRatio),
{
"has-background-dim": dimRatio !== void 0,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
"wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0,
"has-background-gradient": gradientValue,
[gradientClass]: gradientClass
}
),
style: bgStyle
}
),
!useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: imgClasses,
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
) : /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
role: "img",
className: imgClasses,
style: { backgroundPosition, backgroundImage }
}
)),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: "wp-block-cover__inner-container"
})
}
)
] });
},
migrate: migrateTag
};
const deprecated_v10 = {
attributes: v8ToV11BlockAttributes,
supports: v7toV11BlockSupports,
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
useFeaturedImage,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
...isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {},
minHeight: minHeight || void 0
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient ? customGradient : void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : void 0
);
const classes = dist_clsx(
{
"is-light": !isDark,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
const gradientValue = gradient || customGradient;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__background",
overlayColorClass,
dimRatioToClass(dimRatio),
{
"has-background-dim": dimRatio !== void 0,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
"wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0,
"has-background-gradient": gradientValue,
[gradientClass]: gradientClass
}
),
style: bgStyle
}
),
!useFeaturedImage && isImageBackground && isImgElement && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null
),
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: "wp-block-cover__inner-container"
})
}
)
] });
},
migrate: migrateTag
};
const v9 = {
attributes: v8ToV11BlockAttributes,
supports: v7toV11BlockSupports,
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {},
minHeight: minHeight || void 0
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient ? customGradient : void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : void 0
);
const classes = dist_clsx(
{
"is-light": !isDark,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
const gradientValue = gradient || customGradient;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__background",
overlayColorClass,
dimRatioToClass(dimRatio),
{
"has-background-dim": dimRatio !== void 0,
// For backwards compatibility. Former versions of the Cover Block applied
// `.wp-block-cover__gradient-background` in the presence of
// media, a gradient and a dim.
"wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0,
"has-background-gradient": gradientValue,
[gradientClass]: gradientClass
}
),
style: bgStyle
}
),
isImageBackground && isImgElement && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null
),
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: "wp-block-cover__inner-container"
})
}
)
] });
},
migrate: migrateTag
};
const v8 = {
attributes: v8ToV11BlockAttributes,
supports: v7toV11BlockSupports,
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isDark,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {},
minHeight: minHeight || void 0
};
const bgStyle = {
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient ? customGradient : void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : void 0
);
const classes = dist_clsx(
{
"is-light": !isDark,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
overlayColorClass,
dimRatioToClass(dimRatio),
"wp-block-cover__gradient-background",
gradientClass,
{
"has-background-dim": dimRatio !== void 0,
"has-background-gradient": gradient || customGradient,
[gradientClass]: !url && gradientClass
}
),
style: bgStyle
}
),
isImageBackground && isImgElement && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null
),
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"div",
{
...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: "wp-block-cover__inner-container"
})
}
)
] });
},
migrate: migrateTag
};
const v7 = {
attributes: {
...deprecated_blockAttributes,
isRepeated: {
type: "boolean",
default: false
},
minHeight: {
type: "number"
},
minHeightUnit: {
type: "string"
},
gradient: {
type: "string"
},
customGradient: {
type: "string"
},
contentPosition: {
type: "string"
},
alt: {
type: "string",
source: "attribute",
selector: "img",
attribute: "alt",
default: ""
}
},
supports: v7toV11BlockSupports,
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isRepeated,
overlayColor,
url,
alt,
id,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const isImgElement = !(hasParallax || isRepeated);
const style = {
...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {},
backgroundColor: !overlayColorClass ? customOverlayColor : void 0,
background: customGradient && !url ? customGradient : void 0,
minHeight: minHeight || void 0
};
const objectPosition = (
// prettier-ignore
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : void 0
);
const classes = dist_clsx(
dimRatioToClassV1(dimRatio),
overlayColorClass,
{
"has-background-dim": dimRatio !== 0,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-background-gradient": gradient || customGradient,
[gradientClass]: !url && gradientClass,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__gradient-background",
gradientClass
),
style: customGradient ? { background: customGradient } : void 0
}
),
isImageBackground && isImgElement && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
className: dist_clsx(
"wp-block-cover__image-background",
id ? `wp-image-${id}` : null
),
alt,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: dist_clsx(
"wp-block-cover__video-background",
"intrinsic-ignore"
),
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: { objectPosition },
"data-object-fit": "cover",
"data-object-position": objectPosition
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })
] });
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v6 = {
attributes: {
...deprecated_blockAttributes,
isRepeated: {
type: "boolean",
default: false
},
minHeight: {
type: "number"
},
minHeightUnit: {
type: "string"
},
gradient: {
type: "string"
},
customGradient: {
type: "string"
},
contentPosition: {
type: "string"
}
},
supports: {
align: true
},
save({ attributes }) {
const {
backgroundType,
gradient,
contentPosition,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
isRepeated,
overlayColor,
url,
minHeight: minHeightProp,
minHeightUnit
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
const style = isImageBackground ? backgroundImageStyles(url) : {};
const videoStyle = {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (customGradient && !url) {
style.background = customGradient;
}
style.minHeight = minHeight || void 0;
let positionValue;
if (focalPoint) {
positionValue = `${Math.round(
focalPoint.x * 100
)}% ${Math.round(focalPoint.y * 100)}%`;
if (isImageBackground && !hasParallax) {
style.backgroundPosition = positionValue;
}
if (isVideoBackground) {
videoStyle.objectPosition = positionValue;
}
}
const classes = dist_clsx(
dimRatioToClassV1(dimRatio),
overlayColorClass,
{
"has-background-dim": dimRatio !== 0,
"has-parallax": hasParallax,
"is-repeated": isRepeated,
"has-background-gradient": gradient || customGradient,
[gradientClass]: !url && gradientClass,
"has-custom-content-position": !isContentPositionCenter(contentPosition)
},
getPositionClassName(contentPosition)
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [
url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__gradient-background",
gradientClass
),
style: customGradient ? { background: customGradient } : void 0
}
),
isVideoBackground && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
playsInline: true,
src: url,
style: videoStyle
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })
] });
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v5 = {
attributes: {
...deprecated_blockAttributes,
minHeight: {
type: "number"
},
gradient: {
type: "string"
},
customGradient: {
type: "string"
}
},
supports: {
align: true
},
save({ attributes }) {
const {
backgroundType,
gradient,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
overlayColor,
url,
minHeight
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (focalPoint && !hasParallax) {
style.backgroundPosition = `${Math.round(
focalPoint.x * 100
)}% ${Math.round(focalPoint.y * 100)}%`;
}
if (customGradient && !url) {
style.background = customGradient;
}
style.minHeight = minHeight || void 0;
const classes = dist_clsx(
dimRatioToClassV1(dimRatio),
overlayColorClass,
{
"has-background-dim": dimRatio !== 0,
"has-parallax": hasParallax,
"has-background-gradient": customGradient,
[gradientClass]: !url && gradientClass
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style, children: [
url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__gradient-background",
gradientClass
),
style: customGradient ? { background: customGradient } : void 0
}
),
VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
src: url
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })
] });
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v4 = {
attributes: {
...deprecated_blockAttributes,
minHeight: {
type: "number"
},
gradient: {
type: "string"
},
customGradient: {
type: "string"
}
},
supports: {
align: true
},
save({ attributes }) {
const {
backgroundType,
gradient,
customGradient,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
overlayColor,
url,
minHeight
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);
const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (focalPoint && !hasParallax) {
style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
}
if (customGradient && !url) {
style.background = customGradient;
}
style.minHeight = minHeight || void 0;
const classes = dist_clsx(
dimRatioToClassV1(dimRatio),
overlayColorClass,
{
"has-background-dim": dimRatio !== 0,
"has-parallax": hasParallax,
"has-background-gradient": customGradient,
[gradientClass]: !url && gradientClass
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style, children: [
url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"span",
{
"aria-hidden": "true",
className: dist_clsx(
"wp-block-cover__gradient-background",
gradientClass
),
style: customGradient ? { background: customGradient } : void 0
}
),
VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
src: url
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })
] });
},
migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag)
};
const v3 = {
attributes: {
...deprecated_blockAttributes,
title: {
type: "string",
source: "html",
selector: "p"
},
contentAlign: {
type: "string",
default: "center"
}
},
supports: {
align: true
},
save({ attributes }) {
const {
backgroundType,
contentAlign,
customOverlayColor,
dimRatio,
focalPoint,
hasParallax,
overlayColor,
title,
url
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
if (focalPoint && !hasParallax) {
style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`;
}
const classes = dist_clsx(
dimRatioToClassV1(dimRatio),
overlayColorClass,
{
"has-background-dim": dimRatio !== 0,
"has-parallax": hasParallax,
[`has-${contentAlign}-content`]: contentAlign !== "center"
}
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style, children: [
VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"video",
{
className: "wp-block-cover__video-background",
autoPlay: true,
muted: true,
loop: true,
src: url
}
),
!external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "p",
className: "wp-block-cover-text",
value: title
}
)
] });
},
migrate(attributes) {
const newAttribs = {
...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio,
tagName: !attributes.tagName ? "div" : attributes.tagName
};
const { title, contentAlign, ...restAttributes } = newAttribs;
return [
restAttributes,
[
(0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {
content: attributes.title,
align: attributes.contentAlign,
fontSize: "large",
placeholder: (0,external_wp_i18n_namespaceObject.__)("Write title\u2026")
})
]
];
}
};
const v2 = {
attributes: {
...deprecated_blockAttributes,
title: {
type: "string",
source: "html",
selector: "p"
},
contentAlign: {
type: "string",
default: "center"
},
align: {
type: "string"
}
},
supports: {
className: false
},
save({ attributes }) {
const {
url,
title,
hasParallax,
dimRatio,
align,
contentAlign,
overlayColor,
customOverlayColor
} = attributes;
const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)(
"background-color",
overlayColor
);
const style = backgroundImageStyles(url);
if (!overlayColorClass) {
style.backgroundColor = customOverlayColor;
}
const classes = dist_clsx(
"wp-block-cover-image",
dimRatioToClassV1(dimRatio),
overlayColorClass,
{
"has-background-dim": dimRatio !== 0,
"has-parallax": hasParallax,
[`has-${contentAlign}-content`]: contentAlign !== "center"
},
align ? `align${align}` : null
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: classes, style, children: !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.RichText.Content,
{
tagName: "p",
className: "wp-block-cover-image-text",
value: title
}
) });
},
migrate(attributes) {
const newAttribs = {
...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio,
tagName: !attributes.tagName ? "div" : attributes.tagName
};
const { title, contentAlign, align, ...restAttributes } = newAttribs;
return [
restAttributes,
[
(0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {
content: attributes.title,
align: attributes.contentAlign,
fontSize: "large",
placeholder: (0,external_wp_i18n_namespaceObject.__)("Write title\u2026")
})
]
];
}
};
const cover_deprecated_v1 = {
attributes: {
...deprecated_blockAttributes,
title: {
type: "string",
source: "html",
selector: "h2"
},
align: {
type: "string"
},
contentAlign: {
type: "string",
default: "center"
}
},
supports: {
className: false
},
save({ attributes }) {
const { url, title, hasParallax, dimRatio, align } = attributes;
const style = backgroundImageStyles(url);
const classes = dist_clsx(
"wp-block-cover-image",
dimRatioToClassV1(dimRatio),
{
"has-background-dim": dimRatio !== 0,
"has-parallax": hasParallax
},
align ? `align${align}` : null
);
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("section", { className: classes, style, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "h2", value: title }) });
},
migrate(attributes) {
const newAttribs = {
...attributes,
dimRatio: !attributes.url ? 100 : attributes.dimRatio,
tagName: !attributes.tagName ? "div" : attributes.tagName
};
const { title, contentAlign, align, ...restAttributes } = newAttribs;
return [
restAttributes,
[
(0,external_wp_blocks_namespaceObject.createBlock)("core/paragraph", {
content: attributes.title,
align: attributes.contentAlign,
fontSize: "large",
placeholder: (0,external_wp_i18n_namespaceObject.__)("Write title\u2026")
})
]
];
}
};
var cover_deprecated_deprecated_default = [v14, v13, deprecated_v12, deprecated_v11, deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1];
;// ./node_modules/@wordpress/block-library/build-module/cover/constants.js
const DEFAULT_MEDIA_SIZE_SLUG = "full";
;// ./node_modules/@wordpress/block-library/build-module/utils/poster-image.js
const POSTER_IMAGE_ALLOWED_MEDIA_TYPES = ["image"];
function PosterImage({ poster, onChange }) {
const posterButtonRef = (0,external_wp_element_namespaceObject.useRef)();
const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(
PosterImage,
"block-library-poster-image-description"
);
const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onDropFiles = (filesList) => {
getSettings().mediaUpload({
allowedTypes: POSTER_IMAGE_ALLOWED_MEDIA_TYPES,
filesList,
onFileChange: ([image]) => {
if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) {
setIsLoading(true);
return;
}
if (image) {
onChange(image);
}
setIsLoading(false);
},
onError: (message) => {
createErrorNotice(message, {
id: "poster-image-upload-notice",
type: "snackbar"
});
setIsLoading(false);
},
multiple: false
});
};
const getPosterButtonContent = () => {
if (!poster && isLoading) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {});
}
return !poster ? (0,external_wp_i18n_namespaceObject.__)("Set poster image") : (0,external_wp_i18n_namespaceObject.__)("Replace");
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Poster image"),
isShownByDefault: true,
hasValue: () => !!poster,
onDeselect: () => onChange(void 0),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: (0,external_wp_i18n_namespaceObject.__)("Poster image") }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.MediaUpload,
{
title: (0,external_wp_i18n_namespaceObject.__)("Select poster image"),
onSelect: onChange,
allowedTypes: POSTER_IMAGE_ALLOWED_MEDIA_TYPES,
render: ({ open }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-library-poster-image__container", children: [
poster && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: open,
"aria-haspopup": "dialog",
"aria-label": (0,external_wp_i18n_namespaceObject.__)(
"Edit or replace the poster image."
),
className: "block-library-poster-image__preview",
disabled: isLoading,
accessibleWhenDisabled: true,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"img",
{
src: poster,
alt: (0,external_wp_i18n_namespaceObject.__)("Poster image preview"),
className: "block-library-poster-image__preview-image"
}
),
isLoading && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalHStack,
{
className: dist_clsx(
"block-library-poster-image__actions",
{
"block-library-poster-image__actions-select": !poster
}
),
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: open,
ref: posterButtonRef,
className: "block-library-poster-image__action",
"aria-describedby": descriptionId,
"aria-haspopup": "dialog",
variant: !poster ? "secondary" : void 0,
disabled: isLoading,
accessibleWhenDisabled: true,
children: getPosterButtonContent()
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { id: descriptionId, hidden: true, children: poster ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: poster image URL. */
(0,external_wp_i18n_namespaceObject.__)(
"The current poster image url is %s."
),
poster
) : (0,external_wp_i18n_namespaceObject.__)(
"There is no poster image currently selected."
) }),
!!poster && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
onClick: () => {
onChange(void 0);
posterButtonRef.current.focus();
},
className: "block-library-poster-image__action",
disabled: isLoading,
accessibleWhenDisabled: true,
children: (0,external_wp_i18n_namespaceObject.__)("Remove")
}
)
]
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { onFilesDrop: onDropFiles })
] })
}
)
]
}
) });
}
var poster_image_default = PosterImage;
;// ./node_modules/@wordpress/block-library/build-module/cover/edit/inspector-controls.js
const { cleanEmptyObject: inspector_controls_cleanEmptyObject, ResolutionTool, HTMLElementControl: inspector_controls_HTMLElementControl } = unlock(
external_wp_blockEditor_namespaceObject.privateApis
);
function CoverHeightInput({
onChange,
onUnitChange,
unit = "px",
value = ""
}) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
const inputId = `block-cover-height-input-${instanceId}`;
const isPx = unit === "px";
const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)("spacing.units");
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnits || ["px", "em", "rem", "vw", "vh"],
defaultValues: { px: 430, "%": 20, em: 20, rem: 20, vw: 20, vh: 50 }
});
const handleOnChange = (unprocessedValue) => {
const inputValue = unprocessedValue !== "" ? parseFloat(unprocessedValue) : void 0;
if (isNaN(inputValue) && inputValue !== void 0) {
return;
}
onChange(inputValue);
};
const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => {
const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
return [parsedQuantity, unit].join("");
}, [unit, value]);
const min = isPx ? COVER_MIN_HEIGHT : 0;
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalUnitControl,
{
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)("Minimum height"),
id: inputId,
isResetValueOnUnitChange: true,
min,
onChange: handleOnChange,
onUnitChange,
units,
value: computedValue
}
);
}
function CoverInspectorControls({
attributes,
setAttributes,
clientId,
setOverlayColor,
coverRef,
currentSettings,
updateDimRatio,
featuredImage
}) {
const {
useFeaturedImage,
id,
dimRatio,
focalPoint,
hasParallax,
isRepeated,
minHeight,
minHeightUnit,
alt,
tagName,
poster
} = attributes;
const {
isVideoBackground,
isImageBackground,
mediaElement,
url,
overlayColor
} = currentSettings;
const sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
const { gradientValue, setGradient } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)();
const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const imageSizes = getSettings()?.imageSizes;
const image = (0,external_wp_data_namespaceObject.useSelect)(
(select) => id && isImageBackground ? select(external_wp_coreData_namespaceObject.store).getEntityRecord(
"postType",
"attachment",
id,
{ context: "view" }
) : null,
[id, isImageBackground]
);
const currentBackgroundImage = useFeaturedImage ? featuredImage : image;
function updateImage(newSizeSlug) {
const newUrl = currentBackgroundImage?.media_details?.sizes?.[newSizeSlug]?.source_url;
if (!newUrl) {
return null;
}
setAttributes({
url: newUrl,
sizeSlug: newSizeSlug
});
}
const imageSizeOptions = imageSizes?.filter(
({ slug }) => currentBackgroundImage?.media_details?.sizes?.[slug]?.source_url
)?.map(({ name, slug }) => ({ value: slug, label: name }));
const toggleParallax = () => {
setAttributes({
hasParallax: !hasParallax,
...!hasParallax ? { focalPoint: void 0 } : {}
});
};
const toggleIsRepeated = () => {
setAttributes({
isRepeated: !isRepeated
});
};
const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated);
const imperativeFocalPointPreview = (value) => {
const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, "objectPosition"] : [coverRef.current.style, "backgroundPosition"];
styleOfRef[property] = mediaPosition(value);
};
const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: !!url && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.__experimentalToolsPanel,
{
label: (0,external_wp_i18n_namespaceObject.__)("Settings"),
resetAll: () => {
setAttributes({
hasParallax: false,
focalPoint: void 0,
isRepeated: false,
alt: "",
poster: void 0
});
updateImage(DEFAULT_MEDIA_SIZE_SLUG);
},
dropdownMenuProps,
children: [
isImageBackground && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Fixed background"),
isShownByDefault: true,
hasValue: () => !!hasParallax,
onDeselect: () => setAttributes({
hasParallax: false,
focalPoint: void 0
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Fixed background"),
checked: !!hasParallax,
onChange: toggleParallax
}
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Repeated background"),
isShownByDefault: true,
hasValue: () => isRepeated,
onDeselect: () => setAttributes({
isRepeated: false
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ToggleControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Repeated background"),
checked: isRepeated,
onChange: toggleIsRepeated
}
)
}
)
] }),
showFocalPointPicker && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Focal point"),
isShownByDefault: true,
hasValue: () => !!focalPoint,
onDeselect: () => setAttributes({
focalPoint: void 0
}),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.FocalPointPicker,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Focal point"),
url,
value: focalPoint,
onDragStart: imperativeFocalPointPreview,
onDrag: imperativeFocalPointPreview,
onChange: (newFocalPoint) => setAttributes({
focalPoint: newFocalPoint
})
}
)
}
),
isVideoBackground && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
poster_image_default,
{
poster,
onChange: (posterImage) => setAttributes({
poster: posterImage?.url
})
}
),
!useFeaturedImage && url && !isVideoBackground && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
label: (0,external_wp_i18n_namespaceObject.__)("Alternative text"),
isShownByDefault: true,
hasValue: () => !!alt,
onDeselect: () => setAttributes({ alt: "" }),
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.TextareaControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Alternative text"),
value: alt,
onChange: (newAlt) => setAttributes({ alt: newAlt }),
help: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.ExternalLink,
{
href: (
// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
(0,external_wp_i18n_namespaceObject.__)(
"https://www.w3.org/WAI/tutorials/images/decision-tree/"
)
),
children: (0,external_wp_i18n_namespaceObject.__)(
"Describe the purpose of the image."
)
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}),
(0,external_wp_i18n_namespaceObject.__)(
"Leave empty if decorative."
)
] })
}
)
}
),
!!imageSizeOptions?.length && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResolutionTool,
{
value: sizeSlug,
onChange: updateImage,
options: imageSizeOptions,
defaultValue: DEFAULT_MEDIA_SIZE_SLUG
}
)
]
}
) }),
colorGradientSettings.hasColorsOrGradients && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "color", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown,
{
__experimentalIsRenderedInSidebar: true,
settings: [
{
colorValue: overlayColor.color,
gradientValue,
label: (0,external_wp_i18n_namespaceObject.__)("Overlay"),
onColorChange: setOverlayColor,
onGradientChange: setGradient,
isShownByDefault: true,
resetAllFilter: () => ({
overlayColor: void 0,
customOverlayColor: void 0,
gradient: void 0,
customGradient: void 0
}),
clearable: true
}
],
panelId: clientId,
...colorGradientSettings
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
hasValue: () => {
return dimRatio === void 0 ? false : dimRatio !== (url ? 50 : 100);
},
label: (0,external_wp_i18n_namespaceObject.__)("Overlay opacity"),
onDeselect: () => updateDimRatio(url ? 50 : 100),
resetAllFilter: () => ({
dimRatio: url ? 50 : 100
}),
isShownByDefault: true,
panelId: clientId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.RangeControl,
{
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)("Overlay opacity"),
value: dimRatio,
onChange: (newDimRatio) => updateDimRatio(newDimRatio),
min: 0,
max: 100,
step: 10,
required: true,
__next40pxDefaultSize: true
}
)
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "dimensions", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.__experimentalToolsPanelItem,
{
className: "single-column",
hasValue: () => !!minHeight,
label: (0,external_wp_i18n_namespaceObject.__)("Minimum height"),
onDeselect: () => setAttributes({
minHeight: void 0,
minHeightUnit: void 0
}),
resetAllFilter: () => ({
minHeight: void 0,
minHeightUnit: void 0
}),
isShownByDefault: true,
panelId: clientId,
children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
CoverHeightInput,
{
value: attributes?.style?.dimensions?.aspectRatio ? "" : minHeight,
unit: minHeightUnit,
onChange: (newMinHeight) => setAttributes({
minHeight: newMinHeight,
style: inspector_controls_cleanEmptyObject({
...attributes?.style,
dimensions: {
...attributes?.style?.dimensions,
aspectRatio: void 0
// Reset aspect ratio when minHeight is set.
}
})
}),
onUnitChange: (nextUnit) => setAttributes({
minHeightUnit: nextUnit
})
}
)
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
inspector_controls_HTMLElementControl,
{
tagName,
onChange: (value) => setAttributes({ tagName: value }),
clientId,
options: [
{ label: (0,external_wp_i18n_namespaceObject.__)("Default (<div>)"), value: "div" },
{ label: "<header>", value: "header" },
{ label: "<main>", value: "main" },
{ label: "<section>", value: "section" },
{ label: "<article>", value: "article" },
{ label: "<aside>", value: "aside" },
{ label: "<footer>", value: "footer" }
]
}
) })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/cover/edit/block-controls.js
const { cleanEmptyObject: block_controls_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function CoverBlockControls({
attributes,
setAttributes,
onSelectMedia,
currentSettings,
toggleUseFeaturedImage,
onClearMedia,
blockEditingMode
}) {
const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } = attributes;
const { hasInnerBlocks, url } = currentSettings;
const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight);
const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit);
const isMinFullHeight = minHeightUnit === "vh" && minHeight === 100 && !attributes?.style?.dimensions?.aspectRatio;
const isContentOnlyMode = blockEditingMode === "contentOnly";
const toggleMinFullHeight = () => {
if (isMinFullHeight) {
if (prevMinHeightUnit === "vh" && prevMinHeightValue === 100) {
return setAttributes({
minHeight: void 0,
minHeightUnit: void 0
});
}
return setAttributes({
minHeight: prevMinHeightValue,
minHeightUnit: prevMinHeightUnit
});
}
setPrevMinHeightValue(minHeight);
setPrevMinHeightUnit(minHeightUnit);
return setAttributes({
minHeight: 100,
minHeightUnit: "vh",
style: block_controls_cleanEmptyObject({
...attributes?.style,
dimensions: {
...attributes?.style?.dimensions,
aspectRatio: void 0
// Reset aspect ratio when minHeight is set.
}
})
});
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
!isContentOnlyMode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl,
{
label: (0,external_wp_i18n_namespaceObject.__)("Change content position"),
value: contentPosition,
onChange: (nextPosition) => setAttributes({
contentPosition: nextPosition
}),
isDisabled: !hasInnerBlocks
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl,
{
isActive: isMinFullHeight,
onToggle: toggleMinFullHeight,
isDisabled: !hasInnerBlocks
}
)
] }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.MediaReplaceFlow,
{
mediaId: id,
mediaURL: url,
allowedTypes: shared_ALLOWED_MEDIA_TYPES,
accept: "image/*,video/*",
onSelect: onSelectMedia,
onToggleFeaturedImage: toggleUseFeaturedImage,
useFeaturedImage,
name: !url ? (0,external_wp_i18n_namespaceObject.__)("Add media") : (0,external_wp_i18n_namespaceObject.__)("Replace"),
onReset: onClearMedia
}
) })
] });
}
;// ./node_modules/@wordpress/block-library/build-module/cover/edit/cover-placeholder.js
function CoverPlaceholder({
disableMediaButtons = false,
children,
onSelectMedia,
onError,
style,
toggleUseFeaturedImage
}) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_blockEditor_namespaceObject.MediaPlaceholder,
{
icon: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: cover_default }),
labels: {
title: (0,external_wp_i18n_namespaceObject.__)("Cover")
},
onSelect: onSelectMedia,
accept: "image/*,video/*",
allowedTypes: shared_ALLOWED_MEDIA_TYPES,
disableMediaButtons,
onToggleFeaturedImage: toggleUseFeaturedImage,
onError,
style,
children
}
);
}
;// ./node_modules/@wordpress/block-library/build-module/cover/edit/resizable-cover-popover.js
const RESIZABLE_BOX_ENABLE_OPTION = {
top: false,
right: false,
bottom: true,
left: false,
topRight: false,
bottomRight: false,
bottomLeft: false,
topLeft: false
};
const { ResizableBoxPopover } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function ResizableCoverPopover({
className,
height,
minHeight,
onResize,
onResizeStart,
onResizeStop,
showHandle,
size,
width,
...props
}) {
const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
const resizableBoxProps = {
className: dist_clsx(className, { "is-resizing": isResizing }),
enable: RESIZABLE_BOX_ENABLE_OPTION,
onResizeStart: (_event, _direction, elt) => {
onResizeStart(elt.clientHeight);
onResize(elt.clientHeight);
},
onResize: (_event, _direction, elt) => {
onResize(elt.clientHeight);
if (!isResizing) {
setIsResizing(true);
}
},
onResizeStop: (_event, _direction, elt) => {
onResizeStop(elt.clientHeight);
setIsResizing(false);
},
showHandle,
size,
__experimentalShowTooltip: true,
__experimentalTooltipProps: {
axis: "y",
position: "bottom",
isVisible: isResizing
}
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
ResizableBoxPopover,
{
className: "block-library-cover__resizable-box-popover",
resizableBoxProps,
...props
}
);
}
;// ./node_modules/colord/index.mjs
var colord_r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(colord_r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
;// ./node_modules/colord/plugins/names.mjs
/* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
;// ./node_modules/fast-average-color/dist/index.esm.js
/*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color */
function toHex(num) {
var str = num.toString(16);
return str.length === 1 ? '0' + str : str;
}
function arrayToHex(arr) {
return '#' + arr.map(toHex).join('');
}
function isDark(color) {
// http://www.w3.org/TR/AERT#color-contrast
var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000;
return result < 128;
}
function prepareIgnoredColor(color) {
if (!color) {
return [];
}
return isRGBArray(color) ? color : [color];
}
function isRGBArray(value) {
return Array.isArray(value[0]);
}
function isIgnoredColor(data, index, ignoredColor) {
for (var i = 0; i < ignoredColor.length; i++) {
if (isIgnoredColorAsNumbers(data, index, ignoredColor[i])) {
return true;
}
}
return false;
}
function isIgnoredColorAsNumbers(data, index, ignoredColor) {
switch (ignoredColor.length) {
case 3:
// [red, green, blue]
if (isIgnoredRGBColor(data, index, ignoredColor)) {
return true;
}
break;
case 4:
// [red, green, blue, alpha]
if (isIgnoredRGBAColor(data, index, ignoredColor)) {
return true;
}
break;
case 5:
// [red, green, blue, alpha, threshold]
if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) {
return true;
}
break;
default:
return false;
}
}
function isIgnoredRGBColor(data, index, ignoredColor) {
// Ignore if the pixel are transparent.
if (data[index + 3] !== 255) {
return true;
}
if (data[index] === ignoredColor[0] &&
data[index + 1] === ignoredColor[1] &&
data[index + 2] === ignoredColor[2]) {
return true;
}
return false;
}
function isIgnoredRGBAColor(data, index, ignoredColor) {
if (data[index + 3] && ignoredColor[3]) {
return data[index] === ignoredColor[0] &&
data[index + 1] === ignoredColor[1] &&
data[index + 2] === ignoredColor[2] &&
data[index + 3] === ignoredColor[3];
}
// Ignore rgb components if the pixel are fully transparent.
return data[index + 3] === ignoredColor[3];
}
function inRange(colorComponent, ignoredColorComponent, value) {
return colorComponent >= (ignoredColorComponent - value) &&
colorComponent <= (ignoredColorComponent + value);
}
function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) {
var redIgnored = ignoredColor[0];
var greenIgnored = ignoredColor[1];
var blueIgnored = ignoredColor[2];
var alphaIgnored = ignoredColor[3];
var threshold = ignoredColor[4];
var alphaData = data[index + 3];
var alphaInRange = inRange(alphaData, alphaIgnored, threshold);
if (!alphaIgnored) {
return alphaInRange;
}
if (!alphaData && alphaInRange) {
return true;
}
if (inRange(data[index], redIgnored, threshold) &&
inRange(data[index + 1], greenIgnored, threshold) &&
inRange(data[index + 2], blueIgnored, threshold) &&
alphaInRange) {
return true;
}
return false;
}
function dominantAlgorithm(arr, len, options) {
var colorHash = {};
var divider = 24;
var ignoredColor = options.ignoredColor;
var step = options.step;
var max = [0, 0, 0, 0, 0];
for (var i = 0; i < len; i += step) {
var red = arr[i];
var green = arr[i + 1];
var blue = arr[i + 2];
var alpha = arr[i + 3];
if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) {
continue;
}
var key = Math.round(red / divider) + ',' +
Math.round(green / divider) + ',' +
Math.round(blue / divider);
if (colorHash[key]) {
colorHash[key] = [
colorHash[key][0] + red * alpha,
colorHash[key][1] + green * alpha,
colorHash[key][2] + blue * alpha,
colorHash[key][3] + alpha,
colorHash[key][4] + 1
];
}
else {
colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1];
}
if (max[4] < colorHash[key][4]) {
max = colorHash[key];
}
}
var redTotal = max[0];
var greenTotal = max[1];
var blueTotal = max[2];
var alphaTotal = max[3];
var count = max[4];
return alphaTotal ? [
Math.round(redTotal / alphaTotal),
Math.round(greenTotal / alphaTotal),
Math.round(blueTotal / alphaTotal),
Math.round(alphaTotal / count)
] : options.defaultColor;
}
function simpleAlgorithm(arr, len, options) {
var redTotal = 0;
var greenTotal = 0;
var blueTotal = 0;
var alphaTotal = 0;
var count = 0;
var ignoredColor = options.ignoredColor;
var step = options.step;
for (var i = 0; i < len; i += step) {
var alpha = arr[i + 3];
var red = arr[i] * alpha;
var green = arr[i + 1] * alpha;
var blue = arr[i + 2] * alph
Showing 512.00 KB of 2.19 MB. Use Edit/Download for full content.
Directory Contents
Dirs: 24 × Files: 129