"use strict"; var wp; (wp ||= {}).blockEditor = (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to2, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to2; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // node_modules/fast-deep-equal/es6/index.js var require_es6 = __commonJS({ "node_modules/fast-deep-equal/es6/index.js"(exports, module) { "use strict"; module.exports = function equal(a2, b2) { if (a2 === b2) return true; if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { if (a2.constructor !== b2.constructor) return false; var length, i2, keys; if (Array.isArray(a2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (!equal(a2[i2], b2[i2])) return false; return true; } if (a2 instanceof Map && b2 instanceof Map) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; for (i2 of a2.entries()) if (!equal(i2[1], b2.get(i2[0]))) return false; return true; } if (a2 instanceof Set && b2 instanceof Set) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; return true; } if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (a2[i2] !== b2[i2]) return false; return true; } if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); keys = Object.keys(a2); length = keys.length; if (length !== Object.keys(b2).length) return false; for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; for (i2 = length; i2-- !== 0; ) { var key = keys[i2]; if (!equal(a2[key], b2[key])) return false; } return true; } return a2 !== a2 && b2 !== b2; }; } }); // package-external:@wordpress/primitives var require_primitives = __commonJS({ "package-external:@wordpress/primitives"(exports, module) { module.exports = window.wp.primitives; } }); // package-external:@wordpress/rich-text var require_rich_text = __commonJS({ "package-external:@wordpress/rich-text"(exports, module) { module.exports = window.wp.richText; } }); // package-external:@wordpress/block-serialization-default-parser var require_block_serialization_default_parser = __commonJS({ "package-external:@wordpress/block-serialization-default-parser"(exports, module) { module.exports = window.wp.blockSerializationDefaultParser; } }); // package-external:@wordpress/a11y var require_a11y = __commonJS({ "package-external:@wordpress/a11y"(exports, module) { module.exports = window.wp.a11y; } }); // package-external:@wordpress/notices var require_notices = __commonJS({ "package-external:@wordpress/notices"(exports, module) { module.exports = window.wp.notices; } }); // package-external:@wordpress/preferences var require_preferences = __commonJS({ "package-external:@wordpress/preferences"(exports, module) { module.exports = window.wp.preferences; } }); // node_modules/remove-accents/index.js var require_remove_accents = __commonJS({ "node_modules/remove-accents/index.js"(exports, module) { var characterMap = { "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\u1EA4": "A", "\u1EAE": "A", "\u1EB2": "A", "\u1EB4": "A", "\u1EB6": "A", "\xC6": "AE", "\u1EA6": "A", "\u1EB0": "A", "\u0202": "A", "\u1EA2": "A", "\u1EA0": "A", "\u1EA8": "A", "\u1EAA": "A", "\u1EAC": "A", "\xC7": "C", "\u1E08": "C", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\u1EBE": "E", "\u1E16": "E", "\u1EC0": "E", "\u1E14": "E", "\u1E1C": "E", "\u0206": "E", "\u1EBA": "E", "\u1EBC": "E", "\u1EB8": "E", "\u1EC2": "E", "\u1EC4": "E", "\u1EC6": "E", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\u1E2E": "I", "\u020A": "I", "\u1EC8": "I", "\u1ECA": "I", "\xD0": "D", "\xD1": "N", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\u1ED0": "O", "\u1E4C": "O", "\u1E52": "O", "\u020E": "O", "\u1ECE": "O", "\u1ECC": "O", "\u1ED4": "O", "\u1ED6": "O", "\u1ED8": "O", "\u1EDC": "O", "\u1EDE": "O", "\u1EE0": "O", "\u1EDA": "O", "\u1EE2": "O", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\u1EE6": "U", "\u1EE4": "U", "\u1EEC": "U", "\u1EEE": "U", "\u1EF0": "U", "\xDD": "Y", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\u1EA5": "a", "\u1EAF": "a", "\u1EB3": "a", "\u1EB5": "a", "\u1EB7": "a", "\xE6": "ae", "\u1EA7": "a", "\u1EB1": "a", "\u0203": "a", "\u1EA3": "a", "\u1EA1": "a", "\u1EA9": "a", "\u1EAB": "a", "\u1EAD": "a", "\xE7": "c", "\u1E09": "c", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\u1EBF": "e", "\u1E17": "e", "\u1EC1": "e", "\u1E15": "e", "\u1E1D": "e", "\u0207": "e", "\u1EBB": "e", "\u1EBD": "e", "\u1EB9": "e", "\u1EC3": "e", "\u1EC5": "e", "\u1EC7": "e", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\u1E2F": "i", "\u020B": "i", "\u1EC9": "i", "\u1ECB": "i", "\xF0": "d", "\xF1": "n", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\u1ED1": "o", "\u1E4D": "o", "\u1E53": "o", "\u020F": "o", "\u1ECF": "o", "\u1ECD": "o", "\u1ED5": "o", "\u1ED7": "o", "\u1ED9": "o", "\u1EDD": "o", "\u1EDF": "o", "\u1EE1": "o", "\u1EDB": "o", "\u1EE3": "o", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\u1EE7": "u", "\u1EE5": "u", "\u1EED": "u", "\u1EEF": "u", "\u1EF1": "u", "\xFD": "y", "\xFF": "y", "\u0100": "A", "\u0101": "a", "\u0102": "A", "\u0103": "a", "\u0104": "A", "\u0105": "a", "\u0106": "C", "\u0107": "c", "\u0108": "C", "\u0109": "c", "\u010A": "C", "\u010B": "c", "\u010C": "C", "\u010D": "c", "C\u0306": "C", "c\u0306": "c", "\u010E": "D", "\u010F": "d", "\u0110": "D", "\u0111": "d", "\u0112": "E", "\u0113": "e", "\u0114": "E", "\u0115": "e", "\u0116": "E", "\u0117": "e", "\u0118": "E", "\u0119": "e", "\u011A": "E", "\u011B": "e", "\u011C": "G", "\u01F4": "G", "\u011D": "g", "\u01F5": "g", "\u011E": "G", "\u011F": "g", "\u0120": "G", "\u0121": "g", "\u0122": "G", "\u0123": "g", "\u0124": "H", "\u0125": "h", "\u0126": "H", "\u0127": "h", "\u1E2A": "H", "\u1E2B": "h", "\u0128": "I", "\u0129": "i", "\u012A": "I", "\u012B": "i", "\u012C": "I", "\u012D": "i", "\u012E": "I", "\u012F": "i", "\u0130": "I", "\u0131": "i", "\u0132": "IJ", "\u0133": "ij", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u1E30": "K", "\u1E31": "k", "K\u0306": "K", "k\u0306": "k", "\u0139": "L", "\u013A": "l", "\u013B": "L", "\u013C": "l", "\u013D": "L", "\u013E": "l", "\u013F": "L", "\u0140": "l", "\u0141": "l", "\u0142": "l", "\u1E3E": "M", "\u1E3F": "m", "M\u0306": "M", "m\u0306": "m", "\u0143": "N", "\u0144": "n", "\u0145": "N", "\u0146": "n", "\u0147": "N", "\u0148": "n", "\u0149": "n", "N\u0306": "N", "n\u0306": "n", "\u014C": "O", "\u014D": "o", "\u014E": "O", "\u014F": "o", "\u0150": "O", "\u0151": "o", "\u0152": "OE", "\u0153": "oe", "P\u0306": "P", "p\u0306": "p", "\u0154": "R", "\u0155": "r", "\u0156": "R", "\u0157": "r", "\u0158": "R", "\u0159": "r", "R\u0306": "R", "r\u0306": "r", "\u0212": "R", "\u0213": "r", "\u015A": "S", "\u015B": "s", "\u015C": "S", "\u015D": "s", "\u015E": "S", "\u0218": "S", "\u0219": "s", "\u015F": "s", "\u0160": "S", "\u0161": "s", "\u0162": "T", "\u0163": "t", "\u021B": "t", "\u021A": "T", "\u0164": "T", "\u0165": "t", "\u0166": "T", "\u0167": "t", "T\u0306": "T", "t\u0306": "t", "\u0168": "U", "\u0169": "u", "\u016A": "U", "\u016B": "u", "\u016C": "U", "\u016D": "u", "\u016E": "U", "\u016F": "u", "\u0170": "U", "\u0171": "u", "\u0172": "U", "\u0173": "u", "\u0216": "U", "\u0217": "u", "V\u0306": "V", "v\u0306": "v", "\u0174": "W", "\u0175": "w", "\u1E82": "W", "\u1E83": "w", "X\u0306": "X", "x\u0306": "x", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "Y\u0306": "Y", "y\u0306": "y", "\u0179": "Z", "\u017A": "z", "\u017B": "Z", "\u017C": "z", "\u017D": "Z", "\u017E": "z", "\u017F": "s", "\u0192": "f", "\u01A0": "O", "\u01A1": "o", "\u01AF": "U", "\u01B0": "u", "\u01CD": "A", "\u01CE": "a", "\u01CF": "I", "\u01D0": "i", "\u01D1": "O", "\u01D2": "o", "\u01D3": "U", "\u01D4": "u", "\u01D5": "U", "\u01D6": "u", "\u01D7": "U", "\u01D8": "u", "\u01D9": "U", "\u01DA": "u", "\u01DB": "U", "\u01DC": "u", "\u1EE8": "U", "\u1EE9": "u", "\u1E78": "U", "\u1E79": "u", "\u01FA": "A", "\u01FB": "a", "\u01FC": "AE", "\u01FD": "ae", "\u01FE": "O", "\u01FF": "o", "\xDE": "TH", "\xFE": "th", "\u1E54": "P", "\u1E55": "p", "\u1E64": "S", "\u1E65": "s", "X\u0301": "X", "x\u0301": "x", "\u0403": "\u0413", "\u0453": "\u0433", "\u040C": "\u041A", "\u045C": "\u043A", "A\u030B": "A", "a\u030B": "a", "E\u030B": "E", "e\u030B": "e", "I\u030B": "I", "i\u030B": "i", "\u01F8": "N", "\u01F9": "n", "\u1ED2": "O", "\u1ED3": "o", "\u1E50": "O", "\u1E51": "o", "\u1EEA": "U", "\u1EEB": "u", "\u1E80": "W", "\u1E81": "w", "\u1EF2": "Y", "\u1EF3": "y", "\u0200": "A", "\u0201": "a", "\u0204": "E", "\u0205": "e", "\u0208": "I", "\u0209": "i", "\u020C": "O", "\u020D": "o", "\u0210": "R", "\u0211": "r", "\u0214": "U", "\u0215": "u", "B\u030C": "B", "b\u030C": "b", "\u010C\u0323": "C", "\u010D\u0323": "c", "\xCA\u030C": "E", "\xEA\u030C": "e", "F\u030C": "F", "f\u030C": "f", "\u01E6": "G", "\u01E7": "g", "\u021E": "H", "\u021F": "h", "J\u030C": "J", "\u01F0": "j", "\u01E8": "K", "\u01E9": "k", "M\u030C": "M", "m\u030C": "m", "P\u030C": "P", "p\u030C": "p", "Q\u030C": "Q", "q\u030C": "q", "\u0158\u0329": "R", "\u0159\u0329": "r", "\u1E66": "S", "\u1E67": "s", "V\u030C": "V", "v\u030C": "v", "W\u030C": "W", "w\u030C": "w", "X\u030C": "X", "x\u030C": "x", "Y\u030C": "Y", "y\u030C": "y", "A\u0327": "A", "a\u0327": "a", "B\u0327": "B", "b\u0327": "b", "\u1E10": "D", "\u1E11": "d", "\u0228": "E", "\u0229": "e", "\u0190\u0327": "E", "\u025B\u0327": "e", "\u1E28": "H", "\u1E29": "h", "I\u0327": "I", "i\u0327": "i", "\u0197\u0327": "I", "\u0268\u0327": "i", "M\u0327": "M", "m\u0327": "m", "O\u0327": "O", "o\u0327": "o", "Q\u0327": "Q", "q\u0327": "q", "U\u0327": "U", "u\u0327": "u", "X\u0327": "X", "x\u0327": "x", "Z\u0327": "Z", "z\u0327": "z", "\u0439": "\u0438", "\u0419": "\u0418", "\u0451": "\u0435", "\u0401": "\u0415" }; var chars = Object.keys(characterMap).join("|"); var allAccents = new RegExp(chars, "g"); var firstAccent = new RegExp(chars, ""); function matcher(match2) { return characterMap[match2]; } var removeAccents2 = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents2; module.exports.has = hasAccents; module.exports.remove = removeAccents2; } }); // package-external:@wordpress/api-fetch var require_api_fetch = __commonJS({ "package-external:@wordpress/api-fetch"(exports, module) { module.exports = window.wp.apiFetch; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // package-external:@wordpress/style-engine var require_style_engine = __commonJS({ "package-external:@wordpress/style-engine"(exports, module) { module.exports = window.wp.styleEngine; } }); // package-external:@wordpress/keycodes var require_keycodes = __commonJS({ "package-external:@wordpress/keycodes"(exports, module) { module.exports = window.wp.keycodes; } }); // package-external:@wordpress/dom var require_dom = __commonJS({ "package-external:@wordpress/dom"(exports, module) { module.exports = window.wp.dom; } }); // node_modules/diff/lib/diff/base.js var require_base = __commonJS({ "node_modules/diff/lib/diff/base.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Diff; function Diff() { } Diff.prototype = { /*istanbul ignore start*/ /*istanbul ignore end*/ diff: function diff(oldString, newString) { var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var callback = options.callback; if (typeof options === "function") { callback = options; options = {}; } this.options = options; var self = this; function done(value) { if (callback) { setTimeout(function() { callback(void 0, value); }, 0); return true; } else { return value; } } oldString = this.castInput(oldString); newString = this.castInput(newString); oldString = this.removeEmpty(this.tokenize(oldString)); newString = this.removeEmpty(this.tokenize(newString)); var newLen = newString.length, oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { return done([{ value: this.join(newString), count: newString.length }]); } function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath = ( /*istanbul ignore start*/ void 0 ); var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { bestPath[diagonalPath - 1] = void 0; } var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; if (!canAdd && !canRemove) { bestPath[diagonalPath] = void 0; continue; } if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, void 0, true); } else { basePath = addPath; basePath.newPos++; self.pushComponent(basePath.components, true, void 0); } _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); } else { bestPath[diagonalPath] = basePath; } } editLength++; } if (callback) { (function exec() { setTimeout(function() { if (editLength > maxEditLength) { return callback(); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } } }, /*istanbul ignore start*/ /*istanbul ignore end*/ pushComponent: function pushComponent(components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { components[components.length - 1] = { count: last.count + 1, added, removed }; } else { components.push({ count: 1, added, removed }); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, /*istanbul ignore start*/ /*istanbul ignore end*/ equals: function equals(left, right) { if (this.options.comparator) { return this.options.comparator(left, right); } else { return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ removeEmpty: function removeEmpty(array) { var ret = []; for (var i2 = 0; i2 < array.length; i2++) { if (array[i2]) { ret.push(array[i2]); } } return ret; }, /*istanbul ignore start*/ /*istanbul ignore end*/ castInput: function castInput(value) { return value; }, /*istanbul ignore start*/ /*istanbul ignore end*/ tokenize: function tokenize2(value) { return value.split(""); }, /*istanbul ignore start*/ /*istanbul ignore end*/ join: function join(chars) { return chars.join(""); } }; function buildValues(diff, components, newString, oldString, useLongestToken) { var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); value = value.map(function(value2, i2) { var oldValue = oldString[oldPos + i2]; return oldValue.length > value2.length ? oldValue : value2; }); component.value = diff.join(value); } else { component.value = diff.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; if (!component.added) { oldPos += component.count; } } else { component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; components[componentPos - 1] = components[componentPos]; components[componentPos] = tmp; } } } var lastComponent = components[componentLen - 1]; if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) { components[componentLen - 2].value += lastComponent.value; components.pop(); } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } } }); // node_modules/diff/lib/diff/character.js var require_character = __commonJS({ "node_modules/diff/lib/diff/character.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.diffChars = diffChars2; exports.characterDiff = void 0; var _base = _interopRequireDefault(require_base()); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var characterDiff = new /*istanbul ignore start*/ _base.default(); exports.characterDiff = characterDiff; function diffChars2(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } } }); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // node_modules/react-is/cjs/react-is.development.js var require_react_is_development = __commonJS({ "node_modules/react-is/cjs/react-is.development.js"(exports) { "use strict"; if (true) { (function() { "use strict"; var hasSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; function isValidElementType(type) { return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function typeOf(object) { if (typeof object === "object" && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return void 0; } var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element2 = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment96 = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode2 = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element2; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment96; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode2; exports.Suspense = Suspense; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } } }); // node_modules/react-is/index.js var require_react_is = __commonJS({ "node_modules/react-is/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_react_is_development(); } } }); // node_modules/object-assign/index.js var require_object_assign = __commonJS({ "node_modules/object-assign/index.js"(exports, module) { "use strict"; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === void 0) { throw new TypeError("Object.assign cannot be called with null or undefined"); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } var test1 = new String("abc"); test1[5] = "de"; if (Object.getOwnPropertyNames(test1)[0] === "5") { return false; } var test2 = {}; for (var i2 = 0; i2 < 10; i2++) { test2["_" + String.fromCharCode(i2)] = i2; } var order2 = Object.getOwnPropertyNames(test2).map(function(n2) { return test2[n2]; }); if (order2.join("") !== "0123456789") { return false; } var test3 = {}; "abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { return false; } return true; } catch (err) { return false; } } module.exports = shouldUseNative() ? Object.assign : function(target, source) { var from; var to2 = toObject(target); var symbols; for (var s2 = 1; s2 < arguments.length; s2++) { from = Object(arguments[s2]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to2[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i2 = 0; i2 < symbols.length; i2++) { if (propIsEnumerable.call(from, symbols[i2])) { to2[symbols[i2]] = from[symbols[i2]]; } } } } return to2; }; } }); // node_modules/prop-types/lib/ReactPropTypesSecret.js var require_ReactPropTypesSecret = __commonJS({ "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) { "use strict"; var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; module.exports = ReactPropTypesSecret; } }); // node_modules/prop-types/lib/has.js var require_has = __commonJS({ "node_modules/prop-types/lib/has.js"(exports, module) { module.exports = Function.call.bind(Object.prototype.hasOwnProperty); } }); // node_modules/prop-types/checkPropTypes.js var require_checkPropTypes = __commonJS({ "node_modules/prop-types/checkPropTypes.js"(exports, module) { "use strict"; var printWarning = function() { }; if (true) { ReactPropTypesSecret = require_ReactPropTypesSecret(); loggedTypeFailures = {}; has2 = require_has(); printWarning = function(text) { var message2 = "Warning: " + text; if (typeof console !== "undefined") { console.error(message2); } try { throw new Error(message2); } catch (x2) { } }; } var ReactPropTypesSecret; var loggedTypeFailures; var has2; function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (true) { for (var typeSpecName in typeSpecs) { if (has2(typeSpecs, typeSpecName)) { var error; try { if (typeof typeSpecs[typeSpecName] !== "function") { var err = Error( (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." ); err.name = "Invariant Violation"; throw err; } error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } if (error && !(error instanceof Error)) { printWarning( (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." ); } if (error instanceof Error && !(error.message in loggedTypeFailures)) { loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ""; printWarning( "Failed " + location + " type: " + error.message + (stack != null ? stack : "") ); } } } } } checkPropTypes.resetWarningCache = function() { if (true) { loggedTypeFailures = {}; } }; module.exports = checkPropTypes; } }); // node_modules/prop-types/factoryWithTypeCheckers.js var require_factoryWithTypeCheckers = __commonJS({ "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) { "use strict"; var ReactIs = require_react_is(); var assign2 = require_object_assign(); var ReactPropTypesSecret = require_ReactPropTypesSecret(); var has2 = require_has(); var checkPropTypes = require_checkPropTypes(); var printWarning = function() { }; if (true) { printWarning = function(text) { var message2 = "Warning: " + text; if (typeof console !== "undefined") { console.error(message2); } try { throw new Error(message2); } catch (x2) { } }; } function emptyFunctionThatReturnsNull() { return null; } module.exports = function(isValidElement, throwOnDirectAccess) { var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === "function") { return iteratorFn; } } var ANONYMOUS = "<>"; var ReactPropTypes = { array: createPrimitiveTypeChecker("array"), bigint: createPrimitiveTypeChecker("bigint"), bool: createPrimitiveTypeChecker("boolean"), func: createPrimitiveTypeChecker("function"), number: createPrimitiveTypeChecker("number"), object: createPrimitiveTypeChecker("object"), string: createPrimitiveTypeChecker("string"), symbol: createPrimitiveTypeChecker("symbol"), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker }; function is2(x2, y2) { if (x2 === y2) { return x2 !== 0 || 1 / x2 === 1 / y2; } else { return x2 !== x2 && y2 !== y2; } } function PropTypeError(message2, data) { this.message = message2; this.data = data && typeof data === "object" ? data : {}; this.stack = ""; } PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { if (true) { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { var err = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" ); err.name = "Invariant Violation"; throw err; } else if (typeof console !== "undefined") { var cacheKey2 = componentName + ":" + propName; if (!manualPropTypeCallCache[cacheKey2] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3) { printWarning( "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ); manualPropTypeCallCache[cacheKey2] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); } return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { var preciseType = getPreciseType(propValue); return new PropTypeError( "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType } ); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunctionThatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== "function") { return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); } for (var i2 = 0; i2 < propValue.length; i2++) { var error = typeChecker(propValue, i2, componentName, location, propFullName + "[" + i2 + "]", ReactPropTypesSecret); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); } return null; } return createChainableTypeChecker(validate); } function createElementTypeTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!ReactIs.isValidElementType(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { if (true) { if (arguments.length > 1) { printWarning( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ); } else { printWarning("Invalid argument supplied to oneOf, expected an array."); } } return emptyFunctionThatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i2 = 0; i2 < expectedValues.length; i2++) { if (is2(propValue, expectedValues[i2])) { return null; } } var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { var type = getPreciseType(value); if (type === "symbol") { return String(value); } return value; }); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== "function") { return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== "object") { return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); } for (var key in propValue) { if (has2(propValue, key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0; return emptyFunctionThatReturnsNull; } for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) { var checker = arrayOfTypeCheckers[i2]; if (typeof checker !== "function") { printWarning( "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i2 + "." ); return emptyFunctionThatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { var expectedTypes = []; for (var i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) { var checker2 = arrayOfTypeCheckers[i3]; var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret); if (checkerResult == null) { return null; } if (checkerResult.data && has2(checkerResult.data, "expectedType")) { expectedTypes.push(checkerResult.data.expectedType); } } var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); } return null; } return createChainableTypeChecker(validate); } function invalidValidatorError(componentName, location, propFullName, key, type) { return new PropTypeError( (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." ); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== "object") { return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (typeof checker !== "function") { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== "object") { return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); } var allKeys = assign2({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (has2(shapeTypes, key) && typeof checker !== "function") { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } if (!checker) { return new PropTypeError( "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ") ); } var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case "number": case "string": case "undefined": return true; case "boolean": return !propValue; case "object": if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { if (propType === "symbol") { return true; } if (!propValue) { return false; } if (propValue["@@toStringTag"] === "Symbol") { return true; } if (typeof Symbol === "function" && propValue instanceof Symbol) { return true; } return false; } function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return "array"; } if (propValue instanceof RegExp) { return "object"; } if (isSymbol(propType, propValue)) { return "symbol"; } return propType; } function getPreciseType(propValue) { if (typeof propValue === "undefined" || propValue === null) { return "" + propValue; } var propType = getPropType(propValue); if (propType === "object") { if (propValue instanceof Date) { return "date"; } else if (propValue instanceof RegExp) { return "regexp"; } } return propType; } function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case "array": case "object": return "an " + type; case "boolean": case "date": case "regexp": return "a " + type; default: return type; } } function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes; ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; } }); // node_modules/prop-types/index.js var require_prop_types = __commonJS({ "node_modules/prop-types/index.js"(exports, module) { if (true) { ReactIs = require_react_is(); throwOnDirectAccess = true; module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); } else { module.exports = null(); } var ReactIs; var throwOnDirectAccess; } }); // node_modules/autosize/dist/autosize.js var require_autosize = __commonJS({ "node_modules/autosize/dist/autosize.js"(exports, module) { (function(global, factory) { if (typeof define === "function" && define.amd) { define(["module", "exports"], factory); } else if (typeof exports !== "undefined") { factory(module, exports); } else { var mod = { exports: {} }; factory(mod, mod.exports); global.autosize = mod.exports; } })(exports, function(module2, exports2) { "use strict"; var map = typeof Map === "function" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ (function() { var keys = []; var values = []; return { has: function has2(key) { return keys.indexOf(key) > -1; }, get: function get(key) { return values[keys.indexOf(key)]; }, set: function set(key, value) { if (keys.indexOf(key) === -1) { keys.push(key); values.push(value); } }, delete: function _delete(key) { var index = keys.indexOf(key); if (index > -1) { keys.splice(index, 1); values.splice(index, 1); } } }; })(); var createEvent = function createEvent2(name) { return new Event(name, { bubbles: true }); }; try { new Event("test"); } catch (e2) { createEvent = function createEvent2(name) { var evt = document.createEvent("Event"); evt.initEvent(name, true, false); return evt; }; } function assign2(ta) { if (!ta || !ta.nodeName || ta.nodeName !== "TEXTAREA" || map.has(ta)) return; var heightOffset = null; var clientWidth = null; var cachedHeight = null; function init() { var style = window.getComputedStyle(ta, null); if (style.resize === "vertical") { ta.style.resize = "none"; } else if (style.resize === "both") { ta.style.resize = "horizontal"; } if (style.boxSizing === "content-box") { heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)); } else { heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); } if (isNaN(heightOffset)) { heightOffset = 0; } update4(); } function changeOverflow(value) { { var width = ta.style.width; ta.style.width = "0px"; ta.offsetWidth; ta.style.width = width; } ta.style.overflowY = value; } function getParentOverflows(el) { var arr = []; while (el && el.parentNode && el.parentNode instanceof Element) { if (el.parentNode.scrollTop) { arr.push({ node: el.parentNode, scrollTop: el.parentNode.scrollTop }); } el = el.parentNode; } return arr; } function resize() { if (ta.scrollHeight === 0) { return; } var overflows = getParentOverflows(ta); var docTop = document.documentElement && document.documentElement.scrollTop; ta.style.height = ""; ta.style.height = ta.scrollHeight + heightOffset + "px"; clientWidth = ta.clientWidth; overflows.forEach(function(el) { el.node.scrollTop = el.scrollTop; }); if (docTop) { document.documentElement.scrollTop = docTop; } } function update4() { resize(); var styleHeight = Math.round(parseFloat(ta.style.height)); var computed = window.getComputedStyle(ta, null); var actualHeight = computed.boxSizing === "content-box" ? Math.round(parseFloat(computed.height)) : ta.offsetHeight; if (actualHeight < styleHeight) { if (computed.overflowY === "hidden") { changeOverflow("scroll"); resize(); actualHeight = computed.boxSizing === "content-box" ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } else { if (computed.overflowY !== "hidden") { changeOverflow("hidden"); resize(); actualHeight = computed.boxSizing === "content-box" ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } if (cachedHeight !== actualHeight) { cachedHeight = actualHeight; var evt = createEvent("autosize:resized"); try { ta.dispatchEvent(evt); } catch (err) { } } } var pageResize = function pageResize2() { if (ta.clientWidth !== clientWidth) { update4(); } }; var destroy2 = function(style) { window.removeEventListener("resize", pageResize, false); ta.removeEventListener("input", update4, false); ta.removeEventListener("keyup", update4, false); ta.removeEventListener("autosize:destroy", destroy2, false); ta.removeEventListener("autosize:update", update4, false); Object.keys(style).forEach(function(key) { ta.style[key] = style[key]; }); map.delete(ta); }.bind(ta, { height: ta.style.height, resize: ta.style.resize, overflowY: ta.style.overflowY, overflowX: ta.style.overflowX, wordWrap: ta.style.wordWrap }); ta.addEventListener("autosize:destroy", destroy2, false); if ("onpropertychange" in ta && "oninput" in ta) { ta.addEventListener("keyup", update4, false); } window.addEventListener("resize", pageResize, false); ta.addEventListener("input", update4, false); ta.addEventListener("autosize:update", update4, false); ta.style.overflowX = "hidden"; ta.style.wordWrap = "break-word"; map.set(ta, { destroy: destroy2, update: update4 }); init(); } function destroy(ta) { var methods = map.get(ta); if (methods) { methods.destroy(); } } function update3(ta) { var methods = map.get(ta); if (methods) { methods.update(); } } var autosize = null; if (typeof window === "undefined" || typeof window.getComputedStyle !== "function") { autosize = function autosize2(el) { return el; }; autosize.destroy = function(el) { return el; }; autosize.update = function(el) { return el; }; } else { autosize = function autosize2(el, options) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], function(x2) { return assign2(x2, options); }); } return el; }; autosize.destroy = function(el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], destroy); } return el; }; autosize.update = function(el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], update3); } return el; }; } exports2.default = autosize; module2.exports = exports2["default"]; }); } }); // node_modules/computed-style/dist/computedStyle.commonjs.js var require_computedStyle_commonjs = __commonJS({ "node_modules/computed-style/dist/computedStyle.commonjs.js"(exports, module) { var computedStyle = function(el, prop, getComputedStyle) { getComputedStyle = window.getComputedStyle; return ( // If we have getComputedStyle (getComputedStyle ? ( // Query it // TODO: From CSS-Query notes, we might need (node, null) for FF getComputedStyle(el) ) : ( // Otherwise, we are in IE and use currentStyle el.currentStyle ))[ // Switch to camelCase for CSSOM // DEV: Grabbed from jQuery // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 prop.replace(/-(\w)/gi, function(word, letter) { return letter.toUpperCase(); }) ] ); }; module.exports = computedStyle; } }); // node_modules/line-height/lib/line-height.js var require_line_height = __commonJS({ "node_modules/line-height/lib/line-height.js"(exports, module) { var computedStyle = require_computedStyle_commonjs(); function lineHeight(node) { var lnHeightStr = computedStyle(node, "line-height"); var lnHeight = parseFloat(lnHeightStr, 10); if (lnHeightStr === lnHeight + "") { var _lnHeightStyle = node.style.lineHeight; node.style.lineHeight = lnHeightStr + "em"; lnHeightStr = computedStyle(node, "line-height"); lnHeight = parseFloat(lnHeightStr, 10); if (_lnHeightStyle) { node.style.lineHeight = _lnHeightStyle; } else { delete node.style.lineHeight; } } if (lnHeightStr.indexOf("pt") !== -1) { lnHeight *= 4; lnHeight /= 3; } else if (lnHeightStr.indexOf("mm") !== -1) { lnHeight *= 96; lnHeight /= 25.4; } else if (lnHeightStr.indexOf("cm") !== -1) { lnHeight *= 96; lnHeight /= 2.54; } else if (lnHeightStr.indexOf("in") !== -1) { lnHeight *= 96; } else if (lnHeightStr.indexOf("pc") !== -1) { lnHeight *= 16; } lnHeight = Math.round(lnHeight); if (lnHeightStr === "normal") { var nodeName = node.nodeName; var _node = document.createElement(nodeName); _node.innerHTML = " "; if (nodeName.toUpperCase() === "TEXTAREA") { _node.setAttribute("rows", "1"); } var fontSizeStr = computedStyle(node, "font-size"); _node.style.fontSize = fontSizeStr; _node.style.padding = "0px"; _node.style.border = "0px"; var body = document.body; body.appendChild(_node); var height = _node.offsetHeight; lnHeight = height; body.removeChild(_node); } return lnHeight; } module.exports = lineHeight; } }); // node_modules/react-autosize-textarea/lib/TextareaAutosize.js var require_TextareaAutosize = __commonJS({ "node_modules/react-autosize-textarea/lib/TextareaAutosize.js"(exports) { "use strict"; var __extends2 = exports && exports.__extends || (function() { var extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { d2.__proto__ = b2; } || function(d2, b2) { for (var p2 in b2) if (b2.hasOwnProperty(p2)) d2[p2] = b2[p2]; }; return function(d2, b2) { extendStatics2(d2, b2); function __214() { this.constructor = d2; } d2.prototype = b2 === null ? Object.create(b2) : (__214.prototype = b2.prototype, new __214()); }; })(); var __assign2 = exports && exports.__assign || Object.assign || function(t3) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2]; } return t3; }; var __rest = exports && exports.__rest || function(s2, e2) { var t3 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t3[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") { for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) if (e2.indexOf(p2[i2]) < 0) t3[p2[i2]] = s2[p2[i2]]; } return t3; }; exports.__esModule = true; var React4 = require_react(); var PropTypes = require_prop_types(); var autosize = require_autosize(); var _getLineHeight = require_line_height(); var getLineHeight = _getLineHeight; var RESIZED = "autosize:resized"; var TextareaAutosizeClass = ( /** @class */ (function(_super) { __extends2(TextareaAutosizeClass2, _super); function TextareaAutosizeClass2() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { lineHeight: null }; _this.textarea = null; _this.onResize = function(e2) { if (_this.props.onResize) { _this.props.onResize(e2); } }; _this.updateLineHeight = function() { if (_this.textarea) { _this.setState({ lineHeight: getLineHeight(_this.textarea) }); } }; _this.onChange = function(e2) { var onChange = _this.props.onChange; _this.currentValue = e2.currentTarget.value; onChange && onChange(e2); }; return _this; } TextareaAutosizeClass2.prototype.componentDidMount = function() { var _this = this; var _a = this.props, maxRows = _a.maxRows, async = _a.async; if (typeof maxRows === "number") { this.updateLineHeight(); } if (typeof maxRows === "number" || async) { setTimeout(function() { return _this.textarea && autosize(_this.textarea); }); } else { this.textarea && autosize(this.textarea); } if (this.textarea) { this.textarea.addEventListener(RESIZED, this.onResize); } }; TextareaAutosizeClass2.prototype.componentWillUnmount = function() { if (this.textarea) { this.textarea.removeEventListener(RESIZED, this.onResize); autosize.destroy(this.textarea); } }; TextareaAutosizeClass2.prototype.render = function() { var _this = this; var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; return React4.createElement("textarea", __assign2({}, props, { onChange: this.onChange, style: maxHeight ? __assign2({}, style, { maxHeight }) : style, ref: function(element) { _this.textarea = element; if (typeof _this.props.innerRef === "function") { _this.props.innerRef(element); } else if (_this.props.innerRef) { _this.props.innerRef.current = element; } } }), children); }; TextareaAutosizeClass2.prototype.componentDidUpdate = function() { this.textarea && autosize.update(this.textarea); }; TextareaAutosizeClass2.defaultProps = { rows: 1, async: false }; TextareaAutosizeClass2.propTypes = { rows: PropTypes.number, maxRows: PropTypes.number, onResize: PropTypes.func, innerRef: PropTypes.any, async: PropTypes.bool }; return TextareaAutosizeClass2; })(React4.Component) ); exports.TextareaAutosize = React4.forwardRef(function(props, ref) { return React4.createElement(TextareaAutosizeClass, __assign2({}, props, { innerRef: ref })); }); } }); // node_modules/react-autosize-textarea/lib/index.js var require_lib = __commonJS({ "node_modules/react-autosize-textarea/lib/index.js"(exports) { "use strict"; exports.__esModule = true; var TextareaAutosize_1 = require_TextareaAutosize(); exports["default"] = TextareaAutosize_1.TextareaAutosize; } }); // package-external:@wordpress/warning var require_warning = __commonJS({ "package-external:@wordpress/warning"(exports, module) { module.exports = window.wp.warning; } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // package-external:@wordpress/blob var require_blob = __commonJS({ "package-external:@wordpress/blob"(exports, module) { module.exports = window.wp.blob; } }); // package-external:@wordpress/keyboard-shortcuts var require_keyboard_shortcuts = __commonJS({ "package-external:@wordpress/keyboard-shortcuts"(exports, module) { module.exports = window.wp.keyboardShortcuts; } }); // (disabled):node_modules/postcss/node_modules/source-map-js/source-map.js var require_source_map = __commonJS({ "(disabled):node_modules/postcss/node_modules/source-map-js/source-map.js"() { } }); // (disabled):path var require_path = __commonJS({ "(disabled):path"() { } }); // (disabled):node_modules/url/url.js var require_url2 = __commonJS({ "(disabled):node_modules/url/url.js"() { } }); // node_modules/nanoid/non-secure/index.cjs var require_non_secure = __commonJS({ "node_modules/nanoid/non-secure/index.cjs"(exports, module) { var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; var customAlphabet = (alphabet, defaultSize = 21) => { return (size = defaultSize) => { let id = ""; let i2 = size | 0; while (i2--) { id += alphabet[Math.random() * alphabet.length | 0]; } return id; }; }; var nanoid = (size = 21) => { let id = ""; let i2 = size | 0; while (i2--) { id += urlAlphabet[Math.random() * 64 | 0]; } return id; }; module.exports = { nanoid, customAlphabet }; } }); // (disabled):node_modules/postcss/lib/terminal-highlight var require_terminal_highlight = __commonJS({ "(disabled):node_modules/postcss/lib/terminal-highlight"() { } }); // node_modules/picocolors/picocolors.browser.js var require_picocolors_browser = __commonJS({ "node_modules/picocolors/picocolors.browser.js"(exports, module) { var x2 = String; var create6 = function() { return { isColorSupported: false, reset: x2, bold: x2, dim: x2, italic: x2, underline: x2, inverse: x2, hidden: x2, strikethrough: x2, black: x2, red: x2, green: x2, yellow: x2, blue: x2, magenta: x2, cyan: x2, white: x2, gray: x2, bgBlack: x2, bgRed: x2, bgGreen: x2, bgYellow: x2, bgBlue: x2, bgMagenta: x2, bgCyan: x2, bgWhite: x2, blackBright: x2, redBright: x2, greenBright: x2, yellowBright: x2, blueBright: x2, magentaBright: x2, cyanBright: x2, whiteBright: x2, bgBlackBright: x2, bgRedBright: x2, bgGreenBright: x2, bgYellowBright: x2, bgBlueBright: x2, bgMagentaBright: x2, bgCyanBright: x2, bgWhiteBright: x2 }; }; module.exports = create6(); module.exports.createColors = create6; } }); // node_modules/postcss/lib/css-syntax-error.js var require_css_syntax_error = __commonJS({ "node_modules/postcss/lib/css-syntax-error.js"(exports, module) { "use strict"; var pico = require_picocolors_browser(); var terminalHighlight = require_terminal_highlight(); var CssSyntaxError2 = class _CssSyntaxError extends Error { constructor(message2, line, column, source, file, plugin) { super(message2); this.name = "CssSyntaxError"; this.reason = message2; if (file) { this.file = file; } if (source) { this.source = source; } if (plugin) { this.plugin = plugin; } if (typeof line !== "undefined" && typeof column !== "undefined") { if (typeof line === "number") { this.line = line; this.column = column; } else { this.line = line.line; this.column = line.column; this.endLine = column.line; this.endColumn = column.column; } } this.setMessage(); if (Error.captureStackTrace) { Error.captureStackTrace(this, _CssSyntaxError); } } setMessage() { this.message = this.plugin ? this.plugin + ": " : ""; this.message += this.file ? this.file : ""; if (typeof this.line !== "undefined") { this.message += ":" + this.line + ":" + this.column; } this.message += ": " + this.reason; } showSourceCode(color) { if (!this.source) return ""; let css = this.source; if (color == null) color = pico.isColorSupported; if (terminalHighlight) { if (color) css = terminalHighlight(css); } let lines = css.split(/\r?\n/); let start2 = Math.max(this.line - 3, 0); let end = Math.min(this.line + 2, lines.length); let maxWidth = String(end).length; let mark, aside; if (color) { let { bold, gray, red } = pico.createColors(true); mark = (text) => bold(red(text)); aside = (text) => gray(text); } else { mark = aside = (str) => str; } return lines.slice(start2, end).map((line, index) => { let number = start2 + 1 + index; let gutter = " " + (" " + number).slice(-maxWidth) + " | "; if (number === this.line) { let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, this.column - 1).replace(/[^\t]/g, " "); return mark(">") + aside(gutter) + line + "\n " + spacing + mark("^"); } return " " + aside(gutter) + line; }).join("\n"); } toString() { let code = this.showSourceCode(); if (code) { code = "\n\n" + code + "\n"; } return this.name + ": " + this.message + code; } }; module.exports = CssSyntaxError2; CssSyntaxError2.default = CssSyntaxError2; } }); // (disabled):fs var require_fs = __commonJS({ "(disabled):fs"() { } }); // node_modules/postcss/lib/previous-map.js var require_previous_map = __commonJS({ "node_modules/postcss/lib/previous-map.js"(exports, module) { "use strict"; var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); var { existsSync, readFileSync } = require_fs(); var { dirname, join } = require_path(); function fromBase64(str) { if (Buffer) { return Buffer.from(str, "base64").toString(); } else { return window.atob(str); } } var PreviousMap = class { constructor(css, opts) { if (opts.map === false) return; this.loadAnnotation(css); this.inline = this.startWith(this.annotation, "data:"); let prev = opts.map ? opts.map.prev : void 0; let text = this.loadMap(opts.from, prev); if (!this.mapFile && opts.from) { this.mapFile = opts.from; } if (this.mapFile) this.root = dirname(this.mapFile); if (text) this.text = text; } consumer() { if (!this.consumerCache) { this.consumerCache = new SourceMapConsumer(this.text); } return this.consumerCache; } decodeInline(text) { let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/; let baseUri = /^data:application\/json;base64,/; let charsetUri = /^data:application\/json;charset=utf-?8,/; let uri = /^data:application\/json,/; if (charsetUri.test(text) || uri.test(text)) { return decodeURIComponent(text.substr(RegExp.lastMatch.length)); } if (baseCharsetUri.test(text) || baseUri.test(text)) { return fromBase64(text.substr(RegExp.lastMatch.length)); } let encoding = text.match(/data:application\/json;([^,]+),/)[1]; throw new Error("Unsupported source map encoding " + encoding); } getAnnotationURL(sourceMapString) { return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, "").trim(); } isMap(map) { if (typeof map !== "object") return false; return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections); } loadAnnotation(css) { let comments = css.match(/\/\*\s*# sourceMappingURL=/gm); if (!comments) return; let start2 = css.lastIndexOf(comments.pop()); let end = css.indexOf("*/", start2); if (start2 > -1 && end > -1) { this.annotation = this.getAnnotationURL(css.substring(start2, end)); } } loadFile(path) { this.root = dirname(path); if (existsSync(path)) { this.mapFile = path; return readFileSync(path, "utf-8").toString().trim(); } } loadMap(file, prev) { if (prev === false) return false; if (prev) { if (typeof prev === "string") { return prev; } else if (typeof prev === "function") { let prevPath = prev(file); if (prevPath) { let map = this.loadFile(prevPath); if (!map) { throw new Error( "Unable to load previous source map: " + prevPath.toString() ); } return map; } } else if (prev instanceof SourceMapConsumer) { return SourceMapGenerator.fromSourceMap(prev).toString(); } else if (prev instanceof SourceMapGenerator) { return prev.toString(); } else if (this.isMap(prev)) { return JSON.stringify(prev); } else { throw new Error( "Unsupported previous source map format: " + prev.toString() ); } } else if (this.inline) { return this.decodeInline(this.annotation); } else if (this.annotation) { let map = this.annotation; if (file) map = join(dirname(file), map); return this.loadFile(map); } } startWith(string, start2) { if (!string) return false; return string.substr(0, start2.length) === start2; } withContent() { return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0); } }; module.exports = PreviousMap; PreviousMap.default = PreviousMap; } }); // node_modules/postcss/lib/input.js var require_input = __commonJS({ "node_modules/postcss/lib/input.js"(exports, module) { "use strict"; var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); var { fileURLToPath, pathToFileURL } = require_url2(); var { isAbsolute, resolve } = require_path(); var { nanoid } = require_non_secure(); var terminalHighlight = require_terminal_highlight(); var CssSyntaxError2 = require_css_syntax_error(); var PreviousMap = require_previous_map(); var fromOffsetCache = Symbol("fromOffsetCache"); var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); var pathAvailable = Boolean(resolve && isAbsolute); var Input = class { constructor(css, opts = {}) { if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) { throw new Error(`PostCSS received ${css} instead of CSS string`); } this.css = css.toString(); if (this.css[0] === "\uFEFF" || this.css[0] === "\uFFFE") { this.hasBOM = true; this.css = this.css.slice(1); } else { this.hasBOM = false; } if (opts.from) { if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) { this.file = opts.from; } else { this.file = resolve(opts.from); } } if (pathAvailable && sourceMapAvailable) { let map = new PreviousMap(this.css, opts); if (map.text) { this.map = map; let file = map.consumer().file; if (!this.file && file) this.file = this.mapResolve(file); } } if (!this.file) { this.id = ""; } if (this.map) this.map.file = this.from; } error(message2, line, column, opts = {}) { let result, endLine, endColumn; if (line && typeof line === "object") { let start2 = line; let end = column; if (typeof start2.offset === "number") { let pos = this.fromOffset(start2.offset); line = pos.line; column = pos.col; } else { line = start2.line; column = start2.column; } if (typeof end.offset === "number") { let pos = this.fromOffset(end.offset); endLine = pos.line; endColumn = pos.col; } else { endLine = end.line; endColumn = end.column; } } else if (!column) { let pos = this.fromOffset(line); line = pos.line; column = pos.col; } let origin = this.origin(line, column, endLine, endColumn); if (origin) { result = new CssSyntaxError2( message2, origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line }, origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine }, origin.source, origin.file, opts.plugin ); } else { result = new CssSyntaxError2( message2, endLine === void 0 ? line : { column, line }, endLine === void 0 ? column : { column: endColumn, line: endLine }, this.css, this.file, opts.plugin ); } result.input = { column, endColumn, endLine, line, source: this.css }; if (this.file) { if (pathToFileURL) { result.input.url = pathToFileURL(this.file).toString(); } result.input.file = this.file; } return result; } fromOffset(offset) { let lastLine, lineToIndex; if (!this[fromOffsetCache]) { let lines = this.css.split("\n"); lineToIndex = new Array(lines.length); let prevIndex = 0; for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) { lineToIndex[i2] = prevIndex; prevIndex += lines[i2].length + 1; } this[fromOffsetCache] = lineToIndex; } else { lineToIndex = this[fromOffsetCache]; } lastLine = lineToIndex[lineToIndex.length - 1]; let min = 0; if (offset >= lastLine) { min = lineToIndex.length - 1; } else { let max = lineToIndex.length - 2; let mid; while (min < max) { mid = min + (max - min >> 1); if (offset < lineToIndex[mid]) { max = mid - 1; } else if (offset >= lineToIndex[mid + 1]) { min = mid + 1; } else { min = mid; break; } } } return { col: offset - lineToIndex[min] + 1, line: min + 1 }; } mapResolve(file) { if (/^\w+:\/\//.test(file)) { return file; } return resolve(this.map.consumer().sourceRoot || this.map.root || ".", file); } origin(line, column, endLine, endColumn) { if (!this.map) return false; let consumer = this.map.consumer(); let from = consumer.originalPositionFor({ column, line }); if (!from.source) return false; let to2; if (typeof endLine === "number") { to2 = consumer.originalPositionFor({ column: endColumn, line: endLine }); } let fromUrl; if (isAbsolute(from.source)) { fromUrl = pathToFileURL(from.source); } else { fromUrl = new URL( from.source, this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) ); } let result = { column: from.column, endColumn: to2 && to2.column, endLine: to2 && to2.line, line: from.line, url: fromUrl.toString() }; if (fromUrl.protocol === "file:") { if (fileURLToPath) { result.file = fileURLToPath(fromUrl); } else { throw new Error(`file: protocol is not available in this PostCSS build`); } } let source = consumer.sourceContentFor(from.source); if (source) result.source = source; return result; } toJSON() { let json = {}; for (let name of ["hasBOM", "css", "file", "id"]) { if (this[name] != null) { json[name] = this[name]; } } if (this.map) { json.map = { ...this.map }; if (json.map.consumerCache) { json.map.consumerCache = void 0; } } return json; } get from() { return this.file || this.id; } }; module.exports = Input; Input.default = Input; if (terminalHighlight && terminalHighlight.registerInput) { terminalHighlight.registerInput(Input); } } }); // node_modules/postcss/lib/map-generator.js var require_map_generator = __commonJS({ "node_modules/postcss/lib/map-generator.js"(exports, module) { "use strict"; var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); var { dirname, relative, resolve, sep } = require_path(); var { pathToFileURL } = require_url2(); var Input = require_input(); var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); var pathAvailable = Boolean(dirname && resolve && relative && sep); var MapGenerator = class { constructor(stringify2, root, opts, cssString) { this.stringify = stringify2; this.mapOpts = opts.map || {}; this.root = root; this.opts = opts; this.css = cssString; this.originalCSS = cssString; this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute; this.memoizedFileURLs = /* @__PURE__ */ new Map(); this.memoizedPaths = /* @__PURE__ */ new Map(); this.memoizedURLs = /* @__PURE__ */ new Map(); } addAnnotation() { let content; if (this.isInline()) { content = "data:application/json;base64," + this.toBase64(this.map.toString()); } else if (typeof this.mapOpts.annotation === "string") { content = this.mapOpts.annotation; } else if (typeof this.mapOpts.annotation === "function") { content = this.mapOpts.annotation(this.opts.to, this.root); } else { content = this.outputFile() + ".map"; } let eol = "\n"; if (this.css.includes("\r\n")) eol = "\r\n"; this.css += eol + "/*# sourceMappingURL=" + content + " */"; } applyPrevMaps() { for (let prev of this.previous()) { let from = this.toUrl(this.path(prev.file)); let root = prev.root || dirname(prev.file); let map; if (this.mapOpts.sourcesContent === false) { map = new SourceMapConsumer(prev.text); if (map.sourcesContent) { map.sourcesContent = null; } } else { map = prev.consumer(); } this.map.applySourceMap(map, from, this.toUrl(this.path(root))); } } clearAnnotation() { if (this.mapOpts.annotation === false) return; if (this.root) { let node; for (let i2 = this.root.nodes.length - 1; i2 >= 0; i2--) { node = this.root.nodes[i2]; if (node.type !== "comment") continue; if (node.text.indexOf("# sourceMappingURL=") === 0) { this.root.removeChild(i2); } } } else if (this.css) { this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, ""); } } generate() { this.clearAnnotation(); if (pathAvailable && sourceMapAvailable && this.isMap()) { return this.generateMap(); } else { let result = ""; this.stringify(this.root, (i2) => { result += i2; }); return [result]; } } generateMap() { if (this.root) { this.generateString(); } else if (this.previous().length === 1) { let prev = this.previous()[0].consumer(); prev.file = this.outputFile(); this.map = SourceMapGenerator.fromSourceMap(prev, { ignoreInvalidMapping: true }); } else { this.map = new SourceMapGenerator({ file: this.outputFile(), ignoreInvalidMapping: true }); this.map.addMapping({ generated: { column: 0, line: 1 }, original: { column: 0, line: 1 }, source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "" }); } if (this.isSourcesContent()) this.setSourcesContent(); if (this.root && this.previous().length > 0) this.applyPrevMaps(); if (this.isAnnotation()) this.addAnnotation(); if (this.isInline()) { return [this.css]; } else { return [this.css, this.map]; } } generateString() { this.css = ""; this.map = new SourceMapGenerator({ file: this.outputFile(), ignoreInvalidMapping: true }); let line = 1; let column = 1; let noSource = ""; let mapping = { generated: { column: 0, line: 0 }, original: { column: 0, line: 0 }, source: "" }; let lines, last; this.stringify(this.root, (str, node, type) => { this.css += str; if (node && type !== "end") { mapping.generated.line = line; mapping.generated.column = column - 1; if (node.source && node.source.start) { mapping.source = this.sourcePath(node); mapping.original.line = node.source.start.line; mapping.original.column = node.source.start.column - 1; this.map.addMapping(mapping); } else { mapping.source = noSource; mapping.original.line = 1; mapping.original.column = 0; this.map.addMapping(mapping); } } lines = str.match(/\n/g); if (lines) { line += lines.length; last = str.lastIndexOf("\n"); column = str.length - last; } else { column += str.length; } if (node && type !== "start") { let p2 = node.parent || { raws: {} }; let childless = node.type === "decl" || node.type === "atrule" && !node.nodes; if (!childless || node !== p2.last || p2.raws.semicolon) { if (node.source && node.source.end) { mapping.source = this.sourcePath(node); mapping.original.line = node.source.end.line; mapping.original.column = node.source.end.column - 1; mapping.generated.line = line; mapping.generated.column = column - 2; this.map.addMapping(mapping); } else { mapping.source = noSource; mapping.original.line = 1; mapping.original.column = 0; mapping.generated.line = line; mapping.generated.column = column - 1; this.map.addMapping(mapping); } } } }); } isAnnotation() { if (this.isInline()) { return true; } if (typeof this.mapOpts.annotation !== "undefined") { return this.mapOpts.annotation; } if (this.previous().length) { return this.previous().some((i2) => i2.annotation); } return true; } isInline() { if (typeof this.mapOpts.inline !== "undefined") { return this.mapOpts.inline; } let annotation = this.mapOpts.annotation; if (typeof annotation !== "undefined" && annotation !== true) { return false; } if (this.previous().length) { return this.previous().some((i2) => i2.inline); } return true; } isMap() { if (typeof this.opts.map !== "undefined") { return !!this.opts.map; } return this.previous().length > 0; } isSourcesContent() { if (typeof this.mapOpts.sourcesContent !== "undefined") { return this.mapOpts.sourcesContent; } if (this.previous().length) { return this.previous().some((i2) => i2.withContent()); } return true; } outputFile() { if (this.opts.to) { return this.path(this.opts.to); } else if (this.opts.from) { return this.path(this.opts.from); } else { return "to.css"; } } path(file) { if (this.mapOpts.absolute) return file; if (file.charCodeAt(0) === 60) return file; if (/^\w+:\/\//.test(file)) return file; let cached = this.memoizedPaths.get(file); if (cached) return cached; let from = this.opts.to ? dirname(this.opts.to) : "."; if (typeof this.mapOpts.annotation === "string") { from = dirname(resolve(from, this.mapOpts.annotation)); } let path = relative(from, file); this.memoizedPaths.set(file, path); return path; } previous() { if (!this.previousMaps) { this.previousMaps = []; if (this.root) { this.root.walk((node) => { if (node.source && node.source.input.map) { let map = node.source.input.map; if (!this.previousMaps.includes(map)) { this.previousMaps.push(map); } } }); } else { let input = new Input(this.originalCSS, this.opts); if (input.map) this.previousMaps.push(input.map); } } return this.previousMaps; } setSourcesContent() { let already = {}; if (this.root) { this.root.walk((node) => { if (node.source) { let from = node.source.input.from; if (from && !already[from]) { already[from] = true; let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from)); this.map.setSourceContent(fromUrl, node.source.input.css); } } }); } else if (this.css) { let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : ""; this.map.setSourceContent(from, this.css); } } sourcePath(node) { if (this.mapOpts.from) { return this.toUrl(this.mapOpts.from); } else if (this.usesFileUrls) { return this.toFileUrl(node.source.input.from); } else { return this.toUrl(this.path(node.source.input.from)); } } toBase64(str) { if (Buffer) { return Buffer.from(str).toString("base64"); } else { return window.btoa(unescape(encodeURIComponent(str))); } } toFileUrl(path) { let cached = this.memoizedFileURLs.get(path); if (cached) return cached; if (pathToFileURL) { let fileURL = pathToFileURL(path).toString(); this.memoizedFileURLs.set(path, fileURL); return fileURL; } else { throw new Error( "`map.absolute` option is not available in this PostCSS build" ); } } toUrl(path) { let cached = this.memoizedURLs.get(path); if (cached) return cached; if (sep === "\\") { path = path.replace(/\\/g, "/"); } let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent); this.memoizedURLs.set(path, url); return url; } }; module.exports = MapGenerator; } }); // node_modules/postcss/lib/stringifier.js var require_stringifier = __commonJS({ "node_modules/postcss/lib/stringifier.js"(exports, module) { "use strict"; var DEFAULT_RAW = { after: "\n", beforeClose: "\n", beforeComment: "\n", beforeDecl: "\n", beforeOpen: " ", beforeRule: "\n", colon: ": ", commentLeft: " ", commentRight: " ", emptyBody: "", indent: " ", semicolon: false }; function capitalize(str) { return str[0].toUpperCase() + str.slice(1); } var Stringifier = class { constructor(builder) { this.builder = builder; } atrule(node, semicolon) { let name = "@" + node.name; let params = node.params ? this.rawValue(node, "params") : ""; if (typeof node.raws.afterName !== "undefined") { name += node.raws.afterName; } else if (params) { name += " "; } if (node.nodes) { this.block(node, name + params); } else { let end = (node.raws.between || "") + (semicolon ? ";" : ""); this.builder(name + params + end, node); } } beforeAfter(node, detect) { let value; if (node.type === "decl") { value = this.raw(node, null, "beforeDecl"); } else if (node.type === "comment") { value = this.raw(node, null, "beforeComment"); } else if (detect === "before") { value = this.raw(node, null, "beforeRule"); } else { value = this.raw(node, null, "beforeClose"); } let buf = node.parent; let depth = 0; while (buf && buf.type !== "root") { depth += 1; buf = buf.parent; } if (value.includes("\n")) { let indent = this.raw(node, null, "indent"); if (indent.length) { for (let step = 0; step < depth; step++) value += indent; } } return value; } block(node, start2) { let between = this.raw(node, "between", "beforeOpen"); this.builder(start2 + between + "{", node, "start"); let after; if (node.nodes && node.nodes.length) { this.body(node); after = this.raw(node, "after"); } else { after = this.raw(node, "after", "emptyBody"); } if (after) this.builder(after); this.builder("}", node, "end"); } body(node) { let last = node.nodes.length - 1; while (last > 0) { if (node.nodes[last].type !== "comment") break; last -= 1; } let semicolon = this.raw(node, "semicolon"); for (let i2 = 0; i2 < node.nodes.length; i2++) { let child = node.nodes[i2]; let before = this.raw(child, "before"); if (before) this.builder(before); this.stringify(child, last !== i2 || semicolon); } } comment(node) { let left = this.raw(node, "left", "commentLeft"); let right = this.raw(node, "right", "commentRight"); this.builder("/*" + left + node.text + right + "*/", node); } decl(node, semicolon) { let between = this.raw(node, "between", "colon"); let string = node.prop + between + this.rawValue(node, "value"); if (node.important) { string += node.raws.important || " !important"; } if (semicolon) string += ";"; this.builder(string, node); } document(node) { this.body(node); } raw(node, own, detect) { let value; if (!detect) detect = own; if (own) { value = node.raws[own]; if (typeof value !== "undefined") return value; } let parent = node.parent; if (detect === "before") { if (!parent || parent.type === "root" && parent.first === node) { return ""; } if (parent && parent.type === "document") { return ""; } } if (!parent) return DEFAULT_RAW[detect]; let root = node.root(); if (!root.rawCache) root.rawCache = {}; if (typeof root.rawCache[detect] !== "undefined") { return root.rawCache[detect]; } if (detect === "before" || detect === "after") { return this.beforeAfter(node, detect); } else { let method = "raw" + capitalize(detect); if (this[method]) { value = this[method](root, node); } else { root.walk((i2) => { value = i2.raws[own]; if (typeof value !== "undefined") return false; }); } } if (typeof value === "undefined") value = DEFAULT_RAW[detect]; root.rawCache[detect] = value; return value; } rawBeforeClose(root) { let value; root.walk((i2) => { if (i2.nodes && i2.nodes.length > 0) { if (typeof i2.raws.after !== "undefined") { value = i2.raws.after; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } } }); if (value) value = value.replace(/\S/g, ""); return value; } rawBeforeComment(root, node) { let value; root.walkComments((i2) => { if (typeof i2.raws.before !== "undefined") { value = i2.raws.before; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } }); if (typeof value === "undefined") { value = this.raw(node, null, "beforeDecl"); } else if (value) { value = value.replace(/\S/g, ""); } return value; } rawBeforeDecl(root, node) { let value; root.walkDecls((i2) => { if (typeof i2.raws.before !== "undefined") { value = i2.raws.before; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } }); if (typeof value === "undefined") { value = this.raw(node, null, "beforeRule"); } else if (value) { value = value.replace(/\S/g, ""); } return value; } rawBeforeOpen(root) { let value; root.walk((i2) => { if (i2.type !== "decl") { value = i2.raws.between; if (typeof value !== "undefined") return false; } }); return value; } rawBeforeRule(root) { let value; root.walk((i2) => { if (i2.nodes && (i2.parent !== root || root.first !== i2)) { if (typeof i2.raws.before !== "undefined") { value = i2.raws.before; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } } }); if (value) value = value.replace(/\S/g, ""); return value; } rawColon(root) { let value; root.walkDecls((i2) => { if (typeof i2.raws.between !== "undefined") { value = i2.raws.between.replace(/[^\s:]/g, ""); return false; } }); return value; } rawEmptyBody(root) { let value; root.walk((i2) => { if (i2.nodes && i2.nodes.length === 0) { value = i2.raws.after; if (typeof value !== "undefined") return false; } }); return value; } rawIndent(root) { if (root.raws.indent) return root.raws.indent; let value; root.walk((i2) => { let p2 = i2.parent; if (p2 && p2 !== root && p2.parent && p2.parent === root) { if (typeof i2.raws.before !== "undefined") { let parts = i2.raws.before.split("\n"); value = parts[parts.length - 1]; value = value.replace(/\S/g, ""); return false; } } }); return value; } rawSemicolon(root) { let value; root.walk((i2) => { if (i2.nodes && i2.nodes.length && i2.last.type === "decl") { value = i2.raws.semicolon; if (typeof value !== "undefined") return false; } }); return value; } rawValue(node, prop) { let value = node[prop]; let raw = node.raws[prop]; if (raw && raw.value === value) { return raw.raw; } return value; } root(node) { this.body(node); if (node.raws.after) this.builder(node.raws.after); } rule(node) { this.block(node, this.rawValue(node, "selector")); if (node.raws.ownSemicolon) { this.builder(node.raws.ownSemicolon, node, "end"); } } stringify(node, semicolon) { if (!this[node.type]) { throw new Error( "Unknown AST node type " + node.type + ". Maybe you need to change PostCSS stringifier." ); } this[node.type](node, semicolon); } }; module.exports = Stringifier; Stringifier.default = Stringifier; } }); // node_modules/postcss/lib/stringify.js var require_stringify = __commonJS({ "node_modules/postcss/lib/stringify.js"(exports, module) { "use strict"; var Stringifier = require_stringifier(); function stringify2(node, builder) { let str = new Stringifier(builder); str.stringify(node); } module.exports = stringify2; stringify2.default = stringify2; } }); // node_modules/postcss/lib/warn-once.js var require_warn_once = __commonJS({ "node_modules/postcss/lib/warn-once.js"(exports, module) { "use strict"; var printed = {}; module.exports = function warnOnce(message2) { if (printed[message2]) return; printed[message2] = true; if (typeof console !== "undefined" && console.warn) { console.warn(message2); } }; } }); // node_modules/postcss/lib/symbols.js var require_symbols = __commonJS({ "node_modules/postcss/lib/symbols.js"(exports, module) { "use strict"; module.exports.isClean = Symbol("isClean"); module.exports.my = Symbol("my"); } }); // node_modules/postcss/lib/node.js var require_node = __commonJS({ "node_modules/postcss/lib/node.js"(exports, module) { "use strict"; var { isClean, my } = require_symbols(); var CssSyntaxError2 = require_css_syntax_error(); var Stringifier = require_stringifier(); var stringify2 = require_stringify(); function cloneNode(obj, parent) { let cloned = new obj.constructor(); for (let i2 in obj) { if (!Object.prototype.hasOwnProperty.call(obj, i2)) { continue; } if (i2 === "proxyCache") continue; let value = obj[i2]; let type = typeof value; if (i2 === "parent" && type === "object") { if (parent) cloned[i2] = parent; } else if (i2 === "source") { cloned[i2] = value; } else if (Array.isArray(value)) { cloned[i2] = value.map((j2) => cloneNode(j2, cloned)); } else { if (type === "object" && value !== null) value = cloneNode(value); cloned[i2] = value; } } return cloned; } var Node = class { constructor(defaults2 = {}) { this.raws = {}; this[isClean] = false; this[my] = true; for (let name in defaults2) { if (name === "nodes") { this.nodes = []; for (let node of defaults2[name]) { if (typeof node.clone === "function") { this.append(node.clone()); } else { this.append(node); } } } else { this[name] = defaults2[name]; } } } addToError(error) { error.postcssNode = this; if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { let s2 = this.source; error.stack = error.stack.replace( /\n\s{4}at /, `$&${s2.input.from}:${s2.start.line}:${s2.start.column}$&` ); } return error; } after(add2) { this.parent.insertAfter(this, add2); return this; } assign(overrides = {}) { for (let name in overrides) { this[name] = overrides[name]; } return this; } before(add2) { this.parent.insertBefore(this, add2); return this; } cleanRaws(keepBetween) { delete this.raws.before; delete this.raws.after; if (!keepBetween) delete this.raws.between; } clone(overrides = {}) { let cloned = cloneNode(this); for (let name in overrides) { cloned[name] = overrides[name]; } return cloned; } cloneAfter(overrides = {}) { let cloned = this.clone(overrides); this.parent.insertAfter(this, cloned); return cloned; } cloneBefore(overrides = {}) { let cloned = this.clone(overrides); this.parent.insertBefore(this, cloned); return cloned; } error(message2, opts = {}) { if (this.source) { let { end, start: start2 } = this.rangeBy(opts); return this.source.input.error( message2, { column: start2.column, line: start2.line }, { column: end.column, line: end.line }, opts ); } return new CssSyntaxError2(message2); } getProxyProcessor() { return { get(node, prop) { if (prop === "proxyOf") { return node; } else if (prop === "root") { return () => node.root().toProxy(); } else { return node[prop]; } }, set(node, prop, value) { if (node[prop] === value) return true; node[prop] = value; if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */ prop === "text") { node.markDirty(); } return true; } }; } markDirty() { if (this[isClean]) { this[isClean] = false; let next = this; while (next = next.parent) { next[isClean] = false; } } } next() { if (!this.parent) return void 0; let index = this.parent.index(this); return this.parent.nodes[index + 1]; } positionBy(opts, stringRepresentation) { let pos = this.source.start; if (opts.index) { pos = this.positionInside(opts.index, stringRepresentation); } else if (opts.word) { stringRepresentation = this.toString(); let index = stringRepresentation.indexOf(opts.word); if (index !== -1) pos = this.positionInside(index, stringRepresentation); } return pos; } positionInside(index, stringRepresentation) { let string = stringRepresentation || this.toString(); let column = this.source.start.column; let line = this.source.start.line; for (let i2 = 0; i2 < index; i2++) { if (string[i2] === "\n") { column = 1; line += 1; } else { column += 1; } } return { column, line }; } prev() { if (!this.parent) return void 0; let index = this.parent.index(this); return this.parent.nodes[index - 1]; } rangeBy(opts) { let start2 = { column: this.source.start.column, line: this.source.start.line }; let end = this.source.end ? { column: this.source.end.column + 1, line: this.source.end.line } : { column: start2.column + 1, line: start2.line }; if (opts.word) { let stringRepresentation = this.toString(); let index = stringRepresentation.indexOf(opts.word); if (index !== -1) { start2 = this.positionInside(index, stringRepresentation); end = this.positionInside(index + opts.word.length, stringRepresentation); } } else { if (opts.start) { start2 = { column: opts.start.column, line: opts.start.line }; } else if (opts.index) { start2 = this.positionInside(opts.index); } if (opts.end) { end = { column: opts.end.column, line: opts.end.line }; } else if (typeof opts.endIndex === "number") { end = this.positionInside(opts.endIndex); } else if (opts.index) { end = this.positionInside(opts.index + 1); } } if (end.line < start2.line || end.line === start2.line && end.column <= start2.column) { end = { column: start2.column + 1, line: start2.line }; } return { end, start: start2 }; } raw(prop, defaultType) { let str = new Stringifier(); return str.raw(this, prop, defaultType); } remove() { if (this.parent) { this.parent.removeChild(this); } this.parent = void 0; return this; } replaceWith(...nodes) { if (this.parent) { let bookmark = this; let foundSelf = false; for (let node of nodes) { if (node === this) { foundSelf = true; } else if (foundSelf) { this.parent.insertAfter(bookmark, node); bookmark = node; } else { this.parent.insertBefore(bookmark, node); } } if (!foundSelf) { this.remove(); } } return this; } root() { let result = this; while (result.parent && result.parent.type !== "document") { result = result.parent; } return result; } toJSON(_, inputs) { let fixed = {}; let emitInputs = inputs == null; inputs = inputs || /* @__PURE__ */ new Map(); let inputsNextIndex = 0; for (let name in this) { if (!Object.prototype.hasOwnProperty.call(this, name)) { continue; } if (name === "parent" || name === "proxyCache") continue; let value = this[name]; if (Array.isArray(value)) { fixed[name] = value.map((i2) => { if (typeof i2 === "object" && i2.toJSON) { return i2.toJSON(null, inputs); } else { return i2; } }); } else if (typeof value === "object" && value.toJSON) { fixed[name] = value.toJSON(null, inputs); } else if (name === "source") { let inputId = inputs.get(value.input); if (inputId == null) { inputId = inputsNextIndex; inputs.set(value.input, inputsNextIndex); inputsNextIndex++; } fixed[name] = { end: value.end, inputId, start: value.start }; } else { fixed[name] = value; } } if (emitInputs) { fixed.inputs = [...inputs.keys()].map((input) => input.toJSON()); } return fixed; } toProxy() { if (!this.proxyCache) { this.proxyCache = new Proxy(this, this.getProxyProcessor()); } return this.proxyCache; } toString(stringifier = stringify2) { if (stringifier.stringify) stringifier = stringifier.stringify; let result = ""; stringifier(this, (i2) => { result += i2; }); return result; } warn(result, text, opts) { let data = { node: this }; for (let i2 in opts) data[i2] = opts[i2]; return result.warn(text, data); } get proxyOf() { return this; } }; module.exports = Node; Node.default = Node; } }); // node_modules/postcss/lib/declaration.js var require_declaration = __commonJS({ "node_modules/postcss/lib/declaration.js"(exports, module) { "use strict"; var Node = require_node(); var Declaration = class extends Node { constructor(defaults2) { if (defaults2 && typeof defaults2.value !== "undefined" && typeof defaults2.value !== "string") { defaults2 = { ...defaults2, value: String(defaults2.value) }; } super(defaults2); this.type = "decl"; } get variable() { return this.prop.startsWith("--") || this.prop[0] === "$"; } }; module.exports = Declaration; Declaration.default = Declaration; } }); // node_modules/postcss/lib/comment.js var require_comment = __commonJS({ "node_modules/postcss/lib/comment.js"(exports, module) { "use strict"; var Node = require_node(); var Comment = class extends Node { constructor(defaults2) { super(defaults2); this.type = "comment"; } }; module.exports = Comment; Comment.default = Comment; } }); // node_modules/postcss/lib/container.js var require_container = __commonJS({ "node_modules/postcss/lib/container.js"(exports, module) { "use strict"; var { isClean, my } = require_symbols(); var Declaration = require_declaration(); var Comment = require_comment(); var Node = require_node(); var parse4; var Rule; var AtRule; var Root2; function cleanSource(nodes) { return nodes.map((i2) => { if (i2.nodes) i2.nodes = cleanSource(i2.nodes); delete i2.source; return i2; }); } function markDirtyUp(node) { node[isClean] = false; if (node.proxyOf.nodes) { for (let i2 of node.proxyOf.nodes) { markDirtyUp(i2); } } } var Container = class _Container extends Node { append(...children) { for (let child of children) { let nodes = this.normalize(child, this.last); for (let node of nodes) this.proxyOf.nodes.push(node); } this.markDirty(); return this; } cleanRaws(keepBetween) { super.cleanRaws(keepBetween); if (this.nodes) { for (let node of this.nodes) node.cleanRaws(keepBetween); } } each(callback) { if (!this.proxyOf.nodes) return void 0; let iterator = this.getIterator(); let index, result; while (this.indexes[iterator] < this.proxyOf.nodes.length) { index = this.indexes[iterator]; result = callback(this.proxyOf.nodes[index], index); if (result === false) break; this.indexes[iterator] += 1; } delete this.indexes[iterator]; return result; } every(condition) { return this.nodes.every(condition); } getIterator() { if (!this.lastEach) this.lastEach = 0; if (!this.indexes) this.indexes = {}; this.lastEach += 1; let iterator = this.lastEach; this.indexes[iterator] = 0; return iterator; } getProxyProcessor() { return { get(node, prop) { if (prop === "proxyOf") { return node; } else if (!node[prop]) { return node[prop]; } else if (prop === "each" || typeof prop === "string" && prop.startsWith("walk")) { return (...args) => { return node[prop]( ...args.map((i2) => { if (typeof i2 === "function") { return (child, index) => i2(child.toProxy(), index); } else { return i2; } }) ); }; } else if (prop === "every" || prop === "some") { return (cb) => { return node[prop]( (child, ...other) => cb(child.toProxy(), ...other) ); }; } else if (prop === "root") { return () => node.root().toProxy(); } else if (prop === "nodes") { return node.nodes.map((i2) => i2.toProxy()); } else if (prop === "first" || prop === "last") { return node[prop].toProxy(); } else { return node[prop]; } }, set(node, prop, value) { if (node[prop] === value) return true; node[prop] = value; if (prop === "name" || prop === "params" || prop === "selector") { node.markDirty(); } return true; } }; } index(child) { if (typeof child === "number") return child; if (child.proxyOf) child = child.proxyOf; return this.proxyOf.nodes.indexOf(child); } insertAfter(exist, add2) { let existIndex = this.index(exist); let nodes = this.normalize(add2, this.proxyOf.nodes[existIndex]).reverse(); existIndex = this.index(exist); for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node); let index; for (let id in this.indexes) { index = this.indexes[id]; if (existIndex < index) { this.indexes[id] = index + nodes.length; } } this.markDirty(); return this; } insertBefore(exist, add2) { let existIndex = this.index(exist); let type = existIndex === 0 ? "prepend" : false; let nodes = this.normalize(add2, this.proxyOf.nodes[existIndex], type).reverse(); existIndex = this.index(exist); for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node); let index; for (let id in this.indexes) { index = this.indexes[id]; if (existIndex <= index) { this.indexes[id] = index + nodes.length; } } this.markDirty(); return this; } normalize(nodes, sample) { if (typeof nodes === "string") { nodes = cleanSource(parse4(nodes).nodes); } else if (typeof nodes === "undefined") { nodes = []; } else if (Array.isArray(nodes)) { nodes = nodes.slice(0); for (let i2 of nodes) { if (i2.parent) i2.parent.removeChild(i2, "ignore"); } } else if (nodes.type === "root" && this.type !== "document") { nodes = nodes.nodes.slice(0); for (let i2 of nodes) { if (i2.parent) i2.parent.removeChild(i2, "ignore"); } } else if (nodes.type) { nodes = [nodes]; } else if (nodes.prop) { if (typeof nodes.value === "undefined") { throw new Error("Value field is missed in node creation"); } else if (typeof nodes.value !== "string") { nodes.value = String(nodes.value); } nodes = [new Declaration(nodes)]; } else if (nodes.selector) { nodes = [new Rule(nodes)]; } else if (nodes.name) { nodes = [new AtRule(nodes)]; } else if (nodes.text) { nodes = [new Comment(nodes)]; } else { throw new Error("Unknown node type in node creation"); } let processed = nodes.map((i2) => { if (!i2[my]) _Container.rebuild(i2); i2 = i2.proxyOf; if (i2.parent) i2.parent.removeChild(i2); if (i2[isClean]) markDirtyUp(i2); if (typeof i2.raws.before === "undefined") { if (sample && typeof sample.raws.before !== "undefined") { i2.raws.before = sample.raws.before.replace(/\S/g, ""); } } i2.parent = this.proxyOf; return i2; }); return processed; } prepend(...children) { children = children.reverse(); for (let child of children) { let nodes = this.normalize(child, this.first, "prepend").reverse(); for (let node of nodes) this.proxyOf.nodes.unshift(node); for (let id in this.indexes) { this.indexes[id] = this.indexes[id] + nodes.length; } } this.markDirty(); return this; } push(child) { child.parent = this; this.proxyOf.nodes.push(child); return this; } removeAll() { for (let node of this.proxyOf.nodes) node.parent = void 0; this.proxyOf.nodes = []; this.markDirty(); return this; } removeChild(child) { child = this.index(child); this.proxyOf.nodes[child].parent = void 0; this.proxyOf.nodes.splice(child, 1); let index; for (let id in this.indexes) { index = this.indexes[id]; if (index >= child) { this.indexes[id] = index - 1; } } this.markDirty(); return this; } replaceValues(pattern, opts, callback) { if (!callback) { callback = opts; opts = {}; } this.walkDecls((decl) => { if (opts.props && !opts.props.includes(decl.prop)) return; if (opts.fast && !decl.value.includes(opts.fast)) return; decl.value = decl.value.replace(pattern, callback); }); this.markDirty(); return this; } some(condition) { return this.nodes.some(condition); } walk(callback) { return this.each((child, i2) => { let result; try { result = callback(child, i2); } catch (e2) { throw child.addToError(e2); } if (result !== false && child.walk) { result = child.walk(callback); } return result; }); } walkAtRules(name, callback) { if (!callback) { callback = name; return this.walk((child, i2) => { if (child.type === "atrule") { return callback(child, i2); } }); } if (name instanceof RegExp) { return this.walk((child, i2) => { if (child.type === "atrule" && name.test(child.name)) { return callback(child, i2); } }); } return this.walk((child, i2) => { if (child.type === "atrule" && child.name === name) { return callback(child, i2); } }); } walkComments(callback) { return this.walk((child, i2) => { if (child.type === "comment") { return callback(child, i2); } }); } walkDecls(prop, callback) { if (!callback) { callback = prop; return this.walk((child, i2) => { if (child.type === "decl") { return callback(child, i2); } }); } if (prop instanceof RegExp) { return this.walk((child, i2) => { if (child.type === "decl" && prop.test(child.prop)) { return callback(child, i2); } }); } return this.walk((child, i2) => { if (child.type === "decl" && child.prop === prop) { return callback(child, i2); } }); } walkRules(selector3, callback) { if (!callback) { callback = selector3; return this.walk((child, i2) => { if (child.type === "rule") { return callback(child, i2); } }); } if (selector3 instanceof RegExp) { return this.walk((child, i2) => { if (child.type === "rule" && selector3.test(child.selector)) { return callback(child, i2); } }); } return this.walk((child, i2) => { if (child.type === "rule" && child.selector === selector3) { return callback(child, i2); } }); } get first() { if (!this.proxyOf.nodes) return void 0; return this.proxyOf.nodes[0]; } get last() { if (!this.proxyOf.nodes) return void 0; return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; } }; Container.registerParse = (dependant) => { parse4 = dependant; }; Container.registerRule = (dependant) => { Rule = dependant; }; Container.registerAtRule = (dependant) => { AtRule = dependant; }; Container.registerRoot = (dependant) => { Root2 = dependant; }; module.exports = Container; Container.default = Container; Container.rebuild = (node) => { if (node.type === "atrule") { Object.setPrototypeOf(node, AtRule.prototype); } else if (node.type === "rule") { Object.setPrototypeOf(node, Rule.prototype); } else if (node.type === "decl") { Object.setPrototypeOf(node, Declaration.prototype); } else if (node.type === "comment") { Object.setPrototypeOf(node, Comment.prototype); } else if (node.type === "root") { Object.setPrototypeOf(node, Root2.prototype); } node[my] = true; if (node.nodes) { node.nodes.forEach((child) => { Container.rebuild(child); }); } }; } }); // node_modules/postcss/lib/tokenize.js var require_tokenize = __commonJS({ "node_modules/postcss/lib/tokenize.js"(exports, module) { "use strict"; var SINGLE_QUOTE = "'".charCodeAt(0); var DOUBLE_QUOTE = '"'.charCodeAt(0); var BACKSLASH = "\\".charCodeAt(0); var SLASH = "/".charCodeAt(0); var NEWLINE = "\n".charCodeAt(0); var SPACE3 = " ".charCodeAt(0); var FEED = "\f".charCodeAt(0); var TAB4 = " ".charCodeAt(0); var CR = "\r".charCodeAt(0); var OPEN_SQUARE = "[".charCodeAt(0); var CLOSE_SQUARE = "]".charCodeAt(0); var OPEN_PARENTHESES = "(".charCodeAt(0); var CLOSE_PARENTHESES = ")".charCodeAt(0); var OPEN_CURLY = "{".charCodeAt(0); var CLOSE_CURLY = "}".charCodeAt(0); var SEMICOLON = ";".charCodeAt(0); var ASTERISK = "*".charCodeAt(0); var COLON = ":".charCodeAt(0); var AT = "@".charCodeAt(0); var RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g; var RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g; var RE_BAD_BRACKET = /.[\r\n"'(/\\]/; var RE_HEX_ESCAPE = /[\da-f]/i; module.exports = function tokenizer(input, options = {}) { let css = input.css.valueOf(); let ignore = options.ignoreErrors; let code, next, quote, content, escape; let escaped, escapePos, prev, n2, currentToken; let length = css.length; let pos = 0; let buffer = []; let returned = []; function position() { return pos; } function unclosed(what) { throw input.error("Unclosed " + what, pos); } function endOfFile() { return returned.length === 0 && pos >= length; } function nextToken(opts) { if (returned.length) return returned.pop(); if (pos >= length) return; let ignoreUnclosed = opts ? opts.ignoreUnclosed : false; code = css.charCodeAt(pos); switch (code) { case NEWLINE: case SPACE3: case TAB4: case CR: case FEED: { next = pos; do { next += 1; code = css.charCodeAt(next); } while (code === SPACE3 || code === NEWLINE || code === TAB4 || code === CR || code === FEED); currentToken = ["space", css.slice(pos, next)]; pos = next - 1; break; } case OPEN_SQUARE: case CLOSE_SQUARE: case OPEN_CURLY: case CLOSE_CURLY: case COLON: case SEMICOLON: case CLOSE_PARENTHESES: { let controlChar = String.fromCharCode(code); currentToken = [controlChar, controlChar, pos]; break; } case OPEN_PARENTHESES: { prev = buffer.length ? buffer.pop()[1] : ""; n2 = css.charCodeAt(pos + 1); if (prev === "url" && n2 !== SINGLE_QUOTE && n2 !== DOUBLE_QUOTE && n2 !== SPACE3 && n2 !== NEWLINE && n2 !== TAB4 && n2 !== FEED && n2 !== CR) { next = pos; do { escaped = false; next = css.indexOf(")", next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos; break; } else { unclosed("bracket"); } } escapePos = next; while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["brackets", css.slice(pos, next + 1), pos, next]; pos = next; } else { next = css.indexOf(")", pos + 1); content = css.slice(pos, next + 1); if (next === -1 || RE_BAD_BRACKET.test(content)) { currentToken = ["(", "(", pos]; } else { currentToken = ["brackets", content, pos, next]; pos = next; } } break; } case SINGLE_QUOTE: case DOUBLE_QUOTE: { quote = code === SINGLE_QUOTE ? "'" : '"'; next = pos; do { escaped = false; next = css.indexOf(quote, next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos + 1; break; } else { unclosed("string"); } } escapePos = next; while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["string", css.slice(pos, next + 1), pos, next]; pos = next; break; } case AT: { RE_AT_END.lastIndex = pos + 1; RE_AT_END.test(css); if (RE_AT_END.lastIndex === 0) { next = css.length - 1; } else { next = RE_AT_END.lastIndex - 2; } currentToken = ["at-word", css.slice(pos, next + 1), pos, next]; pos = next; break; } case BACKSLASH: { next = pos; escape = true; while (css.charCodeAt(next + 1) === BACKSLASH) { next += 1; escape = !escape; } code = css.charCodeAt(next + 1); if (escape && code !== SLASH && code !== SPACE3 && code !== NEWLINE && code !== TAB4 && code !== CR && code !== FEED) { next += 1; if (RE_HEX_ESCAPE.test(css.charAt(next))) { while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { next += 1; } if (css.charCodeAt(next + 1) === SPACE3) { next += 1; } } } currentToken = ["word", css.slice(pos, next + 1), pos, next]; pos = next; break; } default: { if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { next = css.indexOf("*/", pos + 2) + 1; if (next === 0) { if (ignore || ignoreUnclosed) { next = css.length; } else { unclosed("comment"); } } currentToken = ["comment", css.slice(pos, next + 1), pos, next]; pos = next; } else { RE_WORD_END.lastIndex = pos + 1; RE_WORD_END.test(css); if (RE_WORD_END.lastIndex === 0) { next = css.length - 1; } else { next = RE_WORD_END.lastIndex - 2; } currentToken = ["word", css.slice(pos, next + 1), pos, next]; buffer.push(currentToken); pos = next; } break; } } pos++; return currentToken; } function back(token) { returned.push(token); } return { back, endOfFile, nextToken, position }; }; } }); // node_modules/postcss/lib/at-rule.js var require_at_rule = __commonJS({ "node_modules/postcss/lib/at-rule.js"(exports, module) { "use strict"; var Container = require_container(); var AtRule = class extends Container { constructor(defaults2) { super(defaults2); this.type = "atrule"; } append(...children) { if (!this.proxyOf.nodes) this.nodes = []; return super.append(...children); } prepend(...children) { if (!this.proxyOf.nodes) this.nodes = []; return super.prepend(...children); } }; module.exports = AtRule; AtRule.default = AtRule; Container.registerAtRule(AtRule); } }); // node_modules/postcss/lib/root.js var require_root = __commonJS({ "node_modules/postcss/lib/root.js"(exports, module) { "use strict"; var Container = require_container(); var LazyResult; var Processor2; var Root2 = class extends Container { constructor(defaults2) { super(defaults2); this.type = "root"; if (!this.nodes) this.nodes = []; } normalize(child, sample, type) { let nodes = super.normalize(child); if (sample) { if (type === "prepend") { if (this.nodes.length > 1) { sample.raws.before = this.nodes[1].raws.before; } else { delete sample.raws.before; } } else if (this.first !== sample) { for (let node of nodes) { node.raws.before = sample.raws.before; } } } return nodes; } removeChild(child, ignore) { let index = this.index(child); if (!ignore && index === 0 && this.nodes.length > 1) { this.nodes[1].raws.before = this.nodes[index].raws.before; } return super.removeChild(child); } toResult(opts = {}) { let lazy = new LazyResult(new Processor2(), this, opts); return lazy.stringify(); } }; Root2.registerLazyResult = (dependant) => { LazyResult = dependant; }; Root2.registerProcessor = (dependant) => { Processor2 = dependant; }; module.exports = Root2; Root2.default = Root2; Container.registerRoot(Root2); } }); // node_modules/postcss/lib/list.js var require_list = __commonJS({ "node_modules/postcss/lib/list.js"(exports, module) { "use strict"; var list = { comma(string) { return list.split(string, [","], true); }, space(string) { let spaces = [" ", "\n", " "]; return list.split(string, spaces); }, split(string, separators, last) { let array = []; let current = ""; let split2 = false; let func = 0; let inQuote = false; let prevQuote = ""; let escape = false; for (let letter of string) { if (escape) { escape = false; } else if (letter === "\\") { escape = true; } else if (inQuote) { if (letter === prevQuote) { inQuote = false; } } else if (letter === '"' || letter === "'") { inQuote = true; prevQuote = letter; } else if (letter === "(") { func += 1; } else if (letter === ")") { if (func > 0) func -= 1; } else if (func === 0) { if (separators.includes(letter)) split2 = true; } if (split2) { if (current !== "") array.push(current.trim()); current = ""; split2 = false; } else { current += letter; } } if (last || current !== "") array.push(current.trim()); return array; } }; module.exports = list; list.default = list; } }); // node_modules/postcss/lib/rule.js var require_rule = __commonJS({ "node_modules/postcss/lib/rule.js"(exports, module) { "use strict"; var Container = require_container(); var list = require_list(); var Rule = class extends Container { constructor(defaults2) { super(defaults2); this.type = "rule"; if (!this.nodes) this.nodes = []; } get selectors() { return list.comma(this.selector); } set selectors(values) { let match2 = this.selector ? this.selector.match(/,\s*/) : null; let sep = match2 ? match2[0] : "," + this.raw("between", "beforeOpen"); this.selector = values.join(sep); } }; module.exports = Rule; Rule.default = Rule; Container.registerRule(Rule); } }); // node_modules/postcss/lib/parser.js var require_parser = __commonJS({ "node_modules/postcss/lib/parser.js"(exports, module) { "use strict"; var Declaration = require_declaration(); var tokenizer = require_tokenize(); var Comment = require_comment(); var AtRule = require_at_rule(); var Root2 = require_root(); var Rule = require_rule(); var SAFE_COMMENT_NEIGHBOR = { empty: true, space: true }; function findLastWithPosition(tokens) { for (let i2 = tokens.length - 1; i2 >= 0; i2--) { let token = tokens[i2]; let pos = token[3] || token[2]; if (pos) return pos; } } var Parser = class { constructor(input) { this.input = input; this.root = new Root2(); this.current = this.root; this.spaces = ""; this.semicolon = false; this.createTokenizer(); this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }; } atrule(token) { let node = new AtRule(); node.name = token[1].slice(1); if (node.name === "") { this.unnamedAtrule(node, token); } this.init(node, token[2]); let type; let prev; let shift; let last = false; let open = false; let params = []; let brackets = []; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); type = token[0]; if (type === "(" || type === "[") { brackets.push(type === "(" ? ")" : "]"); } else if (type === "{" && brackets.length > 0) { brackets.push("}"); } else if (type === brackets[brackets.length - 1]) { brackets.pop(); } if (brackets.length === 0) { if (type === ";") { node.source.end = this.getPosition(token[2]); node.source.end.offset++; this.semicolon = true; break; } else if (type === "{") { open = true; break; } else if (type === "}") { if (params.length > 0) { shift = params.length - 1; prev = params[shift]; while (prev && prev[0] === "space") { prev = params[--shift]; } if (prev) { node.source.end = this.getPosition(prev[3] || prev[2]); node.source.end.offset++; } } this.end(token); break; } else { params.push(token); } } else { params.push(token); } if (this.tokenizer.endOfFile()) { last = true; break; } } node.raws.between = this.spacesAndCommentsFromEnd(params); if (params.length) { node.raws.afterName = this.spacesAndCommentsFromStart(params); this.raw(node, "params", params); if (last) { token = params[params.length - 1]; node.source.end = this.getPosition(token[3] || token[2]); node.source.end.offset++; this.spaces = node.raws.between; node.raws.between = ""; } } else { node.raws.afterName = ""; node.params = ""; } if (open) { node.nodes = []; this.current = node; } } checkMissedSemicolon(tokens) { let colon = this.colon(tokens); if (colon === false) return; let founded = 0; let token; for (let j2 = colon - 1; j2 >= 0; j2--) { token = tokens[j2]; if (token[0] !== "space") { founded += 1; if (founded === 2) break; } } throw this.input.error( "Missed semicolon", token[0] === "word" ? token[3] + 1 : token[2] ); } colon(tokens) { let brackets = 0; let token, type, prev; for (let [i2, element] of tokens.entries()) { token = element; type = token[0]; if (type === "(") { brackets += 1; } if (type === ")") { brackets -= 1; } if (brackets === 0 && type === ":") { if (!prev) { this.doubleColon(token); } else if (prev[0] === "word" && prev[1] === "progid") { continue; } else { return i2; } } prev = token; } return false; } comment(token) { let node = new Comment(); this.init(node, token[2]); node.source.end = this.getPosition(token[3] || token[2]); node.source.end.offset++; let text = token[1].slice(2, -2); if (/^\s*$/.test(text)) { node.text = ""; node.raws.left = text; node.raws.right = ""; } else { let match2 = text.match(/^(\s*)([^]*\S)(\s*)$/); node.text = match2[2]; node.raws.left = match2[1]; node.raws.right = match2[3]; } } createTokenizer() { this.tokenizer = tokenizer(this.input); } decl(tokens, customProperty) { let node = new Declaration(); this.init(node, tokens[0][2]); let last = tokens[tokens.length - 1]; if (last[0] === ";") { this.semicolon = true; tokens.pop(); } node.source.end = this.getPosition( last[3] || last[2] || findLastWithPosition(tokens) ); node.source.end.offset++; while (tokens[0][0] !== "word") { if (tokens.length === 1) this.unknownWord(tokens); node.raws.before += tokens.shift()[1]; } node.source.start = this.getPosition(tokens[0][2]); node.prop = ""; while (tokens.length) { let type = tokens[0][0]; if (type === ":" || type === "space" || type === "comment") { break; } node.prop += tokens.shift()[1]; } node.raws.between = ""; let token; while (tokens.length) { token = tokens.shift(); if (token[0] === ":") { node.raws.between += token[1]; break; } else { if (token[0] === "word" && /\w/.test(token[1])) { this.unknownWord([token]); } node.raws.between += token[1]; } } if (node.prop[0] === "_" || node.prop[0] === "*") { node.raws.before += node.prop[0]; node.prop = node.prop.slice(1); } let firstSpaces = []; let next; while (tokens.length) { next = tokens[0][0]; if (next !== "space" && next !== "comment") break; firstSpaces.push(tokens.shift()); } this.precheckMissedSemicolon(tokens); for (let i2 = tokens.length - 1; i2 >= 0; i2--) { token = tokens[i2]; if (token[1].toLowerCase() === "!important") { node.important = true; let string = this.stringFrom(tokens, i2); string = this.spacesFromEnd(tokens) + string; if (string !== " !important") node.raws.important = string; break; } else if (token[1].toLowerCase() === "important") { let cache = tokens.slice(0); let str = ""; for (let j2 = i2; j2 > 0; j2--) { let type = cache[j2][0]; if (str.trim().indexOf("!") === 0 && type !== "space") { break; } str = cache.pop()[1] + str; } if (str.trim().indexOf("!") === 0) { node.important = true; node.raws.important = str; tokens = cache; } } if (token[0] !== "space" && token[0] !== "comment") { break; } } let hasWord = tokens.some((i2) => i2[0] !== "space" && i2[0] !== "comment"); if (hasWord) { node.raws.between += firstSpaces.map((i2) => i2[1]).join(""); firstSpaces = []; } this.raw(node, "value", firstSpaces.concat(tokens), customProperty); if (node.value.includes(":") && !customProperty) { this.checkMissedSemicolon(tokens); } } doubleColon(token) { throw this.input.error( "Double colon", { offset: token[2] }, { offset: token[2] + token[1].length } ); } emptyRule(token) { let node = new Rule(); this.init(node, token[2]); node.selector = ""; node.raws.between = ""; this.current = node; } end(token) { if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.semicolon = false; this.current.raws.after = (this.current.raws.after || "") + this.spaces; this.spaces = ""; if (this.current.parent) { this.current.source.end = this.getPosition(token[2]); this.current.source.end.offset++; this.current = this.current.parent; } else { this.unexpectedClose(token); } } endFile() { if (this.current.parent) this.unclosedBlock(); if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.current.raws.after = (this.current.raws.after || "") + this.spaces; this.root.source.end = this.getPosition(this.tokenizer.position()); } freeSemicolon(token) { this.spaces += token[1]; if (this.current.nodes) { let prev = this.current.nodes[this.current.nodes.length - 1]; if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) { prev.raws.ownSemicolon = this.spaces; this.spaces = ""; } } } // Helpers getPosition(offset) { let pos = this.input.fromOffset(offset); return { column: pos.col, line: pos.line, offset }; } init(node, offset) { this.current.push(node); node.source = { input: this.input, start: this.getPosition(offset) }; node.raws.before = this.spaces; this.spaces = ""; if (node.type !== "comment") this.semicolon = false; } other(start2) { let end = false; let type = null; let colon = false; let bracket = null; let brackets = []; let customProperty = start2[1].startsWith("--"); let tokens = []; let token = start2; while (token) { type = token[0]; tokens.push(token); if (type === "(" || type === "[") { if (!bracket) bracket = token; brackets.push(type === "(" ? ")" : "]"); } else if (customProperty && colon && type === "{") { if (!bracket) bracket = token; brackets.push("}"); } else if (brackets.length === 0) { if (type === ";") { if (colon) { this.decl(tokens, customProperty); return; } else { break; } } else if (type === "{") { this.rule(tokens); return; } else if (type === "}") { this.tokenizer.back(tokens.pop()); end = true; break; } else if (type === ":") { colon = true; } } else if (type === brackets[brackets.length - 1]) { brackets.pop(); if (brackets.length === 0) bracket = null; } token = this.tokenizer.nextToken(); } if (this.tokenizer.endOfFile()) end = true; if (brackets.length > 0) this.unclosedBracket(bracket); if (end && colon) { if (!customProperty) { while (tokens.length) { token = tokens[tokens.length - 1][0]; if (token !== "space" && token !== "comment") break; this.tokenizer.back(tokens.pop()); } } this.decl(tokens, customProperty); } else { this.unknownWord(tokens); } } parse() { let token; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); switch (token[0]) { case "space": this.spaces += token[1]; break; case ";": this.freeSemicolon(token); break; case "}": this.end(token); break; case "comment": this.comment(token); break; case "at-word": this.atrule(token); break; case "{": this.emptyRule(token); break; default: this.other(token); break; } } this.endFile(); } precheckMissedSemicolon() { } raw(node, prop, tokens, customProperty) { let token, type; let length = tokens.length; let value = ""; let clean = true; let next, prev; for (let i2 = 0; i2 < length; i2 += 1) { token = tokens[i2]; type = token[0]; if (type === "space" && i2 === length - 1 && !customProperty) { clean = false; } else if (type === "comment") { prev = tokens[i2 - 1] ? tokens[i2 - 1][0] : "empty"; next = tokens[i2 + 1] ? tokens[i2 + 1][0] : "empty"; if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { if (value.slice(-1) === ",") { clean = false; } else { value += token[1]; } } else { clean = false; } } else { value += token[1]; } } if (!clean) { let raw = tokens.reduce((all, i2) => all + i2[1], ""); node.raws[prop] = { raw, value }; } node[prop] = value; } rule(tokens) { tokens.pop(); let node = new Rule(); this.init(node, tokens[0][2]); node.raws.between = this.spacesAndCommentsFromEnd(tokens); this.raw(node, "selector", tokens); this.current = node; } spacesAndCommentsFromEnd(tokens) { let lastTokenType; let spaces = ""; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== "space" && lastTokenType !== "comment") break; spaces = tokens.pop()[1] + spaces; } return spaces; } // Errors spacesAndCommentsFromStart(tokens) { let next; let spaces = ""; while (tokens.length) { next = tokens[0][0]; if (next !== "space" && next !== "comment") break; spaces += tokens.shift()[1]; } return spaces; } spacesFromEnd(tokens) { let lastTokenType; let spaces = ""; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== "space") break; spaces = tokens.pop()[1] + spaces; } return spaces; } stringFrom(tokens, from) { let result = ""; for (let i2 = from; i2 < tokens.length; i2++) { result += tokens[i2][1]; } tokens.splice(from, tokens.length - from); return result; } unclosedBlock() { let pos = this.current.source.start; throw this.input.error("Unclosed block", pos.line, pos.column); } unclosedBracket(bracket) { throw this.input.error( "Unclosed bracket", { offset: bracket[2] }, { offset: bracket[2] + 1 } ); } unexpectedClose(token) { throw this.input.error( "Unexpected }", { offset: token[2] }, { offset: token[2] + 1 } ); } unknownWord(tokens) { throw this.input.error( "Unknown word", { offset: tokens[0][2] }, { offset: tokens[0][2] + tokens[0][1].length } ); } unnamedAtrule(node, token) { throw this.input.error( "At-rule without name", { offset: token[2] }, { offset: token[2] + token[1].length } ); } }; module.exports = Parser; } }); // node_modules/postcss/lib/parse.js var require_parse = __commonJS({ "node_modules/postcss/lib/parse.js"(exports, module) { "use strict"; var Container = require_container(); var Parser = require_parser(); var Input = require_input(); function parse4(css, opts) { let input = new Input(css, opts); let parser = new Parser(input); try { parser.parse(); } catch (e2) { if (true) { if (e2.name === "CssSyntaxError" && opts && opts.from) { if (/\.scss$/i.test(opts.from)) { e2.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser"; } else if (/\.sass/i.test(opts.from)) { e2.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser"; } else if (/\.less$/i.test(opts.from)) { e2.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser"; } } } throw e2; } return parser.root; } module.exports = parse4; parse4.default = parse4; Container.registerParse(parse4); } }); // node_modules/postcss/lib/warning.js var require_warning2 = __commonJS({ "node_modules/postcss/lib/warning.js"(exports, module) { "use strict"; var Warning2 = class { constructor(text, opts = {}) { this.type = "warning"; this.text = text; if (opts.node && opts.node.source) { let range2 = opts.node.rangeBy(opts); this.line = range2.start.line; this.column = range2.start.column; this.endLine = range2.end.line; this.endColumn = range2.end.column; } for (let opt in opts) this[opt] = opts[opt]; } toString() { if (this.node) { return this.node.error(this.text, { index: this.index, plugin: this.plugin, word: this.word }).message; } if (this.plugin) { return this.plugin + ": " + this.text; } return this.text; } }; module.exports = Warning2; Warning2.default = Warning2; } }); // node_modules/postcss/lib/result.js var require_result = __commonJS({ "node_modules/postcss/lib/result.js"(exports, module) { "use strict"; var Warning2 = require_warning2(); var Result = class { constructor(processor, root, opts) { this.processor = processor; this.messages = []; this.root = root; this.opts = opts; this.css = void 0; this.map = void 0; } toString() { return this.css; } warn(text, opts = {}) { if (!opts.plugin) { if (this.lastPlugin && this.lastPlugin.postcssPlugin) { opts.plugin = this.lastPlugin.postcssPlugin; } } let warning6 = new Warning2(text, opts); this.messages.push(warning6); return warning6; } warnings() { return this.messages.filter((i2) => i2.type === "warning"); } get content() { return this.css; } }; module.exports = Result; Result.default = Result; } }); // node_modules/postcss/lib/no-work-result.js var require_no_work_result = __commonJS({ "node_modules/postcss/lib/no-work-result.js"(exports, module) { "use strict"; var MapGenerator = require_map_generator(); var stringify2 = require_stringify(); var warnOnce = require_warn_once(); var parse4 = require_parse(); var Result = require_result(); var NoWorkResult = class { constructor(processor, css, opts) { css = css.toString(); this.stringified = false; this._processor = processor; this._css = css; this._opts = opts; this._map = void 0; let root; let str = stringify2; this.result = new Result(this._processor, root, this._opts); this.result.css = css; let self = this; Object.defineProperty(this.result, "root", { get() { return self.root; } }); let map = new MapGenerator(str, root, this._opts, css); if (map.isMap()) { let [generatedCSS, generatedMap] = map.generate(); if (generatedCSS) { this.result.css = generatedCSS; } if (generatedMap) { this.result.map = generatedMap; } } else { map.clearAnnotation(); this.result.css = map.css; } } async() { if (this.error) return Promise.reject(this.error); return Promise.resolve(this.result); } catch(onRejected) { return this.async().catch(onRejected); } finally(onFinally) { return this.async().then(onFinally, onFinally); } sync() { if (this.error) throw this.error; return this.result; } then(onFulfilled, onRejected) { if (true) { if (!("from" in this._opts)) { warnOnce( "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." ); } } return this.async().then(onFulfilled, onRejected); } toString() { return this._css; } warnings() { return []; } get content() { return this.result.css; } get css() { return this.result.css; } get map() { return this.result.map; } get messages() { return []; } get opts() { return this.result.opts; } get processor() { return this.result.processor; } get root() { if (this._root) { return this._root; } let root; let parser = parse4; try { root = parser(this._css, this._opts); } catch (error) { this.error = error; } if (this.error) { throw this.error; } else { this._root = root; return root; } } get [Symbol.toStringTag]() { return "NoWorkResult"; } }; module.exports = NoWorkResult; NoWorkResult.default = NoWorkResult; } }); // node_modules/postcss/lib/document.js var require_document = __commonJS({ "node_modules/postcss/lib/document.js"(exports, module) { "use strict"; var Container = require_container(); var LazyResult; var Processor2; var Document = class extends Container { constructor(defaults2) { super({ type: "document", ...defaults2 }); if (!this.nodes) { this.nodes = []; } } toResult(opts = {}) { let lazy = new LazyResult(new Processor2(), this, opts); return lazy.stringify(); } }; Document.registerLazyResult = (dependant) => { LazyResult = dependant; }; Document.registerProcessor = (dependant) => { Processor2 = dependant; }; module.exports = Document; Document.default = Document; } }); // node_modules/postcss/lib/lazy-result.js var require_lazy_result = __commonJS({ "node_modules/postcss/lib/lazy-result.js"(exports, module) { "use strict"; var { isClean, my } = require_symbols(); var MapGenerator = require_map_generator(); var stringify2 = require_stringify(); var Container = require_container(); var Document = require_document(); var warnOnce = require_warn_once(); var Result = require_result(); var parse4 = require_parse(); var Root2 = require_root(); var TYPE_TO_CLASS_NAME = { atrule: "AtRule", comment: "Comment", decl: "Declaration", document: "Document", root: "Root", rule: "Rule" }; var PLUGIN_PROPS = { AtRule: true, AtRuleExit: true, Comment: true, CommentExit: true, Declaration: true, DeclarationExit: true, Document: true, DocumentExit: true, Once: true, OnceExit: true, postcssPlugin: true, prepare: true, Root: true, RootExit: true, Rule: true, RuleExit: true }; var NOT_VISITORS = { Once: true, postcssPlugin: true, prepare: true }; var CHILDREN = 0; function isPromise(obj) { return typeof obj === "object" && typeof obj.then === "function"; } function getEvents(node) { let key = false; let type = TYPE_TO_CLASS_NAME[node.type]; if (node.type === "decl") { key = node.prop.toLowerCase(); } else if (node.type === "atrule") { key = node.name.toLowerCase(); } if (key && node.append) { return [ type, type + "-" + key, CHILDREN, type + "Exit", type + "Exit-" + key ]; } else if (key) { return [type, type + "-" + key, type + "Exit", type + "Exit-" + key]; } else if (node.append) { return [type, CHILDREN, type + "Exit"]; } else { return [type, type + "Exit"]; } } function toStack(node) { let events; if (node.type === "document") { events = ["Document", CHILDREN, "DocumentExit"]; } else if (node.type === "root") { events = ["Root", CHILDREN, "RootExit"]; } else { events = getEvents(node); } return { eventIndex: 0, events, iterator: 0, node, visitorIndex: 0, visitors: [] }; } function cleanMarks(node) { node[isClean] = false; if (node.nodes) node.nodes.forEach((i2) => cleanMarks(i2)); return node; } var postcss = {}; var LazyResult = class _LazyResult { constructor(processor, css, opts) { this.stringified = false; this.processed = false; let root; if (typeof css === "object" && css !== null && (css.type === "root" || css.type === "document")) { root = cleanMarks(css); } else if (css instanceof _LazyResult || css instanceof Result) { root = cleanMarks(css.root); if (css.map) { if (typeof opts.map === "undefined") opts.map = {}; if (!opts.map.inline) opts.map.inline = false; opts.map.prev = css.map; } } else { let parser = parse4; if (opts.syntax) parser = opts.syntax.parse; if (opts.parser) parser = opts.parser; if (parser.parse) parser = parser.parse; try { root = parser(css, opts); } catch (error) { this.processed = true; this.error = error; } if (root && !root[my]) { Container.rebuild(root); } } this.result = new Result(processor, root, opts); this.helpers = { ...postcss, postcss, result: this.result }; this.plugins = this.processor.plugins.map((plugin) => { if (typeof plugin === "object" && plugin.prepare) { return { ...plugin, ...plugin.prepare(this.result) }; } else { return plugin; } }); } async() { if (this.error) return Promise.reject(this.error); if (this.processed) return Promise.resolve(this.result); if (!this.processing) { this.processing = this.runAsync(); } return this.processing; } catch(onRejected) { return this.async().catch(onRejected); } finally(onFinally) { return this.async().then(onFinally, onFinally); } getAsyncError() { throw new Error("Use process(css).then(cb) to work with async plugins"); } handleError(error, node) { let plugin = this.result.lastPlugin; try { if (node) node.addToError(error); this.error = error; if (error.name === "CssSyntaxError" && !error.plugin) { error.plugin = plugin.postcssPlugin; error.setMessage(); } else if (plugin.postcssVersion) { if (true) { let pluginName = plugin.postcssPlugin; let pluginVer = plugin.postcssVersion; let runtimeVer = this.result.processor.version; let a2 = pluginVer.split("."); let b2 = runtimeVer.split("."); if (a2[0] !== b2[0] || parseInt(a2[1]) > parseInt(b2[1])) { console.error( "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below." ); } } } } catch (err) { if (console && console.error) console.error(err); } return error; } prepareVisitors() { this.listeners = {}; let add2 = (plugin, type, cb) => { if (!this.listeners[type]) this.listeners[type] = []; this.listeners[type].push([plugin, cb]); }; for (let plugin of this.plugins) { if (typeof plugin === "object") { for (let event in plugin) { if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { throw new Error( `Unknown event ${event} in ${plugin.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).` ); } if (!NOT_VISITORS[event]) { if (typeof plugin[event] === "object") { for (let filter in plugin[event]) { if (filter === "*") { add2(plugin, event, plugin[event][filter]); } else { add2( plugin, event + "-" + filter.toLowerCase(), plugin[event][filter] ); } } } else if (typeof plugin[event] === "function") { add2(plugin, event, plugin[event]); } } } } } this.hasListener = Object.keys(this.listeners).length > 0; } async runAsync() { this.plugin = 0; for (let i2 = 0; i2 < this.plugins.length; i2++) { let plugin = this.plugins[i2]; let promise = this.runOnRoot(plugin); if (isPromise(promise)) { try { await promise; } catch (error) { throw this.handleError(error); } } } this.prepareVisitors(); if (this.hasListener) { let root = this.result.root; while (!root[isClean]) { root[isClean] = true; let stack = [toStack(root)]; while (stack.length > 0) { let promise = this.visitTick(stack); if (isPromise(promise)) { try { await promise; } catch (e2) { let node = stack[stack.length - 1].node; throw this.handleError(e2, node); } } } } if (this.listeners.OnceExit) { for (let [plugin, visitor] of this.listeners.OnceExit) { this.result.lastPlugin = plugin; try { if (root.type === "document") { let roots = root.nodes.map( (subRoot) => visitor(subRoot, this.helpers) ); await Promise.all(roots); } else { await visitor(root, this.helpers); } } catch (e2) { throw this.handleError(e2); } } } } this.processed = true; return this.stringify(); } runOnRoot(plugin) { this.result.lastPlugin = plugin; try { if (typeof plugin === "object" && plugin.Once) { if (this.result.root.type === "document") { let roots = this.result.root.nodes.map( (root) => plugin.Once(root, this.helpers) ); if (isPromise(roots[0])) { return Promise.all(roots); } return roots; } return plugin.Once(this.result.root, this.helpers); } else if (typeof plugin === "function") { return plugin(this.result.root, this.result); } } catch (error) { throw this.handleError(error); } } stringify() { if (this.error) throw this.error; if (this.stringified) return this.result; this.stringified = true; this.sync(); let opts = this.result.opts; let str = stringify2; if (opts.syntax) str = opts.syntax.stringify; if (opts.stringifier) str = opts.stringifier; if (str.stringify) str = str.stringify; let map = new MapGenerator(str, this.result.root, this.result.opts); let data = map.generate(); this.result.css = data[0]; this.result.map = data[1]; return this.result; } sync() { if (this.error) throw this.error; if (this.processed) return this.result; this.processed = true; if (this.processing) { throw this.getAsyncError(); } for (let plugin of this.plugins) { let promise = this.runOnRoot(plugin); if (isPromise(promise)) { throw this.getAsyncError(); } } this.prepareVisitors(); if (this.hasListener) { let root = this.result.root; while (!root[isClean]) { root[isClean] = true; this.walkSync(root); } if (this.listeners.OnceExit) { if (root.type === "document") { for (let subRoot of root.nodes) { this.visitSync(this.listeners.OnceExit, subRoot); } } else { this.visitSync(this.listeners.OnceExit, root); } } } return this.result; } then(onFulfilled, onRejected) { if (true) { if (!("from" in this.opts)) { warnOnce( "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." ); } } return this.async().then(onFulfilled, onRejected); } toString() { return this.css; } visitSync(visitors, node) { for (let [plugin, visitor] of visitors) { this.result.lastPlugin = plugin; let promise; try { promise = visitor(node, this.helpers); } catch (e2) { throw this.handleError(e2, node.proxyOf); } if (node.type !== "root" && node.type !== "document" && !node.parent) { return true; } if (isPromise(promise)) { throw this.getAsyncError(); } } } visitTick(stack) { let visit = stack[stack.length - 1]; let { node, visitors } = visit; if (node.type !== "root" && node.type !== "document" && !node.parent) { stack.pop(); return; } if (visitors.length > 0 && visit.visitorIndex < visitors.length) { let [plugin, visitor] = visitors[visit.visitorIndex]; visit.visitorIndex += 1; if (visit.visitorIndex === visitors.length) { visit.visitors = []; visit.visitorIndex = 0; } this.result.lastPlugin = plugin; try { return visitor(node.toProxy(), this.helpers); } catch (e2) { throw this.handleError(e2, node); } } if (visit.iterator !== 0) { let iterator = visit.iterator; let child; while (child = node.nodes[node.indexes[iterator]]) { node.indexes[iterator] += 1; if (!child[isClean]) { child[isClean] = true; stack.push(toStack(child)); return; } } visit.iterator = 0; delete node.indexes[iterator]; } let events = visit.events; while (visit.eventIndex < events.length) { let event = events[visit.eventIndex]; visit.eventIndex += 1; if (event === CHILDREN) { if (node.nodes && node.nodes.length) { node[isClean] = true; visit.iterator = node.getIterator(); } return; } else if (this.listeners[event]) { visit.visitors = this.listeners[event]; return; } } stack.pop(); } walkSync(node) { node[isClean] = true; let events = getEvents(node); for (let event of events) { if (event === CHILDREN) { if (node.nodes) { node.each((child) => { if (!child[isClean]) this.walkSync(child); }); } } else { let visitors = this.listeners[event]; if (visitors) { if (this.visitSync(visitors, node.toProxy())) return; } } } } warnings() { return this.sync().warnings(); } get content() { return this.stringify().content; } get css() { return this.stringify().css; } get map() { return this.stringify().map; } get messages() { return this.sync().messages; } get opts() { return this.result.opts; } get processor() { return this.result.processor; } get root() { return this.sync().root; } get [Symbol.toStringTag]() { return "LazyResult"; } }; LazyResult.registerPostcss = (dependant) => { postcss = dependant; }; module.exports = LazyResult; LazyResult.default = LazyResult; Root2.registerLazyResult(LazyResult); Document.registerLazyResult(LazyResult); } }); // node_modules/postcss/lib/processor.js var require_processor = __commonJS({ "node_modules/postcss/lib/processor.js"(exports, module) { "use strict"; var NoWorkResult = require_no_work_result(); var LazyResult = require_lazy_result(); var Document = require_document(); var Root2 = require_root(); var Processor2 = class { constructor(plugins = []) { this.version = "8.4.38"; this.plugins = this.normalize(plugins); } normalize(plugins) { let normalized = []; for (let i2 of plugins) { if (i2.postcss === true) { i2 = i2(); } else if (i2.postcss) { i2 = i2.postcss; } if (typeof i2 === "object" && Array.isArray(i2.plugins)) { normalized = normalized.concat(i2.plugins); } else if (typeof i2 === "object" && i2.postcssPlugin) { normalized.push(i2); } else if (typeof i2 === "function") { normalized.push(i2); } else if (typeof i2 === "object" && (i2.parse || i2.stringify)) { if (true) { throw new Error( "PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation." ); } } else { throw new Error(i2 + " is not a PostCSS plugin"); } } return normalized; } process(css, opts = {}) { if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) { return new NoWorkResult(this, css, opts); } else { return new LazyResult(this, css, opts); } } use(plugin) { this.plugins = this.plugins.concat(this.normalize([plugin])); return this; } }; module.exports = Processor2; Processor2.default = Processor2; Root2.registerProcessor(Processor2); Document.registerProcessor(Processor2); } }); // node_modules/postcss-prefix-selector/index.js var require_postcss_prefix_selector = __commonJS({ "node_modules/postcss-prefix-selector/index.js"(exports, module) { module.exports = function postcssPrefixSelector(options) { const prefix2 = options.prefix; const prefixWithSpace = /\s+$/.test(prefix2) ? prefix2 : `${prefix2} `; const ignoreFiles = options.ignoreFiles ? [].concat(options.ignoreFiles) : []; const includeFiles = options.includeFiles ? [].concat(options.includeFiles) : []; return function(root) { if (ignoreFiles.length && root.source.input.file && isFileInArray(root.source.input.file, ignoreFiles)) { return; } if (includeFiles.length && root.source.input.file && !isFileInArray(root.source.input.file, includeFiles)) { return; } root.walkRules((rule) => { const keyframeRules = [ "keyframes", "-webkit-keyframes", "-moz-keyframes", "-o-keyframes", "-ms-keyframes" ]; if (rule.parent && keyframeRules.includes(rule.parent.name)) { return; } rule.selectors = rule.selectors.map((selector3) => { if (options.exclude && excludeSelector(selector3, options.exclude)) { return selector3; } if (options.transform) { return options.transform( prefix2, selector3, prefixWithSpace + selector3, root.source.input.file, rule ); } return prefixWithSpace + selector3; }); }); }; }; function isFileInArray(file, arr) { return arr.some((ruleOrString) => { if (ruleOrString instanceof RegExp) { return ruleOrString.test(file); } return file.includes(ruleOrString); }); } function excludeSelector(selector3, excludeArr) { return excludeArr.some((excludeRule) => { if (excludeRule instanceof RegExp) { return excludeRule.test(selector3); } return selector3 === excludeRule; }); } } }); // packages/block-editor/node_modules/postcss-value-parser/lib/parse.js var require_parse2 = __commonJS({ "packages/block-editor/node_modules/postcss-value-parser/lib/parse.js"(exports, module) { var openParentheses = "(".charCodeAt(0); var closeParentheses = ")".charCodeAt(0); var singleQuote = "'".charCodeAt(0); var doubleQuote = '"'.charCodeAt(0); var backslash = "\\".charCodeAt(0); var slash = "/".charCodeAt(0); var comma = ",".charCodeAt(0); var colon = ":".charCodeAt(0); var star = "*".charCodeAt(0); var uLower = "u".charCodeAt(0); var uUpper = "U".charCodeAt(0); var plus = "+".charCodeAt(0); var isUnicodeRange = /^[a-f0-9?-]+$/i; module.exports = function(input) { var tokens = []; var value = input; var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos; var pos = 0; var code = value.charCodeAt(pos); var max = value.length; var stack = [{ nodes: tokens }]; var balanced = 0; var parent; var name = ""; var before = ""; var after = ""; while (pos < max) { if (code <= 32) { next = pos; do { next += 1; code = value.charCodeAt(next); } while (code <= 32); token = value.slice(pos, next); prev = tokens[tokens.length - 1]; if (code === closeParentheses && balanced) { after = token; } else if (prev && prev.type === "div") { prev.after = token; prev.sourceEndIndex += token.length; } else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) { before = token; } else { tokens.push({ type: "space", sourceIndex: pos, sourceEndIndex: next, value: token }); } pos = next; } else if (code === singleQuote || code === doubleQuote) { next = pos; quote = code === singleQuote ? "'" : '"'; token = { type: "string", sourceIndex: pos, quote }; do { escape = false; next = value.indexOf(quote, next + 1); if (~next) { escapePos = next; while (value.charCodeAt(escapePos - 1) === backslash) { escapePos -= 1; escape = !escape; } } else { value += quote; next = value.length - 1; token.unclosed = true; } } while (escape); token.value = value.slice(pos + 1, next); token.sourceEndIndex = token.unclosed ? next : next + 1; tokens.push(token); pos = next + 1; code = value.charCodeAt(pos); } else if (code === slash && value.charCodeAt(pos + 1) === star) { next = value.indexOf("*/", pos); token = { type: "comment", sourceIndex: pos, sourceEndIndex: next + 2 }; if (next === -1) { token.unclosed = true; next = value.length; token.sourceEndIndex = next; } token.value = value.slice(pos + 2, next); tokens.push(token); pos = next + 2; code = value.charCodeAt(pos); } else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") { token = value[pos]; tokens.push({ type: "word", sourceIndex: pos - before.length, sourceEndIndex: pos + token.length, value: token }); pos += 1; code = value.charCodeAt(pos); } else if (code === slash || code === comma || code === colon) { token = value[pos]; tokens.push({ type: "div", sourceIndex: pos - before.length, sourceEndIndex: pos + token.length, value: token, before, after: "" }); before = ""; pos += 1; code = value.charCodeAt(pos); } else if (openParentheses === code) { next = pos; do { next += 1; code = value.charCodeAt(next); } while (code <= 32); parenthesesOpenPos = pos; token = { type: "function", sourceIndex: pos - name.length, value: name, before: value.slice(parenthesesOpenPos + 1, next) }; pos = next; if (name === "url" && code !== singleQuote && code !== doubleQuote) { next -= 1; do { escape = false; next = value.indexOf(")", next + 1); if (~next) { escapePos = next; while (value.charCodeAt(escapePos - 1) === backslash) { escapePos -= 1; escape = !escape; } } else { value += ")"; next = value.length - 1; token.unclosed = true; } } while (escape); whitespacePos = next; do { whitespacePos -= 1; code = value.charCodeAt(whitespacePos); } while (code <= 32); if (parenthesesOpenPos < whitespacePos) { if (pos !== whitespacePos + 1) { token.nodes = [ { type: "word", sourceIndex: pos, sourceEndIndex: whitespacePos + 1, value: value.slice(pos, whitespacePos + 1) } ]; } else { token.nodes = []; } if (token.unclosed && whitespacePos + 1 !== next) { token.after = ""; token.nodes.push({ type: "space", sourceIndex: whitespacePos + 1, sourceEndIndex: next, value: value.slice(whitespacePos + 1, next) }); } else { token.after = value.slice(whitespacePos + 1, next); token.sourceEndIndex = next; } } else { token.after = ""; token.nodes = []; } pos = next + 1; token.sourceEndIndex = token.unclosed ? next : pos; code = value.charCodeAt(pos); tokens.push(token); } else { balanced += 1; token.after = ""; token.sourceEndIndex = pos + 1; tokens.push(token); stack.push(token); tokens = token.nodes = []; parent = token; } name = ""; } else if (closeParentheses === code && balanced) { pos += 1; code = value.charCodeAt(pos); parent.after = after; parent.sourceEndIndex += after.length; after = ""; balanced -= 1; stack[stack.length - 1].sourceEndIndex = pos; stack.pop(); parent = stack[balanced]; tokens = parent.nodes; } else { next = pos; do { if (code === backslash) { next += 1; } next += 1; code = value.charCodeAt(next); } while (next < max && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced)); token = value.slice(pos, next); if (openParentheses === code) { name = token; } else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) { tokens.push({ type: "unicode-range", sourceIndex: pos, sourceEndIndex: next, value: token }); } else { tokens.push({ type: "word", sourceIndex: pos, sourceEndIndex: next, value: token }); } pos = next; } } for (pos = stack.length - 1; pos; pos -= 1) { stack[pos].unclosed = true; stack[pos].sourceEndIndex = value.length; } return stack[0].nodes; }; } }); // packages/block-editor/node_modules/postcss-value-parser/lib/walk.js var require_walk = __commonJS({ "packages/block-editor/node_modules/postcss-value-parser/lib/walk.js"(exports, module) { module.exports = function walk(nodes, cb, bubble) { var i2, max, node, result; for (i2 = 0, max = nodes.length; i2 < max; i2 += 1) { node = nodes[i2]; if (!bubble) { result = cb(node, i2, nodes); } if (result !== false && node.type === "function" && Array.isArray(node.nodes)) { walk(node.nodes, cb, bubble); } if (bubble) { cb(node, i2, nodes); } } }; } }); // packages/block-editor/node_modules/postcss-value-parser/lib/stringify.js var require_stringify2 = __commonJS({ "packages/block-editor/node_modules/postcss-value-parser/lib/stringify.js"(exports, module) { function stringifyNode(node, custom) { var type = node.type; var value = node.value; var buf; var customResult; if (custom && (customResult = custom(node)) !== void 0) { return customResult; } else if (type === "word" || type === "space") { return value; } else if (type === "string") { buf = node.quote || ""; return buf + value + (node.unclosed ? "" : buf); } else if (type === "comment") { return "/*" + value + (node.unclosed ? "" : "*/"); } else if (type === "div") { return (node.before || "") + value + (node.after || ""); } else if (Array.isArray(node.nodes)) { buf = stringify2(node.nodes, custom); if (type !== "function") { return buf; } return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")"); } return value; } function stringify2(nodes, custom) { var result, i2; if (Array.isArray(nodes)) { result = ""; for (i2 = nodes.length - 1; ~i2; i2 -= 1) { result = stringifyNode(nodes[i2], custom) + result; } return result; } return stringifyNode(nodes, custom); } module.exports = stringify2; } }); // packages/block-editor/node_modules/postcss-value-parser/lib/unit.js var require_unit = __commonJS({ "packages/block-editor/node_modules/postcss-value-parser/lib/unit.js"(exports, module) { var minus = "-".charCodeAt(0); var plus = "+".charCodeAt(0); var dot = ".".charCodeAt(0); var exp = "e".charCodeAt(0); var EXP = "E".charCodeAt(0); function likeNumber(value) { var code = value.charCodeAt(0); var nextCode; if (code === plus || code === minus) { nextCode = value.charCodeAt(1); if (nextCode >= 48 && nextCode <= 57) { return true; } var nextNextCode = value.charCodeAt(2); if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { return true; } return false; } if (code === dot) { nextCode = value.charCodeAt(1); if (nextCode >= 48 && nextCode <= 57) { return true; } return false; } if (code >= 48 && code <= 57) { return true; } return false; } module.exports = function(value) { var pos = 0; var length = value.length; var code; var nextCode; var nextNextCode; if (length === 0 || !likeNumber(value)) { return false; } code = value.charCodeAt(pos); if (code === plus || code === minus) { pos++; } while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } code = value.charCodeAt(pos); nextCode = value.charCodeAt(pos + 1); if (code === dot && nextCode >= 48 && nextCode <= 57) { pos += 2; while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } } code = value.charCodeAt(pos); nextCode = value.charCodeAt(pos + 1); nextNextCode = value.charCodeAt(pos + 2); if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) { pos += nextCode === plus || nextCode === minus ? 3 : 2; while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } } return { number: value.slice(0, pos), unit: value.slice(pos) }; }; } }); // packages/block-editor/node_modules/postcss-value-parser/lib/index.js var require_lib2 = __commonJS({ "packages/block-editor/node_modules/postcss-value-parser/lib/index.js"(exports, module) { var parse4 = require_parse2(); var walk = require_walk(); var stringify2 = require_stringify2(); function ValueParser(value) { if (this instanceof ValueParser) { this.nodes = parse4(value); return this; } return new ValueParser(value); } ValueParser.prototype.toString = function() { return Array.isArray(this.nodes) ? stringify2(this.nodes) : ""; }; ValueParser.prototype.walk = function(cb, bubble) { walk(this.nodes, cb, bubble); return this; }; ValueParser.unit = require_unit(); ValueParser.walk = walk; ValueParser.stringify = stringify2; module.exports = ValueParser; } }); // packages/block-editor/node_modules/postcss-urlrebase/index.js var require_postcss_urlrebase = __commonJS({ "packages/block-editor/node_modules/postcss-urlrebase/index.js"(exports, module) { var CSSValueParser = require_lib2(); module.exports = (opts) => { const DEFAULTS = { skipHostRelativeUrls: true }; const config2 = Object.assign(DEFAULTS, opts); return { postcssPlugin: "rebaseUrl", Declaration(decl) { const parsedValue = CSSValueParser(decl.value); let valueChanged = false; parsedValue.walk((node) => { if (node.type !== "function" || node.value !== "url") { return; } const urlVal = node.nodes[0].value; const basedUrl = new URL(urlVal, opts.rootUrl); if (basedUrl.pathname === urlVal && config2.skipHostRelativeUrls) { return false; } node.nodes[0].value = basedUrl.toString(); valueChanged = true; return false; }); if (valueChanged) { decl.value = CSSValueParser.stringify(parsedValue); } } }; }; module.exports.postcss = true; } }); // package-external:@wordpress/priority-queue var require_priority_queue = __commonJS({ "package-external:@wordpress/priority-queue"(exports, module) { module.exports = window.wp.priorityQueue; } }); // package-external:@wordpress/is-shallow-equal var require_is_shallow_equal = __commonJS({ "package-external:@wordpress/is-shallow-equal"(exports, module) { module.exports = window.wp.isShallowEqual; } }); // package-external:@wordpress/token-list var require_token_list = __commonJS({ "package-external:@wordpress/token-list"(exports, module) { module.exports = window.wp.tokenList; } }); // node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "node_modules/deepmerge/dist/cjs.js"(exports, module) { "use strict"; var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge; } var customMerge = options.customMerge(key); return typeof customMerge === "function" ? customMerge : deepmerge; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination; } function deepmerge(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options); } else if (sourceIsArray) { return options.arrayMerge(target, source, options); } else { return mergeObject(target, source, options); } } deepmerge.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error("first argument should be an array"); } return array.reduce(function(prev, next) { return deepmerge(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge; module.exports = deepmerge_1; } }); // package-external:@wordpress/commands var require_commands = __commonJS({ "package-external:@wordpress/commands"(exports, module) { module.exports = window.wp.commands; } }); // package-external:@wordpress/date var require_date = __commonJS({ "package-external:@wordpress/date"(exports, module) { module.exports = window.wp.date; } }); // node_modules/normalize-wheel/src/UserAgent_DEPRECATED.js var require_UserAgent_DEPRECATED = __commonJS({ "node_modules/normalize-wheel/src/UserAgent_DEPRECATED.js"(exports, module) { var _populated = false; var _ie; var _firefox; var _opera; var _webkit; var _chrome; var _ie_real_version; var _osx; var _windows; var _linux; var _android; var _win64; var _iphone; var _ipad; var _native; var _mobile; function _populate() { if (_populated) { return; } _populated = true; var uas = navigator.userAgent; var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas); var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas); _iphone = /\b(iPhone|iP[ao]d)/.exec(uas); _ipad = /\b(iP[ao]d)/.exec(uas); _android = /Android/i.exec(uas); _native = /FBAN\/\w+;/i.exec(uas); _mobile = /Mobile/i.exec(uas); _win64 = !!/Win64/.exec(uas); if (agent) { _ie = agent[1] ? parseFloat(agent[1]) : agent[5] ? parseFloat(agent[5]) : NaN; if (_ie && document && document.documentMode) { _ie = document.documentMode; } var trident = /(?:Trident\/(\d+.\d+))/.exec(uas); _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie; _firefox = agent[2] ? parseFloat(agent[2]) : NaN; _opera = agent[3] ? parseFloat(agent[3]) : NaN; _webkit = agent[4] ? parseFloat(agent[4]) : NaN; if (_webkit) { agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas); _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN; } else { _chrome = NaN; } } else { _ie = _firefox = _opera = _chrome = _webkit = NaN; } if (os) { if (os[1]) { var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas); _osx = ver ? parseFloat(ver[1].replace("_", ".")) : true; } else { _osx = false; } _windows = !!os[2]; _linux = !!os[3]; } else { _osx = _windows = _linux = false; } } var UserAgent_DEPRECATED = { /** * Check if the UA is Internet Explorer. * * * @return float|NaN Version number (if match) or NaN. */ ie: function() { return _populate() || _ie; }, /** * Check if we're in Internet Explorer compatibility mode. * * @return bool true if in compatibility mode, false if * not compatibility mode or not ie */ ieCompatibilityMode: function() { return _populate() || _ie_real_version > _ie; }, /** * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we * only need this because Skype can't handle 64-bit IE yet. We need to remove * this when we don't need it -- tracked by #601957. */ ie64: function() { return UserAgent_DEPRECATED.ie() && _win64; }, /** * Check if the UA is Firefox. * * * @return float|NaN Version number (if match) or NaN. */ firefox: function() { return _populate() || _firefox; }, /** * Check if the UA is Opera. * * * @return float|NaN Version number (if match) or NaN. */ opera: function() { return _populate() || _opera; }, /** * Check if the UA is WebKit. * * * @return float|NaN Version number (if match) or NaN. */ webkit: function() { return _populate() || _webkit; }, /** * For Push * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit */ safari: function() { return UserAgent_DEPRECATED.webkit(); }, /** * Check if the UA is a Chrome browser. * * * @return float|NaN Version number (if match) or NaN. */ chrome: function() { return _populate() || _chrome; }, /** * Check if the user is running Windows. * * @return bool `true' if the user's OS is Windows. */ windows: function() { return _populate() || _windows; }, /** * Check if the user is running Mac OS X. * * @return float|bool Returns a float if a version number is detected, * otherwise true/false. */ osx: function() { return _populate() || _osx; }, /** * Check if the user is running Linux. * * @return bool `true' if the user's OS is some flavor of Linux. */ linux: function() { return _populate() || _linux; }, /** * Check if the user is running on an iPhone or iPod platform. * * @return bool `true' if the user is running some flavor of the * iPhone OS. */ iphone: function() { return _populate() || _iphone; }, mobile: function() { return _populate() || (_iphone || _ipad || _android || _mobile); }, nativeApp: function() { return _populate() || _native; }, android: function() { return _populate() || _android; }, ipad: function() { return _populate() || _ipad; } }; module.exports = UserAgent_DEPRECATED; } }); // node_modules/normalize-wheel/src/ExecutionEnvironment.js var require_ExecutionEnvironment = __commonJS({ "node_modules/normalize-wheel/src/ExecutionEnvironment.js"(exports, module) { "use strict"; var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); var ExecutionEnvironment = { canUseDOM, canUseWorkers: typeof Worker !== "undefined", canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; } }); // node_modules/normalize-wheel/src/isEventSupported.js var require_isEventSupported = __commonJS({ "node_modules/normalize-wheel/src/isEventSupported.js"(exports, module) { "use strict"; var ExecutionEnvironment = require_ExecutionEnvironment(); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { useHasFeature = document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature document.implementation.hasFeature("", "") !== true; } function isEventSupported(eventNameSuffix, capture) { if (!ExecutionEnvironment.canUseDOM || capture && !("addEventListener" in document)) { return false; } var eventName = "on" + eventNameSuffix; var isSupported = eventName in document; if (!isSupported) { var element = document.createElement("div"); element.setAttribute(eventName, "return;"); isSupported = typeof element[eventName] === "function"; } if (!isSupported && useHasFeature && eventNameSuffix === "wheel") { isSupported = document.implementation.hasFeature("Events.wheel", "3.0"); } return isSupported; } module.exports = isEventSupported; } }); // node_modules/normalize-wheel/src/normalizeWheel.js var require_normalizeWheel = __commonJS({ "node_modules/normalize-wheel/src/normalizeWheel.js"(exports, module) { "use strict"; var UserAgent_DEPRECATED = require_UserAgent_DEPRECATED(); var isEventSupported = require_isEventSupported(); var PIXEL_STEP = 10; var LINE_HEIGHT = 40; var PAGE_HEIGHT = 800; function normalizeWheel2(event) { var sX = 0, sY = 0, pX = 0, pY = 0; if ("detail" in event) { sY = event.detail; } if ("wheelDelta" in event) { sY = -event.wheelDelta / 120; } if ("wheelDeltaY" in event) { sY = -event.wheelDeltaY / 120; } if ("wheelDeltaX" in event) { sX = -event.wheelDeltaX / 120; } if ("axis" in event && event.axis === event.HORIZONTAL_AXIS) { sX = sY; sY = 0; } pX = sX * PIXEL_STEP; pY = sY * PIXEL_STEP; if ("deltaY" in event) { pY = event.deltaY; } if ("deltaX" in event) { pX = event.deltaX; } if ((pX || pY) && event.deltaMode) { if (event.deltaMode == 1) { pX *= LINE_HEIGHT; pY *= LINE_HEIGHT; } else { pX *= PAGE_HEIGHT; pY *= PAGE_HEIGHT; } } if (pX && !sX) { sX = pX < 1 ? -1 : 1; } if (pY && !sY) { sY = pY < 1 ? -1 : 1; } return { spinX: sX, spinY: sY, pixelX: pX, pixelY: pY }; } normalizeWheel2.getEventType = function() { return UserAgent_DEPRECATED.firefox() ? "DOMMouseScroll" : isEventSupported("wheel") ? "wheel" : "mousewheel"; }; module.exports = normalizeWheel2; } }); // node_modules/normalize-wheel/index.js var require_normalize_wheel = __commonJS({ "node_modules/normalize-wheel/index.js"(exports, module) { module.exports = require_normalizeWheel(); } }); // node_modules/fast-deep-equal/index.js var require_fast_deep_equal = __commonJS({ "node_modules/fast-deep-equal/index.js"(exports, module) { "use strict"; module.exports = function equal(a2, b2) { if (a2 === b2) return true; if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { if (a2.constructor !== b2.constructor) return false; var length, i2, keys; if (Array.isArray(a2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (!equal(a2[i2], b2[i2])) return false; return true; } if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); keys = Object.keys(a2); length = keys.length; if (length !== Object.keys(b2).length) return false; for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; for (i2 = length; i2-- !== 0; ) { var key = keys[i2]; if (!equal(a2[key], b2[key])) return false; } return true; } return a2 !== a2 && b2 !== b2; }; } }); // packages/block-editor/build-module/index.js var index_exports = {}; __export(index_exports, { AlignmentControl: () => AlignmentControl, AlignmentToolbar: () => AlignmentToolbar, Autocomplete: () => autocomplete_default, BlockAlignmentControl: () => BlockAlignmentControl, BlockAlignmentToolbar: () => BlockAlignmentToolbar, BlockBindingsAttributeControl: () => BlockBindingsAttributeControl, BlockBindingsSourceFieldsList: () => BlockBindingsSourceFieldsList, BlockBreadcrumb: () => block_breadcrumb_default, BlockCanvas: () => block_canvas_default, BlockColorsStyleSelector: () => color_style_selector_default, BlockContextProvider: () => BlockContextProvider, BlockControls: () => block_controls_default, BlockEdit: () => BlockEdit, BlockEditorKeyboardShortcuts: () => keyboard_shortcuts_default, BlockEditorProvider: () => provider_default2, BlockFormatControls: () => BlockFormatControls, BlockIcon: () => block_icon_default, BlockInspector: () => block_inspector_default, BlockList: () => BlockList, BlockMover: () => block_mover_default, BlockNavigationDropdown: () => dropdown_default, BlockPopover: () => block_popover_default, BlockPreview: () => block_preview_default, BlockSelectionClearer: () => BlockSelectionClearer, BlockSettingsMenu: () => block_settings_menu_default, BlockSettingsMenuControls: () => block_settings_menu_controls_default, BlockStyles: () => block_styles_default, BlockTitle: () => BlockTitle, BlockToolbar: () => BlockToolbar, BlockTools: () => BlockTools, BlockVerticalAlignmentControl: () => BlockVerticalAlignmentControl, BlockVerticalAlignmentToolbar: () => BlockVerticalAlignmentToolbar, ButtonBlockAppender: () => button_block_appender_default, ButtonBlockerAppender: () => ButtonBlockerAppender, ColorPalette: () => color_palette_default, ColorPaletteControl: () => ColorPaletteControl, ContrastChecker: () => contrast_checker_default, CopyHandler: () => CopyHandler, DefaultBlockAppender: () => DefaultBlockAppender, DimensionControl: () => DimensionControl, FontSizePicker: () => font_size_picker_default, HeadingLevelDropdown: () => HeadingLevelDropdown, HeightControl: () => HeightControl, InnerBlocks: () => inner_blocks_default, Inserter: () => inserter_default, InspectorAdvancedControls: () => InspectorAdvancedControls, InspectorControls: () => inspector_controls_default, JustifyContentControl: () => JustifyContentControl, JustifyToolbar: () => JustifyToolbar, LineHeightControl: () => line_height_control_default, LinkControl: () => link_control_default, MediaPlaceholder: () => media_placeholder_default, MediaReplaceFlow: () => media_replace_flow_default, MediaUpload: () => media_upload_default, MediaUploadCheck: () => check_default2, MultiSelectScrollIntoView: () => MultiSelectScrollIntoView, NavigableToolbar: () => NavigableToolbar, ObserveTyping: () => observe_typing_default, PanelColorSettings: () => panel_color_settings_default, PlainText: () => plain_text_default, RecursionProvider: () => RecursionProvider, RichText: () => rich_text_default, RichTextShortcut: () => RichTextShortcut, RichTextToolbarButton: () => RichTextToolbarButton, SETTINGS_DEFAULTS: () => SETTINGS_DEFAULTS, SkipToSelectedBlock: () => SkipToSelectedBlock, ToolSelector: () => tool_selector_default, Typewriter: () => typewriter_default, URLInput: () => url_input_default, URLInputButton: () => button_default, URLPopover: () => url_popover_default, Warning: () => warning_default, WritingFlow: () => writing_flow_default, __experimentalBlockAlignmentMatrixControl: () => block_alignment_matrix_control_default, __experimentalBlockFullHeightAligmentControl: () => block_full_height_alignment_control_default, __experimentalBlockPatternSetup: () => block_pattern_setup_default, __experimentalBlockPatternsList: () => block_patterns_list_default, __experimentalBlockVariationPicker: () => block_variation_picker_default, __experimentalBlockVariationTransforms: () => block_variation_transforms_default, __experimentalBorderRadiusControl: () => BorderRadiusControl, __experimentalColorGradientControl: () => control_default, __experimentalColorGradientSettingsDropdown: () => ColorGradientSettingsDropdown, __experimentalDateFormatPicker: () => DateFormatPicker, __experimentalDuotoneControl: () => duotone_control_default, __experimentalFontAppearanceControl: () => FontAppearanceControl, __experimentalFontFamilyControl: () => FontFamilyControl, __experimentalGetBorderClassesAndStyles: () => getBorderClassesAndStyles, __experimentalGetColorClassesAndStyles: () => getColorClassesAndStyles, __experimentalGetElementClassName: () => __experimentalGetElementClassName, __experimentalGetGapCSSValue: () => getGapCSSValue, __experimentalGetGradientClass: () => __experimentalGetGradientClass, __experimentalGetGradientObjectByGradientValue: () => __experimentalGetGradientObjectByGradientValue, __experimentalGetShadowClassesAndStyles: () => getShadowClassesAndStyles, __experimentalGetSpacingClassesAndStyles: () => getSpacingClassesAndStyles, __experimentalImageEditor: () => ImageEditor, __experimentalImageSizeControl: () => ImageSizeControl, __experimentalImageURLInputUI: () => ImageURLInputUI, __experimentalInspectorPopoverHeader: () => InspectorPopoverHeader, __experimentalLetterSpacingControl: () => LetterSpacingControl, __experimentalLibrary: () => library_default, __experimentalLinkControl: () => DeprecatedExperimentalLinkControl, __experimentalLinkControlSearchInput: () => __experimentalLinkControlSearchInput, __experimentalLinkControlSearchItem: () => __experimentalLinkControlSearchItem, __experimentalLinkControlSearchResults: () => __experimentalLinkControlSearchResults, __experimentalListView: () => list_view_default2, __experimentalPanelColorGradientSettings: () => panel_color_gradient_settings_default, __experimentalPreviewOptions: () => PreviewOptions, __experimentalPublishDateTimePicker: () => publish_date_time_picker_default, __experimentalRecursionProvider: () => DeprecatedExperimentalRecursionProvider, __experimentalResponsiveBlockControl: () => responsive_block_control_default, __experimentalSpacingSizesControl: () => SpacingSizesControl, __experimentalTextDecorationControl: () => TextDecorationControl, __experimentalTextTransformControl: () => TextTransformControl, __experimentalUnitControl: () => UnitControl6, __experimentalUseBlockOverlayActive: () => useBlockOverlayActive, __experimentalUseBlockPreview: () => useBlockPreview, __experimentalUseBorderProps: () => useBorderProps, __experimentalUseColorProps: () => useColorProps, __experimentalUseCustomSides: () => useCustomSides, __experimentalUseGradient: () => __experimentalUseGradient, __experimentalUseHasRecursion: () => DeprecatedExperimentalUseHasRecursion, __experimentalUseMultipleOriginColorsAndGradients: () => useMultipleOriginColorsAndGradients, __experimentalUseResizeCanvas: () => useResizeCanvas, __experimentalWritingModeControl: () => WritingModeControl, __unstableBlockSettingsMenuFirstItem: () => block_settings_menu_first_item_default, __unstableBlockToolbarLastItem: () => block_toolbar_last_item_default, __unstableEditorStyles: () => editor_styles_default, __unstableIframe: () => iframe_default, __unstableInserterMenuExtension: () => inserter_menu_extension_default, __unstableRichTextInputEvent: () => __unstableRichTextInputEvent, __unstableUseBlockSelectionClearer: () => useBlockSelectionClearer, __unstableUseClipboardHandler: () => __unstableUseClipboardHandler, __unstableUseMouseMoveTypingReset: () => useMouseMoveTypingReset, __unstableUseTypewriter: () => useTypewriter, __unstableUseTypingObserver: () => useTypingObserver, createCustomColorsHOC: () => createCustomColorsHOC, getColorClassName: () => getColorClassName, getColorObjectByAttributeValues: () => getColorObjectByAttributeValues, getColorObjectByColorValue: () => getColorObjectByColorValue, getComputedFluidTypographyValue: () => getComputedFluidTypographyValue, getCustomValueFromPreset: () => getCustomValueFromPreset, getFontSize: () => getFontSize, getFontSizeClass: () => getFontSizeClass, getFontSizeObjectByValue: () => getFontSizeObjectByValue, getGradientSlugByValue: () => getGradientSlugByValue, getGradientValueBySlug: () => getGradientValueBySlug, getPxFromCssUnit: () => get_px_from_css_unit_default, getSpacingPresetCssVar: () => getSpacingPresetCssVar, getTypographyClassesAndStyles: () => getTypographyClassesAndStyles, isValueSpacingPreset: () => isValueSpacingPreset, privateApis: () => privateApis12, store: () => store, storeConfig: () => storeConfig, transformStyles: () => transform_styles_default, useBlockBindingsUtils: () => useBlockBindingsUtils, useBlockCommands: () => useBlockCommands, useBlockDisplayInformation: () => useBlockDisplayInformation, useBlockEditContext: () => useBlockEditContext, useBlockEditingMode: () => useBlockEditingMode, useBlockProps: () => useBlockProps, useCachedTruthy: () => useCachedTruthy, useHasRecursion: () => useHasRecursion, useInnerBlocksProps: () => useInnerBlocksProps, useSetting: () => useSetting, useSettings: () => useSettings, useStyleOverride: () => useStyleOverride, withColorContext: () => with_color_context_default, withColors: () => withColors, withFontSizes: () => with_font_sizes_default }); // packages/block-editor/build-module/hooks/utils.js var import_blocks94 = __toESM(require_blocks()); var import_element247 = __toESM(require_element()); var import_data176 = __toESM(require_data()); var import_compose94 = __toESM(require_compose()); var import_hooks13 = __toESM(require_hooks()); // packages/block-editor/build-module/components/block-edit/context.js var import_element = __toESM(require_element()); var mayDisplayControlsKey = Symbol("mayDisplayControls"); var mayDisplayParentControlsKey = Symbol("mayDisplayParentControls"); var blockEditingModeKey = Symbol("blockEditingMode"); var blockBindingsKey = Symbol("blockBindings"); var isPreviewModeKey = Symbol("isPreviewMode"); var DEFAULT_BLOCK_EDIT_CONTEXT = { name: "", isSelected: false }; var Context = (0, import_element.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT); Context.displayName = "BlockEditContext"; var { Provider } = Context; function useBlockEditContext() { return (0, import_element.useContext)(Context); } // node_modules/colord/index.mjs var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; var t = function(r3) { return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3; }; var n = function(r3, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r3) / n2 + 0; }; var e = function(r3, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t3 ? r3 : t3; }; var u = function(r3) { return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360; }; var a = function(r3) { return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) }; }; var o = function(r3) { return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) }; }; var i = /^#([0-9a-f]{3,8})$/i; var s = function(r3) { var t3 = r3.toString(16); return t3.length < 2 ? "0" + t3 : t3; }; var h = function(r3) { var t3 = r3.r, n2 = r3.g, e2 = r3.b, u2 = r3.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0; return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; }; var b = function(r3) { var t3 = r3.h, n2 = r3.s, e2 = r3.v, u2 = r3.a; t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100; var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6; return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 }; }; var g = function(r3) { return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) }; }; var d = function(r3) { return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) }; }; var f = function(r3) { return b((n2 = (t3 = r3).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a })); var t3, n2, e2; }; var c = function(r3) { return { h: (t3 = h(r3)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a }; var t3, n2, e2, u2; }; var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var y = { string: [[function(r3) { var t3 = i.exec(r3); return t3 ? (r3 = t3[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null; }, "hex"], [function(r3) { var t3 = v.exec(r3) || m.exec(r3); return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null; }, "rgb"], [function(t3) { var n2 = l.exec(t3) || p.exec(t3); if (!n2) return null; var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); return f(a2); }, "hsl"]], object: [[function(r3) { var n2 = r3.r, e2 = r3.g, u2 = r3.b, o3 = r3.a, i2 = void 0 === o3 ? 1 : o3; return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; }, "rgb"], [function(r3) { var n2 = r3.h, e2 = r3.s, u2 = r3.l, a2 = r3.a, o3 = void 0 === a2 ? 1 : a2; if (!t(n2) || !t(e2) || !t(u2)) return null; var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) }); return f(i2); }, "hsl"], [function(r3) { var n2 = r3.h, a2 = r3.s, o3 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2; if (!t(n2) || !t(a2) || !t(o3)) return null; var h2 = (function(r4) { return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) }; })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) }); return b(h2); }, "hsv"]] }; var N = function(r3, t3) { for (var n2 = 0; n2 < t3.length; n2++) { var e2 = t3[n2][0](r3); if (e2) return [e2, t3[n2][1]]; } return [null, void 0]; }; var x = function(r3) { return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0]; }; var M = function(r3, t3) { var n2 = c(r3); return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a }; }; var H = function(r3) { return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255; }; var $ = function(r3, t3) { var n2 = c(r3); return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a }; }; var j = (function() { function r3(r4) { this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; } return r3.prototype.isValid = function() { return null !== this.parsed; }, r3.prototype.brightness = function() { return n(H(this.rgba), 2); }, r3.prototype.isDark = function() { return H(this.rgba) < 0.5; }, r3.prototype.isLight = function() { return H(this.rgba) >= 0.5; }, r3.prototype.toHex = function() { return r4 = o(this.rgba), t3 = r4.r, e2 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2; var r4, t3, e2, u2, a2, i2; }, r3.prototype.toRgb = function() { return o(this.rgba); }, r3.prototype.toRgbString = function() { return r4 = o(this.rgba), t3 = r4.r, n2 = r4.g, e2 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")"; var r4, t3, n2, e2, u2; }, r3.prototype.toHsl = function() { return d(c(this.rgba)); }, r3.prototype.toHslString = function() { return r4 = d(c(this.rgba)), t3 = r4.h, n2 = r4.s, e2 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)"; var r4, t3, n2, e2, u2; }, r3.prototype.toHsv = function() { return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) }; var r4; }, r3.prototype.invert = function() { return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a }); var r4; }, r3.prototype.saturate = function(r4) { return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4)); }, r3.prototype.desaturate = function(r4) { return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4)); }, r3.prototype.grayscale = function() { return w(M(this.rgba, -1)); }, r3.prototype.lighten = function(r4) { return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4)); }, r3.prototype.darken = function(r4) { return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4)); }, r3.prototype.rotate = function(r4) { return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4); }, r3.prototype.alpha = function(r4) { return "number" == typeof r4 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r4 }) : n(this.rgba.a, 3); var t3; }, r3.prototype.hue = function(r4) { var t3 = c(this.rgba); return "number" == typeof r4 ? w({ h: r4, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h); }, r3.prototype.isEqual = function(r4) { return this.toHex() === w(r4).toHex(); }, r3; })(); var w = function(r3) { return r3 instanceof j ? r3 : new j(r3); }; var S = []; var k = function(r3) { r3.forEach(function(r4) { S.indexOf(r4) < 0 && (r4(j, y), S.push(r4)); }); }; // node_modules/colord/plugins/names.mjs function names_default(e2, f2) { var a2 = { 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" }, r3 = {}; for (var d2 in a2) r3[a2[d2]] = d2; var l2 = {}; e2.prototype.toName = function(f3) { if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; var d3, i2, n2 = r3[this.toHex()]; if (n2) return n2; if (null == f3 ? void 0 : f3.closest) { var o3 = this.toRgb(), t3 = 1 / 0, b2 = "black"; if (!l2.length) for (var c6 in a2) l2[c6] = new e2(a2[c6]).toRgb(); for (var g2 in a2) { var u2 = (d3 = o3, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2)); u2 < t3 && (t3 = u2, b2 = g2); } return b2; } }; f2.string.push([function(f3) { var r4 = f3.toLowerCase(), d3 = "transparent" === r4 ? "#0000" : a2[r4]; return d3 ? new e2(d3).toRgb() : null; }, "name"]); } // node_modules/colord/plugins/a11y.mjs var o2 = function(o3) { var t3 = o3 / 255; return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4); }; var t2 = function(t3) { return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b); }; function a11y_default(o3) { o3.prototype.luminance = function() { return o4 = t2(this.rgba), void 0 === (r3 = 2) && (r3 = 0), void 0 === n2 && (n2 = Math.pow(10, r3)), Math.round(n2 * o4) / n2 + 0; var o4, r3, n2; }, o3.prototype.contrast = function(r3) { void 0 === r3 && (r3 = "#FFF"); var n2, a2, i2, e2, v2, u2, d2, c6 = r3 instanceof o3 ? r3 : new o3(r3); return e2 = this.rgba, v2 = c6.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0; }, o3.prototype.isReadable = function(o4, t3) { return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r3 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r3.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5); var r3, n2, a2, i2, e2; }; } // packages/block-editor/build-module/components/colors/utils.js var import_components = __toESM(require_components()); // packages/block-editor/build-module/lock-unlock.js var import_private_apis = __toESM(require_private_apis()); var { lock, unlock } = (0, import_private_apis.__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-editor" ); // packages/block-editor/build-module/components/colors/utils.js k([names_default, a11y_default]); var { kebabCase } = unlock(import_components.privateApis); var getColorObjectByAttributeValues = (colors2, definedColor, customColor) => { if (definedColor) { const colorObj = colors2?.find( (color) => color.slug === definedColor ); if (colorObj) { return colorObj; } } return { color: customColor }; }; var getColorObjectByColorValue = (colors2, colorValue) => { return colors2?.find((color) => color.color === colorValue); }; function getColorClassName(colorContextName, colorSlug) { if (!colorContextName || !colorSlug) { return void 0; } return `has-${kebabCase(colorSlug)}-${colorContextName}`; } function getMostReadableColor(colors2, colorValue) { const colordColor = w(colorValue); const getColorContrast = ({ color }) => colordColor.contrast(color); const maxContrast = Math.max(...colors2.map(getColorContrast)); return colors2.find((color) => getColorContrast(color) === maxContrast).color; } // packages/block-editor/build-module/components/colors/with-colors.js var import_element9 = __toESM(require_element()); var import_compose2 = __toESM(require_compose()); var import_components5 = __toESM(require_components()); // packages/block-editor/build-module/components/use-settings/index.js var import_data7 = __toESM(require_data()); var import_deprecated5 = __toESM(require_deprecated()); // packages/block-editor/build-module/components/block-edit/index.js var import_element8 = __toESM(require_element()); var import_blocks9 = __toESM(require_blocks()); // node_modules/clsx/dist/clsx.mjs function r2(e2) { var t3, f2, n2 = ""; if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; else if ("object" == typeof e2) if (Array.isArray(e2)) { var o3 = e2.length; for (t3 = 0; t3 < o3; t3++) e2[t3] && (f2 = r2(e2[t3])) && (n2 && (n2 += " "), n2 += f2); } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); return n2; } function clsx() { for (var e2, t3, f2 = 0, n2 = "", o3 = arguments.length; f2 < o3; f2++) (e2 = arguments[f2]) && (t3 = r2(e2)) && (n2 && (n2 += " "), n2 += t3); return n2; } var clsx_default = clsx; // packages/block-editor/build-module/components/block-edit/edit.js var import_blocks = __toESM(require_blocks()); var import_components2 = __toESM(require_components()); var import_data = __toESM(require_data()); var import_element4 = __toESM(require_element()); // packages/block-editor/build-module/components/block-context/index.js var import_element2 = __toESM(require_element()); var import_jsx_runtime = __toESM(require_jsx_runtime()); var Context2 = (0, import_element2.createContext)({}); Context2.displayName = "BlockContext"; function BlockContextProvider({ value, children }) { const context = (0, import_element2.useContext)(Context2); const nextValue = (0, import_element2.useMemo)( () => ({ ...context, ...value }), [context, value] ); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context2.Provider, { value: nextValue, children }); } var block_context_default = Context2; // packages/block-editor/build-module/components/link-control/is-url-like.js var import_url = __toESM(require_url()); function isURLLike(val) { const hasSpaces = val.includes(" "); if (hasSpaces) { return false; } const protocol = (0, import_url.getProtocol)(val); const protocolIsValid = (0, import_url.isValidProtocol)(protocol); const mayBeTLD = hasPossibleTLD(val); const isWWW = val?.startsWith("www."); const isInternal = val?.startsWith("#") && (0, import_url.isValidFragment)(val); return protocolIsValid || isWWW || isInternal || mayBeTLD; } function hasPossibleTLD(url, maxLength = 6) { const cleanedURL = url.split(/[?#]/)[0]; const regex = new RegExp( `(?<=\\S)\\.(?:[a-zA-Z_]{2,${maxLength}})(?:\\/|$)` ); return regex.test(cleanedURL); } // packages/block-editor/build-module/utils/block-bindings.js var DEFAULT_ATTRIBUTE = "__default"; var PATTERN_OVERRIDES_SOURCE = "core/pattern-overrides"; function hasPatternOverridesDefaultBinding(bindings) { return bindings?.[DEFAULT_ATTRIBUTE]?.source === PATTERN_OVERRIDES_SOURCE; } function replacePatternOverridesDefaultBinding(bindings, supportedAttributes) { if (hasPatternOverridesDefaultBinding(bindings)) { const bindingsWithDefaults = {}; for (const attributeName of supportedAttributes) { const bindingSource = bindings[attributeName] ? bindings[attributeName] : { source: PATTERN_OVERRIDES_SOURCE }; bindingsWithDefaults[attributeName] = bindingSource; } return bindingsWithDefaults; } return bindings; } // packages/block-editor/build-module/components/block-list/private-block-context.js var import_element3 = __toESM(require_element()); var PrivateBlockContext = (0, import_element3.createContext)({}); PrivateBlockContext.displayName = "PrivateBlockContext"; // packages/block-editor/build-module/components/block-edit/edit.js var import_jsx_runtime2 = __toESM(require_jsx_runtime()); var DEFAULT_BLOCK_CONTEXT = {}; var Edit = (props) => { const { name } = props; const blockType = (0, import_blocks.getBlockType)(name); if (!blockType) { return null; } const Component7 = blockType.edit || blockType.save; return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component7, { ...props }); }; var EditWithFilters = (0, import_components2.withFilters)("editor.BlockEdit")(Edit); var EditWithGeneratedProps = (props) => { const { name, clientId, attributes, setAttributes } = props; const registry = (0, import_data.useRegistry)(); const blockType = (0, import_blocks.getBlockType)(name); const blockContext = (0, import_element4.useContext)(block_context_default); const registeredSources = (0, import_data.useSelect)( (select3) => unlock(select3(import_blocks.store)).getAllBlockBindingsSources(), [] ); const { bindableAttributes } = (0, import_element4.useContext)(PrivateBlockContext); const { blockBindings, context, hasPatternOverrides } = (0, import_element4.useMemo)(() => { const computedContext = blockType?.usesContext ? Object.fromEntries( Object.entries(blockContext).filter( ([key]) => blockType.usesContext.includes(key) ) ) : DEFAULT_BLOCK_CONTEXT; if (attributes?.metadata?.bindings) { Object.values(attributes?.metadata?.bindings || {}).forEach( (binding) => { registeredSources[binding?.source]?.usesContext?.forEach( (key) => { computedContext[key] = blockContext[key]; } ); } ); } return { blockBindings: replacePatternOverridesDefaultBinding( attributes?.metadata?.bindings, bindableAttributes ), context: computedContext, hasPatternOverrides: hasPatternOverridesDefaultBinding( attributes?.metadata?.bindings ) }; }, [ blockType?.usesContext, blockContext, attributes?.metadata?.bindings, bindableAttributes, registeredSources ]); const computedAttributes = (0, import_data.useSelect)( (select3) => { if (!blockBindings) { return attributes; } const attributesFromSources = {}; const blockBindingsBySource = /* @__PURE__ */ new Map(); for (const [attributeName, binding] of Object.entries( blockBindings )) { const { source: sourceName, args: sourceArgs } = binding; const source = registeredSources[sourceName]; if (!source || !bindableAttributes?.includes(attributeName)) { continue; } blockBindingsBySource.set(source, { ...blockBindingsBySource.get(source), [attributeName]: { args: sourceArgs } }); } if (blockBindingsBySource.size) { for (const [source, bindings] of blockBindingsBySource) { let values = {}; if (!source.getValues) { Object.keys(bindings).forEach((attr) => { values[attr] = source.label; }); } else { values = source.getValues({ select: select3, context, clientId, bindings }); } for (const [attributeName, value] of Object.entries( values )) { if (attributeName === "url" && (!value || !isURLLike(value))) { attributesFromSources[attributeName] = null; } else { attributesFromSources[attributeName] = value; } } } } return { ...attributes, ...attributesFromSources }; }, [ attributes, bindableAttributes, blockBindings, clientId, context, registeredSources ] ); const setBoundAttributes = (0, import_element4.useCallback)( (nextAttributes) => { if (!blockBindings) { setAttributes(nextAttributes); return; } registry.batch(() => { const keptAttributes = { ...nextAttributes }; const blockBindingsBySource = /* @__PURE__ */ new Map(); for (const [attributeName, newValue] of Object.entries( keptAttributes )) { if (!blockBindings[attributeName] || !bindableAttributes?.includes(attributeName)) { continue; } const binding = blockBindings[attributeName]; const source = registeredSources[binding?.source]; if (!source?.setValues) { continue; } blockBindingsBySource.set(source, { ...blockBindingsBySource.get(source), [attributeName]: { args: binding.args, newValue } }); delete keptAttributes[attributeName]; } if (blockBindingsBySource.size) { for (const [ source, bindings ] of blockBindingsBySource) { source.setValues({ select: registry.select, dispatch: registry.dispatch, context, clientId, bindings }); } } const hasParentPattern = !!context["pattern/overrides"]; if ( // Don't update non-connected attributes if the block is using pattern overrides // and the editing is happening while overriding the pattern (not editing the original). !(hasPatternOverrides && hasParentPattern) && Object.keys(keptAttributes).length ) { if (hasPatternOverrides) { delete keptAttributes.href; } setAttributes(keptAttributes); } }); }, [ bindableAttributes, blockBindings, clientId, context, hasPatternOverrides, setAttributes, registeredSources, registry ] ); if (!blockType) { return null; } if (blockType.apiVersion > 1) { return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( EditWithFilters, { ...props, attributes: computedAttributes, context, setAttributes: setBoundAttributes } ); } const generatedClassName = (0, import_blocks.hasBlockSupport)(blockType, "className", true) ? (0, import_blocks.getBlockDefaultClassName)(name) : null; const className = clsx_default( generatedClassName, attributes?.className, props.className ); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( EditWithFilters, { ...props, attributes: computedAttributes, className, context, setAttributes: setBoundAttributes } ); }; var edit_default = EditWithGeneratedProps; // packages/block-editor/build-module/components/block-edit/multiple-usage-warning.js var import_blocks8 = __toESM(require_blocks()); var import_components4 = __toESM(require_components()); var import_data6 = __toESM(require_data()); var import_i18n6 = __toESM(require_i18n()); // packages/block-editor/build-module/store/index.js var import_data5 = __toESM(require_data()); // packages/block-editor/build-module/store/reducer.js var import_es6 = __toESM(require_es6()); var import_compose = __toESM(require_compose()); var import_data2 = __toESM(require_data()); var import_deprecated = __toESM(require_deprecated()); var import_blocks2 = __toESM(require_blocks()); // packages/block-editor/build-module/store/defaults.js var import_i18n = __toESM(require_i18n()); var PREFERENCES_DEFAULTS = { insertUsage: {} }; var SETTINGS_DEFAULTS = { alignWide: false, supportsLayout: true, // colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. colors: [ { name: (0, import_i18n.__)("Black"), slug: "black", color: "#000000" }, { name: (0, import_i18n.__)("Cyan bluish gray"), slug: "cyan-bluish-gray", color: "#abb8c3" }, { name: (0, import_i18n.__)("White"), slug: "white", color: "#ffffff" }, { name: (0, import_i18n.__)("Pale pink"), slug: "pale-pink", color: "#f78da7" }, { name: (0, import_i18n.__)("Vivid red"), slug: "vivid-red", color: "#cf2e2e" }, { name: (0, import_i18n.__)("Luminous vivid orange"), slug: "luminous-vivid-orange", color: "#ff6900" }, { name: (0, import_i18n.__)("Luminous vivid amber"), slug: "luminous-vivid-amber", color: "#fcb900" }, { name: (0, import_i18n.__)("Light green cyan"), slug: "light-green-cyan", color: "#7bdcb5" }, { name: (0, import_i18n.__)("Vivid green cyan"), slug: "vivid-green-cyan", color: "#00d084" }, { name: (0, import_i18n.__)("Pale cyan blue"), slug: "pale-cyan-blue", color: "#8ed1fc" }, { name: (0, import_i18n.__)("Vivid cyan blue"), slug: "vivid-cyan-blue", color: "#0693e3" }, { name: (0, import_i18n.__)("Vivid purple"), slug: "vivid-purple", color: "#9b51e0" } ], // fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. fontSizes: [ { name: (0, import_i18n._x)("Small", "font size name"), size: 13, slug: "small" }, { name: (0, import_i18n._x)("Normal", "font size name"), size: 16, slug: "normal" }, { name: (0, import_i18n._x)("Medium", "font size name"), size: 20, slug: "medium" }, { name: (0, import_i18n._x)("Large", "font size name"), size: 36, slug: "large" }, { name: (0, import_i18n._x)("Huge", "font size name"), size: 42, slug: "huge" } ], // Image default size slug. imageDefaultSize: "large", imageSizes: [ { slug: "thumbnail", name: (0, import_i18n.__)("Thumbnail") }, { slug: "medium", name: (0, import_i18n.__)("Medium") }, { slug: "large", name: (0, import_i18n.__)("Large") }, { slug: "full", name: (0, import_i18n.__)("Full Size") } ], // Allow plugin to disable Image Editor if need be. imageEditing: true, // This is current max width of the block inner area // It's used to constraint image resizing and this value could be overridden later by themes maxWidth: 580, // Allowed block types for the editor, defaulting to true (all supported). allowedBlockTypes: true, // Maximum upload size in bytes allowed for the site. maxUploadFileSize: 0, // List of allowed mime types and file extensions. allowedMimeTypes: null, // Allows to disable block locking interface. canLockBlocks: true, // Allows to disable Openverse media category in the inserter. enableOpenverseMediaCategory: true, clearBlockSelection: true, __experimentalCanUserUseUnfilteredHTML: false, __experimentalBlockDirectory: false, __mobileEnablePageTemplates: false, __experimentalBlockPatterns: [], __experimentalBlockPatternCategories: [], isPreviewMode: false, // These settings will be completely revamped in the future. // The goal is to evolve this into an API which will instruct // the block inspector to animate transitions between what it // displays based on the relationship between the selected block // and its parent, and only enable it if the parent is controlling // its children blocks. blockInspectorAnimation: { animationParent: "core/navigation", "core/navigation": { enterDirection: "leftToRight" }, "core/navigation-submenu": { enterDirection: "rightToLeft" }, "core/navigation-link": { enterDirection: "rightToLeft" }, "core/search": { enterDirection: "rightToLeft" }, "core/social-links": { enterDirection: "rightToLeft" }, "core/page-list": { enterDirection: "rightToLeft" }, "core/spacer": { enterDirection: "rightToLeft" }, "core/home-link": { enterDirection: "rightToLeft" }, "core/site-title": { enterDirection: "rightToLeft" }, "core/site-logo": { enterDirection: "rightToLeft" } }, generateAnchors: false, // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. gradients: [ { name: (0, import_i18n.__)("Vivid cyan blue to vivid purple"), gradient: "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)", slug: "vivid-cyan-blue-to-vivid-purple" }, { name: (0, import_i18n.__)("Light green cyan to vivid green cyan"), gradient: "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)", slug: "light-green-cyan-to-vivid-green-cyan" }, { name: (0, import_i18n.__)("Luminous vivid amber to luminous vivid orange"), gradient: "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)", slug: "luminous-vivid-amber-to-luminous-vivid-orange" }, { name: (0, import_i18n.__)("Luminous vivid orange to vivid red"), gradient: "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)", slug: "luminous-vivid-orange-to-vivid-red" }, { name: (0, import_i18n.__)("Very light gray to cyan bluish gray"), gradient: "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)", slug: "very-light-gray-to-cyan-bluish-gray" }, { name: (0, import_i18n.__)("Cool to warm spectrum"), gradient: "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)", slug: "cool-to-warm-spectrum" }, { name: (0, import_i18n.__)("Blush light purple"), gradient: "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)", slug: "blush-light-purple" }, { name: (0, import_i18n.__)("Blush bordeaux"), gradient: "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)", slug: "blush-bordeaux" }, { name: (0, import_i18n.__)("Luminous dusk"), gradient: "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)", slug: "luminous-dusk" }, { name: (0, import_i18n.__)("Pale ocean"), gradient: "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)", slug: "pale-ocean" }, { name: (0, import_i18n.__)("Electric grass"), gradient: "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)", slug: "electric-grass" }, { name: (0, import_i18n.__)("Midnight"), gradient: "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)", slug: "midnight" } ], __unstableResolvedAssets: { styles: [], scripts: [] } }; // packages/block-editor/build-module/store/array.js function insertAt(array, elements, index) { return [ ...array.slice(0, index), ...Array.isArray(elements) ? elements : [elements], ...array.slice(index) ]; } function moveTo(array, from, to2, count = 1) { const withoutMovedElements = [...array]; withoutMovedElements.splice(from, count); return insertAt( withoutMovedElements, array.slice(from, from + count), to2 ); } // packages/block-editor/build-module/store/private-keys.js var globalStylesDataKey = Symbol("globalStylesDataKey"); var globalStylesLinksDataKey = Symbol("globalStylesLinks"); var selectBlockPatternsKey = Symbol("selectBlockPatternsKey"); var reusableBlocksSelectKey = Symbol("reusableBlocksSelect"); var sectionRootClientIdKey = Symbol("sectionRootClientIdKey"); var mediaEditKey = Symbol("mediaEditKey"); var getMediaSelectKey = Symbol("getMediaSelect"); var essentialFormatKey = Symbol("essentialFormat"); var isIsolatedEditorKey = Symbol("isIsolatedEditor"); // packages/block-editor/build-module/store/reducer.js var { isContentBlock } = unlock(import_blocks2.privateApis); var identity = (x2) => x2; function mapBlockOrder(blocks2, rootClientId = "") { const result = /* @__PURE__ */ new Map(); const current = []; result.set(rootClientId, current); blocks2.forEach((block) => { const { clientId, innerBlocks } = block; current.push(clientId); mapBlockOrder(innerBlocks, clientId).forEach( (order, subClientId) => { result.set(subClientId, order); } ); }); return result; } function mapBlockParents(blocks2, rootClientId = "") { const result = []; const stack = [[rootClientId, blocks2]]; while (stack.length) { const [parent, currentBlocks] = stack.shift(); currentBlocks.forEach(({ innerBlocks, ...block }) => { result.push([block.clientId, parent]); if (innerBlocks?.length) { stack.push([block.clientId, innerBlocks]); } }); } return result; } function flattenBlocks(blocks2, transform = identity) { const result = []; const stack = [...blocks2]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result.push([block.clientId, transform(block)]); } return result; } function getFlattenedClientIds(blocks2) { const result = {}; const stack = [...blocks2]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result[block.clientId] = true; } return result; } function getFlattenedBlocksWithoutAttributes(blocks2) { return flattenBlocks(blocks2, (block) => { const { attributes, ...restBlock } = block; return restBlock; }); } function getFlattenedBlockAttributes(blocks2) { return flattenBlocks(blocks2, (block) => block.attributes); } function hasSameKeys(a2, b2) { return (0, import_es6.default)(Object.keys(a2), Object.keys(b2)); } function isUpdatingSameBlockAttribute(action, lastAction) { return action.type === "UPDATE_BLOCK_ATTRIBUTES" && lastAction !== void 0 && lastAction.type === "UPDATE_BLOCK_ATTRIBUTES" && (0, import_es6.default)(action.clientIds, lastAction.clientIds) && hasSameKeys(action.attributes, lastAction.attributes); } function updateBlockTreeForBlocks(state, blocks2) { const treeToUpdate = state.tree; const stack = [...blocks2]; const flattenedBlocks = [...blocks2]; while (stack.length) { const block = stack.shift(); stack.push(...block.innerBlocks); flattenedBlocks.push(...block.innerBlocks); } for (const block of flattenedBlocks) { treeToUpdate.set(block.clientId, {}); } for (const block of flattenedBlocks) { treeToUpdate.set( block.clientId, Object.assign(treeToUpdate.get(block.clientId), { ...state.byClientId.get(block.clientId), attributes: state.attributes.get(block.clientId), innerBlocks: block.innerBlocks.map( (subBlock) => treeToUpdate.get(subBlock.clientId) ) }) ); } } function updateParentInnerBlocksInTree(state, updatedClientIds, updateChildrenOfUpdatedClientIds = false) { const treeToUpdate = state.tree; const uncontrolledParents = /* @__PURE__ */ new Set([]); const controlledParents = /* @__PURE__ */ new Set(); for (const clientId of updatedClientIds) { let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents.get(clientId); do { if (state.controlledInnerBlocks[current]) { controlledParents.add(current); break; } else { uncontrolledParents.add(current); current = state.parents.get(current); } } while (current !== void 0); } for (const clientId of uncontrolledParents) { treeToUpdate.set(clientId, { ...treeToUpdate.get(clientId) }); } for (const clientId of uncontrolledParents) { treeToUpdate.get(clientId).innerBlocks = (state.order.get(clientId) || []).map((subClientId) => treeToUpdate.get(subClientId)); } for (const clientId of controlledParents) { treeToUpdate.set("controlled||" + clientId, { innerBlocks: (state.order.get(clientId) || []).map( (subClientId) => treeToUpdate.get(subClientId) ) }); } } var withBlockTree = (reducer4) => (state = {}, action) => { const newState = reducer4(state, action); if (newState === state) { return state; } newState.tree = state.tree ? state.tree : /* @__PURE__ */ new Map(); switch (action.type) { case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { newState.tree = new Map(newState.tree); updateBlockTreeForBlocks(newState, action.blocks); updateParentInnerBlocksInTree( newState, action.rootClientId ? [action.rootClientId] : [""], true ); break; } case "UPDATE_BLOCK": newState.tree = new Map(newState.tree); newState.tree.set(action.clientId, { ...newState.tree.get(action.clientId), ...newState.byClientId.get(action.clientId), attributes: newState.attributes.get(action.clientId) }); updateParentInnerBlocksInTree( newState, [action.clientId], false ); break; case "SYNC_DERIVED_BLOCK_ATTRIBUTES": case "UPDATE_BLOCK_ATTRIBUTES": { newState.tree = new Map(newState.tree); action.clientIds.forEach((clientId) => { newState.tree.set(clientId, { ...newState.tree.get(clientId), attributes: newState.attributes.get(clientId) }); }); updateParentInnerBlocksInTree( newState, action.clientIds, false ); break; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const inserterClientIds = getFlattenedClientIds( action.blocks ); newState.tree = new Map(newState.tree); action.replacedClientIds.forEach((clientId) => { newState.tree.delete(clientId); if (!inserterClientIds[clientId]) { newState.tree.delete("controlled||" + clientId); } }); updateBlockTreeForBlocks(newState, action.blocks); updateParentInnerBlocksInTree( newState, action.blocks.map((b2) => b2.clientId), false ); const parentsOfRemovedBlocks2 = []; for (const clientId of action.clientIds) { const parentId = state.parents.get(clientId); if (parentId !== void 0 && (parentId === "" || newState.byClientId.get(parentId))) { parentsOfRemovedBlocks2.push(parentId); } } updateParentInnerBlocksInTree( newState, parentsOfRemovedBlocks2, true ); break; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": const parentsOfRemovedBlocks = []; for (const clientId of action.clientIds) { const parentId = state.parents.get(clientId); if (parentId !== void 0 && (parentId === "" || newState.byClientId.get(parentId))) { parentsOfRemovedBlocks.push(parentId); } } newState.tree = new Map(newState.tree); action.removedClientIds.forEach((clientId) => { newState.tree.delete(clientId); newState.tree.delete("controlled||" + clientId); }); updateParentInnerBlocksInTree( newState, parentsOfRemovedBlocks, true ); break; case "MOVE_BLOCKS_TO_POSITION": { const updatedBlockUids = []; if (action.fromRootClientId) { updatedBlockUids.push(action.fromRootClientId); } else { updatedBlockUids.push(""); } if (action.toRootClientId) { updatedBlockUids.push(action.toRootClientId); } newState.tree = new Map(newState.tree); updateParentInnerBlocksInTree( newState, updatedBlockUids, true ); break; } case "MOVE_BLOCKS_UP": case "MOVE_BLOCKS_DOWN": { const updatedBlockUids = [ action.rootClientId ? action.rootClientId : "" ]; newState.tree = new Map(newState.tree); updateParentInnerBlocksInTree( newState, updatedBlockUids, true ); break; } case "SAVE_REUSABLE_BLOCK_SUCCESS": { const updatedBlockUids = []; newState.attributes.forEach((attributes, clientId) => { if (newState.byClientId.get(clientId).name === "core/block" && attributes.ref === action.updatedId) { updatedBlockUids.push(clientId); } }); newState.tree = new Map(newState.tree); updatedBlockUids.forEach((clientId) => { newState.tree.set(clientId, { ...newState.byClientId.get(clientId), attributes: newState.attributes.get(clientId), innerBlocks: newState.tree.get(clientId).innerBlocks }); }); updateParentInnerBlocksInTree( newState, updatedBlockUids, false ); } } return newState; }; function withPersistentBlockChange(reducer4) { let lastAction; let markNextChangeAsNotPersistent = false; let explicitPersistent; return (state, action) => { let nextState = reducer4(state, action); let nextIsPersistentChange; if (action.type === "SET_EXPLICIT_PERSISTENT") { explicitPersistent = action.isPersistentChange; nextIsPersistentChange = state.isPersistentChange ?? true; } if (explicitPersistent !== void 0) { nextIsPersistentChange = explicitPersistent; return nextIsPersistentChange === nextState.isPersistentChange ? nextState : { ...nextState, isPersistentChange: nextIsPersistentChange }; } const isExplicitPersistentChange = action.type === "MARK_LAST_CHANGE_AS_PERSISTENT" || markNextChangeAsNotPersistent; if (state === nextState && !isExplicitPersistentChange) { markNextChangeAsNotPersistent = action.type === "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"; nextIsPersistentChange = state?.isPersistentChange ?? true; if (state.isPersistentChange === nextIsPersistentChange) { return state; } return { ...nextState, isPersistentChange: nextIsPersistentChange }; } nextState = { ...nextState, isPersistentChange: isExplicitPersistentChange ? !markNextChangeAsNotPersistent : !isUpdatingSameBlockAttribute(action, lastAction) }; lastAction = action; markNextChangeAsNotPersistent = action.type === "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"; return nextState; }; } function withIgnoredBlockChange(reducer4) { const IGNORED_ACTION_TYPES = /* @__PURE__ */ new Set(["RECEIVE_BLOCKS"]); return (state, action) => { const nextState = reducer4(state, action); if (nextState !== state) { nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type); } return nextState; }; } var withInnerBlocksRemoveCascade = (reducer4) => (state, action) => { const getAllChildren = (clientIds) => { let result = clientIds; for (let i2 = 0; i2 < result.length; i2++) { if (!state.order.get(result[i2]) || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i2]]) { continue; } if (result === clientIds) { result = [...result]; } result.push(...state.order.get(result[i2])); } return result; }; if (state) { switch (action.type) { case "REMOVE_BLOCKS": action = { ...action, type: "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN", removedClientIds: getAllChildren(action.clientIds) }; break; case "REPLACE_BLOCKS": action = { ...action, type: "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN", replacedClientIds: getAllChildren(action.clientIds) }; break; } } return reducer4(state, action); }; var withBlockReset = (reducer4) => (state, action) => { if (action.type === "RESET_BLOCKS") { const newState = { ...state, byClientId: new Map( getFlattenedBlocksWithoutAttributes(action.blocks) ), attributes: new Map(getFlattenedBlockAttributes(action.blocks)), order: mapBlockOrder(action.blocks), parents: new Map(mapBlockParents(action.blocks)), controlledInnerBlocks: {} }; newState.tree = new Map(state?.tree); updateBlockTreeForBlocks(newState, action.blocks); newState.tree.set("", { innerBlocks: action.blocks.map( (subBlock) => newState.tree.get(subBlock.clientId) ) }); return newState; } return reducer4(state, action); }; var withReplaceInnerBlocks = (reducer4) => (state, action) => { if (action.type !== "REPLACE_INNER_BLOCKS") { return reducer4(state, action); } const nestedControllers = {}; if (Object.keys(state.controlledInnerBlocks).length) { const stack = [...action.blocks]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); if (!!state.controlledInnerBlocks[block.clientId]) { nestedControllers[block.clientId] = true; } } } let stateAfterBlocksRemoval = state; if (state.order.get(action.rootClientId)) { stateAfterBlocksRemoval = reducer4(stateAfterBlocksRemoval, { type: "REMOVE_BLOCKS", keepControlledInnerBlocks: nestedControllers, clientIds: state.order.get(action.rootClientId) }); } let stateAfterInsert = stateAfterBlocksRemoval; if (action.blocks.length) { stateAfterInsert = reducer4(stateAfterInsert, { ...action, type: "INSERT_BLOCKS", index: 0 }); const stateAfterInsertOrder = new Map(stateAfterInsert.order); Object.keys(nestedControllers).forEach((key) => { if (state.order.get(key)) { stateAfterInsertOrder.set(key, state.order.get(key)); } }); stateAfterInsert.order = stateAfterInsertOrder; stateAfterInsert.tree = new Map(stateAfterInsert.tree); Object.keys(nestedControllers).forEach((_key) => { const key = `controlled||${_key}`; if (state.tree.has(key)) { stateAfterInsert.tree.set(key, state.tree.get(key)); } }); } return stateAfterInsert; }; var withSaveReusableBlock = (reducer4) => (state, action) => { if (state && action.type === "SAVE_REUSABLE_BLOCK_SUCCESS") { const { id, updatedId } = action; if (id === updatedId) { return state; } state = { ...state }; state.attributes = new Map(state.attributes); state.attributes.forEach((attributes, clientId) => { const { name } = state.byClientId.get(clientId); if (name === "core/block" && attributes.ref === id) { state.attributes.set(clientId, { ...attributes, ref: updatedId }); } }); } return reducer4(state, action); }; var withResetControlledBlocks = (reducer4) => (state, action) => { if (action.type === "SET_HAS_CONTROLLED_INNER_BLOCKS") { const tempState = reducer4(state, { type: "REPLACE_INNER_BLOCKS", rootClientId: action.clientId, blocks: [] }); return reducer4(tempState, action); } return reducer4(state, action); }; var blocks = (0, import_compose.pipe)( import_data2.combineReducers, withSaveReusableBlock, // Needs to be before withBlockCache. withBlockTree, // Needs to be before withInnerBlocksRemoveCascade. withInnerBlocksRemoveCascade, withReplaceInnerBlocks, // Needs to be after withInnerBlocksRemoveCascade. withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks )({ // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. byClientId(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { const newState = new Map(state); getFlattenedBlocksWithoutAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "UPDATE_BLOCK": { if (!state.has(action.clientId)) { return state; } const { attributes, ...changes } = action.updates; if (Object.values(changes).length === 0) { return state; } const newState = new Map(state); newState.set(action.clientId, { ...state.get(action.clientId), ...changes }); return newState; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { if (!action.blocks) { return state; } const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); getFlattenedBlocksWithoutAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); return newState; } } return state; }, // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. attributes(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { const newState = new Map(state); getFlattenedBlockAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "UPDATE_BLOCK": { if (!state.get(action.clientId) || !action.updates.attributes) { return state; } const newState = new Map(state); newState.set(action.clientId, { ...state.get(action.clientId), ...action.updates.attributes }); return newState; } case "SYNC_DERIVED_BLOCK_ATTRIBUTES": case "UPDATE_BLOCK_ATTRIBUTES": { if (action.clientIds.every((id) => !state.get(id))) { return state; } let hasChange = false; const newState = new Map(state); for (const clientId of action.clientIds) { const updatedAttributeEntries = Object.entries( !!action.options?.uniqueByBlock ? action.attributes[clientId] : action.attributes ?? {} ); if (updatedAttributeEntries.length === 0) { continue; } let hasUpdatedAttributes = false; const existingAttributes = state.get(clientId); const newAttributes = {}; updatedAttributeEntries.forEach(([key, value]) => { if (existingAttributes[key] !== value) { hasUpdatedAttributes = true; newAttributes[key] = value; } }); hasChange = hasChange || hasUpdatedAttributes; if (hasUpdatedAttributes) { newState.set(clientId, { ...existingAttributes, ...newAttributes }); } } return hasChange ? newState : state; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { if (!action.blocks) { return state; } const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); getFlattenedBlockAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); return newState; } } return state; }, // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. order(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": { const blockOrder = mapBlockOrder(action.blocks); const newState = new Map(state); blockOrder.forEach((order, clientId) => { if (clientId !== "") { newState.set(clientId, order); } }); newState.set( "", (state.get("") ?? []).concat(blockOrder[""]) ); return newState; } case "INSERT_BLOCKS": { const { rootClientId = "" } = action; const subState = state.get(rootClientId) || []; const mappedBlocks = mapBlockOrder( action.blocks, rootClientId ); const { index = subState.length } = action; const newState = new Map(state); mappedBlocks.forEach((order, clientId) => { newState.set(clientId, order); }); newState.set( rootClientId, insertAt( subState, mappedBlocks.get(rootClientId), index ) ); return newState; } case "MOVE_BLOCKS_TO_POSITION": { const { fromRootClientId = "", toRootClientId = "", clientIds } = action; const { index = state.get(toRootClientId).length } = action; if (fromRootClientId === toRootClientId) { const subState = state.get(toRootClientId); const fromIndex = subState.indexOf(clientIds[0]); const newState2 = new Map(state); newState2.set( toRootClientId, moveTo( state.get(toRootClientId), fromIndex, index, clientIds.length ) ); return newState2; } const newState = new Map(state); newState.set( fromRootClientId, state.get(fromRootClientId)?.filter((id) => !clientIds.includes(id)) ?? [] ); newState.set( toRootClientId, insertAt(state.get(toRootClientId), clientIds, index) ); return newState; } case "MOVE_BLOCKS_UP": { const { clientIds, rootClientId = "" } = action; const firstClientId = clientIds[0]; const subState = state.get(rootClientId); if (!subState.length || firstClientId === subState[0]) { return state; } const firstIndex = subState.indexOf(firstClientId); const newState = new Map(state); newState.set( rootClientId, moveTo( subState, firstIndex, firstIndex - 1, clientIds.length ) ); return newState; } case "MOVE_BLOCKS_DOWN": { const { clientIds, rootClientId = "" } = action; const firstClientId = clientIds[0]; const lastClientId = clientIds[clientIds.length - 1]; const subState = state.get(rootClientId); if (!subState.length || lastClientId === subState[subState.length - 1]) { return state; } const firstIndex = subState.indexOf(firstClientId); const newState = new Map(state); newState.set( rootClientId, moveTo( subState, firstIndex, firstIndex + 1, clientIds.length ) ); return newState; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const { clientIds } = action; if (!action.blocks) { return state; } const mappedBlocks = mapBlockOrder(action.blocks); const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); mappedBlocks.forEach((order, clientId) => { if (clientId !== "") { newState.set(clientId, order); } }); newState.forEach((order, clientId) => { const newSubOrder = Object.values(order).reduce( (result, subClientId) => { if (subClientId === clientIds[0]) { return [...result, ...mappedBlocks.get("")]; } if (clientIds.indexOf(subClientId) === -1) { result.push(subClientId); } return result; }, [] ); newState.set(clientId, newSubOrder); }); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); newState.forEach((order, clientId) => { const newSubOrder = order?.filter( (id) => !action.removedClientIds.includes(id) ) ?? []; if (newSubOrder.length !== order.length) { newState.set(clientId, newSubOrder); } }); return newState; } } return state; }, // While technically redundant data as the inverse of `order`, it serves as // an optimization for the selectors which derive the ancestry of a block. parents(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": { const newState = new Map(state); mapBlockParents(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "INSERT_BLOCKS": { const newState = new Map(state); mapBlockParents( action.blocks, action.rootClientId || "" ).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case "MOVE_BLOCKS_TO_POSITION": { const newState = new Map(state); action.clientIds.forEach((id) => { newState.set(id, action.toRootClientId || ""); }); return newState; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); mapBlockParents( action.blocks, state.get(action.clientIds[0]) ).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); return newState; } } return state; }, controlledInnerBlocks(state = {}, { type, clientId, hasControlledInnerBlocks }) { if (type === "SET_HAS_CONTROLLED_INNER_BLOCKS") { return { ...state, [clientId]: hasControlledInnerBlocks }; } return state; } }); function isBlockInterfaceHidden(state = false, action) { switch (action.type) { case "HIDE_BLOCK_INTERFACE": return true; case "SHOW_BLOCK_INTERFACE": return false; } return state; } function isTyping(state = false, action) { switch (action.type) { case "START_TYPING": return true; case "STOP_TYPING": return false; } return state; } function isDragging(state = false, action) { switch (action.type) { case "START_DRAGGING": return true; case "STOP_DRAGGING": return false; } return state; } function draggedBlocks(state = [], action) { switch (action.type) { case "START_DRAGGING_BLOCKS": return action.clientIds; case "STOP_DRAGGING_BLOCKS": return []; } return state; } function blockVisibility(state = {}, action) { if (action.type === "SET_BLOCK_VISIBILITY") { return { ...state, ...action.updates }; } return state; } function selectionHelper(state = {}, action) { switch (action.type) { case "CLEAR_SELECTED_BLOCK": { if (state.clientId) { return {}; } return state; } case "SELECT_BLOCK": if (action.clientId === state.clientId) { return state; } return { clientId: action.clientId }; case "REPLACE_INNER_BLOCKS": case "INSERT_BLOCKS": { if (!action.updateSelection || !action.blocks.length) { return state; } return { clientId: action.blocks[0].clientId }; } case "REMOVE_BLOCKS": if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) { return state; } return {}; case "REPLACE_BLOCKS": { if (action.clientIds.indexOf(state.clientId) === -1) { return state; } const blockToSelect = action.blocks[action.indexToSelect] || action.blocks[action.blocks.length - 1]; if (!blockToSelect) { return {}; } if (blockToSelect.clientId === state.clientId) { return state; } return { clientId: blockToSelect.clientId }; } } return state; } function selection(state = {}, action) { switch (action.type) { case "SELECTION_CHANGE": if (action.clientId) { return { selectionStart: { clientId: action.clientId, attributeKey: action.attributeKey, offset: action.startOffset }, selectionEnd: { clientId: action.clientId, attributeKey: action.attributeKey, offset: action.endOffset } }; } return { selectionStart: action.start || state.selectionStart, selectionEnd: action.end || state.selectionEnd }; case "RESET_SELECTION": const { selectionStart: selectionStart2, selectionEnd: selectionEnd2 } = action; return { selectionStart: selectionStart2, selectionEnd: selectionEnd2 }; case "MULTI_SELECT": const { start: start2, end } = action; if (start2 === state.selectionStart?.clientId && end === state.selectionEnd?.clientId) { return state; } return { selectionStart: { clientId: start2 }, selectionEnd: { clientId: end } }; case "RESET_BLOCKS": const startClientId = state?.selectionStart?.clientId; const endClientId = state?.selectionEnd?.clientId; if (!startClientId && !endClientId) { return state; } if (!action.blocks.some( (block) => block.clientId === startClientId )) { return { selectionStart: {}, selectionEnd: {} }; } if (!action.blocks.some( (block) => block.clientId === endClientId )) { return { ...state, selectionEnd: state.selectionStart }; } } const selectionStart = selectionHelper(state.selectionStart, action); const selectionEnd = selectionHelper(state.selectionEnd, action); if (selectionStart === state.selectionStart && selectionEnd === state.selectionEnd) { return state; } return { selectionStart, selectionEnd }; } function isMultiSelecting(state = false, action) { switch (action.type) { case "START_MULTI_SELECT": return true; case "STOP_MULTI_SELECT": return false; } return state; } function isSelectionEnabled(state = true, action) { switch (action.type) { case "TOGGLE_SELECTION": return action.isSelectionEnabled; } return state; } function removalPromptData(state = false, action) { switch (action.type) { case "DISPLAY_BLOCK_REMOVAL_PROMPT": const { clientIds, selectPrevious, message: message2 } = action; return { clientIds, selectPrevious, message: message2 }; case "CLEAR_BLOCK_REMOVAL_PROMPT": return false; } return state; } function blockRemovalRules(state = false, action) { switch (action.type) { case "SET_BLOCK_REMOVAL_RULES": return action.rules; } return state; } function initialPosition(state = null, action) { if (action.type === "REPLACE_BLOCKS" && action.initialPosition !== void 0) { return action.initialPosition; } else if ([ "MULTI_SELECT", "SELECT_BLOCK", "RESET_SELECTION", "INSERT_BLOCKS", "REPLACE_INNER_BLOCKS" ].includes(action.type)) { return action.initialPosition; } return state; } function blocksMode(state = {}, action) { if (action.type === "TOGGLE_BLOCK_MODE") { const { clientId } = action; return { ...state, [clientId]: state[clientId] && state[clientId] === "html" ? "visual" : "html" }; } return state; } function insertionCue(state = null, action) { switch (action.type) { case "SHOW_INSERTION_POINT": { const { rootClientId, index, __unstableWithInserter, operation, nearestSide } = action; const nextState = { rootClientId, index, __unstableWithInserter, operation, nearestSide }; return (0, import_es6.default)(state, nextState) ? state : nextState; } case "HIDE_INSERTION_POINT": return null; } return state; } function template(state = { isValid: true }, action) { switch (action.type) { case "SET_TEMPLATE_VALIDITY": return { ...state, isValid: action.isValid }; } return state; } function settings(state = SETTINGS_DEFAULTS, action) { switch (action.type) { case "UPDATE_SETTINGS": { const updatedSettings = action.reset ? { ...SETTINGS_DEFAULTS, ...action.settings } : { ...state, ...action.settings }; Object.defineProperty(updatedSettings, "__unstableIsPreviewMode", { get() { (0, import_deprecated.default)("__unstableIsPreviewMode", { since: "6.8", alternative: "isPreviewMode" }); return this.isPreviewMode; } }); return updatedSettings; } } return state; } function preferences(state = PREFERENCES_DEFAULTS, action) { switch (action.type) { case "INSERT_BLOCKS": case "REPLACE_BLOCKS": { const nextInsertUsage = action.blocks.reduce( (prevUsage, block) => { const { attributes, name: blockName } = block; let id = blockName; const match2 = (0, import_data2.select)(import_blocks2.store).getActiveBlockVariation( blockName, attributes ); if (match2?.name) { id += "/" + match2.name; } if (blockName === "core/block") { id += "/" + attributes.ref; } return { ...prevUsage, [id]: { time: action.time, count: prevUsage[id] ? prevUsage[id].count + 1 : 1 } }; }, state.insertUsage ); return { ...state, insertUsage: nextInsertUsage }; } } return state; } var blockListSettings = (state = {}, action) => { switch (action.type) { // Even if the replaced blocks have the same client ID, our logic // should correct the state. case "REPLACE_BLOCKS": case "REMOVE_BLOCKS": { return Object.fromEntries( Object.entries(state).filter( ([id]) => !action.clientIds.includes(id) ) ); } case "UPDATE_BLOCK_LIST_SETTINGS": { const updates = typeof action.clientId === "string" ? { [action.clientId]: action.settings } : action.clientId; for (const clientId in updates) { if (!updates[clientId]) { if (!state[clientId]) { delete updates[clientId]; } } else if ((0, import_es6.default)(state[clientId], updates[clientId])) { delete updates[clientId]; } } if (Object.keys(updates).length === 0) { return state; } const merged = { ...state, ...updates }; for (const clientId in updates) { if (!updates[clientId]) { delete merged[clientId]; } } return merged; } } return state; }; function lastBlockAttributesChange(state = null, action) { switch (action.type) { case "UPDATE_BLOCK": if (!action.updates.attributes) { break; } return { [action.clientId]: action.updates.attributes }; case "UPDATE_BLOCK_ATTRIBUTES": return action.clientIds.reduce( (accumulator, id) => ({ ...accumulator, [id]: !!action.options?.uniqueByBlock ? action.attributes[id] : action.attributes }), {} ); } return state; } function highlightedBlock(state, action) { switch (action.type) { case "TOGGLE_BLOCK_HIGHLIGHT": const { clientId, isHighlighted } = action; if (isHighlighted) { return clientId; } else if (state === clientId) { return null; } return state; case "SELECT_BLOCK": if (action.clientId !== state) { return null; } } return state; } function hasBlockSpotlight(state, action) { switch (action.type) { case "TOGGLE_BLOCK_SPOTLIGHT": const { clientId, hasBlockSpotlight: _hasBlockSpotlight } = action; if (_hasBlockSpotlight) { return clientId; } else if (state === clientId) { return null; } return state; case "SELECT_BLOCK": if (action.clientId !== state) { return null; } return state; case "SELECTION_CHANGE": if (action.start?.clientId !== state || action.end?.clientId !== state) { return null; } return state; case "CLEAR_SELECTED_BLOCK": return null; } return state; } function expandedBlock(state = null, action) { switch (action.type) { case "SET_BLOCK_EXPANDED_IN_LIST_VIEW": return action.clientId; case "SELECT_BLOCK": if (action.clientId !== state) { return null; } } return state; } function lastBlockInserted(state = {}, action) { switch (action.type) { case "INSERT_BLOCKS": case "REPLACE_BLOCKS": if (!action.blocks.length) { return state; } const clientIds = action.blocks.map((block) => { return block.clientId; }); const source = action.meta?.source; return { clientIds, source }; case "RESET_BLOCKS": return {}; } return state; } function editedContentOnlySection(state, action) { if (action.type === "EDIT_CONTENT_ONLY_SECTION") { return action.clientId; } return state; } function blockEditingModes(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "SET_BLOCK_EDITING_MODE": if (state.get(action.clientId) === action.mode) { return state; } return new Map(state).set(action.clientId, action.mode); case "UNSET_BLOCK_EDITING_MODE": { if (!state.has(action.clientId)) { return state; } const newState = new Map(state); newState.delete(action.clientId); return newState; } case "RESET_BLOCKS": { return state.has("") ? (/* @__PURE__ */ new Map()).set("", state.get("")) : state; } } return state; } function openedBlockSettingsMenu(state = null, action) { if ("SET_OPENED_BLOCK_SETTINGS_MENU" === action.type) { return action?.clientId ?? null; } return state; } function styleOverrides(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "SET_STYLE_OVERRIDE": return new Map(state).set(action.id, action.style); case "DELETE_STYLE_OVERRIDE": { const newState = new Map(state); newState.delete(action.id); return newState; } } return state; } function registeredInserterMediaCategories(state = [], action) { switch (action.type) { case "REGISTER_INSERTER_MEDIA_CATEGORY": return [...state, action.category]; } return state; } function lastFocus(state = false, action) { switch (action.type) { case "LAST_FOCUS": return action.lastFocus; } return state; } function zoomLevel(state = 100, action) { switch (action.type) { case "SET_ZOOM_LEVEL": return action.zoom; case "RESET_ZOOM_LEVEL": return 100; } return state; } function insertionPoint(state = null, action) { switch (action.type) { case "SET_INSERTION_POINT": return action.value; case "SELECT_BLOCK": return null; } return state; } var combinedReducers = (0, import_data2.combineReducers)({ blocks, isDragging, isTyping, isBlockInterfaceHidden, draggedBlocks, selection, isMultiSelecting, isSelectionEnabled, initialPosition, blocksMode, blockListSettings, insertionPoint, insertionCue, template, settings, preferences, lastBlockAttributesChange, lastFocus, expandedBlock, highlightedBlock, lastBlockInserted, editedContentOnlySection, blockVisibility, blockEditingModes, styleOverrides, removalPromptData, blockRemovalRules, openedBlockSettingsMenu, registeredInserterMediaCategories, zoomLevel, hasBlockSpotlight }); function getBlockTreeBlock(state, clientId) { if (clientId === "") { const rootBlock = state.blocks.tree.get(clientId); if (!rootBlock) { return; } return { clientId: "", ...rootBlock }; } if (!state.blocks.controlledInnerBlocks[clientId]) { return state.blocks.tree.get(clientId); } const controlledTree = state.blocks.tree.get(`controlled||${clientId}`); const regularTree = state.blocks.tree.get(clientId); return { ...regularTree, innerBlocks: controlledTree?.innerBlocks }; } function traverseBlockTree(state, clientId, callback) { const tree = getBlockTreeBlock(state, clientId); if (!tree) { return; } callback(tree); if (!tree?.innerBlocks?.length) { return; } for (const innerBlock of tree?.innerBlocks) { traverseBlockTree(state, innerBlock.clientId, callback); } } function findParentInClientIdsList(state, clientId, clientIds) { if (!clientIds.length) { return; } let parent = state.blocks.parents.get(clientId); while (parent !== void 0) { if (clientIds.includes(parent)) { return parent; } parent = state.blocks.parents.get(parent); } } function hasBindings(block) { return block?.attributes?.metadata?.bindings && Object.keys(block?.attributes?.metadata?.bindings).length; } function getDerivedBlockEditingModesForTree(state, treeClientId = "") { const isZoomedOut = state?.zoomLevel < 100 || state?.zoomLevel === "auto-scaled"; const derivedBlockEditingModes = /* @__PURE__ */ new Map(); const sectionRootClientId = state.settings?.[sectionRootClientIdKey]; const sectionClientIds = state.blocks.order.get(sectionRootClientId); const hasDisabledBlocks = Array.from(state.blockEditingModes).some( ([, mode2]) => mode2 === "disabled" ); const templatePartClientIds = []; const syncedPatternClientIds = []; Object.keys(state.blocks.controlledInnerBlocks).forEach((clientId) => { const block = state.blocks.byClientId?.get(clientId); if (block?.name === "core/template-part") { templatePartClientIds.push(clientId); } if (block?.name === "core/block") { syncedPatternClientIds.push(clientId); } }); const contentOnlyTemplateLockedClientIds = Object.keys( state.blockListSettings ).filter( (clientId) => state.blockListSettings[clientId]?.templateLock === "contentOnly" ); const isIsolatedEditor = state.settings?.[isIsolatedEditorKey]; const unsyncedPatternClientIds = !!window?.__experimentalContentOnlyPatternInsertion && !isIsolatedEditor ? Array.from(state.blocks.attributes.keys()).filter( (clientId) => state.blocks.attributes.get(clientId)?.metadata?.patternName ) : []; const contentOnlyParents = [ ...contentOnlyTemplateLockedClientIds, ...unsyncedPatternClientIds, ...window?.__experimentalContentOnlyPatternInsertion && !isIsolatedEditor ? templatePartClientIds : [] ]; traverseBlockTree(state, treeClientId, (block) => { const { clientId, name: blockName } = block; if (state.editedContentOnlySection) { if (state.editedContentOnlySection === clientId) { derivedBlockEditingModes.set(clientId, "default"); return; } const parentTempEditedClientId = findParentInClientIdsList( state, clientId, [state.editedContentOnlySection] ); if (parentTempEditedClientId) { derivedBlockEditingModes.set(clientId, "default"); return; } if (window?.__experimentalContentOnlyPatternInsertion) { derivedBlockEditingModes.set(clientId, "disabled"); return; } } if (state.blockEditingModes.has(clientId)) { return; } if (hasDisabledBlocks) { let ancestorBlockEditingMode; let parent = state.blocks.parents.get(clientId); while (parent !== void 0) { if (state.blockEditingModes.has(parent)) { ancestorBlockEditingMode = state.blockEditingModes.get(parent); } if (ancestorBlockEditingMode) { break; } parent = state.blocks.parents.get(parent); } if (ancestorBlockEditingMode === "disabled") { derivedBlockEditingModes.set(clientId, "disabled"); return; } } if (isZoomedOut) { if (clientId === sectionRootClientId) { derivedBlockEditingModes.set(clientId, "contentOnly"); return; } if (!sectionClientIds?.length) { derivedBlockEditingModes.set(clientId, "disabled"); return; } if (sectionClientIds.includes(clientId)) { derivedBlockEditingModes.set(clientId, "contentOnly"); return; } derivedBlockEditingModes.set(clientId, "disabled"); return; } if (syncedPatternClientIds.length) { if (syncedPatternClientIds.includes(clientId)) { if (findParentInClientIdsList( state, clientId, syncedPatternClientIds )) { derivedBlockEditingModes.set(clientId, "disabled"); return; } return; } const parentPatternClientId = findParentInClientIdsList( state, clientId, syncedPatternClientIds ); if (parentPatternClientId) { if (findParentInClientIdsList( state, parentPatternClientId, syncedPatternClientIds )) { derivedBlockEditingModes.set(clientId, "disabled"); return; } if (hasBindings(block)) { derivedBlockEditingModes.set(clientId, "contentOnly"); return; } derivedBlockEditingModes.set(clientId, "disabled"); } } if (contentOnlyParents.length) { const hasContentOnlyParent = !!findParentInClientIdsList( state, clientId, contentOnlyParents ); if (hasContentOnlyParent) { if (isContentBlock(blockName)) { derivedBlockEditingModes.set(clientId, "contentOnly"); } else { derivedBlockEditingModes.set(clientId, "disabled"); } } } }); return derivedBlockEditingModes; } function getDerivedBlockEditingModesUpdates({ prevState, nextState, addedBlocks, removedClientIds }) { const prevDerivedBlockEditingModes = prevState.derivedBlockEditingModes; let nextDerivedBlockEditingModes; removedClientIds?.forEach((clientId) => { traverseBlockTree(prevState, clientId, (block) => { if (prevDerivedBlockEditingModes.has(block.clientId)) { if (!nextDerivedBlockEditingModes) { nextDerivedBlockEditingModes = new Map( prevDerivedBlockEditingModes ); } nextDerivedBlockEditingModes.delete(block.clientId); } }); }); addedBlocks?.forEach((addedBlock) => { const updates = getDerivedBlockEditingModesForTree( nextState, addedBlock.clientId ); if (updates.size) { if (!nextDerivedBlockEditingModes) { nextDerivedBlockEditingModes = new Map([ ...prevDerivedBlockEditingModes?.size ? prevDerivedBlockEditingModes : [], ...updates ]); } else { nextDerivedBlockEditingModes = new Map([ ...nextDerivedBlockEditingModes?.size ? nextDerivedBlockEditingModes : [], ...updates ]); } } }); return nextDerivedBlockEditingModes; } function withDerivedBlockEditingModes(reducer4) { return (state, action) => { const nextState = reducer4(state, action); if (action.type !== "SET_EDITOR_MODE" && nextState === state) { return state; } switch (action.type) { case "REMOVE_BLOCKS": { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: action.clientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "UPDATE_BLOCK_ATTRIBUTES": { const addedBlocks = []; const removedClientIds = []; for (const clientId of action?.clientIds) { const attributes = action.options?.uniqueByBlock ? action.attributes[clientId] : action.attributes; if (!attributes) { break; } if ( // patternName is switching from falsy to truthy, indicating // this block is becoming an unsynced pattern. attributes.metadata?.patternName && !state.blocks.attributes.get(clientId)?.metadata?.patternName ) { addedBlocks.push( nextState.blocks.tree.get(clientId) ); } else if ( // patternName is switching from truthy to falsy, this block is becoming // a regular block but was an unsynced pattern. // Check that `metadata` is part of the included attributes, as // `updateBlockAttributes` merges attributes, if it isn't present // the previous `metadata` would be retained. attributes.metadata && !attributes.metadata?.patternName && state.blocks.attributes.get(clientId)?.metadata?.patternName ) { removedClientIds.push(clientId); } } if (!addedBlocks?.length && !removedClientIds?.length) { break; } const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "UPDATE_BLOCK_LIST_SETTINGS": { const addedBlocks = []; const removedClientIds = []; const updates = typeof action.clientId === "string" ? { [action.clientId]: action.settings } : action.clientId; for (const clientId in updates) { const isNewContentOnlyBlock = state.blockListSettings[clientId]?.templateLock !== "contentOnly" && nextState.blockListSettings[clientId]?.templateLock === "contentOnly"; const wasContentOnlyBlock = state.blockListSettings[clientId]?.templateLock === "contentOnly" && nextState.blockListSettings[clientId]?.templateLock !== "contentOnly"; if (isNewContentOnlyBlock) { addedBlocks.push( nextState.blocks.tree.get(clientId) ); } else if (wasContentOnlyBlock) { removedClientIds.push(clientId); } } if (!addedBlocks.length && !removedClientIds.length) { break; } const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "SET_BLOCK_EDITING_MODE": case "UNSET_BLOCK_EDITING_MODE": case "SET_HAS_CONTROLLED_INNER_BLOCKS": { const updatedBlock = getBlockTreeBlock( nextState, action.clientId ); if (!updatedBlock) { break; } const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: [action.clientId], addedBlocks: [updatedBlock] }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "REPLACE_BLOCKS": { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds: action.clientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "REPLACE_INNER_BLOCKS": { const removedClientIds = state.blocks.order.get( action.rootClientId ); const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "MOVE_BLOCKS_TO_POSITION": { const addedBlocks = action.clientIds.map((clientId) => { return nextState.blocks.byClientId.get(clientId); }); const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds: action.clientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "UPDATE_SETTINGS": { if (state?.settings?.[sectionRootClientIdKey] !== nextState?.settings?.[sectionRootClientIdKey]) { return { ...nextState, derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState) }; } break; } case "RESET_BLOCKS": case "EDIT_CONTENT_ONLY_SECTION": case "SET_EDITOR_MODE": case "RESET_ZOOM_LEVEL": case "SET_ZOOM_LEVEL": { return { ...nextState, derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState) }; } } nextState.derivedBlockEditingModes = state?.derivedBlockEditingModes ?? /* @__PURE__ */ new Map(); return nextState; }; } function withAutomaticChangeReset(reducer4) { return (state, action) => { const nextState = reducer4(state, action); if (!state) { return nextState; } nextState.automaticChangeStatus = state.automaticChangeStatus; if (action.type === "MARK_AUTOMATIC_CHANGE") { return { ...nextState, automaticChangeStatus: "pending" }; } if (action.type === "MARK_AUTOMATIC_CHANGE_FINAL" && state.automaticChangeStatus === "pending") { return { ...nextState, automaticChangeStatus: "final" }; } if (nextState.blocks === state.blocks && nextState.selection === state.selection) { return nextState; } if (nextState.automaticChangeStatus !== "final" && nextState.selection !== state.selection) { return nextState; } return { ...nextState, automaticChangeStatus: void 0 }; }; } var reducer_default = (0, import_compose.pipe)( withDerivedBlockEditingModes, withAutomaticChangeReset )(combinedReducers); // packages/block-editor/build-module/store/selectors.js var selectors_exports = {}; __export(selectors_exports, { __experimentalGetActiveBlockIdByBlockNames: () => __experimentalGetActiveBlockIdByBlockNames, __experimentalGetAllowedBlocks: () => __experimentalGetAllowedBlocks, __experimentalGetAllowedPatterns: () => __experimentalGetAllowedPatterns, __experimentalGetBlockListSettingsForBlocks: () => __experimentalGetBlockListSettingsForBlocks, __experimentalGetDirectInsertBlock: () => __experimentalGetDirectInsertBlock, __experimentalGetGlobalBlocksByName: () => __experimentalGetGlobalBlocksByName, __experimentalGetLastBlockAttributeChanges: () => __experimentalGetLastBlockAttributeChanges, __experimentalGetParsedPattern: () => __experimentalGetParsedPattern, __experimentalGetPatternTransformItems: () => __experimentalGetPatternTransformItems, __experimentalGetPatternsByBlockTypes: () => __experimentalGetPatternsByBlockTypes, __experimentalGetReusableBlockTitle: () => __experimentalGetReusableBlockTitle, __unstableGetBlockWithoutInnerBlocks: () => __unstableGetBlockWithoutInnerBlocks, __unstableGetClientIdWithClientIdsTree: () => __unstableGetClientIdWithClientIdsTree, __unstableGetClientIdsTree: () => __unstableGetClientIdsTree, __unstableGetContentLockingParent: () => __unstableGetContentLockingParent, __unstableGetSelectedBlocksWithPartialSelection: () => __unstableGetSelectedBlocksWithPartialSelection, __unstableGetTemporarilyEditingAsBlocks: () => __unstableGetTemporarilyEditingAsBlocks, __unstableGetVisibleBlocks: () => __unstableGetVisibleBlocks, __unstableHasActiveBlockOverlayActive: () => __unstableHasActiveBlockOverlayActive, __unstableIsFullySelected: () => __unstableIsFullySelected, __unstableIsLastBlockChangeIgnored: () => __unstableIsLastBlockChangeIgnored, __unstableIsSelectionCollapsed: () => __unstableIsSelectionCollapsed, __unstableIsSelectionMergeable: () => __unstableIsSelectionMergeable, __unstableIsWithinBlockOverlay: () => __unstableIsWithinBlockOverlay, __unstableSelectionHasUnmergeableBlock: () => __unstableSelectionHasUnmergeableBlock, areInnerBlocksControlled: () => areInnerBlocksControlled, canEditBlock: () => canEditBlock, canInsertBlockType: () => canInsertBlockType, canInsertBlocks: () => canInsertBlocks, canLockBlockType: () => canLockBlockType, canMoveBlock: () => canMoveBlock, canMoveBlocks: () => canMoveBlocks, canRemoveBlock: () => canRemoveBlock, canRemoveBlocks: () => canRemoveBlocks, didAutomaticChange: () => didAutomaticChange, getAdjacentBlockClientId: () => getAdjacentBlockClientId, getAllowedBlocks: () => getAllowedBlocks, getBlock: () => getBlock, getBlockAttributes: () => getBlockAttributes, getBlockCount: () => getBlockCount, getBlockEditingMode: () => getBlockEditingMode, getBlockHierarchyRootClientId: () => getBlockHierarchyRootClientId, getBlockIndex: () => getBlockIndex, getBlockInsertionPoint: () => getBlockInsertionPoint, getBlockListSettings: () => getBlockListSettings, getBlockMode: () => getBlockMode, getBlockName: () => getBlockName, getBlockNamesByClientId: () => getBlockNamesByClientId, getBlockOrder: () => getBlockOrder, getBlockParents: () => getBlockParents, getBlockParentsByBlockName: () => getBlockParentsByBlockName, getBlockRootClientId: () => getBlockRootClientId, getBlockSelectionEnd: () => getBlockSelectionEnd, getBlockSelectionStart: () => getBlockSelectionStart, getBlockTransformItems: () => getBlockTransformItems, getBlocks: () => getBlocks, getBlocksByClientId: () => getBlocksByClientId, getBlocksByName: () => getBlocksByName, getClientIdsOfDescendants: () => getClientIdsOfDescendants, getClientIdsWithDescendants: () => getClientIdsWithDescendants, getDirectInsertBlock: () => getDirectInsertBlock, getDraggedBlockClientIds: () => getDraggedBlockClientIds, getFirstMultiSelectedBlockClientId: () => getFirstMultiSelectedBlockClientId, getGlobalBlockCount: () => getGlobalBlockCount, getHoveredBlockClientId: () => getHoveredBlockClientId, getInserterItems: () => getInserterItems, getLastMultiSelectedBlockClientId: () => getLastMultiSelectedBlockClientId, getLowestCommonAncestorWithSelectedBlock: () => getLowestCommonAncestorWithSelectedBlock, getMultiSelectedBlockClientIds: () => getMultiSelectedBlockClientIds, getMultiSelectedBlocks: () => getMultiSelectedBlocks, getMultiSelectedBlocksEndClientId: () => getMultiSelectedBlocksEndClientId, getMultiSelectedBlocksStartClientId: () => getMultiSelectedBlocksStartClientId, getNextBlockClientId: () => getNextBlockClientId, getPatternsByBlockTypes: () => getPatternsByBlockTypes, getPreviousBlockClientId: () => getPreviousBlockClientId, getSelectedBlock: () => getSelectedBlock, getSelectedBlockClientId: () => getSelectedBlockClientId, getSelectedBlockClientIds: () => getSelectedBlockClientIds, getSelectedBlockCount: () => getSelectedBlockCount, getSelectedBlocksInitialCaretPosition: () => getSelectedBlocksInitialCaretPosition, getSelectionEnd: () => getSelectionEnd, getSelectionStart: () => getSelectionStart, getSettings: () => getSettings, getTemplate: () => getTemplate, getTemplateLock: () => getTemplateLock, hasBlockMovingClientId: () => hasBlockMovingClientId, hasDraggedInnerBlock: () => hasDraggedInnerBlock, hasInserterItems: () => hasInserterItems, hasMultiSelection: () => hasMultiSelection, hasSelectedBlock: () => hasSelectedBlock, hasSelectedInnerBlock: () => hasSelectedInnerBlock, isAncestorBeingDragged: () => isAncestorBeingDragged, isAncestorMultiSelected: () => isAncestorMultiSelected, isBlockBeingDragged: () => isBlockBeingDragged, isBlockHighlighted: () => isBlockHighlighted, isBlockInsertionPointVisible: () => isBlockInsertionPointVisible, isBlockMultiSelected: () => isBlockMultiSelected, isBlockSelected: () => isBlockSelected, isBlockValid: () => isBlockValid, isBlockVisible: () => isBlockVisible, isBlockWithinSelection: () => isBlockWithinSelection, isCaretWithinFormattedText: () => isCaretWithinFormattedText, isDraggingBlocks: () => isDraggingBlocks, isFirstMultiSelectedBlock: () => isFirstMultiSelectedBlock, isGroupable: () => isGroupable, isLastBlockChangePersistent: () => isLastBlockChangePersistent, isMultiSelecting: () => isMultiSelecting2, isSelectionEnabled: () => isSelectionEnabled2, isTyping: () => isTyping2, isUngroupable: () => isUngroupable, isValidTemplate: () => isValidTemplate, wasBlockJustInserted: () => wasBlockJustInserted }); var import_blocks6 = __toESM(require_blocks()); var import_element6 = __toESM(require_element()); var import_hooks2 = __toESM(require_hooks()); // packages/icons/build-module/icon/index.js var import_element5 = __toESM(require_element()); var icon_default = (0, import_element5.forwardRef)( ({ icon, size = 24, ...props }, ref) => { return (0, import_element5.cloneElement)(icon, { width: size, height: size, ...props, ref }); } ); // packages/icons/build-module/library/align-center.js var import_primitives = __toESM(require_primitives()); var import_jsx_runtime3 = __toESM(require_jsx_runtime()); var align_center_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" }) }); // packages/icons/build-module/library/align-justify.js var import_primitives2 = __toESM(require_primitives()); var import_jsx_runtime4 = __toESM(require_jsx_runtime()); var align_justify_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.Path, { d: "M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z" }) }); // packages/icons/build-module/library/align-left.js var import_primitives3 = __toESM(require_primitives()); var import_jsx_runtime5 = __toESM(require_jsx_runtime()); var align_left_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.Path, { d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" }) }); // packages/icons/build-module/library/align-none.js var import_primitives4 = __toESM(require_primitives()); var import_jsx_runtime6 = __toESM(require_jsx_runtime()); var align_none_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z" }) }); // packages/icons/build-module/library/align-right.js var import_primitives5 = __toESM(require_primitives()); var import_jsx_runtime7 = __toESM(require_jsx_runtime()); var align_right_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.Path, { d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" }) }); // packages/icons/build-module/library/arrow-down.js var import_primitives6 = __toESM(require_primitives()); var import_jsx_runtime8 = __toESM(require_jsx_runtime()); var arrow_down_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) }); // packages/icons/build-module/library/arrow-left.js var import_primitives7 = __toESM(require_primitives()); var import_jsx_runtime9 = __toESM(require_jsx_runtime()); var arrow_left_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives7.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) }); // packages/icons/build-module/library/arrow-right.js var import_primitives8 = __toESM(require_primitives()); var import_jsx_runtime10 = __toESM(require_jsx_runtime()); var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives8.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) }); // packages/icons/build-module/library/aspect-ratio.js var import_primitives9 = __toESM(require_primitives()); var import_jsx_runtime11 = __toESM(require_jsx_runtime()); var aspect_ratio_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives9.Path, { d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" }) }); // packages/icons/build-module/library/audio.js var import_primitives10 = __toESM(require_primitives()); var import_jsx_runtime12 = __toESM(require_jsx_runtime()); var audio_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives10.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives10.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" }) }); // packages/icons/build-module/library/block-default.js var import_primitives11 = __toESM(require_primitives()); var import_jsx_runtime13 = __toESM(require_jsx_runtime()); var block_default_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) }); // packages/icons/build-module/library/category.js var import_primitives12 = __toESM(require_primitives()); var import_jsx_runtime14 = __toESM(require_jsx_runtime()); var category_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives12.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( import_primitives12.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" } ) }); // packages/icons/build-module/library/check.js var import_primitives13 = __toESM(require_primitives()); var import_jsx_runtime15 = __toESM(require_jsx_runtime()); var check_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives13.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) }); // packages/icons/build-module/library/chevron-down.js var import_primitives14 = __toESM(require_primitives()); var import_jsx_runtime16 = __toESM(require_jsx_runtime()); var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives14.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives14.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); // packages/icons/build-module/library/chevron-left-small.js var import_primitives15 = __toESM(require_primitives()); var import_jsx_runtime17 = __toESM(require_jsx_runtime()); var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives15.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) }); // packages/icons/build-module/library/chevron-left.js var import_primitives16 = __toESM(require_primitives()); var import_jsx_runtime18 = __toESM(require_jsx_runtime()); var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives16.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); // packages/icons/build-module/library/chevron-right-small.js var import_primitives17 = __toESM(require_primitives()); var import_jsx_runtime19 = __toESM(require_jsx_runtime()); var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives17.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) }); // packages/icons/build-module/library/chevron-right.js var import_primitives18 = __toESM(require_primitives()); var import_jsx_runtime20 = __toESM(require_jsx_runtime()); var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives18.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); // packages/icons/build-module/library/chevron-up.js var import_primitives19 = __toESM(require_primitives()); var import_jsx_runtime21 = __toESM(require_jsx_runtime()); var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives19.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives19.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); // packages/icons/build-module/library/close-small.js var import_primitives20 = __toESM(require_primitives()); var import_jsx_runtime22 = __toESM(require_jsx_runtime()); var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives20.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); // packages/icons/build-module/library/cog.js var import_primitives21 = __toESM(require_primitives()); var import_jsx_runtime23 = __toESM(require_jsx_runtime()); var cog_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( import_primitives21.Path, { fillRule: "evenodd", d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z", clipRule: "evenodd" } ) }); // packages/icons/build-module/library/copy-small.js var import_primitives22 = __toESM(require_primitives()); var import_jsx_runtime24 = __toESM(require_jsx_runtime()); var copy_small_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( import_primitives22.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z" } ) }); // packages/icons/build-module/library/copy.js var import_primitives23 = __toESM(require_primitives()); var import_jsx_runtime25 = __toESM(require_jsx_runtime()); var copy_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( import_primitives23.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z" } ) }); // packages/icons/build-module/library/corner-all.js var import_primitives24 = __toESM(require_primitives()); var import_jsx_runtime26 = __toESM(require_jsx_runtime()); var corner_all_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( import_primitives24.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Zm-12.5 9v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" } ) }); // packages/icons/build-module/library/corner-bottom-left.js var import_primitives25 = __toESM(require_primitives()); var import_jsx_runtime27 = __toESM(require_jsx_runtime()); var corner_bottom_left_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives25.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives25.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( import_primitives25.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.75 15v3c0 .138.112.25.25.25h3v1.5H6A1.75 1.75 0 0 1 4.25 18v-3h1.5Z" } ) ] }); // packages/icons/build-module/library/corner-bottom-right.js var import_primitives26 = __toESM(require_primitives()); var import_jsx_runtime28 = __toESM(require_jsx_runtime()); var corner_bottom_right_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives26.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives26.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( import_primitives26.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 18.25h3a.25.25 0 0 0 .25-.25v-3h1.5v3A1.75 1.75 0 0 1 18 19.75h-3v-1.5Z" } ) ] }); // packages/icons/build-module/library/corner-top-left.js var import_primitives27 = __toESM(require_primitives()); var import_jsx_runtime29 = __toESM(require_jsx_runtime()); var corner_top_left_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives27.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives27.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( import_primitives27.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.75a.25.25 0 0 0-.25.25v3h-1.5V6c0-.966.784-1.75 1.75-1.75h3v1.5H6Z" } ) ] }); // packages/icons/build-module/library/corner-top-right.js var import_primitives28 = __toESM(require_primitives()); var import_jsx_runtime30 = __toESM(require_jsx_runtime()); var corner_top_right_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives28.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives28.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( import_primitives28.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Z" } ) ] }); // packages/icons/build-module/library/drag-handle.js var import_primitives29 = __toESM(require_primitives()); var import_jsx_runtime31 = __toESM(require_jsx_runtime()); var drag_handle_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives29.Path, { d: "M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z" }) }); // packages/icons/build-module/library/envelope.js var import_primitives30 = __toESM(require_primitives()); var import_jsx_runtime32 = __toESM(require_jsx_runtime()); var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( import_primitives30.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M3 7c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Zm2-.5h14c.3 0 .5.2.5.5v1L12 13.5 4.5 7.9V7c0-.3.2-.5.5-.5Zm-.5 3.3V17c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V9.8L12 15.4 4.5 9.8Z" } ) }); // packages/icons/build-module/library/error.js var import_primitives31 = __toESM(require_primitives()); var import_jsx_runtime33 = __toESM(require_jsx_runtime()); var error_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives31.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( import_primitives31.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" } ) }); // packages/icons/build-module/library/external.js var import_primitives32 = __toESM(require_primitives()); var import_jsx_runtime34 = __toESM(require_jsx_runtime()); var external_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives32.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives32.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); // packages/icons/build-module/library/file.js var import_primitives33 = __toESM(require_primitives()); var import_jsx_runtime35 = __toESM(require_jsx_runtime()); var file_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives33.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( import_primitives33.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" } ) }); // packages/icons/build-module/library/filter.js var import_primitives34 = __toESM(require_primitives()); var import_jsx_runtime36 = __toESM(require_jsx_runtime()); var filter_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives34.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives34.Path, { d: "M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z" }) }); // packages/icons/build-module/library/format-capitalize.js var import_primitives35 = __toESM(require_primitives()); var import_jsx_runtime37 = __toESM(require_jsx_runtime()); var format_capitalize_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives35.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives35.Path, { d: "M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z" }) }); // packages/icons/build-module/library/format-lowercase.js var import_primitives36 = __toESM(require_primitives()); var import_jsx_runtime38 = __toESM(require_jsx_runtime()); var format_lowercase_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives36.Path, { d: "M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z" }) }); // packages/icons/build-module/library/format-strikethrough.js var import_primitives37 = __toESM(require_primitives()); var import_jsx_runtime39 = __toESM(require_jsx_runtime()); var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives37.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) }); // packages/icons/build-module/library/format-underline.js var import_primitives38 = __toESM(require_primitives()); var import_jsx_runtime40 = __toESM(require_jsx_runtime()); var format_underline_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives38.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives38.Path, { d: "M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z" }) }); // packages/icons/build-module/library/format-uppercase.js var import_primitives39 = __toESM(require_primitives()); var import_jsx_runtime41 = __toESM(require_jsx_runtime()); var format_uppercase_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives39.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives39.Path, { d: "M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z" }) }); // packages/icons/build-module/library/fullscreen.js var import_primitives40 = __toESM(require_primitives()); var import_jsx_runtime42 = __toESM(require_jsx_runtime()); var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives40.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives40.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" }) }); // packages/icons/build-module/library/globe.js var import_primitives41 = __toESM(require_primitives()); var import_jsx_runtime43 = __toESM(require_jsx_runtime()); var globe_default = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives41.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives41.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) }); // packages/icons/build-module/library/grid.js var import_primitives42 = __toESM(require_primitives()); var import_jsx_runtime44 = __toESM(require_jsx_runtime()); var grid_default = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives42.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( import_primitives42.Path, { d: "m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z", fillRule: "evenodd", clipRule: "evenodd" } ) }); // packages/icons/build-module/library/group.js var import_primitives43 = __toESM(require_primitives()); var import_jsx_runtime45 = __toESM(require_jsx_runtime()); var group_default = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives43.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives43.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) }); // packages/icons/build-module/library/heading-level-1.js var import_primitives44 = __toESM(require_primitives()); var import_jsx_runtime46 = __toESM(require_jsx_runtime()); var heading_level_1_default = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives44.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives44.Path, { d: "M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z" }) }); // packages/icons/build-module/library/heading-level-2.js var import_primitives45 = __toESM(require_primitives()); var import_jsx_runtime47 = __toESM(require_jsx_runtime()); var heading_level_2_default = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives45.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives45.Path, { d: "M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z" }) }); // packages/icons/build-module/library/heading-level-3.js var import_primitives46 = __toESM(require_primitives()); var import_jsx_runtime48 = __toESM(require_jsx_runtime()); var heading_level_3_default = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives46.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives46.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z" }) }); // packages/icons/build-module/library/heading-level-4.js var import_primitives47 = __toESM(require_primitives()); var import_jsx_runtime49 = __toESM(require_jsx_runtime()); var heading_level_4_default = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives47.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives47.Path, { d: "M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); // packages/icons/build-module/library/heading-level-5.js var import_primitives48 = __toESM(require_primitives()); var import_jsx_runtime50 = __toESM(require_jsx_runtime()); var heading_level_5_default = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives48.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives48.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z" }) }); // packages/icons/build-module/library/heading-level-6.js var import_primitives49 = __toESM(require_primitives()); var import_jsx_runtime51 = __toESM(require_jsx_runtime()); var heading_level_6_default = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives49.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives49.Path, { d: "M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); // packages/icons/build-module/library/home.js var import_primitives50 = __toESM(require_primitives()); var import_jsx_runtime52 = __toESM(require_jsx_runtime()); var home_default = /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives50.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives50.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) }); // packages/icons/build-module/library/image.js var import_primitives51 = __toESM(require_primitives()); var import_jsx_runtime53 = __toESM(require_jsx_runtime()); var image_default = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives51.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives51.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-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); // packages/icons/build-module/library/info.js var import_primitives52 = __toESM(require_primitives()); var import_jsx_runtime54 = __toESM(require_jsx_runtime()); var info_default = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives52.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)( import_primitives52.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" } ) }); // packages/icons/build-module/library/justify-bottom.js var import_primitives53 = __toESM(require_primitives()); var import_jsx_runtime55 = __toESM(require_jsx_runtime()); var justify_bottom_default = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives53.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives53.Path, { d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z" }) }); // packages/icons/build-module/library/justify-center-vertical.js var import_primitives54 = __toESM(require_primitives()); var import_jsx_runtime56 = __toESM(require_jsx_runtime()); var justify_center_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives54.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives54.Path, { d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" }) }); // packages/icons/build-module/library/justify-center.js var import_primitives55 = __toESM(require_primitives()); var import_jsx_runtime57 = __toESM(require_jsx_runtime()); var justify_center_default = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives55.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives55.Path, { d: "M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z" }) }); // packages/icons/build-module/library/justify-left.js var import_primitives56 = __toESM(require_primitives()); var import_jsx_runtime58 = __toESM(require_jsx_runtime()); var justify_left_default = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives56.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives56.Path, { d: "M9 9v6h11V9H9zM4 20h1.5V4H4v16z" }) }); // packages/icons/build-module/library/justify-right.js var import_primitives57 = __toESM(require_primitives()); var import_jsx_runtime59 = __toESM(require_jsx_runtime()); var justify_right_default = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives57.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives57.Path, { d: "M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z" }) }); // packages/icons/build-module/library/justify-space-between-vertical.js var import_primitives58 = __toESM(require_primitives()); var import_jsx_runtime60 = __toESM(require_jsx_runtime()); var justify_space_between_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives58.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives58.Path, { d: "M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z" }) }); // packages/icons/build-module/library/justify-space-between.js var import_primitives59 = __toESM(require_primitives()); var import_jsx_runtime61 = __toESM(require_jsx_runtime()); var justify_space_between_default = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives59.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives59.Path, { d: "M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z" }) }); // packages/icons/build-module/library/justify-stretch-vertical.js var import_primitives60 = __toESM(require_primitives()); var import_jsx_runtime62 = __toESM(require_jsx_runtime()); var justify_stretch_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives60.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives60.Path, { d: "M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z" }) }); // packages/icons/build-module/library/justify-stretch.js var import_primitives61 = __toESM(require_primitives()); var import_jsx_runtime63 = __toESM(require_jsx_runtime()); var justify_stretch_default = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives61.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives61.Path, { d: "M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z" }) }); // packages/icons/build-module/library/justify-top.js var import_primitives62 = __toESM(require_primitives()); var import_jsx_runtime64 = __toESM(require_jsx_runtime()); var justify_top_default = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives62.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives62.Path, { d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z" }) }); // packages/icons/build-module/library/keyboard-return.js var import_primitives63 = __toESM(require_primitives()); var import_jsx_runtime65 = __toESM(require_jsx_runtime()); var keyboard_return_default = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives63.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives63.Path, { d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z" }) }); // packages/icons/build-module/library/layout.js var import_primitives64 = __toESM(require_primitives()); var import_jsx_runtime66 = __toESM(require_jsx_runtime()); var layout_default = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives64.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives64.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" }) }); // packages/icons/build-module/library/link-off.js var import_primitives65 = __toESM(require_primitives()); var import_jsx_runtime67 = __toESM(require_jsx_runtime()); var link_off_default = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives65.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives65.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" }) }); // packages/icons/build-module/library/link.js var import_primitives66 = __toESM(require_primitives()); var import_jsx_runtime68 = __toESM(require_jsx_runtime()); var link_default = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives66.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives66.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" }) }); // packages/icons/build-module/library/list-view.js var import_primitives67 = __toESM(require_primitives()); var import_jsx_runtime69 = __toESM(require_jsx_runtime()); var list_view_default = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives67.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives67.Path, { d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) }); // packages/icons/build-module/library/lock-outline.js var import_primitives68 = __toESM(require_primitives()); var import_jsx_runtime70 = __toESM(require_jsx_runtime()); var lock_outline_default = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives68.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives68.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z" }) }); // packages/icons/build-module/library/lock-small.js var import_primitives69 = __toESM(require_primitives()); var import_jsx_runtime71 = __toESM(require_jsx_runtime()); var lock_small_default = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives69.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)( import_primitives69.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z" } ) }); // packages/icons/build-module/library/lock.js var import_primitives70 = __toESM(require_primitives()); var import_jsx_runtime72 = __toESM(require_jsx_runtime()); var lock_default = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives70.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives70.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z" }) }); // packages/icons/build-module/library/media.js var import_primitives71 = __toESM(require_primitives()); var import_jsx_runtime73 = __toESM(require_jsx_runtime()); var media_default = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_primitives71.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_primitives71.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), /* @__PURE__ */ (0, import_jsx_runtime73.jsx)( import_primitives71.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" } ) ] }); // packages/icons/build-module/library/mobile.js var import_primitives72 = __toESM(require_primitives()); var import_jsx_runtime74 = __toESM(require_jsx_runtime()); var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives72.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives72.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) }); // packages/icons/build-module/library/more-vertical.js var import_primitives73 = __toESM(require_primitives()); var import_jsx_runtime75 = __toESM(require_jsx_runtime()); var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); // packages/icons/build-module/library/page.js var import_primitives74 = __toESM(require_primitives()); var import_jsx_runtime76 = __toESM(require_jsx_runtime()); var page_default = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_primitives74.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives74.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives74.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" }) ] }); // packages/icons/build-module/library/paragraph.js var import_primitives75 = __toESM(require_primitives()); var import_jsx_runtime77 = __toESM(require_jsx_runtime()); var paragraph_default = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.Path, { d: "m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z" }) }); // packages/icons/build-module/library/pencil.js var import_primitives76 = __toESM(require_primitives()); var import_jsx_runtime78 = __toESM(require_jsx_runtime()); var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives76.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives76.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); // packages/icons/build-module/library/pin-small.js var import_primitives77 = __toESM(require_primitives()); var import_jsx_runtime79 = __toESM(require_jsx_runtime()); var pin_small_default = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives77.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives77.Path, { d: "M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z" }) }); // packages/icons/build-module/library/plus.js var import_primitives78 = __toESM(require_primitives()); var import_jsx_runtime80 = __toESM(require_jsx_runtime()); var plus_default = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives78.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives78.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); // packages/icons/build-module/library/position-center.js var import_primitives79 = __toESM(require_primitives()); var import_jsx_runtime81 = __toESM(require_jsx_runtime()); var position_center_default = /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives79.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives79.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z" }) }); // packages/icons/build-module/library/position-left.js var import_primitives80 = __toESM(require_primitives()); var import_jsx_runtime82 = __toESM(require_jsx_runtime()); var position_left_default = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives80.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives80.Path, { d: "M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z" }) }); // packages/icons/build-module/library/position-right.js var import_primitives81 = __toESM(require_primitives()); var import_jsx_runtime83 = __toESM(require_jsx_runtime()); var position_right_default = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives81.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives81.Path, { d: "M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); // packages/icons/build-module/library/post-featured-image.js var import_primitives82 = __toESM(require_primitives()); var import_jsx_runtime84 = __toESM(require_jsx_runtime()); var post_featured_image_default = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives82.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives82.Path, { d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" }) }); // packages/icons/build-module/library/post-list.js var import_primitives83 = __toESM(require_primitives()); var import_jsx_runtime85 = __toESM(require_jsx_runtime()); var post_list_default = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives83.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives83.Path, { d: "M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z" }) }); // packages/icons/build-module/library/post.js var import_primitives84 = __toESM(require_primitives()); var import_jsx_runtime86 = __toESM(require_jsx_runtime()); var post_default = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives84.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives84.Path, { d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) }); // packages/icons/build-module/library/reset.js var import_primitives85 = __toESM(require_primitives()); var import_jsx_runtime87 = __toESM(require_jsx_runtime()); var reset_default = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives85.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives85.Path, { d: "M7 11.5h10V13H7z" }) }); // packages/icons/build-module/library/rotate-right.js var import_primitives86 = __toESM(require_primitives()); var import_jsx_runtime88 = __toESM(require_jsx_runtime()); var rotate_right_default = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives86.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives86.Path, { d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" }) }); // packages/icons/build-module/library/row.js var import_primitives87 = __toESM(require_primitives()); var import_jsx_runtime89 = __toESM(require_jsx_runtime()); var row_default = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives87.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives87.Path, { d: "M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z" }) }); // packages/icons/build-module/library/search.js var import_primitives88 = __toESM(require_primitives()); var import_jsx_runtime90 = __toESM(require_jsx_runtime()); var search_default = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives88.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives88.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) }); // packages/icons/build-module/library/seen.js var import_primitives89 = __toESM(require_primitives()); var import_jsx_runtime91 = __toESM(require_jsx_runtime()); var seen_default = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives89.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives89.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) }); // packages/icons/build-module/library/settings.js var import_primitives90 = __toESM(require_primitives()); var import_jsx_runtime92 = __toESM(require_jsx_runtime()); var settings_default = /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_primitives90.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives90.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }), /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives90.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" }) ] }); // packages/icons/build-module/library/shadow.js var import_primitives91 = __toESM(require_primitives()); var import_jsx_runtime93 = __toESM(require_jsx_runtime()); var shadow_default = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives91.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives91.Path, { d: "M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z" }) }); // packages/icons/build-module/library/sides-all.js var import_primitives92 = __toESM(require_primitives()); var import_jsx_runtime94 = __toESM(require_jsx_runtime()); var sides_all_default = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives92.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives92.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z" }) }); // packages/icons/build-module/library/sides-bottom.js var import_primitives93 = __toESM(require_primitives()); var import_jsx_runtime95 = __toESM(require_jsx_runtime()); var sides_bottom_default = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_primitives93.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)( import_primitives93.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } } ), /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives93.Path, { d: "m16.5 19.5h-9v-1.5h9z" }) ] }); // packages/icons/build-module/library/sides-horizontal.js var import_primitives94 = __toESM(require_primitives()); var import_jsx_runtime96 = __toESM(require_jsx_runtime()); var sides_horizontal_default = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_primitives94.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)( import_primitives94.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } } ), /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives94.Path, { d: "m4.5 7.5v9h1.5v-9z" }), /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives94.Path, { d: "m18 7.5v9h1.5v-9z" }) ] }); // packages/icons/build-module/library/sides-left.js var import_primitives95 = __toESM(require_primitives()); var import_jsx_runtime97 = __toESM(require_jsx_runtime()); var sides_left_default = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_primitives95.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)( import_primitives95.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } } ), /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives95.Path, { d: "m4.5 16.5v-9h1.5v9z" }) ] }); // packages/icons/build-module/library/sides-right.js var import_primitives96 = __toESM(require_primitives()); var import_jsx_runtime98 = __toESM(require_jsx_runtime()); var sides_right_default = /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_primitives96.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)( import_primitives96.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } } ), /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives96.Path, { d: "m18 16.5v-9h1.5v9z" }) ] }); // packages/icons/build-module/library/sides-top.js var import_primitives97 = __toESM(require_primitives()); var import_jsx_runtime99 = __toESM(require_jsx_runtime()); var sides_top_default = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_primitives97.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime99.jsx)( import_primitives97.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } } ), /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives97.Path, { d: "m16.5 6h-9v-1.5h9z" }) ] }); // packages/icons/build-module/library/sides-vertical.js var import_primitives98 = __toESM(require_primitives()); var import_jsx_runtime100 = __toESM(require_jsx_runtime()); var sides_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_primitives98.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)( import_primitives98.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } } ), /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives98.Path, { d: "m7.5 6h9v-1.5h-9z" }), /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives98.Path, { d: "m7.5 19.5h9v-1.5h-9z" }) ] }); // packages/icons/build-module/library/stack.js var import_primitives99 = __toESM(require_primitives()); var import_jsx_runtime101 = __toESM(require_jsx_runtime()); var stack_default = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives99.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives99.Path, { d: "M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z" }) }); // packages/icons/build-module/library/stretch-full-width.js var import_primitives100 = __toESM(require_primitives()); var import_jsx_runtime102 = __toESM(require_jsx_runtime()); var stretch_full_width_default = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives100.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives100.Path, { d: "M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z" }) }); // packages/icons/build-module/library/stretch-wide.js var import_primitives101 = __toESM(require_primitives()); var import_jsx_runtime103 = __toESM(require_jsx_runtime()); var stretch_wide_default = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives101.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives101.Path, { d: "M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); // packages/icons/build-module/library/styles.js var import_primitives102 = __toESM(require_primitives()); var import_jsx_runtime104 = __toESM(require_jsx_runtime()); var styles_default = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives102.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)( import_primitives102.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z" } ) }); // packages/icons/build-module/library/symbol.js var import_primitives103 = __toESM(require_primitives()); var import_jsx_runtime105 = __toESM(require_jsx_runtime()); var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives103.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives103.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) }); // packages/icons/build-module/library/tag.js var import_primitives104 = __toESM(require_primitives()); var import_jsx_runtime106 = __toESM(require_jsx_runtime()); var tag_default = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives104.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives104.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) }); // packages/icons/build-module/library/text-horizontal.js var import_primitives105 = __toESM(require_primitives()); var import_jsx_runtime107 = __toESM(require_jsx_runtime()); var text_horizontal_default = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives105.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives105.Path, { d: "M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z" }) }); // packages/icons/build-module/library/text-vertical.js var import_primitives106 = __toESM(require_primitives()); var import_jsx_runtime108 = __toESM(require_jsx_runtime()); var text_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives106.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives106.Path, { d: "M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z" }) }); // packages/icons/build-module/library/trash.js var import_primitives107 = __toESM(require_primitives()); var import_jsx_runtime109 = __toESM(require_jsx_runtime()); var trash_default = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives107.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)( import_primitives107.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" } ) }); // packages/icons/build-module/library/ungroup.js var import_primitives108 = __toESM(require_primitives()); var import_jsx_runtime110 = __toESM(require_jsx_runtime()); var ungroup_default = /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives108.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives108.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z" }) }); // packages/icons/build-module/library/unlock.js var import_primitives109 = __toESM(require_primitives()); var import_jsx_runtime111 = __toESM(require_jsx_runtime()); var unlock_default = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives109.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives109.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z" }) }); // packages/icons/build-module/library/unseen.js var import_primitives110 = __toESM(require_primitives()); var import_jsx_runtime112 = __toESM(require_jsx_runtime()); var unseen_default = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives110.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives110.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) }); // packages/icons/build-module/library/upload.js var import_primitives111 = __toESM(require_primitives()); var import_jsx_runtime113 = __toESM(require_jsx_runtime()); var upload_default = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives111.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives111.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) }); // packages/icons/build-module/library/verse.js var import_primitives112 = __toESM(require_primitives()); var import_jsx_runtime114 = __toESM(require_jsx_runtime()); var verse_default = /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives112.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives112.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" }) }); // packages/icons/build-module/library/video.js var import_primitives113 = __toESM(require_primitives()); var import_jsx_runtime115 = __toESM(require_jsx_runtime()); var video_default = /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives113.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives113.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-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" }) }); // packages/block-editor/build-module/store/selectors.js var import_rich_text = __toESM(require_rich_text()); var import_deprecated2 = __toESM(require_deprecated()); var import_data4 = __toESM(require_data()); // packages/block-editor/build-module/store/utils.js var import_blocks5 = __toESM(require_blocks()); var import_block_serialization_default_parser = __toESM(require_block_serialization_default_parser()); // packages/block-editor/build-module/store/constants.js var STORE_NAME = "core/block-editor"; // packages/block-editor/build-module/store/private-selectors.js var private_selectors_exports = {}; __export(private_selectors_exports, { getAllPatterns: () => getAllPatterns, getBlockRemovalRules: () => getBlockRemovalRules, getBlockSettings: () => getBlockSettings, getBlockStyles: () => getBlockStyles, getBlockWithoutAttributes: () => getBlockWithoutAttributes, getClosestAllowedInsertionPoint: () => getClosestAllowedInsertionPoint, getClosestAllowedInsertionPointForPattern: () => getClosestAllowedInsertionPointForPattern, getContentLockingParent: () => getContentLockingParent, getEditedContentOnlySection: () => getEditedContentOnlySection, getEnabledBlockParents: () => getEnabledBlockParents, getEnabledClientIdsTree: () => getEnabledClientIdsTree, getExpandedBlock: () => getExpandedBlock, getInserterMediaCategories: () => getInserterMediaCategories, getInsertionPoint: () => getInsertionPoint, getLastFocus: () => getLastFocus, getLastInsertedBlocksClientIds: () => getLastInsertedBlocksClientIds, getOpenedBlockSettingsMenu: () => getOpenedBlockSettingsMenu, getParentSectionBlock: () => getParentSectionBlock, getPatternBySlug: () => getPatternBySlug, getRegisteredInserterMediaCategories: () => getRegisteredInserterMediaCategories, getRemovalPromptData: () => getRemovalPromptData, getReusableBlocks: () => getReusableBlocks, getSectionRootClientId: () => getSectionRootClientId, getStyleOverrides: () => getStyleOverrides, getZoomLevel: () => getZoomLevel, hasAllowedPatterns: () => hasAllowedPatterns, hasBlockSpotlight: () => hasBlockSpotlight2, isBlockHidden: () => isBlockHidden, isBlockInterfaceHidden: () => isBlockInterfaceHidden2, isBlockSubtreeDisabled: () => isBlockSubtreeDisabled, isContainerInsertableToInContentOnlyMode: () => isContainerInsertableToInContentOnlyMode, isDragging: () => isDragging2, isEditLockedBlock: () => isEditLockedBlock, isLockedBlock: () => isLockedBlock, isMoveLockedBlock: () => isMoveLockedBlock, isRemoveLockedBlock: () => isRemoveLockedBlock, isSectionBlock: () => isSectionBlock, isWithinEditedContentOnlySection: () => isWithinEditedContentOnlySection, isZoomOut: () => isZoomOut }); var import_data3 = __toESM(require_data()); var import_blocks4 = __toESM(require_blocks()); // packages/block-editor/build-module/store/get-block-settings.js var import_blocks3 = __toESM(require_blocks()); var import_hooks = __toESM(require_hooks()); // packages/block-editor/build-module/utils/object.js function setImmutably(object, path, value) { path = Array.isArray(path) ? [...path] : [path]; object = Array.isArray(object) ? [...object] : { ...object }; const leaf = path.pop(); let prev = object; for (const key of path) { const lvl = prev[key]; prev = prev[key] = Array.isArray(lvl) ? [...lvl] : { ...lvl }; } prev[leaf] = value; return object; } var getValueFromObjectPath = (object, path, defaultValue) => { const arrayPath = Array.isArray(path) ? path : path.split("."); let value = object; arrayPath.forEach((fieldName) => { value = value?.[fieldName]; }); return value ?? defaultValue; }; // packages/block-editor/build-module/store/get-block-settings.js var blockedPaths = [ "color", "border", "dimensions", "typography", "spacing" ]; var deprecatedFlags = { "color.palette": (settings2) => settings2.colors, "color.gradients": (settings2) => settings2.gradients, "color.custom": (settings2) => settings2.disableCustomColors === void 0 ? void 0 : !settings2.disableCustomColors, "color.customGradient": (settings2) => settings2.disableCustomGradients === void 0 ? void 0 : !settings2.disableCustomGradients, "typography.fontSizes": (settings2) => settings2.fontSizes, "typography.customFontSize": (settings2) => settings2.disableCustomFontSizes === void 0 ? void 0 : !settings2.disableCustomFontSizes, "typography.lineHeight": (settings2) => settings2.enableCustomLineHeight, "spacing.units": (settings2) => { if (settings2.enableCustomUnits === void 0) { return; } if (settings2.enableCustomUnits === true) { return ["px", "em", "rem", "vh", "vw", "%"]; } return settings2.enableCustomUnits; }, "spacing.padding": (settings2) => settings2.enableCustomSpacing }; var prefixedFlags = { /* * These were only available in the plugin * and can be removed when the minimum WordPress version * for the plugin is 5.9. */ "border.customColor": "border.color", "border.customStyle": "border.style", "border.customWidth": "border.width", "typography.customFontStyle": "typography.fontStyle", "typography.customFontWeight": "typography.fontWeight", "typography.customLetterSpacing": "typography.letterSpacing", "typography.customTextDecorations": "typography.textDecoration", "typography.customTextTransforms": "typography.textTransform", /* * These were part of WordPress 5.8 and we need to keep them. */ "border.customRadius": "border.radius", "spacing.customMargin": "spacing.margin", "spacing.customPadding": "spacing.padding", "typography.customLineHeight": "typography.lineHeight" }; var removeCustomPrefixes = (path) => { return prefixedFlags[path] || path; }; function getBlockSettings(state, clientId, ...paths) { const blockName = getBlockName(state, clientId); const candidates = []; if (clientId) { let id = clientId; do { const name = getBlockName(state, id); if ((0, import_blocks3.hasBlockSupport)(name, "__experimentalSettings", false)) { candidates.push(id); } } while (id = state.blocks.parents.get(id)); } return paths.map((path) => { if (blockedPaths.includes(path)) { console.warn( "Top level useSetting paths are disabled. Please use a subpath to query the information needed." ); return void 0; } let result = (0, import_hooks.applyFilters)( "blockEditor.useSetting.before", void 0, path, clientId, blockName ); if (void 0 !== result) { return result; } const normalizedPath = removeCustomPrefixes(path); for (const candidateClientId of candidates) { const candidateAtts = getBlockAttributes( state, candidateClientId ); result = getValueFromObjectPath( candidateAtts.settings?.blocks?.[blockName], normalizedPath ) ?? getValueFromObjectPath( candidateAtts.settings, normalizedPath ); if (result !== void 0) { break; } } const settings2 = getSettings(state); if (result === void 0 && blockName) { result = getValueFromObjectPath( settings2.__experimentalFeatures?.blocks?.[blockName], normalizedPath ); } if (result === void 0) { result = getValueFromObjectPath( settings2.__experimentalFeatures, normalizedPath ); } if (result !== void 0) { if (import_blocks3.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[normalizedPath]) { return result.custom ?? result.theme ?? result.default; } return result; } const deprecatedSettingsValue = deprecatedFlags[normalizedPath]?.(settings2); if (deprecatedSettingsValue !== void 0) { return deprecatedSettingsValue; } return normalizedPath === "typography.dropCap" ? true : void 0; }); } // packages/block-editor/build-module/store/private-selectors.js var { isContentBlock: isContentBlock2 } = unlock(import_blocks4.privateApis); function isBlockInterfaceHidden2(state) { return state.isBlockInterfaceHidden; } function getLastInsertedBlocksClientIds(state) { return state?.lastBlockInserted?.clientIds; } function getBlockWithoutAttributes(state, clientId) { return state.blocks.byClientId.get(clientId); } var isBlockSubtreeDisabled = (state, clientId) => { const isChildSubtreeDisabled = (childClientId) => { return getBlockEditingMode(state, childClientId) === "disabled" && getBlockOrder(state, childClientId).every( isChildSubtreeDisabled ); }; return getBlockOrder(state, clientId).every(isChildSubtreeDisabled); }; function isContainerInsertableToInContentOnlyMode(state, blockName, rootClientId) { const isBlockContentBlock = isContentBlock2(blockName); const rootBlockName = getBlockName(state, rootClientId); const isContainerContentBlock = isContentBlock2(rootBlockName); const isRootBlockMain = getSectionRootClientId(state) === rootClientId; return isRootBlockMain || isContainerContentBlock && isBlockContentBlock; } function getEnabledClientIdsTreeUnmemoized(state, rootClientId) { const blockOrder = getBlockOrder(state, rootClientId); const result = []; for (const clientId of blockOrder) { const innerBlocks = getEnabledClientIdsTreeUnmemoized( state, clientId ); if (getBlockEditingMode(state, clientId) !== "disabled") { result.push({ clientId, innerBlocks }); } else { result.push(...innerBlocks); } } return result; } var getEnabledClientIdsTree = (0, import_data3.createRegistrySelector)( () => (0, import_data3.createSelector)(getEnabledClientIdsTreeUnmemoized, (state) => [ state.blocks.order, state.derivedBlockEditingModes, state.blockEditingModes ]) ); var getEnabledBlockParents = (0, import_data3.createSelector)( (state, clientId, ascending = false) => { return getBlockParents(state, clientId, ascending).filter( (parent) => getBlockEditingMode(state, parent) !== "disabled" ); }, (state) => [ state.blocks.parents, state.blockEditingModes, state.settings.templateLock, state.blockListSettings ] ); function getRemovalPromptData(state) { return state.removalPromptData; } function getBlockRemovalRules(state) { return state.blockRemovalRules; } function getOpenedBlockSettingsMenu(state) { return state.openedBlockSettingsMenu; } var getStyleOverrides = (0, import_data3.createSelector)( (state) => { const clientIds = getClientIdsWithDescendants(state); const clientIdMap = clientIds.reduce((acc, clientId, index) => { acc[clientId] = index; return acc; }, {}); return [...state.styleOverrides].sort((overrideA, overrideB) => { const [, { clientId: clientIdA }] = overrideA; const [, { clientId: clientIdB }] = overrideB; const aIndex = clientIdMap[clientIdA] ?? -1; const bIndex = clientIdMap[clientIdB] ?? -1; return aIndex - bIndex; }); }, (state) => [state.blocks.order, state.styleOverrides] ); function getRegisteredInserterMediaCategories(state) { return state.registeredInserterMediaCategories; } var getInserterMediaCategories = (0, import_data3.createSelector)( (state) => { const { settings: { inserterMediaCategories, allowedMimeTypes, enableOpenverseMediaCategory }, registeredInserterMediaCategories: registeredInserterMediaCategories2 } = state; if (!inserterMediaCategories && !registeredInserterMediaCategories2.length || !allowedMimeTypes) { return; } const coreInserterMediaCategoriesNames = inserterMediaCategories?.map(({ name }) => name) || []; const mergedCategories = [ ...inserterMediaCategories || [], ...(registeredInserterMediaCategories2 || []).filter( ({ name }) => !coreInserterMediaCategoriesNames.includes(name) ) ]; return mergedCategories.filter((category) => { if (!enableOpenverseMediaCategory && category.name === "openverse") { return false; } return Object.values(allowedMimeTypes).some( (mimeType) => mimeType.startsWith(`${category.mediaType}/`) ); }); }, (state) => [ state.settings.inserterMediaCategories, state.settings.allowedMimeTypes, state.settings.enableOpenverseMediaCategory, state.registeredInserterMediaCategories ] ); var hasAllowedPatterns = (0, import_data3.createRegistrySelector)( (select3) => (0, import_data3.createSelector)( (state, rootClientId = null) => { const { getAllPatterns: getAllPatterns2 } = unlock(select3(STORE_NAME)); const patterns = getAllPatterns2(); const { allowedBlockTypes } = getSettings(state); return patterns.some((pattern) => { const { inserter = true } = pattern; if (!inserter) { return false; } const grammar = getGrammar(pattern); return checkAllowListRecursive(grammar, allowedBlockTypes) && grammar.every( ({ name: blockName }) => canInsertBlockType(state, blockName, rootClientId) ); }); }, (state, rootClientId) => [ ...getAllPatternsDependants(select3)(state), ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var getPatternBySlug = (0, import_data3.createRegistrySelector)( (select3) => (0, import_data3.createSelector)( (state, patternName) => { if (patternName?.startsWith("core/block/")) { const _id = parseInt( patternName.slice("core/block/".length), 10 ); const block = unlock(select3(STORE_NAME)).getReusableBlocks().find(({ id }) => id === _id); if (!block) { return null; } return mapUserPattern( block, state.settings.__experimentalUserPatternCategories ); } return [ // This setting is left for back compat. ...state.settings.__experimentalBlockPatterns ?? [], ...state.settings[selectBlockPatternsKey]?.(select3) ?? [] ].find(({ name }) => name === patternName); }, (state, patternName) => patternName?.startsWith("core/block/") ? [ unlock(select3(STORE_NAME)).getReusableBlocks(), state.settings.__experimentalReusableBlocks ] : [ state.settings.__experimentalBlockPatterns, state.settings[selectBlockPatternsKey]?.(select3) ] ) ); var getAllPatterns = (0, import_data3.createRegistrySelector)( (select3) => (0, import_data3.createSelector)((state) => { return [ ...unlock(select3(STORE_NAME)).getReusableBlocks().map( (userPattern) => mapUserPattern( userPattern, state.settings.__experimentalUserPatternCategories ) ), // This setting is left for back compat. ...state.settings.__experimentalBlockPatterns ?? [], ...state.settings[selectBlockPatternsKey]?.(select3) ?? [] ].filter( (x2, index, arr) => index === arr.findIndex((y2) => x2.name === y2.name) ); }, getAllPatternsDependants(select3)) ); var EMPTY_ARRAY = []; var getReusableBlocks = (0, import_data3.createRegistrySelector)( (select3) => (state) => { const reusableBlocksSelect = state.settings[reusableBlocksSelectKey]; return (reusableBlocksSelect ? reusableBlocksSelect(select3) : state.settings.__experimentalReusableBlocks) ?? EMPTY_ARRAY; } ); function getLastFocus(state) { return state.lastFocus; } function isDragging2(state) { return state.isDragging; } function getExpandedBlock(state) { return state.expandedBlock; } var getContentLockingParent = (state, clientId) => { let current = clientId; let result; while (!result && (current = state.blocks.parents.get(current))) { if (getTemplateLock(state, current) === "contentOnly") { result = current; } } return result; }; var getParentSectionBlock = (state, clientId) => { let current = clientId; let result; while (current = state.blocks.parents.get(current)) { if (isSectionBlock(state, current)) { result = current; } } return result; }; function isSectionBlock(state, clientId) { if (clientId === state.editedContentOnlySection) { return false; } const blockName = getBlockName(state, clientId); if (blockName === "core/block") { return true; } const attributes = getBlockAttributes(state, clientId); const isTemplatePart8 = blockName === "core/template-part"; const isIsolatedEditor = state.settings?.[isIsolatedEditorKey]; if ((attributes?.metadata?.patternName || isTemplatePart8) && !!window?.__experimentalContentOnlyPatternInsertion && !isIsolatedEditor) { return true; } const hasContentOnlyTempateLock = getTemplateLock(state, clientId) === "contentOnly"; const rootClientId = getBlockRootClientId(state, clientId); const hasRootContentOnlyTemplateLock = getTemplateLock(state, rootClientId) === "contentOnly"; if (hasContentOnlyTempateLock && !hasRootContentOnlyTemplateLock) { return true; } return false; } function getEditedContentOnlySection(state) { return state.editedContentOnlySection; } function isWithinEditedContentOnlySection(state, clientId) { if (!state.editedContentOnlySection) { return false; } if (state.editedContentOnlySection === clientId) { return true; } let current = clientId; while (current = state.blocks.parents.get(current)) { if (state.editedContentOnlySection === current) { return true; } } return false; } var getBlockStyles = (0, import_data3.createSelector)( (state, clientIds) => clientIds.reduce((styles, clientId) => { styles[clientId] = state.blocks.attributes.get(clientId)?.style; return styles; }, {}), (state, clientIds) => [ ...clientIds.map( (clientId) => state.blocks.attributes.get(clientId)?.style ) ] ); function getSectionRootClientId(state) { return state.settings?.[sectionRootClientIdKey]; } function isZoomOut(state) { return state.zoomLevel === "auto-scaled" || state.zoomLevel < 100; } function getZoomLevel(state) { return state.zoomLevel; } function getClosestAllowedInsertionPoint(state, name, clientId = "") { const blockNames = Array.isArray(name) ? name : [name]; const areBlockNamesAllowedInClientId = (id) => blockNames.every( (currentName) => canInsertBlockType(state, currentName, id) ); if (!clientId) { if (areBlockNamesAllowedInClientId(clientId)) { return clientId; } const sectionRootClientId = getSectionRootClientId(state); if (sectionRootClientId && areBlockNamesAllowedInClientId(sectionRootClientId)) { return sectionRootClientId; } return null; } let current = clientId; while (current !== null && !areBlockNamesAllowedInClientId(current)) { const parentClientId = getBlockRootClientId(state, current); current = parentClientId; } return current; } function getClosestAllowedInsertionPointForPattern(state, pattern, clientId) { const { allowedBlockTypes } = getSettings(state); const isAllowed = checkAllowListRecursive( getGrammar(pattern), allowedBlockTypes ); if (!isAllowed) { return null; } const names = getGrammar(pattern).map(({ blockName: name }) => name); return getClosestAllowedInsertionPoint(state, names, clientId); } function getInsertionPoint(state) { return state.insertionPoint; } var isBlockHidden = (state, clientId) => { const blockName = getBlockName(state, clientId); if (!(0, import_blocks4.hasBlockSupport)(state, blockName, "visibility", true)) { return false; } const attributes = state.blocks.attributes.get(clientId); return attributes?.metadata?.blockVisibility === false; }; function hasBlockSpotlight2(state) { return !!state.hasBlockSpotlight || !!state.editedContentOnlySection; } function isEditLockedBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); return !!attributes?.lock?.edit; } function isMoveLockedBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes?.lock?.move !== void 0) { return !!attributes?.lock?.move; } const rootClientId = getBlockRootClientId(state, clientId); const templateLock = getTemplateLock(state, rootClientId); return templateLock === "all"; } function isRemoveLockedBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes?.lock?.remove !== void 0) { return !!attributes?.lock?.remove; } const rootClientId = getBlockRootClientId(state, clientId); const templateLock = getTemplateLock(state, rootClientId); return templateLock === "all" || templateLock === "insert"; } function isLockedBlock(state, clientId) { return isEditLockedBlock(state, clientId) || isMoveLockedBlock(state, clientId) || isRemoveLockedBlock(state, clientId); } // packages/block-editor/build-module/components/inserter/block-patterns-tab/utils.js var import_i18n2 = __toESM(require_i18n()); var INSERTER_PATTERN_TYPES = { user: "user", theme: "theme", directory: "directory" }; var INSERTER_SYNC_TYPES = { full: "fully", unsynced: "unsynced" }; var allPatternsCategory = { name: "allPatterns", label: (0, import_i18n2._x)("All", "patterns") }; var myPatternsCategory = { name: "myPatterns", label: (0, import_i18n2.__)("My patterns") }; var starterPatternsCategory = { name: "core/starter-content", label: (0, import_i18n2.__)("Starter content") }; function isPatternFiltered(pattern, sourceFilter, syncFilter) { const isUserPattern = pattern.name.startsWith("core/block"); const isDirectoryPattern = pattern.source === "core" || pattern.source?.startsWith("pattern-directory"); if (sourceFilter === INSERTER_PATTERN_TYPES.theme && (isUserPattern || isDirectoryPattern)) { return true; } if (sourceFilter === INSERTER_PATTERN_TYPES.directory && (isUserPattern || !isDirectoryPattern)) { return true; } if (sourceFilter === INSERTER_PATTERN_TYPES.user && pattern.type !== INSERTER_PATTERN_TYPES.user) { return true; } if (syncFilter === INSERTER_SYNC_TYPES.full && pattern.syncStatus !== "") { return true; } if (syncFilter === INSERTER_SYNC_TYPES.unsynced && pattern.syncStatus !== "unsynced" && isUserPattern) { return true; } return false; } // packages/block-editor/build-module/store/utils.js var isFiltered = Symbol("isFiltered"); var parsedPatternCache = /* @__PURE__ */ new WeakMap(); var grammarMapCache = /* @__PURE__ */ new WeakMap(); function mapUserPattern(userPattern, __experimentalUserPatternCategories = []) { return { name: `core/block/${userPattern.id}`, id: userPattern.id, type: INSERTER_PATTERN_TYPES.user, title: userPattern.title?.raw, categories: userPattern.wp_pattern_category?.map((catId) => { const category = __experimentalUserPatternCategories.find( ({ id }) => id === catId ); return category ? category.slug : catId; }), content: userPattern.content?.raw, syncStatus: userPattern.wp_pattern_sync_status }; } function parsePattern(pattern) { const blocks2 = (0, import_blocks5.parse)(pattern.content, { __unstableSkipMigrationLogs: true }); if (blocks2.length === 1) { blocks2[0].attributes = { ...blocks2[0].attributes, metadata: { ...blocks2[0].attributes.metadata || {}, categories: pattern.categories, patternName: pattern.name, name: blocks2[0].attributes.metadata?.name || pattern.title } }; } return { ...pattern, blocks: blocks2 }; } function getParsedPattern(pattern) { let parsedPattern = parsedPatternCache.get(pattern); if (!parsedPattern) { parsedPattern = parsePattern(pattern); parsedPatternCache.set(pattern, parsedPattern); } return parsedPattern; } function getGrammar(pattern) { let grammarMap = grammarMapCache.get(pattern); if (!grammarMap) { grammarMap = (0, import_block_serialization_default_parser.parse)(pattern.content); grammarMap = grammarMap.filter((block) => block.blockName !== null); grammarMapCache.set(pattern, grammarMap); } return grammarMap; } var checkAllowList = (list, item, defaultResult = null) => { if (typeof list === "boolean") { return list; } if (Array.isArray(list)) { if (list.includes("core/post-content") && item === null) { return true; } return list.includes(item); } return defaultResult; }; var checkAllowListRecursive = (blocks2, allowedBlockTypes) => { if (typeof allowedBlockTypes === "boolean") { return allowedBlockTypes; } const blocksQueue = [...blocks2]; while (blocksQueue.length > 0) { const block = blocksQueue.shift(); const isAllowed = checkAllowList( allowedBlockTypes, block.name || block.blockName, true ); if (!isAllowed) { return false; } block.innerBlocks?.forEach((innerBlock) => { blocksQueue.push(innerBlock); }); } return true; }; var getAllPatternsDependants = (select3) => (state) => { return [ state.settings.__experimentalBlockPatterns, state.settings.__experimentalUserPatternCategories, state.settings.__experimentalReusableBlocks, state.settings[selectBlockPatternsKey]?.(select3), state.blockPatterns, unlock(select3(STORE_NAME)).getReusableBlocks() ]; }; var getInsertBlockTypeDependants = () => (state, rootClientId) => { return [ state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId), state.settings.allowedBlockTypes, state.settings.templateLock, getBlockEditingMode(state, rootClientId), getSectionRootClientId(state), isSectionBlock(state, rootClientId) ]; }; // packages/block-editor/build-module/utils/sorting.js var comparator = (field, items, order) => { return (a2, b2) => { let cmpA, cmpB; if (typeof field === "function") { cmpA = field(a2); cmpB = field(b2); } else { cmpA = a2[field]; cmpB = b2[field]; } if (cmpA > cmpB) { return order === "asc" ? 1 : -1; } else if (cmpB > cmpA) { return order === "asc" ? -1 : 1; } const orderA = items.findIndex((item) => item === a2); const orderB = items.findIndex((item) => item === b2); if (orderA > orderB) { return 1; } else if (orderB > orderA) { return -1; } return 0; }; }; function orderBy(items, field, order = "asc") { return items.concat().sort(comparator(field, items, order)); } // packages/block-editor/build-module/store/selectors.js var { isContentBlock: isContentBlock3 } = unlock(import_blocks6.privateApis); var MILLISECONDS_PER_HOUR = 3600 * 1e3; var MILLISECONDS_PER_DAY = 24 * 3600 * 1e3; var MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1e3; var EMPTY_ARRAY2 = []; var EMPTY_SET = /* @__PURE__ */ new Set(); var DEFAULT_INSERTER_OPTIONS = { [isFiltered]: true }; function getBlockName(state, clientId) { const block = state.blocks.byClientId.get(clientId); const socialLinkName = "core/social-link"; if (import_element6.Platform.OS !== "web" && block?.name === socialLinkName) { const attributes = state.blocks.attributes.get(clientId); const { service } = attributes ?? {}; return service ? `${socialLinkName}-${service}` : socialLinkName; } return block ? block.name : null; } function isBlockValid(state, clientId) { const block = state.blocks.byClientId.get(clientId); return !!block && block.isValid; } function getBlockAttributes(state, clientId) { const block = state.blocks.byClientId.get(clientId); if (!block) { return null; } return state.blocks.attributes.get(clientId); } function getBlock(state, clientId) { if (!state.blocks.byClientId.has(clientId)) { return null; } return state.blocks.tree.get(clientId); } var __unstableGetBlockWithoutInnerBlocks = (0, import_data4.createSelector)( (state, clientId) => { const block = state.blocks.byClientId.get(clientId); if (!block) { return null; } return { ...block, attributes: getBlockAttributes(state, clientId) }; }, (state, clientId) => [ state.blocks.byClientId.get(clientId), state.blocks.attributes.get(clientId) ] ); function getBlocks(state, rootClientId) { const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || "" : "controlled||" + rootClientId; return state.blocks.tree.get(treeKey)?.innerBlocks || EMPTY_ARRAY2; } var __unstableGetClientIdWithClientIdsTree = (0, import_data4.createSelector)( (state, clientId) => { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree", { since: "6.3", version: "6.5" } ); return { clientId, innerBlocks: __unstableGetClientIdsTree(state, clientId) }; }, (state) => [state.blocks.order] ); var __unstableGetClientIdsTree = (0, import_data4.createSelector)( (state, rootClientId = "") => { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree", { since: "6.3", version: "6.5" } ); return getBlockOrder(state, rootClientId).map( (clientId) => __unstableGetClientIdWithClientIdsTree(state, clientId) ); }, (state) => [state.blocks.order] ); var getClientIdsOfDescendants = (0, import_data4.createSelector)( (state, rootIds) => { rootIds = Array.isArray(rootIds) ? [...rootIds] : [rootIds]; const ids = []; for (const rootId of rootIds) { const order = state.blocks.order.get(rootId); if (order) { ids.push(...order); } } let index = 0; while (index < ids.length) { const id = ids[index]; const order = state.blocks.order.get(id); if (order) { ids.splice(index + 1, 0, ...order); } index++; } return ids; }, (state) => [state.blocks.order] ); var getClientIdsWithDescendants = (state) => getClientIdsOfDescendants(state, ""); var getGlobalBlockCount = (0, import_data4.createSelector)( (state, blockName) => { const clientIds = getClientIdsWithDescendants(state); if (!blockName) { return clientIds.length; } let count = 0; for (const clientId of clientIds) { const block = state.blocks.byClientId.get(clientId); if (block.name === blockName) { count++; } } return count; }, (state) => [state.blocks.order, state.blocks.byClientId] ); var getBlocksByName = (0, import_data4.createSelector)( (state, blockName) => { if (!blockName) { return EMPTY_ARRAY2; } const blockNames = Array.isArray(blockName) ? blockName : [blockName]; const clientIds = getClientIdsWithDescendants(state); const foundBlocks = clientIds.filter((clientId) => { const block = state.blocks.byClientId.get(clientId); return blockNames.includes(block.name); }); return foundBlocks.length > 0 ? foundBlocks : EMPTY_ARRAY2; }, (state) => [state.blocks.order, state.blocks.byClientId] ); function __experimentalGetGlobalBlocksByName(state, blockName) { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName", { since: "6.5", alternative: `wp.data.select( 'core/block-editor' ).getBlocksByName` } ); return getBlocksByName(state, blockName); } var getBlocksByClientId = (0, import_data4.createSelector)( (state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map( (clientId) => getBlock(state, clientId) ), (state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map( (clientId) => state.blocks.tree.get(clientId) ) ); var getBlockNamesByClientId = (0, import_data4.createSelector)( (state, clientIds) => getBlocksByClientId(state, clientIds).filter(Boolean).map((block) => block.name), (state, clientIds) => getBlocksByClientId(state, clientIds) ); function getBlockCount(state, rootClientId) { return getBlockOrder(state, rootClientId).length; } function getSelectionStart(state) { return state.selection.selectionStart; } function getSelectionEnd(state) { return state.selection.selectionEnd; } function getBlockSelectionStart(state) { return state.selection.selectionStart.clientId; } function getBlockSelectionEnd(state) { return state.selection.selectionEnd.clientId; } function getSelectedBlockCount(state) { const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length; if (multiSelectedBlockCount) { return multiSelectedBlockCount; } return state.selection.selectionStart.clientId ? 1 : 0; } function hasSelectedBlock(state) { const { selectionStart, selectionEnd } = state.selection; return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId; } function getSelectedBlockClientId(state) { const { selectionStart, selectionEnd } = state.selection; const { clientId } = selectionStart; if (!clientId || clientId !== selectionEnd.clientId) { return null; } return clientId; } function getSelectedBlock(state) { const clientId = getSelectedBlockClientId(state); return clientId ? getBlock(state, clientId) : null; } function getBlockRootClientId(state, clientId) { return state.blocks.parents.get(clientId) ?? null; } var getBlockParents = (0, import_data4.createSelector)( (state, clientId, ascending = false) => { const parents = []; let current = clientId; while (current = state.blocks.parents.get(current)) { parents.push(current); } if (!parents.length) { return EMPTY_ARRAY2; } return ascending ? parents : parents.reverse(); }, (state) => [state.blocks.parents] ); var getBlockParentsByBlockName = (0, import_data4.createSelector)( (state, clientId, blockName, ascending = false) => { const parents = getBlockParents(state, clientId, ascending); const hasName = Array.isArray(blockName) ? (name) => blockName.includes(name) : (name) => blockName === name; return parents.filter((id) => hasName(getBlockName(state, id))); }, (state) => [state.blocks.parents] ); function getBlockHierarchyRootClientId(state, clientId) { let current = clientId; let parent; do { parent = current; current = state.blocks.parents.get(current); } while (current); return parent; } function getLowestCommonAncestorWithSelectedBlock(state, clientId) { const selectedId = getSelectedBlockClientId(state); const clientParents = [...getBlockParents(state, clientId), clientId]; const selectedParents = [ ...getBlockParents(state, selectedId), selectedId ]; let lowestCommonAncestor; const maxDepth = Math.min(clientParents.length, selectedParents.length); for (let index = 0; index < maxDepth; index++) { if (clientParents[index] === selectedParents[index]) { lowestCommonAncestor = clientParents[index]; } else { break; } } return lowestCommonAncestor; } function getAdjacentBlockClientId(state, startClientId, modifier = 1) { if (startClientId === void 0) { startClientId = getSelectedBlockClientId(state); } if (startClientId === void 0) { if (modifier < 0) { startClientId = getFirstMultiSelectedBlockClientId(state); } else { startClientId = getLastMultiSelectedBlockClientId(state); } } if (!startClientId) { return null; } const rootClientId = getBlockRootClientId(state, startClientId); if (rootClientId === null) { return null; } const { order } = state.blocks; const orderSet = order.get(rootClientId); const index = orderSet.indexOf(startClientId); const nextIndex = index + 1 * modifier; if (nextIndex < 0) { return null; } if (nextIndex === orderSet.length) { return null; } return orderSet[nextIndex]; } function getPreviousBlockClientId(state, startClientId) { return getAdjacentBlockClientId(state, startClientId, -1); } function getNextBlockClientId(state, startClientId) { return getAdjacentBlockClientId(state, startClientId, 1); } function getSelectedBlocksInitialCaretPosition(state) { return state.initialPosition; } var getSelectedBlockClientIds = (0, import_data4.createSelector)( (state) => { const { selectionStart, selectionEnd } = state.selection; if (!selectionStart.clientId || !selectionEnd.clientId) { return EMPTY_ARRAY2; } if (selectionStart.clientId === selectionEnd.clientId) { return [selectionStart.clientId]; } const rootClientId = getBlockRootClientId( state, selectionStart.clientId ); if (rootClientId === null) { return EMPTY_ARRAY2; } const blockOrder = getBlockOrder(state, rootClientId); const startIndex = blockOrder.indexOf(selectionStart.clientId); const endIndex = blockOrder.indexOf(selectionEnd.clientId); if (startIndex > endIndex) { return blockOrder.slice(endIndex, startIndex + 1); } return blockOrder.slice(startIndex, endIndex + 1); }, (state) => [ state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId ] ); function getMultiSelectedBlockClientIds(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return EMPTY_ARRAY2; } return getSelectedBlockClientIds(state); } var getMultiSelectedBlocks = (0, import_data4.createSelector)( (state) => { const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); if (!multiSelectedBlockClientIds.length) { return EMPTY_ARRAY2; } return multiSelectedBlockClientIds.map( (clientId) => getBlock(state, clientId) ); }, (state) => [ ...getSelectedBlockClientIds.getDependants(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes ] ); function getFirstMultiSelectedBlockClientId(state) { return getMultiSelectedBlockClientIds(state)[0] || null; } function getLastMultiSelectedBlockClientId(state) { const selectedClientIds = getMultiSelectedBlockClientIds(state); return selectedClientIds[selectedClientIds.length - 1] || null; } function isFirstMultiSelectedBlock(state, clientId) { return getFirstMultiSelectedBlockClientId(state) === clientId; } function isBlockMultiSelected(state, clientId) { return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1; } var isAncestorMultiSelected = (0, import_data4.createSelector)( (state, clientId) => { let ancestorClientId = clientId; let isMultiSelected = false; while (ancestorClientId && !isMultiSelected) { ancestorClientId = getBlockRootClientId(state, ancestorClientId); isMultiSelected = isBlockMultiSelected(state, ancestorClientId); } return isMultiSelected; }, (state) => [ state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId ] ); function getMultiSelectedBlocksStartClientId(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return null; } return selectionStart.clientId || null; } function getMultiSelectedBlocksEndClientId(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return null; } return selectionEnd.clientId || null; } function __unstableIsFullySelected(state) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === "undefined" && typeof selectionFocus.offset === "undefined"; } function __unstableIsSelectionCollapsed(state) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); return !!selectionAnchor && !!selectionFocus && selectionAnchor.clientId === selectionFocus.clientId && selectionAnchor.attributeKey === selectionFocus.attributeKey && selectionAnchor.offset === selectionFocus.offset; } function __unstableSelectionHasUnmergeableBlock(state) { return getSelectedBlockClientIds(state).some((clientId) => { const blockName = getBlockName(state, clientId); const blockType = (0, import_blocks6.getBlockType)(blockName); return !blockType.merge; }); } function __unstableIsSelectionMergeable(state, isForward) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); if (selectionAnchor.clientId === selectionFocus.clientId) { return false; } if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return false; } const anchorRootClientId = getBlockRootClientId( state, selectionAnchor.clientId ); const focusRootClientId = getBlockRootClientId( state, selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return false; } const blockOrder = getBlockOrder(state, anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const targetBlockClientId = isForward ? selectionEnd.clientId : selectionStart.clientId; const blockToMergeClientId = isForward ? selectionStart.clientId : selectionEnd.clientId; const targetBlockName = getBlockName(state, targetBlockClientId); const targetBlockType = (0, import_blocks6.getBlockType)(targetBlockName); if (!targetBlockType.merge) { return false; } const blockToMerge = getBlock(state, blockToMergeClientId); if (blockToMerge.name === targetBlockName) { return true; } const blocksToMerge = (0, import_blocks6.switchToBlockType)(blockToMerge, targetBlockName); return blocksToMerge && blocksToMerge.length; } var __unstableGetSelectedBlocksWithPartialSelection = (state) => { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); if (selectionAnchor.clientId === selectionFocus.clientId) { return EMPTY_ARRAY2; } if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return EMPTY_ARRAY2; } const anchorRootClientId = getBlockRootClientId( state, selectionAnchor.clientId ); const focusRootClientId = getBlockRootClientId( state, selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return EMPTY_ARRAY2; } const blockOrder = getBlockOrder(state, anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); const [selectionStart, selectionEnd] = anchorIndex > focusIndex ? [selectionFocus, selectionAnchor] : [selectionAnchor, selectionFocus]; const blockA = getBlock(state, selectionStart.clientId); const blockB = getBlock(state, selectionEnd.clientId); const htmlA = blockA.attributes[selectionStart.attributeKey]; const htmlB = blockB.attributes[selectionEnd.attributeKey]; let valueA = (0, import_rich_text.create)({ html: htmlA }); let valueB = (0, import_rich_text.create)({ html: htmlB }); valueA = (0, import_rich_text.remove)(valueA, 0, selectionStart.offset); valueB = (0, import_rich_text.remove)(valueB, selectionEnd.offset, valueB.text.length); return [ { ...blockA, attributes: { ...blockA.attributes, [selectionStart.attributeKey]: (0, import_rich_text.toHTMLString)({ value: valueA }) } }, { ...blockB, attributes: { ...blockB.attributes, [selectionEnd.attributeKey]: (0, import_rich_text.toHTMLString)({ value: valueB }) } } ]; }; function getBlockOrder(state, rootClientId) { return state.blocks.order.get(rootClientId || "") || EMPTY_ARRAY2; } function getBlockIndex(state, clientId) { const rootClientId = getBlockRootClientId(state, clientId); return getBlockOrder(state, rootClientId).indexOf(clientId); } function isBlockSelected(state, clientId) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId !== selectionEnd.clientId) { return false; } return selectionStart.clientId === clientId; } function hasSelectedInnerBlock(state, clientId, deep = false) { const selectedBlockClientIds = getSelectedBlockClientIds(state); if (!selectedBlockClientIds.length) { return false; } if (deep) { return selectedBlockClientIds.some( (id) => ( // Pass true because we don't care about order and it's more // performant. getBlockParents(state, id, true).includes(clientId) ) ); } return selectedBlockClientIds.some( (id) => getBlockRootClientId(state, id) === clientId ); } function hasDraggedInnerBlock(state, clientId, deep = false) { return getBlockOrder(state, clientId).some( (innerClientId) => isBlockBeingDragged(state, innerClientId) || deep && hasDraggedInnerBlock(state, innerClientId, deep) ); } function isBlockWithinSelection(state, clientId) { if (!clientId) { return false; } const clientIds = getMultiSelectedBlockClientIds(state); const index = clientIds.indexOf(clientId); return index > -1 && index < clientIds.length - 1; } function hasMultiSelection(state) { const { selectionStart, selectionEnd } = state.selection; return selectionStart.clientId !== selectionEnd.clientId; } function isMultiSelecting2(state) { return state.isMultiSelecting; } function isSelectionEnabled2(state) { return state.isSelectionEnabled; } function getBlockMode(state, clientId) { return state.blocksMode[clientId] || "visual"; } function isTyping2(state) { return state.isTyping; } function isDraggingBlocks(state) { return !!state.draggedBlocks.length; } function getDraggedBlockClientIds(state) { return state.draggedBlocks; } function isBlockBeingDragged(state, clientId) { return state.draggedBlocks.includes(clientId); } function isAncestorBeingDragged(state, clientId) { if (!isDraggingBlocks(state)) { return false; } const parents = getBlockParents(state, clientId); return parents.some( (parentClientId) => isBlockBeingDragged(state, parentClientId) ); } function isCaretWithinFormattedText() { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).isCaretWithinFormattedText', { since: "6.1", version: "6.3" } ); return false; } var getBlockInsertionPoint = (0, import_data4.createSelector)( (state) => { let rootClientId, index; const { insertionCue: insertionCue2, selection: { selectionEnd } } = state; if (insertionCue2 !== null) { return insertionCue2; } const { clientId } = selectionEnd; if (clientId) { rootClientId = getBlockRootClientId(state, clientId) || void 0; index = getBlockIndex(state, selectionEnd.clientId) + 1; } else { index = getBlockOrder(state).length; } return { rootClientId, index }; }, (state) => [ state.insertionCue, state.selection.selectionEnd.clientId, state.blocks.parents, state.blocks.order ] ); function isBlockInsertionPointVisible(state) { return state.insertionCue !== null; } function isValidTemplate(state) { return state.template.isValid; } function getTemplate(state) { return state.settings.template; } function getTemplateLock(state, rootClientId) { if (!rootClientId) { return state.settings.templateLock ?? false; } const blockListTemplateLock = getBlockListSettings( state, rootClientId )?.templateLock; if (blockListTemplateLock === "contentOnly" && state.editedContentOnlySection === rootClientId) { return false; } return blockListTemplateLock ?? false; } var isBlockVisibleInTheInserter = (state, blockNameOrType, rootClientId = null) => { let blockType; let blockName; if (blockNameOrType && "object" === typeof blockNameOrType) { blockType = blockNameOrType; blockName = blockNameOrType.name; } else { blockType = (0, import_blocks6.getBlockType)(blockNameOrType); blockName = blockNameOrType; } if (!blockType) { return false; } const { allowedBlockTypes } = getSettings(state); const isBlockAllowedInEditor = checkAllowList( allowedBlockTypes, blockName, true ); if (!isBlockAllowedInEditor) { return false; } const parents = (Array.isArray(blockType.parent) ? blockType.parent : []).concat(Array.isArray(blockType.ancestor) ? blockType.ancestor : []); if (parents.length > 0) { if (parents.includes("core/post-content")) { return true; } let current = rootClientId; let hasParent = false; do { if (parents.includes(getBlockName(state, current))) { hasParent = true; break; } current = state.blocks.parents.get(current); } while (current); return hasParent; } return true; }; var canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) => { if (!isBlockVisibleInTheInserter(state, blockName, rootClientId)) { return false; } let blockType; if (blockName && "object" === typeof blockName) { blockType = blockName; blockName = blockType.name; } else { blockType = (0, import_blocks6.getBlockType)(blockName); } const rootTemplateLock = getTemplateLock(state, rootClientId); if (rootTemplateLock && rootTemplateLock !== "contentOnly") { return false; } const blockEditingMode = getBlockEditingMode(state, rootClientId ?? ""); if (blockEditingMode === "disabled") { return false; } const parentBlockListSettings = getBlockListSettings(state, rootClientId); if (rootClientId && parentBlockListSettings === void 0) { return false; } const isContentRoleBlock = isContentBlock3(blockName); const isParentSectionBlock = !!isSectionBlock(state, rootClientId); const isBlockWithinSection = !!getParentSectionBlock( state, rootClientId ); if ((isParentSectionBlock || isBlockWithinSection) && !isContentRoleBlock) { return false; } if ((isParentSectionBlock || blockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode( state, blockName, rootClientId )) { return false; } const parentName = getBlockName(state, rootClientId); const parentBlockType = (0, import_blocks6.getBlockType)(parentName); const parentAllowedChildBlocks = parentBlockType?.allowedBlocks; let hasParentAllowedBlock = checkAllowList( parentAllowedChildBlocks, blockName ); if (hasParentAllowedBlock !== false) { const parentAllowedBlocks = parentBlockListSettings?.allowedBlocks; const hasParentListAllowedBlock = checkAllowList( parentAllowedBlocks, blockName ); if (hasParentListAllowedBlock !== null) { hasParentAllowedBlock = hasParentListAllowedBlock; } } const blockAllowedParentBlocks = blockType.parent; const hasBlockAllowedParent = checkAllowList( blockAllowedParentBlocks, parentName ); let hasBlockAllowedAncestor = true; const blockAllowedAncestorBlocks = blockType.ancestor; if (blockAllowedAncestorBlocks) { const ancestors = [ rootClientId, ...getBlockParents(state, rootClientId) ]; hasBlockAllowedAncestor = ancestors.some( (ancestorClientId) => checkAllowList( blockAllowedAncestorBlocks, getBlockName(state, ancestorClientId) ) ); } const canInsert = hasBlockAllowedAncestor && (hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true); if (!canInsert) { return canInsert; } return (0, import_hooks2.applyFilters)( "blockEditor.__unstableCanInsertBlockType", canInsert, blockType, rootClientId, { // Pass bound selectors of the current registry. If we're in a nested // context, the data will differ from the one selected from the root // registry. getBlock: getBlock.bind(null, state), getBlockParentsByBlockName: getBlockParentsByBlockName.bind( null, state ) } ); }; var canInsertBlockType = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => getInsertBlockTypeDependants(select3)(state, rootClientId) ) ); function canInsertBlocks(state, clientIds, rootClientId = null) { return clientIds.every( (id) => canInsertBlockType(state, getBlockName(state, id), rootClientId) ); } function canRemoveBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } if (attributes.lock?.remove !== void 0) { return !attributes.lock.remove; } const rootClientId = getBlockRootClientId(state, clientId); const rootTemplateLock = getTemplateLock(state, rootClientId); if (rootTemplateLock && rootTemplateLock !== "contentOnly") { return false; } const isBlockWithinSection = !!getParentSectionBlock(state, clientId); const isContentRoleBlock = isContentBlock3( getBlockName(state, clientId) ); if (isBlockWithinSection && !isContentRoleBlock) { return false; } const isParentSectionBlock = !!isSectionBlock(state, rootClientId); const rootBlockEditingMode = getBlockEditingMode(state, rootClientId); if ((isParentSectionBlock || rootBlockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode( state, getBlockName(state, clientId), rootClientId )) { return false; } return rootBlockEditingMode !== "disabled"; } function canRemoveBlocks(state, clientIds) { return clientIds.every((clientId) => canRemoveBlock(state, clientId)); } function canMoveBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } if (attributes.lock?.move !== void 0) { return !attributes.lock.move; } const rootClientId = getBlockRootClientId(state, clientId); const rootTemplateLock = getTemplateLock(state, rootClientId); if (rootTemplateLock === "all") { return false; } const isBlockWithinSection = !!getParentSectionBlock(state, clientId); const isContentRoleBlock = isContentBlock3( getBlockName(state, clientId) ); if (isBlockWithinSection && !isContentRoleBlock) { return false; } const isParentSectionBlock = !!isSectionBlock(state, rootClientId); const rootBlockEditingMode = getBlockEditingMode(state, rootClientId); if ((isParentSectionBlock || rootBlockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode( state, getBlockName(state, clientId), rootClientId )) { return false; } return getBlockEditingMode(state, rootClientId) !== "disabled"; } function canMoveBlocks(state, clientIds) { return clientIds.every((clientId) => canMoveBlock(state, clientId)); } function canEditBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } const { lock: lock4 } = attributes; return !lock4?.edit; } function canLockBlockType(state, nameOrType) { if (!(0, import_blocks6.hasBlockSupport)(nameOrType, "lock", true)) { return false; } return !!state.settings?.canLockBlocks; } function getInsertUsage(state, id) { return state.preferences.insertUsage?.[id] ?? null; } var canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => { if (!(0, import_blocks6.hasBlockSupport)(blockType, "inserter", true)) { return false; } return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId); }; var getItemFromVariation = (state, item) => (variation) => { const variationId = `${item.id}/${variation.name}`; const { time, count = 0 } = getInsertUsage(state, variationId) || {}; return { ...item, id: variationId, icon: variation.icon || item.icon, title: variation.title || item.title, description: variation.description || item.description, category: variation.category || item.category, // If `example` is explicitly undefined for the variation, the preview will not be shown. example: variation.hasOwnProperty("example") ? variation.example : item.example, initialAttributes: { ...item.initialAttributes, ...variation.attributes }, innerBlocks: variation.innerBlocks, keywords: variation.keywords || item.keywords, frecency: calculateFrecency(time, count), // Pass through search-only flag for block-scope variations. isSearchOnly: variation.isSearchOnly }; }; var calculateFrecency = (time, count) => { if (!time) { return count; } const duration = Date.now() - time; switch (true) { case duration < MILLISECONDS_PER_HOUR: return count * 4; case duration < MILLISECONDS_PER_DAY: return count * 2; case duration < MILLISECONDS_PER_WEEK: return count / 2; default: return count / 4; } }; var buildBlockTypeItem = (state, { buildScope = "inserter" }) => (blockType) => { const id = blockType.name; let isDisabled = false; if (!(0, import_blocks6.hasBlockSupport)(blockType.name, "multiple", true)) { isDisabled = getBlocksByClientId( state, getClientIdsWithDescendants(state) ).some(({ name }) => name === blockType.name); } const { time, count = 0 } = getInsertUsage(state, id) || {}; const blockItemBase = { id, name: blockType.name, title: blockType.title, icon: blockType.icon, isDisabled, frecency: calculateFrecency(time, count) }; if (buildScope === "transform") { return blockItemBase; } const inserterVariations = (0, import_blocks6.getBlockVariations)( blockType.name, "inserter" ); const blockVariations = (0, import_blocks6.getBlockVariations)(blockType.name, "block"); const inserterVariationNames = new Set( inserterVariations.map((variation) => variation.name) ); const allVariations = [ ...inserterVariations, ...blockVariations.filter( (variation) => !inserterVariationNames.has(variation.name) ).map((variation) => ({ ...variation, isSearchOnly: true, // Block-scope `isDefault` is for the placeholder picker, // not for the inserter, so don't carry it over. isDefault: false })) ]; return { ...blockItemBase, initialAttributes: {}, description: blockType.description, category: blockType.category, keywords: blockType.keywords, parent: blockType.parent, ancestor: blockType.ancestor, variations: allVariations, example: blockType.example, utility: 1 // Deprecated. }; }; var getInserterItems = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => { const buildReusableBlockInserterItem = (reusableBlock) => { const icon = !reusableBlock.wp_pattern_sync_status ? { src: symbol_default, foreground: "var(--wp-block-synced-color)" } : symbol_default; const userPattern = mapUserPattern(reusableBlock); const { time, count = 0 } = getInsertUsage(state, userPattern.name) || {}; const frecency = calculateFrecency(time, count); return { id: userPattern.name, name: "core/block", initialAttributes: { ref: reusableBlock.id }, title: userPattern.title, icon, category: "reusable", keywords: ["reusable"], isDisabled: false, utility: 1, // Deprecated. frecency, content: userPattern.content, get blocks() { return getParsedPattern(userPattern).blocks; }, syncStatus: userPattern.syncStatus }; }; const patternInserterItems = canInsertBlockTypeUnmemoized( state, "core/block", rootClientId ) ? unlock(select3(STORE_NAME)).getReusableBlocks().map(buildReusableBlockInserterItem) : []; const buildBlockTypeInserterItem = buildBlockTypeItem(state, { buildScope: "inserter" }); let blockTypeInserterItems = (0, import_blocks6.getBlockTypes)().filter( (blockType) => (0, import_blocks6.hasBlockSupport)(blockType, "inserter", true) ).map(buildBlockTypeInserterItem); if (options[isFiltered] !== false) { blockTypeInserterItems = blockTypeInserterItems.filter( (blockType) => canIncludeBlockTypeInInserter( state, blockType, rootClientId ) ); } else { blockTypeInserterItems = blockTypeInserterItems.filter( (blockType) => isBlockVisibleInTheInserter( state, blockType, rootClientId ) ).map((blockType) => ({ ...blockType, isAllowedInCurrentRoot: canIncludeBlockTypeInInserter( state, blockType, rootClientId ) })); } const items = blockTypeInserterItems.reduce( (accumulator, item) => { const { variations = [] } = item; if (!variations.some(({ isDefault }) => isDefault)) { accumulator.push(item); } if (variations.length) { const variationMapper = getItemFromVariation( state, item ); accumulator.push( ...variations.map(variationMapper) ); } return accumulator; }, [] ); const groupByType = (blocks2, block) => { const { core, noncore } = blocks2; const type = block.name.startsWith("core/") ? core : noncore; type.push(block); return blocks2; }; const { core: coreItems, noncore: nonCoreItems } = items.reduce( groupByType, { core: [], noncore: [] } ); const sortedBlockTypes = [...coreItems, ...nonCoreItems]; return [...sortedBlockTypes, ...patternInserterItems]; }, (state, rootClientId) => [ (0, import_blocks6.getBlockTypes)(), unlock(select3(STORE_NAME)).getReusableBlocks(), state.blocks.order, state.preferences.insertUsage, ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var getBlockTransformItems = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, blocks2, rootClientId = null) => { const normalizedBlocks = Array.isArray(blocks2) ? blocks2 : [blocks2]; const buildBlockTypeTransformItem = buildBlockTypeItem(state, { buildScope: "transform" }); const blockTypeTransformItems = (0, import_blocks6.getBlockTypes)().filter( (blockType) => canIncludeBlockTypeInInserter( state, blockType, rootClientId ) ).map(buildBlockTypeTransformItem); const itemsByName = Object.fromEntries( Object.entries(blockTypeTransformItems).map( ([, value]) => [value.name, value] ) ); const possibleTransforms = (0, import_blocks6.getPossibleBlockTransformations)( normalizedBlocks ).reduce((accumulator, block) => { if (itemsByName[block?.name]) { accumulator.push(itemsByName[block.name]); } return accumulator; }, []); return orderBy( possibleTransforms, (block) => itemsByName[block.name].frecency, "desc" ); }, (state, blocks2, rootClientId) => [ (0, import_blocks6.getBlockTypes)(), state.preferences.insertUsage, ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var hasInserterItems = (state, rootClientId = null) => { const hasBlockType = (0, import_blocks6.getBlockTypes)().some( (blockType) => canIncludeBlockTypeInInserter(state, blockType, rootClientId) ); if (hasBlockType) { return true; } const hasReusableBlock = canInsertBlockTypeUnmemoized( state, "core/block", rootClientId ); return hasReusableBlock; }; var getAllowedBlocks = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, rootClientId = null) => { if (!rootClientId) { return; } const blockTypes = (0, import_blocks6.getBlockTypes)().filter( (blockType) => canIncludeBlockTypeInInserter(state, blockType, rootClientId) ); const hasReusableBlock = canInsertBlockTypeUnmemoized( state, "core/block", rootClientId ); if (hasReusableBlock) { blockTypes.push("core/block"); } return blockTypes; }, (state, rootClientId) => [ (0, import_blocks6.getBlockTypes)(), ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var __experimentalGetAllowedBlocks = (0, import_data4.createSelector)( (state, rootClientId = null) => { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks', { alternative: 'wp.data.select( "core/block-editor" ).getAllowedBlocks', since: "6.2", version: "6.4" } ); return getAllowedBlocks(state, rootClientId); }, (state, rootClientId) => getAllowedBlocks.getDependants(state, rootClientId) ); function getDirectInsertBlock(state, rootClientId = null) { if (!rootClientId) { return; } const { defaultBlock, directInsert } = state.blockListSettings[rootClientId] ?? {}; if (!defaultBlock || !directInsert) { return; } return defaultBlock; } function __experimentalGetDirectInsertBlock(state, rootClientId = null) { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock', { alternative: 'wp.data.select( "core/block-editor" ).getDirectInsertBlock', since: "6.3", version: "6.4" } ); return getDirectInsertBlock(state, rootClientId); } var __experimentalGetParsedPattern = (0, import_data4.createRegistrySelector)( (select3) => (state, patternName) => { const pattern = unlock(select3(STORE_NAME)).getPatternBySlug( patternName ); return pattern ? getParsedPattern(pattern) : null; } ); var getAllowedPatternsDependants = (select3) => (state, rootClientId) => [ ...getAllPatternsDependants(select3)(state), ...getInsertBlockTypeDependants(select3)(state, rootClientId) ]; var patternsWithParsedBlocks = /* @__PURE__ */ new WeakMap(); function enhancePatternWithParsedBlocks(pattern) { let enhancedPattern = patternsWithParsedBlocks.get(pattern); if (!enhancedPattern) { enhancedPattern = { ...pattern, get blocks() { return getParsedPattern(pattern).blocks; } }; patternsWithParsedBlocks.set(pattern, enhancedPattern); } return enhancedPattern; } var __experimentalGetAllowedPatterns = (0, import_data4.createRegistrySelector)( (select3) => { return (0, import_data4.createSelector)( (state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => { const { getAllPatterns: getAllPatterns2 } = unlock(select3(STORE_NAME)); const patterns = getAllPatterns2(); const { allowedBlockTypes } = getSettings(state); const parsedPatterns = patterns.filter(({ inserter = true }) => !!inserter).map(enhancePatternWithParsedBlocks); const availableParsedPatterns = parsedPatterns.filter( (pattern) => checkAllowListRecursive( getGrammar(pattern), allowedBlockTypes ) ); const patternsAllowed = availableParsedPatterns.filter( (pattern) => getGrammar(pattern).every( ({ blockName: name }) => options[isFiltered] !== false ? canInsertBlockType( state, name, rootClientId ) : isBlockVisibleInTheInserter( state, name, rootClientId ) ) ); return patternsAllowed; }, getAllowedPatternsDependants(select3) ); } ); var getPatternsByBlockTypes = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, blockNames, rootClientId = null) => { if (!blockNames) { return EMPTY_ARRAY2; } const patterns = select3(STORE_NAME).__experimentalGetAllowedPatterns( rootClientId ); const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; const filteredPatterns = patterns.filter( (pattern) => pattern?.blockTypes?.some?.( (blockName) => normalizedBlockNames.includes(blockName) ) ); if (filteredPatterns.length === 0) { return EMPTY_ARRAY2; } return filteredPatterns; }, (state, blockNames, rootClientId) => getAllowedPatternsDependants(select3)(state, rootClientId) ) ); var __experimentalGetPatternsByBlockTypes = (0, import_data4.createRegistrySelector)( (select3) => { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes', { alternative: 'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes', since: "6.2", version: "6.4" } ); return select3(STORE_NAME).getPatternsByBlockTypes; } ); var __experimentalGetPatternTransformItems = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, blocks2, rootClientId = null) => { if (!blocks2) { return EMPTY_ARRAY2; } if (blocks2.some( ({ clientId, innerBlocks }) => innerBlocks.length || areInnerBlocksControlled(state, clientId) )) { return EMPTY_ARRAY2; } const selectedBlockNames = Array.from( new Set(blocks2.map(({ name }) => name)) ); return select3(STORE_NAME).getPatternsByBlockTypes( selectedBlockNames, rootClientId ); }, (state, blocks2, rootClientId) => getAllowedPatternsDependants(select3)(state, rootClientId) ) ); function getBlockListSettings(state, clientId) { return state.blockListSettings[clientId]; } function getSettings(state) { return state.settings; } function isLastBlockChangePersistent(state) { return state.blocks.isPersistentChange; } var __experimentalGetBlockListSettingsForBlocks = (0, import_data4.createSelector)( (state, clientIds = []) => { return clientIds.reduce((blockListSettingsForBlocks, clientId) => { if (!state.blockListSettings[clientId]) { return blockListSettingsForBlocks; } return { ...blockListSettingsForBlocks, [clientId]: state.blockListSettings[clientId] }; }, {}); }, (state) => [state.blockListSettings] ); var __experimentalGetReusableBlockTitle = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, ref) => { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle", { since: "6.6", version: "6.8" } ); const reusableBlock = unlock(select3(STORE_NAME)).getReusableBlocks().find((block) => block.id === ref); if (!reusableBlock) { return null; } return reusableBlock.title?.raw; }, () => [unlock(select3(STORE_NAME)).getReusableBlocks()] ) ); function __unstableIsLastBlockChangeIgnored(state) { return state.blocks.isIgnoredChange; } function __experimentalGetLastBlockAttributeChanges(state) { return state.lastBlockAttributesChange; } function hasBlockMovingClientId() { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).hasBlockMovingClientId', { since: "6.7", hint: "Block moving mode feature has been removed" } ); return false; } function didAutomaticChange(state) { return !!state.automaticChangeStatus; } function isBlockHighlighted(state, clientId) { return state.highlightedBlock === clientId; } function areInnerBlocksControlled(state, clientId) { return !!state.blocks.controlledInnerBlocks[clientId]; } var __experimentalGetActiveBlockIdByBlockNames = (0, import_data4.createSelector)( (state, validBlockNames) => { if (!validBlockNames.length) { return null; } const selectedBlockClientId = getSelectedBlockClientId(state); if (validBlockNames.includes( getBlockName(state, selectedBlockClientId) )) { return selectedBlockClientId; } const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); const entityAreaParents = getBlockParentsByBlockName( state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames ); if (entityAreaParents) { return entityAreaParents[entityAreaParents.length - 1]; } return null; }, (state, validBlockNames) => [ state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId, validBlockNames ] ); function wasBlockJustInserted(state, clientId, source) { const { lastBlockInserted: lastBlockInserted2 } = state; return lastBlockInserted2.clientIds?.includes(clientId) && lastBlockInserted2.source === source; } function isBlockVisible(state, clientId) { return state.blockVisibility?.[clientId] ?? true; } function getHoveredBlockClientId() { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).getHoveredBlockClientId", { since: "6.9", version: "7.1" } ); return void 0; } var __unstableGetVisibleBlocks = (0, import_data4.createSelector)( (state) => { const visibleBlocks = new Set( Object.keys(state.blockVisibility).filter( (key) => state.blockVisibility[key] ) ); if (visibleBlocks.size === 0) { return EMPTY_SET; } return visibleBlocks; }, (state) => [state.blockVisibility] ); function __unstableHasActiveBlockOverlayActive(state, clientId) { if (getBlockEditingMode(state, clientId) !== "default") { return false; } if (!canEditBlock(state, clientId)) { return true; } if (isZoomOut(state)) { const sectionRootClientId = getSectionRootClientId(state); if (sectionRootClientId) { const sectionClientIds = getBlockOrder( state, sectionRootClientId ); if (sectionClientIds?.includes(clientId)) { return true; } } else if (clientId && !getBlockRootClientId(state, clientId)) { return true; } } const blockSupportDisable = (0, import_blocks6.hasBlockSupport)( getBlockName(state, clientId), "__experimentalDisableBlockOverlay", false ); const shouldEnableIfUnselected = blockSupportDisable ? false : areInnerBlocksControlled(state, clientId); return shouldEnableIfUnselected && !isBlockSelected(state, clientId) && !hasSelectedInnerBlock(state, clientId, true); } function __unstableIsWithinBlockOverlay(state, clientId) { let parent = state.blocks.parents.get(clientId); while (!!parent) { if (__unstableHasActiveBlockOverlayActive(state, parent)) { return true; } parent = state.blocks.parents.get(parent); } return false; } function getBlockEditingMode(state, clientId = "") { if (clientId === null) { clientId = ""; } if (state.derivedBlockEditingModes?.has(clientId)) { return state.derivedBlockEditingModes.get(clientId); } if (state.blockEditingModes.has(clientId)) { return state.blockEditingModes.get(clientId); } return "default"; } var isUngroupable = (0, import_data4.createRegistrySelector)( (select3) => (state, clientId = "") => { const _clientId = clientId || getSelectedBlockClientId(state); if (!_clientId) { return false; } if (isSectionBlock(state, _clientId)) { return false; } const { getGroupingBlockName } = select3(import_blocks6.store); const block = getBlock(state, _clientId); const groupingBlockName = getGroupingBlockName(); const _isUngroupable = block && (block.name === groupingBlockName || (0, import_blocks6.getBlockType)(block.name)?.transforms?.ungroup) && !!block.innerBlocks.length; return _isUngroupable && canRemoveBlock(state, _clientId); } ); var isGroupable = (0, import_data4.createRegistrySelector)( (select3) => (state, clientIds = EMPTY_ARRAY2) => { const { getGroupingBlockName } = select3(import_blocks6.store); const groupingBlockName = getGroupingBlockName(); const _clientIds = clientIds?.length ? clientIds : getSelectedBlockClientIds(state); const rootClientId = _clientIds?.length ? getBlockRootClientId(state, _clientIds[0]) : void 0; const groupingBlockAvailable = canInsertBlockType( state, groupingBlockName, rootClientId ); const _isGroupable = groupingBlockAvailable && _clientIds.length; return _isGroupable && canRemoveBlocks(state, _clientIds); } ); var __unstableGetContentLockingParent = (state, clientId) => { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent", { since: "6.1", version: "6.7" } ); return getContentLockingParent(state, clientId); }; function __unstableGetTemporarilyEditingAsBlocks(state) { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks", { since: "6.1", version: "6.7" } ); return getEditedContentOnlySection(state); } // packages/block-editor/build-module/store/private-actions.js var private_actions_exports = {}; __export(private_actions_exports, { __experimentalUpdateSettings: () => __experimentalUpdateSettings, clearBlockRemovalPrompt: () => clearBlockRemovalPrompt, deleteStyleOverride: () => deleteStyleOverride, editContentOnlySection: () => editContentOnlySection, ensureDefaultBlock: () => ensureDefaultBlock, expandBlock: () => expandBlock, hideBlockInterface: () => hideBlockInterface, privateRemoveBlocks: () => privateRemoveBlocks, resetZoomLevel: () => resetZoomLevel, setBlockRemovalRules: () => setBlockRemovalRules, setInsertionPoint: () => setInsertionPoint, setLastFocus: () => setLastFocus, setOpenedBlockSettingsMenu: () => setOpenedBlockSettingsMenu, setStyleOverride: () => setStyleOverride, setZoomLevel: () => setZoomLevel, showBlockInterface: () => showBlockInterface, startDragging: () => startDragging, stopDragging: () => stopDragging, stopEditingContentOnlySection: () => stopEditingContentOnlySection, toggleBlockSpotlight: () => toggleBlockSpotlight }); var import_element7 = __toESM(require_element()); var import_deprecated3 = __toESM(require_deprecated()); var import_a11y2 = __toESM(require_a11y()); var import_i18n3 = __toESM(require_i18n()); var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; var privateSettings = [ "inserterMediaCategories", "blockInspectorAnimation", "mediaSideload" ]; function __experimentalUpdateSettings(settings2, { stripExperimentalSettings = false, reset = false } = {}) { let incomingSettings = settings2; if (Object.hasOwn(incomingSettings, "__unstableIsPreviewMode")) { (0, import_deprecated3.default)( "__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings", { since: "6.8", alternative: "isPreviewMode" } ); incomingSettings = { ...incomingSettings }; incomingSettings.isPreviewMode = incomingSettings.__unstableIsPreviewMode; delete incomingSettings.__unstableIsPreviewMode; } let cleanSettings = incomingSettings; if (stripExperimentalSettings && import_element7.Platform.OS === "web") { cleanSettings = {}; for (const key in incomingSettings) { if (!privateSettings.includes(key)) { cleanSettings[key] = incomingSettings[key]; } } } return { type: "UPDATE_SETTINGS", settings: cleanSettings, reset }; } function hideBlockInterface() { return { type: "HIDE_BLOCK_INTERFACE" }; } function showBlockInterface() { return { type: "SHOW_BLOCK_INTERFACE" }; } var privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemove = false) => ({ select: select3, dispatch, registry }) => { if (!clientIds || !clientIds.length) { return; } clientIds = castArray(clientIds); const canRemoveBlocks2 = select3.canRemoveBlocks(clientIds); if (!canRemoveBlocks2) { return; } const rules = !forceRemove && select3.getBlockRemovalRules(); if (rules) { let flattenBlocks22 = function(blocks2) { const result = []; const stack = [...blocks2]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result.push(block); } return result; }; var flattenBlocks2 = flattenBlocks22; const blockList = clientIds.map(select3.getBlock); const flattenedBlocks = flattenBlocks22(blockList); let message2; for (const rule of rules) { message2 = rule.callback(flattenedBlocks); if (message2) { dispatch( displayBlockRemovalPrompt( clientIds, selectPrevious, message2 ) ); return; } } } if (selectPrevious) { dispatch.selectPreviousBlock(clientIds[0], selectPrevious); } registry.batch(() => { dispatch({ type: "REMOVE_BLOCKS", clientIds }); dispatch(ensureDefaultBlock()); }); }; var ensureDefaultBlock = () => ({ select: select3, dispatch }) => { const count = select3.getBlockCount(); if (count > 0) { return; } const { __unstableHasCustomAppender } = select3.getSettings(); if (__unstableHasCustomAppender) { return; } dispatch.insertDefaultBlock(); }; function displayBlockRemovalPrompt(clientIds, selectPrevious, message2) { return { type: "DISPLAY_BLOCK_REMOVAL_PROMPT", clientIds, selectPrevious, message: message2 }; } function clearBlockRemovalPrompt() { return { type: "CLEAR_BLOCK_REMOVAL_PROMPT" }; } function setBlockRemovalRules(rules = false) { return { type: "SET_BLOCK_REMOVAL_RULES", rules }; } function setOpenedBlockSettingsMenu(clientId) { return { type: "SET_OPENED_BLOCK_SETTINGS_MENU", clientId }; } function setStyleOverride(id, style) { return { type: "SET_STYLE_OVERRIDE", id, style }; } function deleteStyleOverride(id) { return { type: "DELETE_STYLE_OVERRIDE", id }; } function setLastFocus(lastFocus2 = null) { return { type: "LAST_FOCUS", lastFocus: lastFocus2 }; } function startDragging() { return { type: "START_DRAGGING" }; } function stopDragging() { return { type: "STOP_DRAGGING" }; } function expandBlock(clientId) { return { type: "SET_BLOCK_EXPANDED_IN_LIST_VIEW", clientId }; } function setInsertionPoint(value) { return { type: "SET_INSERTION_POINT", value }; } function editContentOnlySection(clientId) { return { type: "EDIT_CONTENT_ONLY_SECTION", clientId }; } function stopEditingContentOnlySection() { return { type: "EDIT_CONTENT_ONLY_SECTION" }; } var setZoomLevel = (zoom = 100) => ({ select: select3, dispatch }) => { if (zoom !== 100) { const firstSelectedClientId = select3.getBlockSelectionStart(); const sectionRootClientId = select3.getSectionRootClientId(); if (firstSelectedClientId) { let sectionClientId; if (sectionRootClientId) { const sectionClientIds = select3.getBlockOrder(sectionRootClientId); if (sectionClientIds?.includes(firstSelectedClientId)) { sectionClientId = firstSelectedClientId; } else { sectionClientId = select3.getBlockParents(firstSelectedClientId).find( (parent) => sectionClientIds.includes(parent) ); } } else { sectionClientId = select3.getBlockHierarchyRootClientId( firstSelectedClientId ); } if (sectionClientId) { dispatch.selectBlock(sectionClientId); } else { dispatch.clearSelectedBlock(); } (0, import_a11y2.speak)((0, import_i18n3.__)("You are currently in zoom-out mode.")); } } dispatch({ type: "SET_ZOOM_LEVEL", zoom }); }; function resetZoomLevel() { return { type: "RESET_ZOOM_LEVEL" }; } function toggleBlockSpotlight(clientId, hasBlockSpotlight3) { return { type: "TOGGLE_BLOCK_SPOTLIGHT", clientId, hasBlockSpotlight: hasBlockSpotlight3 }; } // packages/block-editor/build-module/store/actions.js var actions_exports = {}; __export(actions_exports, { __unstableDeleteSelection: () => __unstableDeleteSelection, __unstableExpandSelection: () => __unstableExpandSelection, __unstableMarkAutomaticChange: () => __unstableMarkAutomaticChange, __unstableMarkLastChangeAsPersistent: () => __unstableMarkLastChangeAsPersistent, __unstableMarkNextChangeAsNotPersistent: () => __unstableMarkNextChangeAsNotPersistent, __unstableSaveReusableBlock: () => __unstableSaveReusableBlock, __unstableSetEditorMode: () => __unstableSetEditorMode, __unstableSetTemporarilyEditingAsBlocks: () => __unstableSetTemporarilyEditingAsBlocks, __unstableSplitSelection: () => __unstableSplitSelection, clearSelectedBlock: () => clearSelectedBlock, duplicateBlocks: () => duplicateBlocks, enterFormattedText: () => enterFormattedText, exitFormattedText: () => exitFormattedText, flashBlock: () => flashBlock, hideInsertionPoint: () => hideInsertionPoint, hoverBlock: () => hoverBlock, insertAfterBlock: () => insertAfterBlock, insertBeforeBlock: () => insertBeforeBlock, insertBlock: () => insertBlock, insertBlocks: () => insertBlocks, insertDefaultBlock: () => insertDefaultBlock, mergeBlocks: () => mergeBlocks, moveBlockToPosition: () => moveBlockToPosition, moveBlocksDown: () => moveBlocksDown, moveBlocksToPosition: () => moveBlocksToPosition, moveBlocksUp: () => moveBlocksUp, multiSelect: () => multiSelect, receiveBlocks: () => receiveBlocks, registerInserterMediaCategory: () => registerInserterMediaCategory, removeBlock: () => removeBlock, removeBlocks: () => removeBlocks, replaceBlock: () => replaceBlock, replaceBlocks: () => replaceBlocks, replaceInnerBlocks: () => replaceInnerBlocks, resetBlocks: () => resetBlocks, resetSelection: () => resetSelection, selectBlock: () => selectBlock, selectNextBlock: () => selectNextBlock, selectPreviousBlock: () => selectPreviousBlock, selectionChange: () => selectionChange, setBlockEditingMode: () => setBlockEditingMode, setBlockMovingClientId: () => setBlockMovingClientId, setBlockVisibility: () => setBlockVisibility, setHasControlledInnerBlocks: () => setHasControlledInnerBlocks, setTemplateValidity: () => setTemplateValidity, showInsertionPoint: () => showInsertionPoint, startDraggingBlocks: () => startDraggingBlocks, startMultiSelect: () => startMultiSelect, startTyping: () => startTyping, stopDraggingBlocks: () => stopDraggingBlocks, stopMultiSelect: () => stopMultiSelect, stopTyping: () => stopTyping, synchronizeTemplate: () => synchronizeTemplate, toggleBlockHighlight: () => toggleBlockHighlight, toggleBlockMode: () => toggleBlockMode, toggleSelection: () => toggleSelection, unsetBlockEditingMode: () => unsetBlockEditingMode, updateBlock: () => updateBlock, updateBlockAttributes: () => updateBlockAttributes, updateBlockListSettings: () => updateBlockListSettings, updateSettings: () => updateSettings, validateBlocksToTemplate: () => validateBlocksToTemplate }); var import_blocks7 = __toESM(require_blocks()); var import_a11y3 = __toESM(require_a11y()); var import_i18n4 = __toESM(require_i18n()); var import_notices = __toESM(require_notices()); var import_rich_text3 = __toESM(require_rich_text()); var import_deprecated4 = __toESM(require_deprecated()); var import_preferences = __toESM(require_preferences()); // packages/block-editor/build-module/utils/selection.js var import_rich_text2 = __toESM(require_rich_text()); var START_OF_SELECTED_AREA = "\x86"; function retrieveSelectedAttribute(blockAttributes) { if (!blockAttributes) { return; } return Object.keys(blockAttributes).find((name) => { const value = blockAttributes[name]; return (typeof value === "string" || value instanceof import_rich_text2.RichTextData) && // To do: refactor this to use rich text's selection instead, so we // no longer have to use on this hack inserting a special character. value.toString().indexOf(START_OF_SELECTED_AREA) !== -1; }); } function findRichTextAttributeKey(blockType) { for (const [key, value] of Object.entries(blockType.attributes)) { if (value.source === "rich-text" || value.source === "html") { return key; } } } // packages/block-editor/build-module/store/actions.js var castArray2 = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; var resetBlocks = (blocks2) => ({ dispatch }) => { dispatch({ type: "RESET_BLOCKS", blocks: blocks2 }); dispatch(validateBlocksToTemplate(blocks2)); }; var validateBlocksToTemplate = (blocks2) => ({ select: select3, dispatch }) => { const template2 = select3.getTemplate(); const templateLock = select3.getTemplateLock(); const isBlocksValidToTemplate = !template2 || templateLock !== "all" || (0, import_blocks7.doBlocksMatchTemplate)(blocks2, template2); const isValidTemplate2 = select3.isValidTemplate(); if (isBlocksValidToTemplate !== isValidTemplate2) { dispatch.setTemplateValidity(isBlocksValidToTemplate); return isBlocksValidToTemplate; } }; function resetSelection(selectionStart, selectionEnd, initialPosition2) { return { type: "RESET_SELECTION", selectionStart, selectionEnd, initialPosition: initialPosition2 }; } function receiveBlocks(blocks2) { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks', { since: "5.9", alternative: "resetBlocks or insertBlocks" }); return { type: "RECEIVE_BLOCKS", blocks: blocks2 }; } function updateBlockAttributes(clientIds, attributes, options = { uniqueByBlock: false }) { if (typeof options === "boolean") { options = { uniqueByBlock: options }; } return { type: "UPDATE_BLOCK_ATTRIBUTES", clientIds: castArray2(clientIds), attributes, options }; } function updateBlock(clientId, updates) { return { type: "UPDATE_BLOCK", clientId, updates }; } function selectBlock(clientId, initialPosition2 = 0) { return { type: "SELECT_BLOCK", initialPosition: initialPosition2, clientId }; } function hoverBlock() { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).hoverBlock', { since: "6.9", version: "7.1" }); return { type: "DO_NOTHING" }; } var selectPreviousBlock = (clientId, fallbackToParent = false) => ({ select: select3, dispatch }) => { const previousBlockClientId = select3.getPreviousBlockClientId(clientId); if (previousBlockClientId) { dispatch.selectBlock(previousBlockClientId, -1); } else if (fallbackToParent) { const firstParentClientId = select3.getBlockRootClientId(clientId); if (firstParentClientId) { dispatch.selectBlock(firstParentClientId, -1); } } }; var selectNextBlock = (clientId) => ({ select: select3, dispatch }) => { const nextBlockClientId = select3.getNextBlockClientId(clientId); if (nextBlockClientId) { dispatch.selectBlock(nextBlockClientId); } }; function startMultiSelect() { return { type: "START_MULTI_SELECT" }; } function stopMultiSelect() { return { type: "STOP_MULTI_SELECT" }; } var multiSelect = (start2, end, __experimentalInitialPosition = 0) => ({ select: select3, dispatch }) => { const startBlockRootClientId = select3.getBlockRootClientId(start2); const endBlockRootClientId = select3.getBlockRootClientId(end); if (startBlockRootClientId !== endBlockRootClientId) { return; } dispatch({ type: "MULTI_SELECT", start: start2, end, initialPosition: __experimentalInitialPosition }); const blockCount = select3.getSelectedBlockCount(); (0, import_a11y3.speak)( (0, import_i18n4.sprintf)( /* translators: %s: number of selected blocks */ (0, import_i18n4._n)("%s block selected.", "%s blocks selected.", blockCount), blockCount ), "assertive" ); }; function clearSelectedBlock() { return { type: "CLEAR_SELECTED_BLOCK" }; } function toggleSelection(isSelectionEnabled3 = true) { return { type: "TOGGLE_SELECTION", isSelectionEnabled: isSelectionEnabled3 }; } var replaceBlocks = (clientIds, blocks2, indexToSelect, initialPosition2 = 0, meta) => ({ select: select3, dispatch, registry }) => { clientIds = castArray2(clientIds); blocks2 = castArray2(blocks2); const rootClientId = select3.getBlockRootClientId(clientIds[0]); for (let index = 0; index < blocks2.length; index++) { const block = blocks2[index]; const canInsertBlock = select3.canInsertBlockType( block.name, rootClientId ); if (!canInsertBlock) { return; } } registry.batch(() => { dispatch({ type: "REPLACE_BLOCKS", clientIds, blocks: blocks2, time: Date.now(), indexToSelect, initialPosition: initialPosition2, meta }); dispatch.ensureDefaultBlock(); }); }; function replaceBlock(clientId, block) { return replaceBlocks(clientId, block); } var createOnMove = (type) => (clientIds, rootClientId) => ({ select: select3, dispatch }) => { const canMoveBlocks2 = select3.canMoveBlocks(clientIds); if (!canMoveBlocks2) { return; } dispatch({ type, clientIds: castArray2(clientIds), rootClientId }); }; var moveBlocksDown = createOnMove("MOVE_BLOCKS_DOWN"); var moveBlocksUp = createOnMove("MOVE_BLOCKS_UP"); var moveBlocksToPosition = (clientIds, fromRootClientId = "", toRootClientId = "", index) => ({ select: select3, dispatch }) => { const canMoveBlocks2 = select3.canMoveBlocks(clientIds); if (!canMoveBlocks2) { return; } if (fromRootClientId !== toRootClientId) { const canRemoveBlocks2 = select3.canRemoveBlocks(clientIds); if (!canRemoveBlocks2) { return; } const canInsertBlocks2 = select3.canInsertBlocks( clientIds, toRootClientId ); if (!canInsertBlocks2) { return; } } dispatch({ type: "MOVE_BLOCKS_TO_POSITION", fromRootClientId, toRootClientId, clientIds, index }); }; function moveBlockToPosition(clientId, fromRootClientId = "", toRootClientId = "", index) { return moveBlocksToPosition( [clientId], fromRootClientId, toRootClientId, index ); } function insertBlock(block, index, rootClientId, updateSelection, meta) { return insertBlocks( [block], index, rootClientId, updateSelection, 0, meta ); } var insertBlocks = (blocks2, index, rootClientId, updateSelection = true, initialPosition2 = 0, meta) => ({ select: select3, dispatch }) => { if (initialPosition2 !== null && typeof initialPosition2 === "object") { meta = initialPosition2; initialPosition2 = 0; (0, import_deprecated4.default)( "meta argument in wp.data.dispatch('core/block-editor')", { since: "5.8", hint: "The meta argument is now the 6th argument of the function" } ); } blocks2 = castArray2(blocks2); const allowedBlocks = []; for (const block of blocks2) { const isValid2 = select3.canInsertBlockType( block.name, rootClientId ); if (isValid2) { allowedBlocks.push(block); } } if (allowedBlocks.length) { dispatch({ type: "INSERT_BLOCKS", blocks: allowedBlocks, index, rootClientId, time: Date.now(), updateSelection, initialPosition: updateSelection ? initialPosition2 : null, meta }); } }; function showInsertionPoint(rootClientId, index, __unstableOptions = {}) { const { __unstableWithInserter, operation, nearestSide } = __unstableOptions; return { type: "SHOW_INSERTION_POINT", rootClientId, index, __unstableWithInserter, operation, nearestSide }; } var hideInsertionPoint = () => ({ select: select3, dispatch }) => { if (!select3.isBlockInsertionPointVisible()) { return; } dispatch({ type: "HIDE_INSERTION_POINT" }); }; function setTemplateValidity(isValid2) { return { type: "SET_TEMPLATE_VALIDITY", isValid: isValid2 }; } var synchronizeTemplate = () => ({ select: select3, dispatch }) => { dispatch({ type: "SYNCHRONIZE_TEMPLATE" }); const blocks2 = select3.getBlocks(); const template2 = select3.getTemplate(); const updatedBlockList = (0, import_blocks7.synchronizeBlocksWithTemplate)( blocks2, template2 ); dispatch.resetBlocks(updatedBlockList); }; var __unstableDeleteSelection = (isForward) => ({ registry, select: select3, dispatch }) => { const selectionAnchor = select3.getSelectionStart(); const selectionFocus = select3.getSelectionEnd(); if (selectionAnchor.clientId === selectionFocus.clientId) { return; } if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return false; } const anchorRootClientId = select3.getBlockRootClientId( selectionAnchor.clientId ); const focusRootClientId = select3.getBlockRootClientId( selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return; } const blockOrder = select3.getBlockOrder(anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const targetSelection = isForward ? selectionEnd : selectionStart; const targetBlock = select3.getBlock(targetSelection.clientId); const targetBlockType = (0, import_blocks7.getBlockType)(targetBlock.name); if (!targetBlockType.merge) { return; } const selectionA = selectionStart; const selectionB = selectionEnd; const blockA = select3.getBlock(selectionA.clientId); const blockB = select3.getBlock(selectionB.clientId); const htmlA = blockA.attributes[selectionA.attributeKey]; const htmlB = blockB.attributes[selectionB.attributeKey]; let valueA = (0, import_rich_text3.create)({ html: htmlA }); let valueB = (0, import_rich_text3.create)({ html: htmlB }); valueA = (0, import_rich_text3.remove)(valueA, selectionA.offset, valueA.text.length); valueB = (0, import_rich_text3.insert)(valueB, START_OF_SELECTED_AREA, 0, selectionB.offset); const cloneA = (0, import_blocks7.cloneBlock)(blockA, { [selectionA.attributeKey]: (0, import_rich_text3.toHTMLString)({ value: valueA }) }); const cloneB = (0, import_blocks7.cloneBlock)(blockB, { [selectionB.attributeKey]: (0, import_rich_text3.toHTMLString)({ value: valueB }) }); const followingBlock = isForward ? cloneA : cloneB; const blocksWithTheSameType = blockA.name === blockB.name ? [followingBlock] : (0, import_blocks7.switchToBlockType)(followingBlock, targetBlockType.name); if (!blocksWithTheSameType || !blocksWithTheSameType.length) { return; } let updatedAttributes; if (isForward) { const blockToMerge = blocksWithTheSameType.pop(); updatedAttributes = targetBlockType.merge( blockToMerge.attributes, cloneB.attributes ); } else { const blockToMerge = blocksWithTheSameType.shift(); updatedAttributes = targetBlockType.merge( cloneA.attributes, blockToMerge.attributes ); } const newAttributeKey = retrieveSelectedAttribute(updatedAttributes); const convertedHtml = updatedAttributes[newAttributeKey]; const convertedValue = (0, import_rich_text3.create)({ html: convertedHtml }); const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA); const newValue = (0, import_rich_text3.remove)(convertedValue, newOffset, newOffset + 1); const newHtml = (0, import_rich_text3.toHTMLString)({ value: newValue }); updatedAttributes[newAttributeKey] = newHtml; const selectedBlockClientIds = select3.getSelectedBlockClientIds(); const replacement = [ ...isForward ? blocksWithTheSameType : [], { // Preserve the original client ID. ...targetBlock, attributes: { ...targetBlock.attributes, ...updatedAttributes } }, ...isForward ? [] : blocksWithTheSameType ]; registry.batch(() => { dispatch.selectionChange( targetBlock.clientId, newAttributeKey, newOffset, newOffset ); dispatch.replaceBlocks( selectedBlockClientIds, replacement, 0, // If we don't pass the `indexToSelect` it will default to the last block. select3.getSelectedBlocksInitialCaretPosition() ); }); }; var __unstableSplitSelection = (blocks2 = []) => ({ registry, select: select3, dispatch }) => { const selectionAnchor = select3.getSelectionStart(); const selectionFocus = select3.getSelectionEnd(); const anchorRootClientId = select3.getBlockRootClientId( selectionAnchor.clientId ); const focusRootClientId = select3.getBlockRootClientId( selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return; } const blockOrder = select3.getBlockOrder(anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const selectionA = selectionStart; const selectionB = selectionEnd; const blockA = select3.getBlock(selectionA.clientId); const blockB = select3.getBlock(selectionB.clientId); const blockAType = (0, import_blocks7.getBlockType)(blockA.name); const blockBType = (0, import_blocks7.getBlockType)(blockB.name); const attributeKeyA = typeof selectionA.attributeKey === "string" ? selectionA.attributeKey : findRichTextAttributeKey(blockAType); const attributeKeyB = typeof selectionB.attributeKey === "string" ? selectionB.attributeKey : findRichTextAttributeKey(blockBType); const blockAttributes = select3.getBlockAttributes( selectionA.clientId ); const bindings = blockAttributes?.metadata?.bindings; if (bindings?.[attributeKeyA]) { if (blocks2.length) { const { createWarningNotice } = registry.dispatch(import_notices.store); createWarningNotice( (0, import_i18n4.__)( "Blocks can't be inserted into other blocks with bindings" ), { type: "snackbar" } ); return; } dispatch.insertAfterBlock(selectionA.clientId); return; } if (!attributeKeyA || !attributeKeyB || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return; } if (selectionA.clientId === selectionB.clientId && attributeKeyA === attributeKeyB && selectionA.offset === selectionB.offset) { if (blocks2.length) { if ((0, import_blocks7.isUnmodifiedDefaultBlock)(blockA, "content")) { dispatch.replaceBlocks( [selectionA.clientId], blocks2, blocks2.length - 1, -1 ); return; } } else if (!select3.getBlockOrder(selectionA.clientId).length) { let createEmpty2 = function() { const defaultBlockName2 = (0, import_blocks7.getDefaultBlockName)(); return select3.canInsertBlockType( defaultBlockName2, anchorRootClientId ) ? (0, import_blocks7.createBlock)(defaultBlockName2) : (0, import_blocks7.createBlock)( select3.getBlockName(selectionA.clientId) ); }; var createEmpty = createEmpty2; const length = blockAttributes[attributeKeyA].length; if (selectionA.offset === 0 && length) { dispatch.insertBlocks( [createEmpty2()], select3.getBlockIndex(selectionA.clientId), anchorRootClientId, false ); return; } if (selectionA.offset === length) { dispatch.insertBlocks( [createEmpty2()], select3.getBlockIndex(selectionA.clientId) + 1, anchorRootClientId ); return; } } } const htmlA = blockA.attributes[attributeKeyA]; const htmlB = blockB.attributes[attributeKeyB]; let valueA = (0, import_rich_text3.create)({ html: htmlA }); let valueB = (0, import_rich_text3.create)({ html: htmlB }); valueA = (0, import_rich_text3.remove)(valueA, selectionA.offset, valueA.text.length); valueB = (0, import_rich_text3.remove)(valueB, 0, selectionB.offset); let head = { // Preserve the original client ID. ...blockA, // If both start and end are the same, should only copy innerBlocks // once. innerBlocks: blockA.clientId === blockB.clientId ? [] : blockA.innerBlocks, attributes: { ...blockA.attributes, [attributeKeyA]: (0, import_rich_text3.toHTMLString)({ value: valueA }) } }; let tail = { ...blockB, // Only preserve the original client ID if the end is different. clientId: blockA.clientId === blockB.clientId ? (0, import_blocks7.createBlock)(blockB.name).clientId : blockB.clientId, attributes: { ...blockB.attributes, [attributeKeyB]: (0, import_rich_text3.toHTMLString)({ value: valueB }) } }; const defaultBlockName = (0, import_blocks7.getDefaultBlockName)(); if ( // A block is only split when the selection is within the same // block. blockA.clientId === blockB.clientId && defaultBlockName && tail.name !== defaultBlockName && select3.canInsertBlockType(defaultBlockName, anchorRootClientId) ) { const switched = (0, import_blocks7.switchToBlockType)(tail, defaultBlockName); if (switched?.length === 1) { tail = switched[0]; } } if (!blocks2.length) { dispatch.replaceBlocks(select3.getSelectedBlockClientIds(), [ head, tail ]); return; } let selection2; const output = []; const clonedBlocks = [...blocks2]; const firstBlock = clonedBlocks.shift(); const headType = (0, import_blocks7.getBlockType)(head.name); const firstBlocks = headType.merge && firstBlock.name === headType.name ? [firstBlock] : (0, import_blocks7.switchToBlockType)(firstBlock, headType.name); if (firstBlocks?.length) { const first = firstBlocks.shift(); head = { ...head, attributes: { ...head.attributes, ...headType.merge(head.attributes, first.attributes) } }; output.push(head); selection2 = { clientId: head.clientId, attributeKey: attributeKeyA, offset: (0, import_rich_text3.create)({ html: head.attributes[attributeKeyA] }).text.length }; clonedBlocks.unshift(...firstBlocks); } else { if (!(0, import_blocks7.isUnmodifiedBlock)(head)) { output.push(head); } output.push(firstBlock); } const lastBlock = clonedBlocks.pop(); const tailType = (0, import_blocks7.getBlockType)(tail.name); if (clonedBlocks.length) { output.push(...clonedBlocks); } if (lastBlock) { const lastBlocks = tailType.merge && tailType.name === lastBlock.name ? [lastBlock] : (0, import_blocks7.switchToBlockType)(lastBlock, tailType.name); if (lastBlocks?.length) { const last = lastBlocks.pop(); output.push({ ...tail, attributes: { ...tail.attributes, ...tailType.merge(last.attributes, tail.attributes) } }); output.push(...lastBlocks); selection2 = { clientId: tail.clientId, attributeKey: attributeKeyB, offset: (0, import_rich_text3.create)({ html: last.attributes[attributeKeyB] }).text.length }; } else { output.push(lastBlock); if (!(0, import_blocks7.isUnmodifiedBlock)(tail)) { output.push(tail); } } } else if (!(0, import_blocks7.isUnmodifiedBlock)(tail)) { output.push(tail); } registry.batch(() => { dispatch.replaceBlocks( select3.getSelectedBlockClientIds(), output, output.length - 1, 0 ); if (selection2) { dispatch.selectionChange( selection2.clientId, selection2.attributeKey, selection2.offset, selection2.offset ); } }); }; var __unstableExpandSelection = () => ({ select: select3, dispatch }) => { const selectionAnchor = select3.getSelectionStart(); const selectionFocus = select3.getSelectionEnd(); dispatch.selectionChange({ start: { clientId: selectionAnchor.clientId }, end: { clientId: selectionFocus.clientId } }); }; var mergeBlocks = (firstBlockClientId, secondBlockClientId) => ({ registry, select: select3, dispatch }) => { const clientIdA = firstBlockClientId; const clientIdB = secondBlockClientId; const blockA = select3.getBlock(clientIdA); const blockAType = (0, import_blocks7.getBlockType)(blockA.name); if (!blockAType || select3.getBlockEditingMode(clientIdA) === "disabled" || select3.getBlockEditingMode(clientIdB) === "disabled") { return; } const blockB = select3.getBlock(clientIdB); if (!blockAType.merge && (0, import_blocks7.getBlockSupport)(blockA.name, "__experimentalOnMerge")) { const blocksWithTheSameType2 = (0, import_blocks7.switchToBlockType)( blockB, blockAType.name ); if (blocksWithTheSameType2?.length !== 1) { dispatch.selectBlock(blockA.clientId); return; } const [blockWithSameType] = blocksWithTheSameType2; if (blockWithSameType.innerBlocks.length < 1) { dispatch.selectBlock(blockA.clientId); return; } registry.batch(() => { dispatch.insertBlocks( blockWithSameType.innerBlocks, void 0, clientIdA ); dispatch.removeBlock(clientIdB); dispatch.selectBlock( blockWithSameType.innerBlocks[0].clientId ); const nextBlockClientId = select3.getNextBlockClientId(clientIdA); if (nextBlockClientId && select3.getBlockName(clientIdA) === select3.getBlockName(nextBlockClientId)) { const rootAttributes = select3.getBlockAttributes(clientIdA); const previousRootAttributes = select3.getBlockAttributes(nextBlockClientId); if (Object.keys(rootAttributes).every( (key) => rootAttributes[key] === previousRootAttributes[key] )) { dispatch.moveBlocksToPosition( select3.getBlockOrder(nextBlockClientId), nextBlockClientId, clientIdA ); dispatch.removeBlock(nextBlockClientId, false); } } }); return; } if ((0, import_blocks7.isUnmodifiedDefaultBlock)(blockA)) { dispatch.removeBlock( clientIdA, select3.isBlockSelected(clientIdA) ); return; } if ((0, import_blocks7.isUnmodifiedDefaultBlock)(blockB)) { dispatch.removeBlock( clientIdB, select3.isBlockSelected(clientIdB) ); return; } if (!blockAType.merge) { if ((0, import_blocks7.isUnmodifiedBlock)(blockB, "content")) { dispatch.removeBlock( clientIdB, select3.isBlockSelected(clientIdB) ); } else { dispatch.selectBlock(blockA.clientId); } return; } const blockBType = (0, import_blocks7.getBlockType)(blockB.name); const { clientId, attributeKey, offset } = select3.getSelectionStart(); const selectedBlockType = clientId === clientIdA ? blockAType : blockBType; const attributeDefinition = selectedBlockType.attributes[attributeKey]; const canRestoreTextSelection = (clientId === clientIdA || clientId === clientIdB) && attributeKey !== void 0 && offset !== void 0 && // We cannot restore text selection if the RichText identifier // is not a defined block attribute key. This can be the case if the // fallback instance ID is used to store selection (and no RichText // identifier is set), or when the identifier is wrong. !!attributeDefinition; if (!attributeDefinition) { if (typeof attributeKey === "number") { window.console.error( `RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${typeof attributeKey}` ); } else { window.console.error( "The RichText identifier prop does not match any attributes defined by the block." ); } } const cloneA = (0, import_blocks7.cloneBlock)(blockA); const cloneB = (0, import_blocks7.cloneBlock)(blockB); if (canRestoreTextSelection) { const selectedBlock = clientId === clientIdA ? cloneA : cloneB; const html = selectedBlock.attributes[attributeKey]; const value = (0, import_rich_text3.insert)( (0, import_rich_text3.create)({ html }), START_OF_SELECTED_AREA, offset, offset ); selectedBlock.attributes[attributeKey] = (0, import_rich_text3.toHTMLString)({ value }); } const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : (0, import_blocks7.switchToBlockType)(cloneB, blockA.name); if (!blocksWithTheSameType || !blocksWithTheSameType.length) { return; } const updatedAttributes = blockAType.merge( cloneA.attributes, blocksWithTheSameType[0].attributes ); if (canRestoreTextSelection) { const newAttributeKey = retrieveSelectedAttribute(updatedAttributes); const convertedHtml = updatedAttributes[newAttributeKey]; const convertedValue = (0, import_rich_text3.create)({ html: convertedHtml }); const newOffset = convertedValue.text.indexOf( START_OF_SELECTED_AREA ); const newValue = (0, import_rich_text3.remove)(convertedValue, newOffset, newOffset + 1); const newHtml = (0, import_rich_text3.toHTMLString)({ value: newValue }); updatedAttributes[newAttributeKey] = newHtml; dispatch.selectionChange( blockA.clientId, newAttributeKey, newOffset, newOffset ); } dispatch.replaceBlocks( [blockA.clientId, blockB.clientId], [ { ...blockA, attributes: { ...blockA.attributes, ...updatedAttributes } }, ...blocksWithTheSameType.slice(1) ], 0 // If we don't pass the `indexToSelect` it will default to the last block. ); }; var removeBlocks = (clientIds, selectPrevious = true) => privateRemoveBlocks(clientIds, selectPrevious); function removeBlock(clientId, selectPrevious) { return removeBlocks([clientId], selectPrevious); } function replaceInnerBlocks(rootClientId, blocks2, updateSelection = false, initialPosition2 = 0) { return { type: "REPLACE_INNER_BLOCKS", rootClientId, blocks: blocks2, updateSelection, initialPosition: updateSelection ? initialPosition2 : null, time: Date.now() }; } function toggleBlockMode(clientId) { return { type: "TOGGLE_BLOCK_MODE", clientId }; } function startTyping() { return { type: "START_TYPING" }; } function stopTyping() { return { type: "STOP_TYPING" }; } function startDraggingBlocks(clientIds = []) { return { type: "START_DRAGGING_BLOCKS", clientIds }; } function stopDraggingBlocks() { return { type: "STOP_DRAGGING_BLOCKS" }; } function enterFormattedText() { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText', { since: "6.1", version: "6.3" }); return { type: "DO_NOTHING" }; } function exitFormattedText() { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText', { since: "6.1", version: "6.3" }); return { type: "DO_NOTHING" }; } function selectionChange(clientId, attributeKey, startOffset, endOffset) { if (typeof clientId === "string") { return { type: "SELECTION_CHANGE", clientId, attributeKey, startOffset, endOffset }; } return { type: "SELECTION_CHANGE", ...clientId }; } var insertDefaultBlock = (attributes, rootClientId, index) => ({ dispatch }) => { const defaultBlockName = (0, import_blocks7.getDefaultBlockName)(); if (!defaultBlockName) { return; } const block = (0, import_blocks7.createBlock)(defaultBlockName, attributes); return dispatch.insertBlock(block, index, rootClientId); }; function updateBlockListSettings(clientId, settings2) { return { type: "UPDATE_BLOCK_LIST_SETTINGS", clientId, settings: settings2 }; } function updateSettings(settings2) { return __experimentalUpdateSettings(settings2, { stripExperimentalSettings: true }); } function __unstableSaveReusableBlock(id, updatedId) { return { type: "SAVE_REUSABLE_BLOCK_SUCCESS", id, updatedId }; } function __unstableMarkLastChangeAsPersistent() { return { type: "MARK_LAST_CHANGE_AS_PERSISTENT" }; } function __unstableMarkNextChangeAsNotPersistent() { return { type: "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT" }; } var __unstableMarkAutomaticChange = () => ({ dispatch }) => { dispatch({ type: "MARK_AUTOMATIC_CHANGE" }); const { requestIdleCallback = (cb) => setTimeout(cb, 100) } = window; requestIdleCallback(() => { dispatch({ type: "MARK_AUTOMATIC_CHANGE_FINAL" }); }); }; var __unstableSetEditorMode = (mode2) => ({ registry }) => { registry.dispatch(import_preferences.store).set("core", "editorTool", mode2); if (mode2 === "navigation") { (0, import_a11y3.speak)((0, import_i18n4.__)("You are currently in Write mode.")); } else if (mode2 === "edit") { (0, import_a11y3.speak)((0, import_i18n4.__)("You are currently in Design mode.")); } }; function setBlockMovingClientId() { (0, import_deprecated4.default)( 'wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId', { since: "6.7", hint: "Block moving mode feature has been removed" } ); return { type: "DO_NOTHING" }; } var duplicateBlocks = (clientIds, updateSelection = true) => ({ select: select3, dispatch }) => { if (!clientIds || !clientIds.length) { return; } const blocks2 = select3.getBlocksByClientId(clientIds); if (blocks2.some((block) => !block)) { return; } const blockNames = blocks2.map((block) => block.name); if (blockNames.some( (blockName) => !(0, import_blocks7.hasBlockSupport)(blockName, "multiple", true) )) { return; } const rootClientId = select3.getBlockRootClientId(clientIds[0]); const clientIdsArray = castArray2(clientIds); const lastSelectedIndex = select3.getBlockIndex( clientIdsArray[clientIdsArray.length - 1] ); const clonedBlocks = blocks2.map( (block) => (0, import_blocks7.__experimentalCloneSanitizedBlock)(block) ); dispatch.insertBlocks( clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection ); if (clonedBlocks.length > 1 && updateSelection) { dispatch.multiSelect( clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId ); } return clonedBlocks.map((block) => block.clientId); }; var insertBeforeBlock = (clientId) => ({ select: select3, dispatch }) => { if (!clientId) { return; } const rootClientId = select3.getBlockRootClientId(clientId); const isLocked = select3.getTemplateLock(rootClientId); if (isLocked) { return; } const blockIndex = select3.getBlockIndex(clientId); const directInsertBlock = rootClientId ? select3.getDirectInsertBlock(rootClientId) : null; if (!directInsertBlock) { return dispatch.insertDefaultBlock({}, rootClientId, blockIndex); } const copiedAttributes = {}; if (directInsertBlock.attributesToCopy) { const attributes = select3.getBlockAttributes(clientId); directInsertBlock.attributesToCopy.forEach((key) => { if (attributes[key]) { copiedAttributes[key] = attributes[key]; } }); } const block = (0, import_blocks7.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...copiedAttributes }); return dispatch.insertBlock(block, blockIndex, rootClientId); }; var insertAfterBlock = (clientId) => ({ select: select3, dispatch }) => { if (!clientId) { return; } const rootClientId = select3.getBlockRootClientId(clientId); const isLocked = select3.getTemplateLock(rootClientId); if (isLocked) { return; } const blockIndex = select3.getBlockIndex(clientId); const directInsertBlock = rootClientId ? select3.getDirectInsertBlock(rootClientId) : null; if (!directInsertBlock) { return dispatch.insertDefaultBlock( {}, rootClientId, blockIndex + 1 ); } const copiedAttributes = {}; if (directInsertBlock.attributesToCopy) { const attributes = select3.getBlockAttributes(clientId); directInsertBlock.attributesToCopy.forEach((key) => { if (attributes[key]) { copiedAttributes[key] = attributes[key]; } }); } const block = (0, import_blocks7.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...copiedAttributes }); return dispatch.insertBlock(block, blockIndex + 1, rootClientId); }; function toggleBlockHighlight(clientId, isHighlighted) { return { type: "TOGGLE_BLOCK_HIGHLIGHT", clientId, isHighlighted }; } var flashBlock = (clientId, timeout = 150) => async ({ dispatch }) => { dispatch(toggleBlockHighlight(clientId, true)); await new Promise((resolve) => setTimeout(resolve, timeout)); dispatch(toggleBlockHighlight(clientId, false)); }; function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) { return { type: "SET_HAS_CONTROLLED_INNER_BLOCKS", hasControlledInnerBlocks, clientId }; } function setBlockVisibility(updates) { return { type: "SET_BLOCK_VISIBILITY", updates }; } function __unstableSetTemporarilyEditingAsBlocks(clientId) { (0, import_deprecated4.default)( "wp.data.dispatch( 'core/block-editor' ).__unstableSetTemporarilyEditingAsBlocks", { since: "7.0" } ); return editContentOnlySection(clientId); } var registerInserterMediaCategory = (category) => ({ select: select3, dispatch }) => { if (!category || typeof category !== "object") { console.error( "Category should be an `InserterMediaCategory` object." ); return; } if (!category.name) { console.error( "Category should have a `name` that should be unique among all media categories." ); return; } if (!category.labels?.name) { console.error("Category should have a `labels.name`."); return; } if (!["image", "audio", "video"].includes(category.mediaType)) { console.error( "Category should have `mediaType` property that is one of `image|audio|video`." ); return; } if (!category.fetch || typeof category.fetch !== "function") { console.error( "Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise`." ); return; } const registeredInserterMediaCategories2 = select3.getRegisteredInserterMediaCategories(); if (registeredInserterMediaCategories2.some( ({ name }) => name === category.name )) { console.error( `A category is already registered with the same name: "${category.name}".` ); return; } if (registeredInserterMediaCategories2.some( ({ labels: { name } = {} }) => name === category.labels?.name )) { console.error( `A category is already registered with the same labels.name: "${category.labels.name}".` ); return; } dispatch({ type: "REGISTER_INSERTER_MEDIA_CATEGORY", category: { ...category, isExternalResource: true } }); }; function setBlockEditingMode(clientId = "", mode2) { return { type: "SET_BLOCK_EDITING_MODE", clientId, mode: mode2 }; } function unsetBlockEditingMode(clientId = "") { return { type: "UNSET_BLOCK_EDITING_MODE", clientId }; } // packages/block-editor/build-module/store/index.js var storeConfig = { reducer: reducer_default, selectors: selectors_exports, actions: actions_exports }; var store = (0, import_data5.createReduxStore)(STORE_NAME, { ...storeConfig, persist: ["preferences"] }); var registeredStore = (0, import_data5.registerStore)(STORE_NAME, { ...storeConfig, persist: ["preferences"] }); unlock(registeredStore).registerPrivateActions(private_actions_exports); unlock(registeredStore).registerPrivateSelectors(private_selectors_exports); unlock(store).registerPrivateActions(private_actions_exports); unlock(store).registerPrivateSelectors(private_selectors_exports); // packages/block-editor/build-module/components/warning/index.js var import_components3 = __toESM(require_components()); var import_i18n5 = __toESM(require_i18n()); var import_jsx_runtime116 = __toESM(require_jsx_runtime()); function Warning({ className, actions, children, secondaryActions }) { return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { style: { display: "contents", all: "initial" }, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: clsx_default(className, "block-editor-warning"), children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "block-editor-warning__contents", children: [ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("p", { className: "block-editor-warning__message", children }), (actions?.length > 0 || secondaryActions) && /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "block-editor-warning__actions", children: [ actions?.length > 0 && actions.map((action, i2) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)( "span", { className: "block-editor-warning__action", children: action }, i2 )), secondaryActions && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)( import_components3.DropdownMenu, { className: "block-editor-warning__secondary", icon: more_vertical_default, label: (0, import_i18n5.__)("More options"), popoverProps: { placement: "bottom-end", className: "block-editor-warning__dropdown" }, noIcons: true, children: () => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_components3.MenuGroup, { children: secondaryActions.map( (item, pos) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)( import_components3.MenuItem, { onClick: item.onClick, children: item.title }, pos ) ) }) } ) ] }) ] }) }) }); } var warning_default = Warning; // packages/block-editor/build-module/components/block-edit/multiple-usage-warning.js var import_jsx_runtime117 = __toESM(require_jsx_runtime()); function MultipleUsageWarning({ originalBlockClientId, name, onReplace }) { const { selectBlock: selectBlock2 } = (0, import_data6.useDispatch)(store); const blockType = (0, import_blocks8.getBlockType)(name); return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)( warning_default, { actions: [ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)( import_components4.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => selectBlock2(originalBlockClientId), children: (0, import_i18n6.__)("Find original") }, "find-original" ), /* @__PURE__ */ (0, import_jsx_runtime117.jsx)( import_components4.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => onReplace([]), children: (0, import_i18n6.__)("Remove") }, "remove" ) ], children: [ /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("strong", { children: [ blockType?.title, ": " ] }), (0, import_i18n6.__)("This block can only be used once.") ] } ); } // packages/block-editor/build-module/components/block-edit/index.js var import_jsx_runtime118 = __toESM(require_jsx_runtime()); function BlockEdit({ mayDisplayControls, mayDisplayParentControls, blockEditingMode, isPreviewMode, // The remaining props are passed through the BlockEdit filters and are thus // public API! ...props }) { const { name, isSelected, clientId, attributes = {}, __unstableLayoutClassNames } = props; const { layout = null, metadata = {} } = attributes; const { bindings } = metadata; const layoutSupport = (0, import_blocks9.hasBlockSupport)(name, "layout", false) || (0, import_blocks9.hasBlockSupport)(name, "__experimentalLayout", false); const { originalBlockClientId } = (0, import_element8.useContext)(PrivateBlockContext); return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)( Provider, { value: (0, import_element8.useMemo)( () => ({ name, isSelected, clientId, layout: layoutSupport ? layout : null, __unstableLayoutClassNames, // We use symbols in favour of an __unstable prefix to avoid // usage outside of the package (this context is exposed). [mayDisplayControlsKey]: mayDisplayControls, [mayDisplayParentControlsKey]: mayDisplayParentControls, [blockEditingModeKey]: blockEditingMode, [blockBindingsKey]: bindings, [isPreviewModeKey]: isPreviewMode }), [ name, isSelected, clientId, layoutSupport, layout, __unstableLayoutClassNames, mayDisplayControls, mayDisplayParentControls, blockEditingMode, bindings, isPreviewMode ] ), children: [ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(edit_default, { ...props }), originalBlockClientId && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)( MultipleUsageWarning, { originalBlockClientId, name, onReplace: props.onReplace } ) ] } ); } // packages/block-editor/build-module/components/use-settings/index.js function useSettings(...paths) { const { clientId = null } = useBlockEditContext(); return (0, import_data7.useSelect)( (select3) => unlock(select3(store)).getBlockSettings( clientId, ...paths ), [clientId, ...paths] ); } function useSetting(path) { (0, import_deprecated5.default)("wp.blockEditor.useSetting", { since: "6.5", alternative: "wp.blockEditor.useSettings", note: "The new useSettings function can retrieve multiple settings at once, with better performance." }); const [value] = useSettings(path); return value; } // packages/block-editor/build-module/components/colors/with-colors.js var import_jsx_runtime119 = __toESM(require_jsx_runtime()); var { kebabCase: kebabCase2 } = unlock(import_components5.privateApis); var upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join(""); var withCustomColorPalette = (colorsArray) => (0, import_compose2.createHigherOrderComponent)( (WrappedComponent) => (props) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(WrappedComponent, { ...props, colors: colorsArray }), "withCustomColorPalette" ); var withEditorColorPalette = () => (0, import_compose2.createHigherOrderComponent)( (WrappedComponent) => (props) => { const [userPalette, themePalette, defaultPalette] = useSettings( "color.palette.custom", "color.palette.theme", "color.palette.default" ); const allColors = (0, import_element9.useMemo)( () => [ ...userPalette || [], ...themePalette || [], ...defaultPalette || [] ], [userPalette, themePalette, defaultPalette] ); return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(WrappedComponent, { ...props, colors: allColors }); }, "withEditorColorPalette" ); function createColorHOC(colorTypes, withColorPalette) { const colorMap = colorTypes.reduce((colorObject, colorType) => { return { ...colorObject, ...typeof colorType === "string" ? { [colorType]: kebabCase2(colorType) } : colorType }; }, {}); return (0, import_compose2.compose)([ withColorPalette, (WrappedComponent) => { return class extends import_element9.Component { constructor(props) { super(props); this.setters = this.createSetters(); this.colorUtils = { getMostReadableColor: this.getMostReadableColor.bind(this) }; this.state = {}; } getMostReadableColor(colorValue) { const { colors: colors2 } = this.props; return getMostReadableColor(colors2, colorValue); } createSetters() { return Object.keys(colorMap).reduce( (settersAccumulator, colorAttributeName) => { const upperFirstColorAttributeName = upperFirst(colorAttributeName); const customColorAttributeName = `custom${upperFirstColorAttributeName}`; settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor( colorAttributeName, customColorAttributeName ); return settersAccumulator; }, {} ); } createSetColor(colorAttributeName, customColorAttributeName) { return (colorValue) => { const colorObject = getColorObjectByColorValue( this.props.colors, colorValue ); this.props.setAttributes({ [colorAttributeName]: colorObject && colorObject.slug ? colorObject.slug : void 0, [customColorAttributeName]: colorObject && colorObject.slug ? void 0 : colorValue }); }; } static getDerivedStateFromProps({ attributes, colors: colors2 }, previousState) { return Object.entries(colorMap).reduce( (newState, [colorAttributeName, colorContext]) => { const colorObject = getColorObjectByAttributeValues( colors2, attributes[colorAttributeName], attributes[`custom${upperFirst( colorAttributeName )}`] ); const previousColorObject = previousState[colorAttributeName]; const previousColor = previousColorObject?.color; if (previousColor === colorObject.color && previousColorObject) { newState[colorAttributeName] = previousColorObject; } else { newState[colorAttributeName] = { ...colorObject, class: getColorClassName( colorContext, colorObject.slug ) }; } return newState; }, {} ); } render() { return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)( WrappedComponent, { ...{ ...this.props, colors: void 0, ...this.state, ...this.setters, colorUtils: this.colorUtils } } ); } }; } ]); } function createCustomColorsHOC(colorsArray) { return (...colorTypes) => { const withColorPalette = withCustomColorPalette(colorsArray); return (0, import_compose2.createHigherOrderComponent)( createColorHOC(colorTypes, withColorPalette), "withCustomColors" ); }; } function withColors(...colorTypes) { const withColorPalette = withEditorColorPalette(); return (0, import_compose2.createHigherOrderComponent)( createColorHOC(colorTypes, withColorPalette), "withColors" ); } // packages/block-editor/build-module/components/gradients/use-gradient.js var import_element10 = __toESM(require_element()); var import_data8 = __toESM(require_data()); function __experimentalGetGradientClass(gradientSlug) { if (!gradientSlug) { return void 0; } return `has-${gradientSlug}-gradient-background`; } function getGradientValueBySlug(gradients, slug) { const gradient = gradients?.find((g2) => g2.slug === slug); return gradient && gradient.gradient; } function __experimentalGetGradientObjectByGradientValue(gradients, value) { const gradient = gradients?.find((g2) => g2.gradient === value); return gradient; } function getGradientSlugByValue(gradients, value) { const gradient = __experimentalGetGradientObjectByGradientValue( gradients, value ); return gradient && gradient.slug; } function __experimentalUseGradient({ gradientAttribute = "gradient", customGradientAttribute = "customGradient" } = {}) { const { clientId } = useBlockEditContext(); const [ userGradientPalette, themeGradientPalette, defaultGradientPalette ] = useSettings( "color.gradients.custom", "color.gradients.theme", "color.gradients.default" ); const allGradients = (0, import_element10.useMemo)( () => [ ...userGradientPalette || [], ...themeGradientPalette || [], ...defaultGradientPalette || [] ], [userGradientPalette, themeGradientPalette, defaultGradientPalette] ); const { gradient, customGradient } = (0, import_data8.useSelect)( (select3) => { const { getBlockAttributes: getBlockAttributes3 } = select3(store); const attributes = getBlockAttributes3(clientId) || {}; return { customGradient: attributes[customGradientAttribute], gradient: attributes[gradientAttribute] }; }, [clientId, gradientAttribute, customGradientAttribute] ); const { updateBlockAttributes: updateBlockAttributes2 } = (0, import_data8.useDispatch)(store); const setGradient = (0, import_element10.useCallback)( (newGradientValue) => { const slug = getGradientSlugByValue( allGradients, newGradientValue ); if (slug) { updateBlockAttributes2(clientId, { [gradientAttribute]: slug, [customGradientAttribute]: void 0 }); return; } updateBlockAttributes2(clientId, { [gradientAttribute]: void 0, [customGradientAttribute]: newGradientValue }); }, [allGradients, clientId, updateBlockAttributes2] ); const gradientClass = __experimentalGetGradientClass(gradient); let gradientValue; if (gradient) { gradientValue = getGradientValueBySlug(allGradients, gradient); } else { gradientValue = customGradient; } return { gradientClass, gradientValue, setGradient }; } // packages/block-editor/build-module/components/font-sizes/utils.js var import_components6 = __toESM(require_components()); var { kebabCase: kebabCase3 } = unlock(import_components6.privateApis); var getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => { if (fontSizeAttribute) { const fontSizeObject = fontSizes?.find( ({ slug }) => slug === fontSizeAttribute ); if (fontSizeObject) { return fontSizeObject; } } return { size: customFontSizeAttribute }; }; function getFontSizeObjectByValue(fontSizes, value) { const fontSizeObject = fontSizes?.find(({ size }) => size === value); if (fontSizeObject) { return fontSizeObject; } return { size: value }; } function getFontSizeClass(fontSizeSlug) { if (!fontSizeSlug) { return; } return `has-${kebabCase3(fontSizeSlug)}-font-size`; } // packages/block-editor/build-module/components/font-sizes/fluid-utils.js var DEFAULT_MAXIMUM_VIEWPORT_WIDTH = "1600px"; var DEFAULT_MINIMUM_VIEWPORT_WIDTH = "320px"; var DEFAULT_SCALE_FACTOR = 1; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN = 0.25; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX = 0.75; var DEFAULT_MINIMUM_FONT_SIZE_LIMIT = "14px"; function getComputedFluidTypographyValue({ minimumFontSize, maximumFontSize, fontSize, minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH, maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH, scaleFactor = DEFAULT_SCALE_FACTOR, minimumFontSizeLimit }) { minimumFontSizeLimit = !!getTypographyValueAndUnit(minimumFontSizeLimit) ? minimumFontSizeLimit : DEFAULT_MINIMUM_FONT_SIZE_LIMIT; if (fontSize) { const fontSizeParsed = getTypographyValueAndUnit(fontSize); if (!fontSizeParsed?.unit) { return null; } const minimumFontSizeLimitParsed = getTypographyValueAndUnit( minimumFontSizeLimit, { coerceTo: fontSizeParsed.unit } ); if (!!minimumFontSizeLimitParsed?.value && !minimumFontSize && !maximumFontSize) { if (fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value) { return null; } } if (!maximumFontSize) { maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`; } if (!minimumFontSize) { const fontSizeValueInPx = fontSizeParsed.unit === "px" ? fontSizeParsed.value : fontSizeParsed.value * 16; const minimumFontSizeFactor = Math.min( Math.max( 1 - 0.075 * Math.log2(fontSizeValueInPx), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN ), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX ); const calculatedMinimumFontSize = roundToPrecision( fontSizeParsed.value * minimumFontSizeFactor, 3 ); if (!!minimumFontSizeLimitParsed?.value && calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value) { minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`; } else { minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`; } } } const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); const fontSizeUnit = minimumFontSizeParsed?.unit || "rem"; const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, { coerceTo: fontSizeUnit }); if (!minimumFontSizeParsed || !maximumFontSizeParsed) { return null; } const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, { coerceTo: "rem" }); const maximumViewportWidthParsed = getTypographyValueAndUnit( maximumViewportWidth, { coerceTo: fontSizeUnit } ); const minimumViewportWidthParsed = getTypographyValueAndUnit( minimumViewportWidth, { coerceTo: fontSizeUnit } ); if (!maximumViewportWidthParsed || !minimumViewportWidthParsed || !minimumFontSizeRem) { return null; } const linearDenominator = maximumViewportWidthParsed.value - minimumViewportWidthParsed.value; if (!linearDenominator) { return null; } const minViewportWidthOffsetValue = roundToPrecision( minimumViewportWidthParsed.value / 100, 3 ); const viewportWidthOffset = roundToPrecision(minViewportWidthOffsetValue, 3) + fontSizeUnit; const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / linearDenominator); const linearFactorScaled = roundToPrecision( (linearFactor || 1) * scaleFactor, 3 ); const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewportWidthOffset}) * ${linearFactorScaled})`; return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`; } function getTypographyValueAndUnit(rawValue, options = {}) { if (typeof rawValue !== "string" && typeof rawValue !== "number") { return null; } if (isFinite(rawValue)) { rawValue = `${rawValue}px`; } const { coerceTo, rootSizeValue, acceptableUnits } = { coerceTo: "", // Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`. rootSizeValue: 16, acceptableUnits: ["rem", "px", "em"], ...options }; const acceptableUnitsGroup = acceptableUnits?.join("|"); const regexUnits = new RegExp( `^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$` ); const matches = rawValue.match(regexUnits); if (!matches || matches.length < 3) { return null; } let [, value, unit] = matches; let returnValue = parseFloat(value); if ("px" === coerceTo && ("em" === unit || "rem" === unit)) { returnValue = returnValue * rootSizeValue; unit = coerceTo; } if ("px" === unit && ("em" === coerceTo || "rem" === coerceTo)) { returnValue = returnValue / rootSizeValue; unit = coerceTo; } if (("em" === coerceTo || "rem" === coerceTo) && ("em" === unit || "rem" === unit)) { unit = coerceTo; } return { value: roundToPrecision(returnValue, 3), unit }; } function roundToPrecision(value, digits = 3) { const base = Math.pow(10, digits); return Number.isFinite(value) ? parseFloat(Math.round(value * base) / base) : void 0; } // packages/block-editor/build-module/components/font-sizes/font-size-picker.js var import_components7 = __toESM(require_components()); var import_jsx_runtime120 = __toESM(require_jsx_runtime()); function FontSizePicker(props) { const [fontSizes, customFontSize] = useSettings( "typography.fontSizes", "typography.customFontSize" ); return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)( import_components7.FontSizePicker, { ...props, fontSizes, disableCustomFontSizes: !customFontSize } ); } var font_size_picker_default = FontSizePicker; // packages/block-editor/build-module/components/font-sizes/with-font-sizes.js var import_compose3 = __toESM(require_compose()); var import_element11 = __toESM(require_element()); var import_jsx_runtime121 = __toESM(require_jsx_runtime()); var DEFAULT_FONT_SIZES = []; var upperFirst2 = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join(""); var with_font_sizes_default = (...fontSizeNames) => { const fontSizeAttributeNames = fontSizeNames.reduce( (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => { fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${upperFirst2(fontSizeAttributeName)}`; return fontSizeAttributeNamesAccumulator; }, {} ); return (0, import_compose3.createHigherOrderComponent)( (0, import_compose3.compose)([ (0, import_compose3.createHigherOrderComponent)( (WrappedComponent) => (props) => { const [fontSizes] = useSettings("typography.fontSizes"); return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)( WrappedComponent, { ...props, fontSizes: fontSizes || DEFAULT_FONT_SIZES } ); }, "withFontSizes" ), (WrappedComponent) => { return class extends import_element11.Component { constructor(props) { super(props); this.setters = this.createSetters(); this.state = {}; } createSetters() { return Object.entries(fontSizeAttributeNames).reduce( (settersAccumulator, [ fontSizeAttributeName, customFontSizeAttributeName ]) => { const upperFirstFontSizeAttributeName = upperFirst2(fontSizeAttributeName); settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize( fontSizeAttributeName, customFontSizeAttributeName ); return settersAccumulator; }, {} ); } createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) { return (fontSizeValue) => { const fontSizeObject = this.props.fontSizes?.find( ({ size }) => size === Number(fontSizeValue) ); this.props.setAttributes({ [fontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : void 0, [customFontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? void 0 : fontSizeValue }); }; } static getDerivedStateFromProps({ attributes, fontSizes }, previousState) { const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => { if (previousState[fontSizeAttributeName]) { if (attributes[fontSizeAttributeName]) { return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug; } return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName]; } return true; }; if (!Object.values(fontSizeAttributeNames).some( didAttributesChange )) { return null; } const newState = Object.entries( fontSizeAttributeNames ).filter( ([key, value]) => didAttributesChange(value, key) ).reduce( (newStateAccumulator, [ fontSizeAttributeName, customFontSizeAttributeName ]) => { const fontSizeAttributeValue = attributes[fontSizeAttributeName]; const fontSizeObject = getFontSize( fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName] ); newStateAccumulator[fontSizeAttributeName] = { ...fontSizeObject, class: getFontSizeClass( fontSizeAttributeValue ) }; return newStateAccumulator; }, {} ); return { ...previousState, ...newState }; } render() { return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)( WrappedComponent, { ...{ ...this.props, fontSizes: void 0, ...this.state, ...this.setters } } ); } }; } ]), "withFontSizes" ); }; // packages/block-editor/build-module/components/alignment-control/ui.js var import_i18n7 = __toESM(require_i18n()); var import_components8 = __toESM(require_components()); var import_jsx_runtime122 = __toESM(require_jsx_runtime()); var DEFAULT_ALIGNMENT_CONTROLS = [ { icon: align_left_default, title: (0, import_i18n7.__)("Align text left"), align: "left" }, { icon: align_center_default, title: (0, import_i18n7.__)("Align text center"), align: "center" }, { icon: align_right_default, title: (0, import_i18n7.__)("Align text right"), align: "right" } ]; var POPOVER_PROPS = { placement: "bottom-start" }; function AlignmentUI({ value, onChange, alignmentControls = DEFAULT_ALIGNMENT_CONTROLS, label = (0, import_i18n7.__)("Align text"), description = (0, import_i18n7.__)("Change text alignment"), isCollapsed: isCollapsed3 = true, isToolbar }) { function applyOrUnset(align) { return () => onChange(value === align ? void 0 : align); } const activeAlignment = alignmentControls.find( (control) => control.align === value ); function setIcon() { if (activeAlignment) { return activeAlignment.icon; } return (0, import_i18n7.isRTL)() ? align_right_default : align_left_default; } const UIComponent = isToolbar ? import_components8.ToolbarGroup : import_components8.ToolbarDropdownMenu; const extraProps = isToolbar ? { isCollapsed: isCollapsed3 } : { toggleProps: { description }, popoverProps: POPOVER_PROPS }; return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)( UIComponent, { icon: setIcon(), label, controls: alignmentControls.map((control) => { const { align } = control; const isActive = value === align; return { ...control, isActive, role: isCollapsed3 ? "menuitemradio" : void 0, onClick: applyOrUnset(align) }; }), ...extraProps } ); } var ui_default = AlignmentUI; // packages/block-editor/build-module/components/alignment-control/index.js var import_jsx_runtime123 = __toESM(require_jsx_runtime()); var AlignmentControl = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ui_default, { ...props, isToolbar: false }); }; var AlignmentToolbar = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ui_default, { ...props, isToolbar: true }); }; // packages/block-editor/build-module/components/autocomplete/index.js var import_hooks3 = __toESM(require_hooks()); var import_components10 = __toESM(require_components()); var import_element15 = __toESM(require_element()); var import_blocks12 = __toESM(require_blocks()); // packages/block-editor/build-module/autocompleters/block.js var import_data10 = __toESM(require_data()); var import_blocks11 = __toESM(require_blocks()); var import_element14 = __toESM(require_element()); // packages/block-editor/build-module/components/inserter/search-items.js var import_remove_accents = __toESM(require_remove_accents()); // node_modules/tslib/tslib.es6.mjs var extendStatics = function(d2, b2) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) { d3.__proto__ = b3; } || function(d3, b3) { for (var p2 in b3) if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2]; }; return extendStatics(d2, b2); }; function __extends(d2, b2) { if (typeof b2 !== "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null"); extendStatics(d2, b2); function __214() { this.constructor = d2; } d2.prototype = b2 === null ? Object.create(b2) : (__214.prototype = b2.prototype, new __214()); } var __assign = function() { __assign = Object.assign || function __assign2(t3) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2]; } return t3; }; return __assign.apply(this, arguments); }; // node_modules/lower-case/dist.es2015/index.js function lowerCase(str) { return str.toLowerCase(); } // node_modules/no-case/dist.es2015/index.js var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp2 = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp2 = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp2, "$1\0$2"), stripRegexp2, "\0"); var start2 = 0; var end = result.length; while (result.charAt(start2) === "\0") start2++; while (result.charAt(end - 1) === "\0") end--; return result.slice(start2, end).split("\0").map(transform).join(delimiter); } function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function(input2, re2) { return input2.replace(re2, value); }, input); } // packages/block-editor/build-module/components/inserter/search-items.js var defaultGetName = (item) => item.name || ""; var defaultGetTitle = (item) => item.title; var defaultGetDescription = (item) => item.description || ""; var defaultGetKeywords = (item) => item.keywords || []; var defaultGetCategory = (item) => item.category; var defaultGetCollection = () => null; var splitRegexp = [ /([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu, // One lowercase or digit, followed by one uppercase. /([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu // One uppercase followed by one uppercase and one lowercase. ]; var stripRegexp = new RegExp("(\\p{C}|\\p{P}|\\p{S})+", "giu"); var extractedWords = /* @__PURE__ */ new Map(); var normalizedStrings = /* @__PURE__ */ new Map(); function extractWords(input = "") { if (extractedWords.has(input)) { return extractedWords.get(input); } const result = noCase(input, { splitRegexp, stripRegexp }).split(" ").filter(Boolean); extractedWords.set(input, result); return result; } function normalizeString(input = "") { if (normalizedStrings.has(input)) { return normalizedStrings.get(input); } let result = (0, import_remove_accents.default)(input); result = result.replace(/^\//, ""); result = result.toLowerCase(); normalizedStrings.set(input, result); return result; } var getNormalizedSearchTerms = (input = "") => { return extractWords(normalizeString(input)); }; var removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { return unmatchedTerms.filter( (term) => !getNormalizedSearchTerms(unprocessedTerms).some( (unprocessedTerm) => unprocessedTerm.includes(term) ) ); }; var searchBlockItems = (items, categories, collections, searchInput) => { const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); if (normalizedSearchTerms.length === 0) { return items; } const config2 = { getCategory: (item) => categories.find(({ slug }) => slug === item.category)?.title, getCollection: (item) => collections[item.name.split("/")[0]]?.title }; return searchItems(items, searchInput, config2); }; var searchItems = (items = [], searchInput = "", config2 = {}) => { const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); if (normalizedSearchTerms.length === 0) { return items; } const rankedItems = items.map((item) => { return [item, getItemSearchRank(item, searchInput, config2)]; }).filter(([, rank]) => rank > 0); rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); return rankedItems.map(([item]) => item); }; function getItemSearchRank(item, searchTerm, config2 = {}) { const { getName = defaultGetName, getTitle = defaultGetTitle, getDescription = defaultGetDescription, getKeywords = defaultGetKeywords, getCategory = defaultGetCategory, getCollection = defaultGetCollection } = config2; const name = getName(item); const title = getTitle(item); const description = getDescription(item); const keywords = getKeywords(item); const category = getCategory(item); const collection = getCollection(item); const normalizedSearchInput = normalizeString(searchTerm); const normalizedTitle = normalizeString(title); let rank = 0; if (normalizedSearchInput === normalizedTitle) { rank += 30; } else if (normalizedTitle.startsWith(normalizedSearchInput)) { rank += 20; } else { const terms = [ name, title, description, ...keywords, category, collection ].join(" "); const normalizedSearchTerms = extractWords(normalizedSearchInput); const unmatchedTerms = removeMatchingTerms( normalizedSearchTerms, terms ); if (unmatchedTerms.length === 0) { rank += 10; } } if (rank !== 0 && name.startsWith("core/")) { const isCoreBlockVariation = name !== item.id; rank += isCoreBlockVariation ? 1 : 2; } return rank; } // packages/block-editor/build-module/components/inserter/hooks/use-block-types-state.js var import_blocks10 = __toESM(require_blocks()); var import_data9 = __toESM(require_data()); var import_element12 = __toESM(require_element()); var import_notices2 = __toESM(require_notices()); var import_i18n8 = __toESM(require_i18n()); var useBlockTypesState = (rootClientId, onInsert, isQuick) => { const options = (0, import_element12.useMemo)( () => ({ [isFiltered]: !!isQuick }), [isQuick] ); const [items] = (0, import_data9.useSelect)( (select3) => [ select3(store).getInserterItems( rootClientId, options ) ], [rootClientId, options] ); const { getClosestAllowedInsertionPoint: getClosestAllowedInsertionPoint2 } = unlock( (0, import_data9.useSelect)(store) ); const { createErrorNotice } = (0, import_data9.useDispatch)(import_notices2.store); const [categories, collections] = (0, import_data9.useSelect)((select3) => { const { getCategories, getCollections } = select3(import_blocks10.store); return [getCategories(), getCollections()]; }, []); const onSelectItem = (0, import_element12.useCallback)( ({ name, initialAttributes, innerBlocks, syncStatus, content }, shouldFocusBlock) => { const destinationClientId = getClosestAllowedInsertionPoint2( name, rootClientId ); if (destinationClientId === null) { const title = (0, import_blocks10.getBlockType)(name)?.title ?? name; createErrorNotice( (0, import_i18n8.sprintf)( /* translators: %s: block pattern title. */ (0, import_i18n8.__)(`Block "%s" can't be inserted.`), title ), { type: "snackbar", id: "inserter-notice" } ); return; } const insertedBlock = syncStatus === "unsynced" ? (0, import_blocks10.parse)(content, { __unstableSkipMigrationLogs: true }) : (0, import_blocks10.createBlock)( name, initialAttributes, (0, import_blocks10.createBlocksFromInnerBlocksTemplate)(innerBlocks) ); onInsert( insertedBlock, void 0, shouldFocusBlock, destinationClientId ); }, [ getClosestAllowedInsertionPoint2, rootClientId, onInsert, createErrorNotice ] ); return [items, categories, collections, onSelectItem]; }; var use_block_types_state_default = useBlockTypesState; // packages/block-editor/build-module/components/block-icon/index.js var import_components9 = __toESM(require_components()); var import_element13 = __toESM(require_element()); var import_jsx_runtime124 = __toESM(require_jsx_runtime()); function BlockIcon({ icon, showColors = false, className, context }) { if (icon?.src === "block-default") { icon = { src: block_default_default }; } const renderedIcon = /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_components9.Icon, { icon: icon && icon.src ? icon.src : icon, context }); const style = showColors ? { backgroundColor: icon && icon.background, color: icon && icon.foreground } : {}; return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)( "span", { style, className: clsx_default("block-editor-block-icon", className, { "has-colors": showColors }), children: renderedIcon } ); } var block_icon_default = (0, import_element13.memo)(BlockIcon); // packages/block-editor/build-module/utils/order-inserter-block-items.js var orderInserterBlockItems = (items, priority2) => { if (!priority2) { return items; } items.sort(({ id: aName }, { id: bName }) => { let aIndex = priority2.indexOf(aName); let bIndex = priority2.indexOf(bName); if (aIndex < 0) { aIndex = priority2.length; } if (bIndex < 0) { bIndex = priority2.length; } return aIndex - bIndex; }); return items; }; // packages/block-editor/build-module/autocompleters/block.js var import_jsx_runtime125 = __toESM(require_jsx_runtime()); var noop = () => { }; var SHOWN_BLOCK_TYPES = 9; function createBlockCompleter() { return { name: "blocks", className: "block-editor-autocompleters__block", triggerPrefix: "/", useItems(filterValue) { const { rootClientId, selectedBlockId, prioritizedBlocks } = (0, import_data10.useSelect)((select3) => { const { getSelectedBlockClientId: getSelectedBlockClientId2, getBlock: getBlock2, getBlockListSettings: getBlockListSettings2, getBlockRootClientId: getBlockRootClientId2 } = select3(store); const { getActiveBlockVariation } = select3(import_blocks11.store); const selectedBlockClientId = getSelectedBlockClientId2(); const { name: blockName, attributes } = getBlock2( selectedBlockClientId ); const activeBlockVariation = getActiveBlockVariation( blockName, attributes ); const _rootClientId = getBlockRootClientId2( selectedBlockClientId ); return { selectedBlockId: activeBlockVariation ? `${blockName}/${activeBlockVariation.name}` : blockName, rootClientId: _rootClientId, prioritizedBlocks: getBlockListSettings2(_rootClientId)?.prioritizedInserterBlocks }; }, []); const [items, categories, collections] = use_block_types_state_default( rootClientId, noop, true ); const filteredItems = (0, import_element14.useMemo)(() => { const initialFilteredItems = !!filterValue.trim() ? searchBlockItems( items, categories, collections, filterValue ) : orderInserterBlockItems( orderBy(items, "frecency", "desc"), prioritizedBlocks ); return initialFilteredItems.filter((item) => item.id !== selectedBlockId).slice(0, SHOWN_BLOCK_TYPES); }, [ filterValue, selectedBlockId, items, categories, collections, prioritizedBlocks ]); const options = (0, import_element14.useMemo)( () => filteredItems.map((blockItem) => { const { title, icon, isDisabled } = blockItem; return { key: `block-${blockItem.id}`, value: blockItem, label: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(import_jsx_runtime125.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)( block_icon_default, { icon, showColors: true }, "icon" ), title ] }), isDisabled }; }), [filteredItems] ); return [options]; }, allowContext(before, after) { return !(/\S/.test(before) || /\S/.test(after)); }, getOptionCompletion(inserterItem) { const { name, initialAttributes, innerBlocks, syncStatus, blocks: blocks2 } = inserterItem; return { action: "replace", value: syncStatus === "unsynced" ? (blocks2 ?? []).map( (block) => (0, import_blocks11.cloneBlock)(block) ) : (0, import_blocks11.createBlock)( name, initialAttributes, (0, import_blocks11.createBlocksFromInnerBlocksTemplate)( innerBlocks ) ) }; } }; } var block_default = createBlockCompleter(); // packages/block-editor/build-module/autocompleters/link.js var import_api_fetch = __toESM(require_api_fetch()); var import_url2 = __toESM(require_url()); var import_html_entities = __toESM(require_html_entities()); var import_jsx_runtime126 = __toESM(require_jsx_runtime()); var SHOWN_SUGGESTIONS = 10; function createLinkCompleter() { return { name: "links", className: "block-editor-autocompleters__link", triggerPrefix: "[[", options: async (letters) => { let options = await (0, import_api_fetch.default)({ path: (0, import_url2.addQueryArgs)("/wp/v2/search", { per_page: SHOWN_SUGGESTIONS, search: letters, type: "post", order_by: "menu_order" }) }); options = options.filter((option) => option.title !== ""); return options; }, getOptionKeywords(item) { const expansionWords = item.title.split(/\s+/); return [...expansionWords]; }, getOptionLabel(item) { return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_jsx_runtime126.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)( icon_default, { icon: item.subtype === "page" ? page_default : post_default }, "icon" ), (0, import_html_entities.decodeEntities)(item.title) ] }); }, getOptionCompletion(item) { return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("a", { href: item.url, children: item.title }); } }; } var link_default2 = createLinkCompleter(); // packages/block-editor/build-module/components/autocomplete/index.js var import_jsx_runtime127 = __toESM(require_jsx_runtime()); var EMPTY_ARRAY3 = []; function useCompleters({ completers = EMPTY_ARRAY3 }) { const { name } = useBlockEditContext(); return (0, import_element15.useMemo)(() => { let filteredCompleters = [...completers, link_default2]; if (name === (0, import_blocks12.getDefaultBlockName)() || (0, import_blocks12.getBlockSupport)(name, "__experimentalSlashInserter", false)) { filteredCompleters = [...filteredCompleters, block_default]; } if ((0, import_hooks3.hasFilter)("editor.Autocomplete.completers")) { if (filteredCompleters === completers) { filteredCompleters = filteredCompleters.map( (completer) => ({ ...completer }) ); } filteredCompleters = (0, import_hooks3.applyFilters)( "editor.Autocomplete.completers", filteredCompleters, name ); } return filteredCompleters; }, [completers, name]); } function useBlockEditorAutocompleteProps(props) { return (0, import_components10.__unstableUseAutocompleteProps)({ ...props, completers: useCompleters(props) }); } function BlockEditorAutocomplete(props) { return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components10.Autocomplete, { ...props, completers: useCompleters(props) }); } var autocomplete_default = BlockEditorAutocomplete; // packages/block-editor/build-module/components/block-alignment-control/ui.js var import_i18n16 = __toESM(require_i18n()); var import_components16 = __toESM(require_components()); // packages/block-editor/build-module/components/block-alignment-control/use-available-alignments.js var import_data11 = __toESM(require_data()); // packages/block-editor/build-module/components/block-list/layout.js var import_element17 = __toESM(require_element()); // packages/block-editor/build-module/layouts/flex.js var import_i18n11 = __toESM(require_i18n()); var import_components11 = __toESM(require_components()); // packages/block-editor/build-module/layouts/utils.js var import_i18n9 = __toESM(require_i18n()); // packages/block-editor/build-module/layouts/definitions.js var LAYOUT_DEFINITIONS = { default: { name: "default", slug: "flow", className: "is-layout-flow", baseStyles: [ { selector: " > .alignleft", rules: { float: "left", "margin-inline-start": "0", "margin-inline-end": "2em" } }, { selector: " > .alignright", rules: { float: "right", "margin-inline-start": "2em", "margin-inline-end": "0" } }, { selector: " > .aligncenter", rules: { "margin-left": "auto !important", "margin-right": "auto !important" } } ], spacingStyles: [ { selector: " > :first-child", rules: { "margin-block-start": "0" } }, { selector: " > :last-child", rules: { "margin-block-end": "0" } }, { selector: " > *", rules: { "margin-block-start": null, "margin-block-end": "0" } } ] }, constrained: { name: "constrained", slug: "constrained", className: "is-layout-constrained", baseStyles: [ { selector: " > .alignleft", rules: { float: "left", "margin-inline-start": "0", "margin-inline-end": "2em" } }, { selector: " > .alignright", rules: { float: "right", "margin-inline-start": "2em", "margin-inline-end": "0" } }, { selector: " > .aligncenter", rules: { "margin-left": "auto !important", "margin-right": "auto !important" } }, { selector: " > :where(:not(.alignleft):not(.alignright):not(.alignfull))", rules: { "max-width": "var(--wp--style--global--content-size)", "margin-left": "auto !important", "margin-right": "auto !important" } }, { selector: " > .alignwide", rules: { "max-width": "var(--wp--style--global--wide-size)" } } ], spacingStyles: [ { selector: " > :first-child", rules: { "margin-block-start": "0" } }, { selector: " > :last-child", rules: { "margin-block-end": "0" } }, { selector: " > *", rules: { "margin-block-start": null, "margin-block-end": "0" } } ] }, flex: { name: "flex", slug: "flex", className: "is-layout-flex", displayMode: "flex", baseStyles: [ { selector: "", rules: { "flex-wrap": "wrap", "align-items": "center" } }, { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] }, grid: { name: "grid", slug: "grid", className: "is-layout-grid", displayMode: "grid", baseStyles: [ { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] } }; // packages/block-editor/build-module/layouts/utils.js function appendSelectors(selectors, append = "") { return selectors.split(",").map( (subselector) => `${subselector}${append ? ` ${append}` : ""}` ).join(","); } function getBlockGapCSS(selector3, layoutDefinitions = LAYOUT_DEFINITIONS, layoutType, blockGapValue) { let output = ""; if (layoutDefinitions?.[layoutType]?.spacingStyles?.length && blockGapValue) { layoutDefinitions[layoutType].spacingStyles.forEach((gapStyle) => { output += `${appendSelectors( selector3, gapStyle.selector.trim() )} { `; output += Object.entries(gapStyle.rules).map( ([cssProperty, value]) => `${cssProperty}: ${value ? value : blockGapValue}` ).join("; "); output += "; }"; }); } return output; } function getAlignmentsInfo(layout) { const { contentSize, wideSize, type = "default" } = layout; const alignmentInfo = {}; const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i; if (sizeRegex.test(contentSize) && type === "constrained") { alignmentInfo.none = (0, import_i18n9.sprintf)((0, import_i18n9.__)("Max %s wide"), contentSize); } if (sizeRegex.test(wideSize)) { alignmentInfo.wide = (0, import_i18n9.sprintf)((0, import_i18n9.__)("Max %s wide"), wideSize); } return alignmentInfo; } // packages/block-editor/build-module/components/spacing-sizes-control/utils.js var import_i18n10 = __toESM(require_i18n()); var RANGE_CONTROL_MAX_SIZE = 8; var ALL_SIDES = ["top", "right", "bottom", "left"]; var DEFAULT_VALUES = { top: void 0, right: void 0, bottom: void 0, left: void 0 }; var ICONS = { custom: sides_all_default, axial: sides_all_default, horizontal: sides_horizontal_default, vertical: sides_vertical_default, top: sides_top_default, right: sides_right_default, bottom: sides_bottom_default, left: sides_left_default }; var LABELS = { default: (0, import_i18n10.__)("Spacing control"), top: (0, import_i18n10.__)("Top"), bottom: (0, import_i18n10.__)("Bottom"), left: (0, import_i18n10.__)("Left"), right: (0, import_i18n10.__)("Right"), mixed: (0, import_i18n10.__)("Mixed"), vertical: (0, import_i18n10.__)("Vertical"), horizontal: (0, import_i18n10.__)("Horizontal"), axial: (0, import_i18n10.__)("Horizontal & vertical"), custom: (0, import_i18n10.__)("Custom") }; var VIEWS = { axial: "axial", top: "top", right: "right", bottom: "bottom", left: "left", custom: "custom" }; function isValueSpacingPreset(value) { if (!value?.includes) { return false; } return value === "0" || value.includes("var:preset|spacing|"); } function getCustomValueFromPreset(value, spacingSizes) { if (!isValueSpacingPreset(value)) { return value; } const slug = getSpacingPresetSlug(value); const spacingSize = spacingSizes.find( (size) => String(size.slug) === slug ); return spacingSize?.size; } function getPresetValueFromCustomValue(value, spacingSizes) { if (!value || isValueSpacingPreset(value) || value === "0") { return value; } const spacingMatch = spacingSizes.find( (size) => String(size.size) === String(value) ); if (spacingMatch?.slug) { return `var:preset|spacing|${spacingMatch.slug}`; } return value; } function getSpacingPresetCssVar(value) { if (!value) { return; } const slug = value.match(/var:preset\|spacing\|(.+)/); if (!slug) { return value; } return `var(--wp--preset--spacing--${slug[1]})`; } function getSpacingPresetSlug(value) { if (!value) { return; } if (value === "0" || value === "default") { return value; } const slug = value.match(/var:preset\|spacing\|(.+)/); return slug ? slug[1] : void 0; } function hasAxisSupport(sides, axis) { if (!sides || !sides.length) { return false; } const hasHorizontalSupport = sides.includes("horizontal") || sides.includes("left") && sides.includes("right"); const hasVerticalSupport = sides.includes("vertical") || sides.includes("top") && sides.includes("bottom"); if (axis === "horizontal") { return hasHorizontalSupport; } if (axis === "vertical") { return hasVerticalSupport; } return hasHorizontalSupport || hasVerticalSupport; } function hasBalancedSidesSupport(sides = []) { const counts = { top: 0, right: 0, bottom: 0, left: 0 }; sides.forEach((side) => counts[side] += 1); return (counts.top + counts.bottom) % 2 === 0 && (counts.left + counts.right) % 2 === 0; } function getInitialView(values = {}, sides) { const { top, right, bottom, left } = values; const sideValues = [top, right, bottom, left].filter(Boolean); const hasMatchingAxialValues = top === bottom && left === right && (!!top || !!left); const hasNoValuesAndBalancedSides = !sideValues.length && hasBalancedSidesSupport(sides); const hasOnlyAxialSides = sides?.includes("horizontal") && sides?.includes("vertical") && sides?.length === 2; if (hasAxisSupport(sides) && (hasMatchingAxialValues || hasNoValuesAndBalancedSides)) { return VIEWS.axial; } if (hasOnlyAxialSides && sideValues.length === 1) { let side; Object.entries(values).some(([key, value]) => { side = key; return value !== void 0; }); return side; } if (sides?.length === 1 && !sideValues.length) { return sides[0]; } return VIEWS.custom; } // packages/block-editor/build-module/hooks/gap.js function getGapBoxControlValueFromStyle(blockGapValue) { if (!blockGapValue) { return null; } const isValueString = typeof blockGapValue === "string"; return { top: isValueString ? blockGapValue : blockGapValue?.top, left: isValueString ? blockGapValue : blockGapValue?.left }; } function getGapCSSValue(blockGapValue, defaultValue = "0") { const blockGapBoxControlValue = getGapBoxControlValueFromStyle(blockGapValue); if (!blockGapBoxControlValue) { return null; } const row = getSpacingPresetCssVar(blockGapBoxControlValue?.top) || defaultValue; const column = getSpacingPresetCssVar(blockGapBoxControlValue?.left) || defaultValue; return row === column ? row : `${row} ${column}`; } // packages/block-editor/build-module/layouts/flex.js var import_jsx_runtime128 = __toESM(require_jsx_runtime()); var justifyContentMap = { left: "flex-start", right: "flex-end", center: "center", "space-between": "space-between" }; var alignItemsMap = { left: "flex-start", right: "flex-end", center: "center", stretch: "stretch" }; var verticalAlignmentMap = { top: "flex-start", center: "center", bottom: "flex-end", stretch: "stretch", "space-between": "space-between" }; var defaultAlignments = { horizontal: "center", vertical: "top" }; var flexWrapOptions = ["wrap", "nowrap"]; var flex_default = { name: "flex", label: (0, import_i18n11.__)("Flex"), inspectorControls: function FlexLayoutInspectorControls({ layout = {}, onChange, layoutBlockSupport = {} }) { const { allowOrientation = true, allowJustification = true } = layoutBlockSupport; return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_components11.Flex, { children: [ allowJustification && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components11.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( FlexLayoutJustifyContentControl, { layout, onChange } ) }), allowOrientation && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components11.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( OrientationControl, { layout, onChange } ) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FlexWrapControl, { layout, onChange }) ] }); }, toolBarControls: function FlexLayoutToolbarControls({ layout = {}, onChange, layoutBlockSupport }) { const { allowVerticalAlignment = true, allowJustification = true } = layoutBlockSupport; if (!allowJustification && !allowVerticalAlignment) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(block_controls_default, { group: "block", __experimentalShareWithChildBlocks: true, children: [ allowJustification && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( FlexLayoutJustifyContentControl, { layout, onChange, isToolbar: true } ), allowVerticalAlignment && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( FlexLayoutVerticalAlignmentControl, { layout, onChange } ) ] }); }, getLayoutStyle: function getLayoutStyle({ selector: selector3, layout, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const { orientation = "horizontal" } = layout; const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, "spacing", "blockGap") ? getGapCSSValue(style?.spacing?.blockGap, "0.5em") : void 0; const justifyContent = justifyContentMap[layout.justifyContent]; const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : "wrap"; const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment]; const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left; let output = ""; const rules = []; if (flexWrap && flexWrap !== "wrap") { rules.push(`flex-wrap: ${flexWrap}`); } if (orientation === "horizontal") { if (verticalAlignment) { rules.push(`align-items: ${verticalAlignment}`); } if (justifyContent) { rules.push(`justify-content: ${justifyContent}`); } } else { if (verticalAlignment) { rules.push(`justify-content: ${verticalAlignment}`); } rules.push("flex-direction: column"); rules.push(`align-items: ${alignItems}`); } if (rules.length) { output = `${appendSelectors(selector3)} { ${rules.join("; ")}; }`; } if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "flex", blockGapValue ); } return output; }, getOrientation(layout) { const { orientation = "horizontal" } = layout; return orientation; }, getAlignments() { return []; } }; function FlexLayoutVerticalAlignmentControl({ layout, onChange }) { const { orientation = "horizontal" } = layout; const defaultVerticalAlignment = orientation === "horizontal" ? defaultAlignments.horizontal : defaultAlignments.vertical; const { verticalAlignment = defaultVerticalAlignment } = layout; const onVerticalAlignmentChange = (value) => { onChange({ ...layout, verticalAlignment: value }); }; return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( BlockVerticalAlignmentControl, { onChange: onVerticalAlignmentChange, value: verticalAlignment, controls: orientation === "horizontal" ? ["top", "center", "bottom", "stretch"] : ["top", "center", "bottom", "space-between"] } ); } var POPOVER_PROPS2 = { placement: "bottom-start" }; function FlexLayoutJustifyContentControl({ layout, onChange, isToolbar = false }) { const { justifyContent = "left", orientation = "horizontal" } = layout; const onJustificationChange = (value) => { onChange({ ...layout, justifyContent: value }); }; const allowedControls = ["left", "center", "right"]; if (orientation === "horizontal") { allowedControls.push("space-between"); } else { allowedControls.push("stretch"); } if (isToolbar) { return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( JustifyContentControl, { allowedControls, value: justifyContent, onChange: onJustificationChange, popoverProps: POPOVER_PROPS2 } ); } const justificationOptions = [ { value: "left", icon: justify_left_default, label: (0, import_i18n11.__)("Justify items left") }, { value: "center", icon: justify_center_default, label: (0, import_i18n11.__)("Justify items center") }, { value: "right", icon: justify_right_default, label: (0, import_i18n11.__)("Justify items right") } ]; if (orientation === "horizontal") { justificationOptions.push({ value: "space-between", icon: justify_space_between_default, label: (0, import_i18n11.__)("Space between items") }); } else { justificationOptions.push({ value: "stretch", icon: justify_stretch_default, label: (0, import_i18n11.__)("Stretch items") }); } return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( import_components11.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, label: (0, import_i18n11.__)("Justification"), value: justifyContent, onChange: onJustificationChange, className: "block-editor-hooks__flex-layout-justification-controls", children: justificationOptions.map(({ value, icon, label }) => { return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( import_components11.__experimentalToggleGroupControlOptionIcon, { value, icon, label }, value ); }) } ); } function FlexWrapControl({ layout, onChange }) { const { flexWrap = "wrap" } = layout; return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( import_components11.ToggleControl, { label: (0, import_i18n11.__)("Allow to wrap to multiple lines"), onChange: (value) => { onChange({ ...layout, flexWrap: value ? "wrap" : "nowrap" }); }, checked: flexWrap === "wrap" } ); } function OrientationControl({ layout, onChange }) { const { orientation = "horizontal", verticalAlignment, justifyContent } = layout; return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)( import_components11.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, className: "block-editor-hooks__flex-layout-orientation-controls", label: (0, import_i18n11.__)("Orientation"), value: orientation, onChange: (value) => { let newVerticalAlignment = verticalAlignment; let newJustification = justifyContent; if (value === "horizontal") { if (verticalAlignment === "space-between") { newVerticalAlignment = "center"; } if (justifyContent === "stretch") { newJustification = "left"; } } else { if (verticalAlignment === "stretch") { newVerticalAlignment = "top"; } if (justifyContent === "space-between") { newJustification = "left"; } } return onChange({ ...layout, orientation: value, verticalAlignment: newVerticalAlignment, justifyContent: newJustification }); }, children: [ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( import_components11.__experimentalToggleGroupControlOptionIcon, { icon: arrow_right_default, value: "horizontal", label: (0, import_i18n11.__)("Horizontal") } ), /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( import_components11.__experimentalToggleGroupControlOptionIcon, { icon: arrow_down_default, value: "vertical", label: (0, import_i18n11.__)("Vertical") } ) ] } ); } // packages/block-editor/build-module/layouts/flow.js var import_i18n12 = __toESM(require_i18n()); var flow_default = { name: "default", label: (0, import_i18n12.__)("Flow"), inspectorControls: function DefaultLayoutInspectorControls() { return null; }, toolBarControls: function DefaultLayoutToolbarControls() { return null; }, getLayoutStyle: function getLayoutStyle2({ selector: selector3, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap); let blockGapValue = ""; if (!shouldSkipSerialization(blockName, "spacing", "blockGap")) { if (blockGapStyleValue?.top) { blockGapValue = getGapCSSValue(blockGapStyleValue?.top); } else if (typeof blockGapStyleValue === "string") { blockGapValue = getGapCSSValue(blockGapStyleValue); } } let output = ""; if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "default", blockGapValue ); } return output; }, getOrientation() { return "vertical"; }, getAlignments(layout, isBlockBasedTheme) { const alignmentInfo = getAlignmentsInfo(layout); if (layout.alignments !== void 0) { if (!layout.alignments.includes("none")) { layout.alignments.unshift("none"); } return layout.alignments.map((alignment) => ({ name: alignment, info: alignmentInfo[alignment] })); } const alignments = [ { name: "left" }, { name: "center" }, { name: "right" } ]; if (!isBlockBasedTheme) { const { contentSize, wideSize } = layout; if (contentSize) { alignments.unshift({ name: "full" }); } if (wideSize) { alignments.unshift({ name: "wide", info: alignmentInfo.wide }); } } alignments.unshift({ name: "none", info: alignmentInfo.none }); return alignments; } }; // packages/block-editor/build-module/layouts/constrained.js var import_components13 = __toESM(require_components()); var import_i18n13 = __toESM(require_i18n()); var import_style_engine = __toESM(require_style_engine()); var import_jsx_runtime129 = __toESM(require_jsx_runtime()); var constrained_default = { name: "constrained", label: (0, import_i18n13.__)("Constrained"), inspectorControls: function DefaultLayoutInspectorControls2({ layout, onChange, layoutBlockSupport = {} }) { const { wideSize, contentSize, justifyContent = "center" } = layout; const { allowJustification = true, allowCustomContentAndWideSize = true } = layoutBlockSupport; const onJustificationChange = (value) => { onChange({ ...layout, justifyContent: value }); }; const justificationOptions = [ { value: "left", icon: justify_left_default, label: (0, import_i18n13.__)("Justify items left") }, { value: "center", icon: justify_center_default, label: (0, import_i18n13.__)("Justify items center") }, { value: "right", icon: justify_right_default, label: (0, import_i18n13.__)("Justify items right") } ]; const [availableUnits] = useSettings("spacing.units"); const units2 = (0, import_components13.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ["%", "px", "em", "rem", "vw"] }); return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)( import_components13.__experimentalVStack, { spacing: 4, className: "block-editor-hooks__layout-constrained", children: [ allowCustomContentAndWideSize && /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components13.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0, import_i18n13.__)("Content width"), labelPosition: "top", value: contentSize || wideSize || "", onChange: (nextWidth) => { nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth; onChange({ ...layout, contentSize: nextWidth !== "" ? nextWidth : void 0 }); }, units: units2, prefix: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_components13.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(icon_default, { icon: align_none_default }) }) } ), /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components13.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0, import_i18n13.__)("Wide width"), labelPosition: "top", value: wideSize || contentSize || "", onChange: (nextWidth) => { nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth; onChange({ ...layout, wideSize: nextWidth !== "" ? nextWidth : void 0 }); }, units: units2, prefix: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_components13.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(icon_default, { icon: stretch_wide_default }) }) } ), /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "block-editor-hooks__layout-constrained-helptext", children: (0, import_i18n13.__)( "Customize the width for all elements that are assigned to the center or wide columns." ) }) ] }), allowJustification && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components13.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, label: (0, import_i18n13.__)("Justification"), value: justifyContent, onChange: onJustificationChange, children: justificationOptions.map( ({ value, icon, label }) => { return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components13.__experimentalToggleGroupControlOptionIcon, { value, icon, label }, value ); } ) } ) ] } ); }, toolBarControls: function DefaultLayoutToolbarControls2({ layout = {}, onChange, layoutBlockSupport }) { const { allowJustification = true } = layoutBlockSupport; if (!allowJustification) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(block_controls_default, { group: "block", __experimentalShareWithChildBlocks: true, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( DefaultLayoutJustifyContentControl, { layout, onChange } ) }); }, getLayoutStyle: function getLayoutStyle3({ selector: selector3, layout = {}, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const { contentSize, wideSize, justifyContent } = layout; const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap); let blockGapValue = ""; if (!shouldSkipSerialization(blockName, "spacing", "blockGap")) { if (blockGapStyleValue?.top) { blockGapValue = getGapCSSValue(blockGapStyleValue?.top); } else if (typeof blockGapStyleValue === "string") { blockGapValue = getGapCSSValue(blockGapStyleValue); } } const marginLeft = justifyContent === "left" ? "0 !important" : "auto !important"; const marginRight = justifyContent === "right" ? "0 !important" : "auto !important"; let output = !!contentSize || !!wideSize ? ` ${appendSelectors( selector3, "> :where(:not(.alignleft):not(.alignright):not(.alignfull))" )} { max-width: ${contentSize ?? wideSize}; margin-left: ${marginLeft}; margin-right: ${marginRight}; } ${appendSelectors(selector3, "> .alignwide")} { max-width: ${wideSize ?? contentSize}; } ${appendSelectors(selector3, "> .alignfull")} { max-width: none; } ` : ""; if (justifyContent === "left") { output += `${appendSelectors( selector3, "> :where(:not(.alignleft):not(.alignright):not(.alignfull))" )} { margin-left: ${marginLeft}; }`; } else if (justifyContent === "right") { output += `${appendSelectors( selector3, "> :where(:not(.alignleft):not(.alignright):not(.alignfull))" )} { margin-right: ${marginRight}; }`; } if (style?.spacing?.padding) { const paddingValues = (0, import_style_engine.getCSSRules)(style); paddingValues.forEach((rule) => { if (rule.key === "paddingRight") { const paddingRightValue = rule.value === "0" ? "0px" : rule.value; output += ` ${appendSelectors(selector3, "> .alignfull")} { margin-right: calc(${paddingRightValue} * -1); } `; } else if (rule.key === "paddingLeft") { const paddingLeftValue = rule.value === "0" ? "0px" : rule.value; output += ` ${appendSelectors(selector3, "> .alignfull")} { margin-left: calc(${paddingLeftValue} * -1); } `; } }); } if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "constrained", blockGapValue ); } return output; }, getOrientation() { return "vertical"; }, getAlignments(layout) { const alignmentInfo = getAlignmentsInfo(layout); if (layout.alignments !== void 0) { if (!layout.alignments.includes("none")) { layout.alignments.unshift("none"); } return layout.alignments.map((alignment) => ({ name: alignment, info: alignmentInfo[alignment] })); } const { contentSize, wideSize } = layout; const alignments = [ { name: "left" }, { name: "center" }, { name: "right" } ]; if (contentSize) { alignments.unshift({ name: "full" }); } if (wideSize) { alignments.unshift({ name: "wide", info: alignmentInfo.wide }); } alignments.unshift({ name: "none", info: alignmentInfo.none }); return alignments; } }; var POPOVER_PROPS3 = { placement: "bottom-start" }; function DefaultLayoutJustifyContentControl({ layout, onChange }) { const { justifyContent = "center" } = layout; const onJustificationChange = (value) => { onChange({ ...layout, justifyContent: value }); }; const allowedControls = ["left", "center", "right"]; return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( JustifyContentControl, { allowedControls, value: justifyContent, onChange: onJustificationChange, popoverProps: POPOVER_PROPS3 } ); } // packages/block-editor/build-module/layouts/grid.js var import_i18n14 = __toESM(require_i18n()); var import_components15 = __toESM(require_components()); var import_element16 = __toESM(require_element()); var import_jsx_runtime130 = __toESM(require_jsx_runtime()); var RANGE_CONTROL_MAX_VALUES = { px: 600, "%": 100, vw: 100, vh: 100, em: 38, rem: 38, svw: 100, lvw: 100, dvw: 100, svh: 100, lvh: 100, dvh: 100, vi: 100, svi: 100, lvi: 100, dvi: 100, vb: 100, svb: 100, lvb: 100, dvb: 100, vmin: 100, svmin: 100, lvmin: 100, dvmin: 100, vmax: 100, svmax: 100, lvmax: 100, dvmax: 100 }; var units = [ { value: "px", label: "px", default: 0 }, { value: "rem", label: "rem", default: 0 }, { value: "em", label: "em", default: 0 } ]; var grid_default2 = { name: "grid", label: (0, import_i18n14.__)("Grid"), inspectorControls: function GridLayoutInspectorControls({ layout = {}, onChange, layoutBlockSupport = {} }) { const { allowSizingOnChildren = false } = layoutBlockSupport; const showColumnsControl = true; const showMinWidthControl = !layout?.isManualPlacement || window.__experimentalEnableGridInteractivity; return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [ window.__experimentalEnableGridInteractivity && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( GridLayoutTypeControl, { layout, onChange } ), /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_components15.__experimentalVStack, { spacing: 4, children: [ showColumnsControl && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( GridLayoutColumnsAndRowsControl, { layout, onChange, allowSizingOnChildren } ), showMinWidthControl && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( GridLayoutMinimumWidthControl, { layout, onChange } ) ] }) ] }); }, toolBarControls: function GridLayoutToolbarControls() { return null; }, getLayoutStyle: function getLayoutStyle4({ selector: selector3, layout, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const { minimumColumnWidth = null, columnCount = null, rowCount = null } = layout; if (true) { if (minimumColumnWidth && typeof minimumColumnWidth !== "string") { throw new Error("minimumColumnWidth must be a string"); } if (columnCount && typeof columnCount !== "number") { throw new Error("columnCount must be a number"); } if (rowCount && typeof rowCount !== "number") { throw new Error("rowCount must be a number"); } } const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, "spacing", "blockGap") ? getGapCSSValue(style?.spacing?.blockGap, "0.5em") : void 0; let output = ""; const rules = []; if (minimumColumnWidth && columnCount > 0) { const maxValue = `max(${minimumColumnWidth}, ( 100% - (${blockGapValue || "1.2rem"}*${columnCount - 1}) ) / ${columnCount})`; rules.push( `grid-template-columns: repeat(auto-fill, minmax(${maxValue}, 1fr))`, `container-type: inline-size` ); if (rowCount) { rules.push( `grid-template-rows: repeat(${rowCount}, minmax(1rem, auto))` ); } } else if (columnCount) { rules.push( `grid-template-columns: repeat(${columnCount}, minmax(0, 1fr))` ); if (rowCount) { rules.push( `grid-template-rows: repeat(${rowCount}, minmax(1rem, auto))` ); } } else { rules.push( `grid-template-columns: repeat(auto-fill, minmax(min(${minimumColumnWidth || "12rem"}, 100%), 1fr))`, "container-type: inline-size" ); } if (rules.length) { output = `${appendSelectors(selector3)} { ${rules.join( "; " )}; }`; } if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "grid", blockGapValue ); } return output; }, getOrientation() { return "horizontal"; }, getAlignments() { return []; } }; function GridLayoutMinimumWidthControl({ layout, onChange }) { const { minimumColumnWidth, columnCount, isManualPlacement } = layout; const defaultValue = isManualPlacement || columnCount ? null : "12rem"; const value = minimumColumnWidth || defaultValue; const [quantity, unit = "rem"] = (0, import_components15.__experimentalParseQuantityAndUnitFromRawValue)(value); const handleSliderChange = (next) => { onChange({ ...layout, minimumColumnWidth: [next, unit].join("") }); }; const handleUnitChange = (newUnit) => { let newValue; if (["em", "rem"].includes(newUnit) && unit === "px") { newValue = (quantity / 16).toFixed(2) + newUnit; } else if (["em", "rem"].includes(unit) && newUnit === "px") { newValue = Math.round(quantity * 16) + newUnit; } onChange({ ...layout, minimumColumnWidth: newValue }); }; return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-minimum-width-control", children: [ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components15.BaseControl.VisualLabel, { as: "legend", children: (0, import_i18n14.__)("Min. column width") }), /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_components15.Flex, { gap: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components15.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components15.__experimentalUnitControl, { size: "__unstable-large", onChange: (newValue) => { onChange({ ...layout, minimumColumnWidth: newValue === "" ? void 0 : newValue }); }, onUnitChange: handleUnitChange, value, units, min: 0, label: (0, import_i18n14.__)("Minimum column width"), hideLabelFromVision: true } ) }), /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components15.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components15.RangeControl, { __next40pxDefaultSize: true, onChange: handleSliderChange, value: quantity || 0, min: 0, max: RANGE_CONTROL_MAX_VALUES[unit] || 600, withInputField: false, label: (0, import_i18n14.__)("Minimum column width"), hideLabelFromVision: true } ) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "components-base-control__help", children: (0, import_i18n14.__)( "Columns will wrap to fewer per row when they can no longer maintain the minimum width." ) }) ] }); } function GridLayoutColumnsAndRowsControl({ layout, onChange, allowSizingOnChildren }) { const defaultColumnCount = void 0; const { columnCount = defaultColumnCount, rowCount, isManualPlacement } = layout; return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_jsx_runtime130.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-columns-and-rows-controls", children: [ !isManualPlacement && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components15.BaseControl.VisualLabel, { as: "legend", children: (0, import_i18n14.__)("Max. columns") }), /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_components15.Flex, { gap: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components15.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components15.__experimentalNumberControl, { size: "__unstable-large", onChange: (value) => { const defaultNewColumnCount = isManualPlacement ? 1 : void 0; const newColumnCount = value === "" || value === "0" ? defaultNewColumnCount : parseInt(value, 10); onChange({ ...layout, columnCount: newColumnCount }); }, value: columnCount, min: 1, label: (0, import_i18n14.__)("Columns"), hideLabelFromVision: !isManualPlacement } ) }), /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components15.FlexItem, { isBlock: true, children: allowSizingOnChildren && isManualPlacement ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components15.__experimentalNumberControl, { size: "__unstable-large", onChange: (value) => { const newRowCount = value === "" || value === "0" ? 1 : parseInt(value, 10); onChange({ ...layout, rowCount: newRowCount }); }, value: rowCount, min: 1, label: (0, import_i18n14.__)("Rows") } ) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components15.RangeControl, { __next40pxDefaultSize: true, value: columnCount ?? 1, onChange: (value) => onChange({ ...layout, columnCount: value === "" || value === "0" ? 1 : value }), min: 1, max: 16, withInputField: false, label: (0, import_i18n14.__)("Columns"), hideLabelFromVision: true } ) }) ] }) ] }) }); } function GridLayoutTypeControl({ layout, onChange }) { const { columnCount, rowCount, minimumColumnWidth, isManualPlacement } = layout; const [tempColumnCount, setTempColumnCount] = (0, import_element16.useState)( columnCount || 3 ); const [tempRowCount, setTempRowCount] = (0, import_element16.useState)(rowCount); const [tempMinimumColumnWidth, setTempMinimumColumnWidth] = (0, import_element16.useState)( minimumColumnWidth || "12rem" ); const gridPlacement = isManualPlacement ? "manual" : "auto"; const onChangeType = (value) => { if (value === "manual") { setTempMinimumColumnWidth(minimumColumnWidth || "12rem"); } else { setTempColumnCount(columnCount || 3); setTempRowCount(rowCount); } onChange({ ...layout, columnCount: value === "manual" ? tempColumnCount : tempColumnCount, rowCount: value === "manual" ? tempRowCount : void 0, isManualPlacement: value === "manual" ? true : void 0, minimumColumnWidth: value === "auto" ? tempMinimumColumnWidth : null }); }; const helpText2 = gridPlacement === "manual" ? (0, import_i18n14.__)( "Grid items can be manually placed in any position on the grid." ) : (0, import_i18n14.__)( "Grid items are placed automatically depending on their order." ); return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)( import_components15.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, label: (0, import_i18n14.__)("Grid item position"), value: gridPlacement, onChange: onChangeType, isBlock: true, help: helpText2, children: [ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components15.__experimentalToggleGroupControlOption, { value: "auto", label: (0, import_i18n14.__)("Auto") }, "auto" ), /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components15.__experimentalToggleGroupControlOption, { value: "manual", label: (0, import_i18n14.__)("Manual") }, "manual" ) ] } ); } // packages/block-editor/build-module/layouts/index.js var layoutTypes = [flow_default, flex_default, constrained_default, grid_default2]; function getLayoutType(name = "default") { return layoutTypes.find((layoutType) => layoutType.name === name); } function getLayoutTypes() { return layoutTypes; } // packages/block-editor/build-module/components/block-list/layout.js var import_jsx_runtime131 = __toESM(require_jsx_runtime()); var defaultLayout = { type: "default" }; var Layout = (0, import_element17.createContext)(defaultLayout); Layout.displayName = "BlockLayoutContext"; var LayoutProvider = Layout.Provider; function useLayout() { return (0, import_element17.useContext)(Layout); } function LayoutStyle({ layout = {}, css, ...props }) { const layoutType = getLayoutType(layout.type); const [blockGapSupport] = useSettings("spacing.blockGap"); const hasBlockGapSupport = blockGapSupport !== null; if (layoutType) { if (css) { return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("style", { children: css }); } const layoutStyle = layoutType.getLayoutStyle?.({ hasBlockGapSupport, layout, ...props }); if (layoutStyle) { return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("style", { children: layoutStyle }); } } return null; } // packages/block-editor/build-module/components/block-alignment-control/use-available-alignments.js var EMPTY_ARRAY4 = []; var DEFAULT_CONTROLS = ["none", "left", "center", "right", "wide", "full"]; var WIDE_CONTROLS = ["wide", "full"]; function useAvailableAlignments(controls = DEFAULT_CONTROLS) { if (!controls.includes("none")) { controls = ["none", ...controls]; } const isNoneOnly = controls.length === 1 && controls[0] === "none"; const [wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme] = (0, import_data11.useSelect)( (select3) => { if (isNoneOnly) { return [false, false, false]; } const settings2 = select3(store).getSettings(); return [ settings2.alignWide ?? false, settings2.supportsLayout, settings2.__unstableIsBlockBasedTheme ]; }, [isNoneOnly] ); const layout = useLayout(); if (isNoneOnly) { return EMPTY_ARRAY4; } const layoutType = getLayoutType(layout?.type); if (themeSupportsLayout) { const layoutAlignments = layoutType.getAlignments( layout, isBlockBasedTheme ); const alignments2 = layoutAlignments.filter( (alignment) => controls.includes(alignment.name) ); if (alignments2.length === 1 && alignments2[0].name === "none") { return EMPTY_ARRAY4; } return alignments2; } if (layoutType.name !== "default" && layoutType.name !== "constrained") { return EMPTY_ARRAY4; } const alignments = controls.filter((control) => { if (layout.alignments) { return layout.alignments.includes(control); } if (!wideControlsEnabled && WIDE_CONTROLS.includes(control)) { return false; } return DEFAULT_CONTROLS.includes(control); }).map((name) => ({ name })); if (alignments.length === 1 && alignments[0].name === "none") { return EMPTY_ARRAY4; } return alignments; } // packages/block-editor/build-module/components/block-alignment-control/constants.js var import_i18n15 = __toESM(require_i18n()); var BLOCK_ALIGNMENTS_CONTROLS = { none: { icon: align_none_default, title: (0, import_i18n15._x)("None", "Alignment option") }, left: { icon: position_left_default, title: (0, import_i18n15.__)("Align left") }, center: { icon: position_center_default, title: (0, import_i18n15.__)("Align center") }, right: { icon: position_right_default, title: (0, import_i18n15.__)("Align right") }, wide: { icon: stretch_wide_default, title: (0, import_i18n15.__)("Wide width") }, full: { icon: stretch_full_width_default, title: (0, import_i18n15.__)("Full width") } }; var DEFAULT_CONTROL = "none"; // packages/block-editor/build-module/components/block-alignment-control/ui.js var import_jsx_runtime132 = __toESM(require_jsx_runtime()); function BlockAlignmentUI({ value, onChange, controls, isToolbar, isCollapsed: isCollapsed3 = true }) { const enabledControls = useAvailableAlignments(controls); const hasEnabledControls = !!enabledControls.length; if (!hasEnabledControls) { return null; } function onChangeAlignment(align) { onChange([value, "none"].includes(align) ? void 0 : align); } const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[value]; const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL]; const UIComponent = isToolbar ? import_components16.ToolbarGroup : import_components16.ToolbarDropdownMenu; const commonProps = { icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon, label: (0, import_i18n16.__)("Align") }; const extraProps = isToolbar ? { isCollapsed: isCollapsed3, controls: enabledControls.map(({ name: controlName }) => { return { ...BLOCK_ALIGNMENTS_CONTROLS[controlName], isActive: value === controlName || !value && controlName === "none", role: isCollapsed3 ? "menuitemradio" : void 0, onClick: () => onChangeAlignment(controlName) }; }) } : { toggleProps: { description: (0, import_i18n16.__)("Change alignment") }, children: ({ onClose }) => { return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_jsx_runtime132.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components16.MenuGroup, { className: "block-editor-block-alignment-control__menu-group", children: enabledControls.map( ({ name: controlName, info }) => { const { icon, title } = BLOCK_ALIGNMENTS_CONTROLS[controlName]; const isSelected = controlName === value || !value && controlName === "none"; return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components16.MenuItem, { icon, iconPosition: "left", className: clsx_default( "components-dropdown-menu__menu-item", { "is-active": isSelected } ), isSelected, onClick: () => { onChangeAlignment( controlName ); onClose(); }, role: "menuitemradio", info, children: title }, controlName ); } ) }) }); } }; return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(UIComponent, { ...commonProps, ...extraProps }); } var ui_default2 = BlockAlignmentUI; // packages/block-editor/build-module/components/block-alignment-control/index.js var import_jsx_runtime133 = __toESM(require_jsx_runtime()); var BlockAlignmentControl = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(ui_default2, { ...props, isToolbar: false }); }; var BlockAlignmentToolbar = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(ui_default2, { ...props, isToolbar: true }); }; // packages/block-editor/build-module/components/block-bindings/attribute-control.js var import_es63 = __toESM(require_es6()); var import_i18n17 = __toESM(require_i18n()); var import_blocks14 = __toESM(require_blocks()); var import_components18 = __toESM(require_components()); var import_data14 = __toESM(require_data()); var import_element19 = __toESM(require_element()); var import_compose5 = __toESM(require_compose()); // packages/block-editor/build-module/components/block-bindings/source-fields-list.js var import_es62 = __toESM(require_es6()); var import_blocks13 = __toESM(require_blocks()); var import_components17 = __toESM(require_components()); var import_data13 = __toESM(require_data()); var import_element18 = __toESM(require_element()); var import_compose4 = __toESM(require_compose()); // packages/block-editor/build-module/components/block-bindings/use-block-bindings-utils.js var import_data12 = __toESM(require_data()); function isObjectEmpty(object) { return !object || Object.keys(object).length === 0; } function useBlockBindingsUtils(clientId) { const { clientId: contextClientId } = useBlockEditContext(); const blockClientId = clientId || contextClientId; const { updateBlockAttributes: updateBlockAttributes2 } = (0, import_data12.useDispatch)(store); const { getBlockAttributes: getBlockAttributes3 } = (0, import_data12.useRegistry)().select(store); const updateBlockBindings = (bindings) => { const { metadata: { bindings: currentBindings, ...metadata } = {} } = getBlockAttributes3(blockClientId); const newBindings = { ...currentBindings }; Object.entries(bindings).forEach(([attribute, binding]) => { if (!binding && newBindings[attribute]) { delete newBindings[attribute]; return; } newBindings[attribute] = binding; }); const newMetadata = { ...metadata, bindings: newBindings }; if (isObjectEmpty(newMetadata.bindings)) { delete newMetadata.bindings; } updateBlockAttributes2(blockClientId, { metadata: isObjectEmpty(newMetadata) ? void 0 : newMetadata }); }; const removeAllBlockBindings = () => { const { metadata: { bindings, ...metadata } = {} } = getBlockAttributes3(blockClientId); updateBlockAttributes2(blockClientId, { metadata: isObjectEmpty(metadata) ? void 0 : metadata }); }; return { updateBlockBindings, removeAllBlockBindings }; } // packages/block-editor/build-module/components/block-bindings/source-fields-list.js var import_jsx_runtime134 = __toESM(require_jsx_runtime()); var { Menu } = unlock(import_components17.privateApis); function BlockBindingsSourceFieldsListItem({ args, attribute, field, source, sourceKey }) { const itemBindings = (0, import_element18.useMemo)( () => ({ source: sourceKey, args: field.args || { key: field.key } }), [field.args, field.key, sourceKey] ); const blockContext = (0, import_element18.useContext)(block_context_default); const values = (0, import_data13.useSelect)( (select3) => source.getValues({ select: select3, context: blockContext, bindings: { [attribute]: itemBindings } }), [attribute, blockContext, itemBindings, source] ); const { updateBlockBindings } = useBlockBindingsUtils(); return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)( Menu.CheckboxItem, { onChange: () => { const isCurrentlySelected = (0, import_es62.default)(args, field.args) ?? // Deprecate key dependency in 7.0. field.key === args?.key; if (isCurrentlySelected) { updateBlockBindings({ [attribute]: void 0 }); } else { updateBlockBindings({ [attribute]: itemBindings }); } }, name: attribute + "-binding", value: values[attribute], checked: (0, import_es62.default)(args, field.args) ?? // Deprecate key dependency in 7.0. field.key === args?.key, children: [ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Menu.ItemLabel, { children: field.label }), /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Menu.ItemHelpText, { children: values[attribute] }) ] } ); } function BlockBindingsSourceFieldsList({ args, attribute, sourceKey, fields }) { const isMobile = (0, import_compose4.useViewportMatch)("medium", "<"); if (!fields || fields.length === 0) { return null; } const source = (0, import_blocks13.getBlockBindingsSource)(sourceKey); return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)( Menu, { placement: isMobile ? "bottom-start" : "left-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Menu.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Menu.ItemLabel, { children: source.label }) }), /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Menu.Popover, { gutter: 8, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Menu.Group, { children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)( BlockBindingsSourceFieldsListItem, { args, attribute, field, source, sourceKey }, sourceKey + JSON.stringify(field.args) || field.key )) }) }) ] }, sourceKey ); } // packages/block-editor/build-module/components/block-bindings/attribute-control.js var import_jsx_runtime135 = __toESM(require_jsx_runtime()); var { Menu: Menu2 } = unlock(import_components18.privateApis); function BlockBindingsAttributeControl({ attribute, binding, blockName }) { const { updateBlockBindings } = useBlockBindingsUtils(); const isMobile = (0, import_compose5.useViewportMatch)("medium", "<"); const blockContext = (0, import_element19.useContext)(block_context_default); const compatibleFields = (0, import_data14.useSelect)( (select3) => { const { getAllBlockBindingsSources, getBlockBindingsSourceFieldsList, getBlockType: getBlockType21 } = unlock(select3(import_blocks14.store)); const _attributeType = getBlockType21(blockName).attributes?.[attribute]?.type; const attributeType = _attributeType === "rich-text" ? "string" : _attributeType; const sourceFields = {}; Object.entries(getAllBlockBindingsSources()).forEach( ([sourceName, source2]) => { const fieldsList = getBlockBindingsSourceFieldsList( source2, blockContext ); if (!fieldsList?.length) { return; } const compatibleFieldsList = fieldsList.filter( (field) => field.type === attributeType ); if (compatibleFieldsList.length) { sourceFields[sourceName] = compatibleFieldsList; } } ); return sourceFields; }, [attribute, blockName, blockContext] ); const { canUpdateBlockBindings } = (0, import_data14.useSelect)((select3) => ({ canUpdateBlockBindings: select3(store).getSettings().canUpdateBlockBindings })); const hasCompatibleFields = Object.keys(compatibleFields).length > 0; const isAttributeReadOnly = !canUpdateBlockBindings || !hasCompatibleFields; const { source: boundSourceName, args } = binding || {}; const source = (0, import_blocks14.getBlockBindingsSource)(boundSourceName); let displayText; let isValid2 = true; if (binding === void 0) { if (!hasCompatibleFields) { displayText = (0, import_i18n17.__)("No sources available"); } else { displayText = (0, import_i18n17.__)("Not connected"); } isValid2 = true; } else if (!source) { isValid2 = false; displayText = (0, import_i18n17.__)("Source not registered"); } else { displayText = compatibleFields?.[boundSourceName]?.find( (field) => (0, import_es63.default)(field.args, args) )?.label || source?.label || boundSourceName; } return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( import_components18.__experimentalToolsPanelItem, { hasValue: () => !!binding, label: attribute, onDeselect: !!hasCompatibleFields && (() => { updateBlockBindings({ [attribute]: void 0 }); }), children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(Menu2, { placement: isMobile ? "bottom-start" : "left-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( Menu2.TriggerButton, { render: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_components18.__experimentalItem, {}), disabled: !hasCompatibleFields, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)( import_components18.__experimentalVStack, { className: "block-editor-bindings__item", spacing: 0, children: [ /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_components18.__experimentalText, { truncate: true, children: attribute }), /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( import_components18.__experimentalText, { truncate: true, variant: isValid2 ? "muted" : void 0, isDestructive: !isValid2, children: displayText } ) ] } ) } ), !isAttributeReadOnly && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Menu2.Popover, { gutter: isMobile ? 8 : 36, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( Menu2, { placement: isMobile ? "bottom-start" : "left-start", children: Object.entries(compatibleFields).map( ([sourceKey, fields]) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( BlockBindingsSourceFieldsList, { args: binding?.args, attribute, sourceKey, fields }, sourceKey ) ) } ) }) ] }) } ); } // packages/block-editor/build-module/components/block-full-height-alignment-control/index.js var import_i18n18 = __toESM(require_i18n()); var import_components19 = __toESM(require_components()); var import_jsx_runtime136 = __toESM(require_jsx_runtime()); function BlockFullHeightAlignmentControl({ isActive, label = (0, import_i18n18.__)("Full height"), onToggle, isDisabled }) { return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)( import_components19.ToolbarButton, { isActive, icon: fullscreen_default, label, onClick: () => onToggle(!isActive), disabled: isDisabled } ); } var block_full_height_alignment_control_default = BlockFullHeightAlignmentControl; // packages/block-editor/build-module/components/block-alignment-matrix-control/index.js var import_i18n19 = __toESM(require_i18n()); var import_keycodes = __toESM(require_keycodes()); var import_components20 = __toESM(require_components()); var import_jsx_runtime137 = __toESM(require_jsx_runtime()); var noop2 = () => { }; function BlockAlignmentMatrixControl(props) { const { label = (0, import_i18n19.__)("Change matrix alignment"), onChange = noop2, value = "center", isDisabled } = props; const icon = /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components20.AlignmentMatrixControl.Icon, { value }); return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)( import_components20.Dropdown, { popoverProps: { placement: "bottom-start" }, renderToggle: ({ onToggle, isOpen }) => { const openOnArrowDown = (event) => { if (!isOpen && event.keyCode === import_keycodes.DOWN) { event.preventDefault(); onToggle(); } }; return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)( import_components20.ToolbarButton, { onClick: onToggle, "aria-haspopup": "true", "aria-expanded": isOpen, onKeyDown: openOnArrowDown, label, icon, showTooltip: true, disabled: isDisabled } ); }, renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components20.AlignmentMatrixControl, { onChange, value }) } ); } var block_alignment_matrix_control_default = BlockAlignmentMatrixControl; // packages/block-editor/build-module/components/block-breadcrumb/index.js var import_components21 = __toESM(require_components()); var import_data16 = __toESM(require_data()); var import_i18n20 = __toESM(require_i18n()); var import_element22 = __toESM(require_element()); // packages/block-editor/build-module/components/block-title/use-block-display-title.js var import_data15 = __toESM(require_data()); var import_blocks15 = __toESM(require_blocks()); function useBlockDisplayTitle({ clientId, maximumLength, context }) { const blockTitle = (0, import_data15.useSelect)( (select3) => { if (!clientId) { return null; } const { getBlockName: getBlockName2, getBlockAttributes: getBlockAttributes3 } = select3(store); const { getBlockType: getBlockType21, getActiveBlockVariation } = select3(import_blocks15.store); const blockName = getBlockName2(clientId); const blockType = getBlockType21(blockName); if (!blockType) { return null; } const attributes = getBlockAttributes3(clientId); const label = (0, import_blocks15.__experimentalGetBlockLabel)(blockType, attributes, context); if (label !== blockType.title) { return label; } const match2 = getActiveBlockVariation(blockName, attributes); return match2?.title || blockType.title; }, [clientId, context] ); if (!blockTitle) { return null; } if (maximumLength && maximumLength > 0 && blockTitle.length > maximumLength) { const omission = "..."; return blockTitle.slice(0, maximumLength - omission.length) + omission; } return blockTitle; } // packages/block-editor/build-module/components/block-title/index.js function BlockTitle({ clientId, maximumLength, context }) { return useBlockDisplayTitle({ clientId, maximumLength, context }); } // packages/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js var import_element21 = __toESM(require_element()); var import_compose7 = __toESM(require_compose()); // packages/block-editor/build-module/components/provider/block-refs-provider.js var import_element20 = __toESM(require_element()); var import_compose6 = __toESM(require_compose()); var import_jsx_runtime138 = __toESM(require_jsx_runtime()); var BlockRefs = (0, import_element20.createContext)({ refsMap: (0, import_compose6.observableMap)() }); BlockRefs.displayName = "BlockRefsContext"; function BlockRefsProvider({ children }) { const value = (0, import_element20.useMemo)(() => ({ refsMap: (0, import_compose6.observableMap)() }), []); return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(BlockRefs.Provider, { value, children }); } // packages/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js function useBlockRefProvider(clientId) { const { refsMap } = (0, import_element21.useContext)(BlockRefs); return (0, import_compose7.useRefEffect)( (element) => { refsMap.set(clientId, element); return () => refsMap.delete(clientId); }, [clientId] ); } function assignRef(ref, value) { if (typeof ref === "function") { ref(value); } else if (ref) { ref.current = value; } } function useBlockElementRef(clientId, ref) { const { refsMap } = (0, import_element21.useContext)(BlockRefs); (0, import_element21.useLayoutEffect)(() => { assignRef(ref, refsMap.get(clientId)); const unsubscribe = refsMap.subscribe( clientId, () => assignRef(ref, refsMap.get(clientId)) ); return () => { unsubscribe(); assignRef(ref, null); }; }, [refsMap, clientId, ref]); } function useBlockElement(clientId) { const [blockElement, setBlockElement] = (0, import_element21.useState)(null); useBlockElementRef(clientId, setBlockElement); return blockElement; } // packages/block-editor/build-module/utils/get-editor-region.js function getEditorRegion(editor) { if (!editor) { return null; } const editorCanvas = Array.from( document.querySelectorAll('iframe[name="editor-canvas"]').values() ).find((iframe) => { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; return iframeDocument === editor.ownerDocument; }) ?? editor; return editorCanvas?.closest('[role="region"]') ?? editorCanvas; } // packages/block-editor/build-module/components/block-breadcrumb/index.js var import_jsx_runtime139 = __toESM(require_jsx_runtime()); function BlockBreadcrumb({ rootLabelText }) { const { selectBlock: selectBlock2, clearSelectedBlock: clearSelectedBlock2 } = (0, import_data16.useDispatch)(store); const { clientId, parents, hasSelection } = (0, import_data16.useSelect)((select3) => { const { getSelectionStart: getSelectionStart2, getSelectedBlockClientId: getSelectedBlockClientId2, getEnabledBlockParents: getEnabledBlockParents2 } = unlock(select3(store)); const selectedBlockClientId = getSelectedBlockClientId2(); return { parents: getEnabledBlockParents2(selectedBlockClientId), clientId: selectedBlockClientId, hasSelection: !!getSelectionStart2().clientId }; }, []); const rootLabel = rootLabelText || (0, import_i18n20._x)("Document", "noun, breadcrumb"); const blockRef = (0, import_element22.useRef)(); useBlockElementRef(clientId, blockRef); return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)( "ul", { className: "block-editor-block-breadcrumb", role: "list", "aria-label": (0, import_i18n20.__)("Block breadcrumb"), children: [ /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)( "li", { className: !hasSelection ? "block-editor-block-breadcrumb__current" : void 0, "aria-current": !hasSelection ? "true" : void 0, children: [ hasSelection && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( import_components21.Button, { size: "small", className: "block-editor-block-breadcrumb__button", onClick: () => { const blockEditor = blockRef.current?.closest( ".editor-styles-wrapper" ); clearSelectedBlock2(); getEditorRegion(blockEditor)?.focus(); }, children: rootLabel } ), !hasSelection && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { children: rootLabel }), !!clientId && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( icon_default, { icon: chevron_right_small_default, className: "block-editor-block-breadcrumb__separator" } ) ] } ), parents.map((parentClientId) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("li", { children: [ /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( import_components21.Button, { size: "small", className: "block-editor-block-breadcrumb__button", onClick: () => selectBlock2(parentClientId), children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( BlockTitle, { clientId: parentClientId, maximumLength: 35 } ) } ), /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( icon_default, { icon: chevron_right_small_default, className: "block-editor-block-breadcrumb__separator" } ) ] }, parentClientId)), !!clientId && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( "li", { className: "block-editor-block-breadcrumb__current", "aria-current": "true", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(BlockTitle, { clientId, maximumLength: 35 }) } ) ] } ); } var block_breadcrumb_default = BlockBreadcrumb; // packages/block-editor/build-module/components/block-content-overlay/index.js var import_data17 = __toESM(require_data()); function useBlockOverlayActive(clientId) { return (0, import_data17.useSelect)( (select3) => { const { __unstableHasActiveBlockOverlayActive: __unstableHasActiveBlockOverlayActive2 } = select3(store); return __unstableHasActiveBlockOverlayActive2(clientId); }, [clientId] ); } // packages/block-editor/build-module/components/block-canvas/index.js var import_compose66 = __toESM(require_compose()); var import_element124 = __toESM(require_element()); var import_data122 = __toESM(require_data()); // packages/block-editor/build-module/components/block-list/index.js var import_data75 = __toESM(require_data()); var import_compose55 = __toESM(require_compose()); var import_element89 = __toESM(require_element()); var import_blocks42 = __toESM(require_blocks()); // packages/block-editor/build-module/components/block-list/block.js var import_element31 = __toESM(require_element()); var import_blocks20 = __toESM(require_blocks()); var import_components24 = __toESM(require_components()); var import_data25 = __toESM(require_data()); var import_compose16 = __toESM(require_compose()); var import_dom7 = __toESM(require_dom()); // packages/block-editor/build-module/components/block-list/block-invalid-warning.js var import_i18n22 = __toESM(require_i18n()); var import_components23 = __toESM(require_components()); var import_element24 = __toESM(require_element()); var import_blocks17 = __toESM(require_blocks()); var import_data18 = __toESM(require_data()); // packages/block-editor/build-module/components/block-compare/index.js var import_character = __toESM(require_character()); var import_i18n21 = __toESM(require_i18n()); var import_blocks16 = __toESM(require_blocks()); // packages/block-editor/build-module/components/block-compare/block-view.js var import_components22 = __toESM(require_components()); var import_element23 = __toESM(require_element()); var import_dom = __toESM(require_dom()); var import_jsx_runtime140 = __toESM(require_jsx_runtime()); function BlockView({ title, rawContent, renderedContent, action, actionText, className }) { return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className, children: [ /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "block-editor-block-compare__content", children: [ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("h2", { className: "block-editor-block-compare__heading", children: title }), /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "block-editor-block-compare__html", children: rawContent }), /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "block-editor-block-compare__preview edit-post-visual-editor", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_element23.RawHTML, { children: (0, import_dom.safeHTML)(renderedContent) }) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "block-editor-block-compare__action", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)( import_components22.Button, { __next40pxDefaultSize: true, variant: "secondary", tabIndex: "0", onClick: action, children: actionText } ) }) ] }); } // packages/block-editor/build-module/components/block-compare/index.js var import_jsx_runtime141 = __toESM(require_jsx_runtime()); function BlockCompare({ block, onKeep, onConvert, convertor, convertButtonText }) { function getDifference(originalContent, newContent) { const difference2 = (0, import_character.diffChars)(originalContent, newContent); return difference2.map((item, pos) => { const classes = clsx_default({ "block-editor-block-compare__added": item.added, "block-editor-block-compare__removed": item.removed }); return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("span", { className: classes, children: item.value }, pos); }); } function getConvertedContent(convertedBlock) { const newBlocks = Array.isArray(convertedBlock) ? convertedBlock : [convertedBlock]; const newContent = newBlocks.map( (item) => (0, import_blocks16.getSaveContent)(item.name, item.attributes, item.innerBlocks) ); return newContent.join(""); } const converted = getConvertedContent(convertor(block)); const difference = getDifference(block.originalContent, converted); return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "block-editor-block-compare__wrapper", children: [ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( BlockView, { title: (0, import_i18n21.__)("Current"), className: "block-editor-block-compare__current", action: onKeep, actionText: (0, import_i18n21.__)("Convert to HTML"), rawContent: block.originalContent, renderedContent: block.originalContent } ), /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( BlockView, { title: (0, import_i18n21.__)("After Conversion"), className: "block-editor-block-compare__converted", action: onConvert, actionText: convertButtonText, rawContent: difference, renderedContent: converted } ) ] }); } var block_compare_default = BlockCompare; // packages/block-editor/build-module/components/block-list/block-invalid-warning.js var import_jsx_runtime142 = __toESM(require_jsx_runtime()); var blockToBlocks = (block) => (0, import_blocks17.rawHandler)({ HTML: block.originalContent }); function BlockInvalidWarning({ clientId }) { const { block, canInsertHTMLBlock, canInsertClassicBlock } = (0, import_data18.useSelect)( (select3) => { const { canInsertBlockType: canInsertBlockType2, getBlock: getBlock2, getBlockRootClientId: getBlockRootClientId2 } = select3(store); const rootClientId = getBlockRootClientId2(clientId); return { block: getBlock2(clientId), canInsertHTMLBlock: canInsertBlockType2( "core/html", rootClientId ), canInsertClassicBlock: canInsertBlockType2( "core/freeform", rootClientId ) }; }, [clientId] ); const { replaceBlock: replaceBlock2 } = (0, import_data18.useDispatch)(store); const [compare2, setCompare] = (0, import_element24.useState)(false); const onCompareClose = (0, import_element24.useCallback)(() => setCompare(false), []); const convert = (0, import_element24.useMemo)( () => ({ toClassic() { const classicBlock = (0, import_blocks17.createBlock)("core/freeform", { content: block.originalContent }); return replaceBlock2(block.clientId, classicBlock); }, toHTML() { const htmlBlock = (0, import_blocks17.createBlock)("core/html", { content: block.originalContent }); return replaceBlock2(block.clientId, htmlBlock); }, toBlocks() { const newBlocks = blockToBlocks(block); return replaceBlock2(block.clientId, newBlocks); }, toRecoveredBlock() { const recoveredBlock = (0, import_blocks17.createBlock)( block.name, block.attributes, block.innerBlocks ); return replaceBlock2(block.clientId, recoveredBlock); } }), [block, replaceBlock2] ); const secondaryActions = (0, import_element24.useMemo)( () => [ { // translators: Button to fix block content title: (0, import_i18n22._x)("Resolve", "imperative verb"), onClick: () => setCompare(true) }, canInsertHTMLBlock && { title: (0, import_i18n22.__)("Convert to HTML"), onClick: convert.toHTML }, canInsertClassicBlock && { title: (0, import_i18n22.__)("Convert to Classic Block"), onClick: convert.toClassic } ].filter(Boolean), [canInsertHTMLBlock, canInsertClassicBlock, convert] ); return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(import_jsx_runtime142.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)( warning_default, { actions: [ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)( import_components23.Button, { __next40pxDefaultSize: true, onClick: convert.toRecoveredBlock, variant: "primary", children: (0, import_i18n22.__)("Attempt recovery") }, "recover" ) ], secondaryActions, children: (0, import_i18n22.__)("Block contains unexpected or invalid content.") } ), compare2 && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)( import_components23.Modal, { title: ( // translators: Dialog title to fix block content (0, import_i18n22.__)("Resolve Block") ), onRequestClose: onCompareClose, className: "block-editor-block-compare", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)( block_compare_default, { block, onKeep: convert.toHTML, onConvert: convert.toBlocks, convertor: blockToBlocks, convertButtonText: (0, import_i18n22.__)("Convert to Blocks") } ) } ) ] }); } // packages/block-editor/build-module/components/block-list/block-crash-warning.js var import_i18n23 = __toESM(require_i18n()); var import_jsx_runtime143 = __toESM(require_jsx_runtime()); var warning = /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(warning_default, { className: "block-editor-block-list__block-crash-warning", children: (0, import_i18n23.__)("This block has encountered an error and cannot be previewed.") }); var block_crash_warning_default = () => warning; // packages/block-editor/build-module/components/block-list/block-crash-boundary.js var import_element25 = __toESM(require_element()); var BlockCrashBoundary = class extends import_element25.Component { constructor() { super(...arguments); this.state = { hasError: false }; } componentDidCatch() { this.setState({ hasError: true }); } render() { if (this.state.hasError) { return this.props.fallback; } return this.props.children; } }; var block_crash_boundary_default = BlockCrashBoundary; // packages/block-editor/build-module/components/block-list/block-html.js var import_react_autosize_textarea = __toESM(require_lib()); var import_element26 = __toESM(require_element()); var import_data19 = __toESM(require_data()); var import_blocks18 = __toESM(require_blocks()); var import_jsx_runtime144 = __toESM(require_jsx_runtime()); function BlockHTML({ clientId }) { const [html, setHtml] = (0, import_element26.useState)(""); const block = (0, import_data19.useSelect)( (select3) => select3(store).getBlock(clientId), [clientId] ); const { updateBlock: updateBlock2 } = (0, import_data19.useDispatch)(store); const onChange = () => { const blockType = (0, import_blocks18.getBlockType)(block.name); if (!blockType) { return; } const attributes = (0, import_blocks18.getBlockAttributes)( blockType, html, block.attributes ); const content = html ? html : (0, import_blocks18.getSaveContent)(blockType, attributes); const [isValid2] = html ? (0, import_blocks18.validateBlock)({ ...block, attributes, originalContent: content }) : [true]; updateBlock2(clientId, { attributes, originalContent: content, isValid: isValid2 }); if (!html) { setHtml(content); } }; (0, import_element26.useEffect)(() => { setHtml((0, import_blocks18.getBlockContent)(block)); }, [block]); return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)( import_react_autosize_textarea.default, { className: "block-editor-block-list__block-html-textarea", value: html, onBlur: onChange, onChange: (event) => setHtml(event.target.value) } ); } var block_html_default = BlockHTML; // packages/block-editor/build-module/components/block-list/use-block-props/index.js var import_element30 = __toESM(require_element()); var import_i18n24 = __toESM(require_i18n()); var import_blocks19 = __toESM(require_blocks()); var import_compose15 = __toESM(require_compose()); var import_warning4 = __toESM(require_warning()); // node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js var updateQueue = makeQueue(); var raf = (fn) => schedule(fn, updateQueue); var writeQueue = makeQueue(); raf.write = (fn) => schedule(fn, writeQueue); var onStartQueue = makeQueue(); raf.onStart = (fn) => schedule(fn, onStartQueue); var onFrameQueue = makeQueue(); raf.onFrame = (fn) => schedule(fn, onFrameQueue); var onFinishQueue = makeQueue(); raf.onFinish = (fn) => schedule(fn, onFinishQueue); var timeouts = []; raf.setTimeout = (handler, ms) => { let time = raf.now() + ms; let cancel = () => { let i2 = timeouts.findIndex((t3) => t3.cancel == cancel); if (~i2) timeouts.splice(i2, 1); pendingCount -= ~i2 ? 1 : 0; }; let timeout = { time, handler, cancel }; timeouts.splice(findTimeout(time), 0, timeout); pendingCount += 1; start(); return timeout; }; var findTimeout = (time) => ~(~timeouts.findIndex((t3) => t3.time > time) || ~timeouts.length); raf.cancel = (fn) => { onStartQueue.delete(fn); onFrameQueue.delete(fn); onFinishQueue.delete(fn); updateQueue.delete(fn); writeQueue.delete(fn); }; raf.sync = (fn) => { sync = true; raf.batchedUpdates(fn); sync = false; }; raf.throttle = (fn) => { let lastArgs; function queuedFn() { try { fn(...lastArgs); } finally { lastArgs = null; } } function throttled(...args) { lastArgs = args; raf.onStart(queuedFn); } throttled.handler = fn; throttled.cancel = () => { onStartQueue.delete(queuedFn); lastArgs = null; }; return throttled; }; var nativeRaf = typeof window != "undefined" ? window.requestAnimationFrame : () => { }; raf.use = (impl) => nativeRaf = impl; raf.now = typeof performance != "undefined" ? () => performance.now() : Date.now; raf.batchedUpdates = (fn) => fn(); raf.catch = console.error; raf.frameLoop = "always"; raf.advance = () => { if (raf.frameLoop !== "demand") { console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"); } else { update(); } }; var ts = -1; var pendingCount = 0; var sync = false; function schedule(fn, queue) { if (sync) { queue.delete(fn); fn(0); } else { queue.add(fn); start(); } } function start() { if (ts < 0) { ts = 0; if (raf.frameLoop !== "demand") { nativeRaf(loop); } } } function stop() { ts = -1; } function loop() { if (~ts) { nativeRaf(loop); raf.batchedUpdates(update); } } function update() { let prevTs = ts; ts = raf.now(); let count = findTimeout(ts); if (count) { eachSafely(timeouts.splice(0, count), (t3) => t3.handler()); pendingCount -= count; } if (!pendingCount) { stop(); return; } onStartQueue.flush(); updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667); onFrameQueue.flush(); writeQueue.flush(); onFinishQueue.flush(); } function makeQueue() { let next = /* @__PURE__ */ new Set(); let current = next; return { add(fn) { pendingCount += current == next && !next.has(fn) ? 1 : 0; next.add(fn); }, delete(fn) { pendingCount -= current == next && next.has(fn) ? 1 : 0; return next.delete(fn); }, flush(arg) { if (current.size) { next = /* @__PURE__ */ new Set(); pendingCount -= current.size; eachSafely(current, (fn) => fn(arg) && next.add(fn)); pendingCount += next.size; current = next; } } }; } function eachSafely(values, each2) { values.forEach((value) => { try { each2(value); } catch (e2) { raf.catch(e2); } }); } // node_modules/@react-spring/shared/dist/react-spring-shared.esm.js var import_react = __toESM(require_react()); function noop3() { } var defineHidden = (obj, key, value) => Object.defineProperty(obj, key, { value, writable: true, configurable: true }); var is = { arr: Array.isArray, obj: (a2) => !!a2 && a2.constructor.name === "Object", fun: (a2) => typeof a2 === "function", str: (a2) => typeof a2 === "string", num: (a2) => typeof a2 === "number", und: (a2) => a2 === void 0 }; function isEqual(a2, b2) { if (is.arr(a2)) { if (!is.arr(b2) || a2.length !== b2.length) return false; for (let i2 = 0; i2 < a2.length; i2++) { if (a2[i2] !== b2[i2]) return false; } return true; } return a2 === b2; } var each = (obj, fn) => obj.forEach(fn); function eachProp(obj, fn, ctx2) { if (is.arr(obj)) { for (let i2 = 0; i2 < obj.length; i2++) { fn.call(ctx2, obj[i2], `${i2}`); } return; } for (const key in obj) { if (obj.hasOwnProperty(key)) { fn.call(ctx2, obj[key], key); } } } var toArray = (a2) => is.und(a2) ? [] : is.arr(a2) ? a2 : [a2]; function flush(queue, iterator) { if (queue.size) { const items = Array.from(queue); queue.clear(); each(items, iterator); } } var flushCalls = (queue, ...args) => flush(queue, (fn) => fn(...args)); var isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent); var createStringInterpolator$1; var to; var colors$1 = null; var skipAnimation = false; var willAdvance = noop3; var assign = (globals2) => { if (globals2.to) to = globals2.to; if (globals2.now) raf.now = globals2.now; if (globals2.colors !== void 0) colors$1 = globals2.colors; if (globals2.skipAnimation != null) skipAnimation = globals2.skipAnimation; if (globals2.createStringInterpolator) createStringInterpolator$1 = globals2.createStringInterpolator; if (globals2.requestAnimationFrame) raf.use(globals2.requestAnimationFrame); if (globals2.batchedUpdates) raf.batchedUpdates = globals2.batchedUpdates; if (globals2.willAdvance) willAdvance = globals2.willAdvance; if (globals2.frameLoop) raf.frameLoop = globals2.frameLoop; }; var globals = /* @__PURE__ */ Object.freeze({ __proto__: null, get createStringInterpolator() { return createStringInterpolator$1; }, get to() { return to; }, get colors() { return colors$1; }, get skipAnimation() { return skipAnimation; }, get willAdvance() { return willAdvance; }, assign }); var startQueue = /* @__PURE__ */ new Set(); var currentFrame = []; var prevFrame = []; var priority = 0; var frameLoop = { get idle() { return !startQueue.size && !currentFrame.length; }, start(animation) { if (priority > animation.priority) { startQueue.add(animation); raf.onStart(flushStartQueue); } else { startSafely(animation); raf(advance); } }, advance, sort(animation) { if (priority) { raf.onFrame(() => frameLoop.sort(animation)); } else { const prevIndex = currentFrame.indexOf(animation); if (~prevIndex) { currentFrame.splice(prevIndex, 1); startUnsafely(animation); } } }, clear() { currentFrame = []; startQueue.clear(); } }; function flushStartQueue() { startQueue.forEach(startSafely); startQueue.clear(); raf(advance); } function startSafely(animation) { if (!currentFrame.includes(animation)) startUnsafely(animation); } function startUnsafely(animation) { currentFrame.splice(findIndex(currentFrame, (other) => other.priority > animation.priority), 0, animation); } function advance(dt) { const nextFrame = prevFrame; for (let i2 = 0; i2 < currentFrame.length; i2++) { const animation = currentFrame[i2]; priority = animation.priority; if (!animation.idle) { willAdvance(animation); animation.advance(dt); if (!animation.idle) { nextFrame.push(animation); } } } priority = 0; prevFrame = currentFrame; prevFrame.length = 0; currentFrame = nextFrame; return currentFrame.length > 0; } function findIndex(arr, test) { const index = arr.findIndex(test); return index < 0 ? arr.length : index; } var colors = { transparent: 0, aliceblue: 4042850303, antiquewhite: 4209760255, aqua: 16777215, aquamarine: 2147472639, azure: 4043309055, beige: 4126530815, bisque: 4293182719, black: 255, blanchedalmond: 4293643775, blue: 65535, blueviolet: 2318131967, brown: 2771004159, burlywood: 3736635391, burntsienna: 3934150143, cadetblue: 1604231423, chartreuse: 2147418367, chocolate: 3530104575, coral: 4286533887, cornflowerblue: 1687547391, cornsilk: 4294499583, crimson: 3692313855, cyan: 16777215, darkblue: 35839, darkcyan: 9145343, darkgoldenrod: 3095792639, darkgray: 2846468607, darkgreen: 6553855, darkgrey: 2846468607, darkkhaki: 3182914559, darkmagenta: 2332068863, darkolivegreen: 1433087999, darkorange: 4287365375, darkorchid: 2570243327, darkred: 2332033279, darksalmon: 3918953215, darkseagreen: 2411499519, darkslateblue: 1211993087, darkslategray: 793726975, darkslategrey: 793726975, darkturquoise: 13554175, darkviolet: 2483082239, deeppink: 4279538687, deepskyblue: 12582911, dimgray: 1768516095, dimgrey: 1768516095, dodgerblue: 512819199, firebrick: 2988581631, floralwhite: 4294635775, forestgreen: 579543807, fuchsia: 4278255615, gainsboro: 3705462015, ghostwhite: 4177068031, gold: 4292280575, goldenrod: 3668254975, gray: 2155905279, green: 8388863, greenyellow: 2919182335, grey: 2155905279, honeydew: 4043305215, hotpink: 4285117695, indianred: 3445382399, indigo: 1258324735, ivory: 4294963455, khaki: 4041641215, lavender: 3873897215, lavenderblush: 4293981695, lawngreen: 2096890111, lemonchiffon: 4294626815, lightblue: 2916673279, lightcoral: 4034953471, lightcyan: 3774873599, lightgoldenrodyellow: 4210742015, lightgray: 3553874943, lightgreen: 2431553791, lightgrey: 3553874943, lightpink: 4290167295, lightsalmon: 4288707327, lightseagreen: 548580095, lightskyblue: 2278488831, lightslategray: 2005441023, lightslategrey: 2005441023, lightsteelblue: 2965692159, lightyellow: 4294959359, lime: 16711935, limegreen: 852308735, linen: 4210091775, magenta: 4278255615, maroon: 2147483903, mediumaquamarine: 1724754687, mediumblue: 52735, mediumorchid: 3126187007, mediumpurple: 2473647103, mediumseagreen: 1018393087, mediumslateblue: 2070474495, mediumspringgreen: 16423679, mediumturquoise: 1221709055, mediumvioletred: 3340076543, midnightblue: 421097727, mintcream: 4127193855, mistyrose: 4293190143, moccasin: 4293178879, navajowhite: 4292783615, navy: 33023, oldlace: 4260751103, olive: 2155872511, olivedrab: 1804477439, orange: 4289003775, orangered: 4282712319, orchid: 3664828159, palegoldenrod: 4008225535, palegreen: 2566625535, paleturquoise: 2951671551, palevioletred: 3681588223, papayawhip: 4293907967, peachpuff: 4292524543, peru: 3448061951, pink: 4290825215, plum: 3718307327, powderblue: 2967529215, purple: 2147516671, rebeccapurple: 1714657791, red: 4278190335, rosybrown: 3163525119, royalblue: 1097458175, saddlebrown: 2336560127, salmon: 4202722047, sandybrown: 4104413439, seagreen: 780883967, seashell: 4294307583, sienna: 2689740287, silver: 3233857791, skyblue: 2278484991, slateblue: 1784335871, slategray: 1887473919, slategrey: 1887473919, snow: 4294638335, springgreen: 16744447, steelblue: 1182971135, tan: 3535047935, teal: 8421631, thistle: 3636451583, tomato: 4284696575, turquoise: 1088475391, violet: 4001558271, wheat: 4125012991, white: 4294967295, whitesmoke: 4126537215, yellow: 4294902015, yellowgreen: 2597139199 }; var NUMBER = "[-+]?\\d*\\.?\\d+"; var PERCENTAGE = NUMBER + "%"; function call(...parts) { return "\\(\\s*(" + parts.join(")\\s*,\\s*(") + ")\\s*\\)"; } var rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER)); var rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER)); var hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE)); var hsla = new RegExp("hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)); var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex6 = /^#([0-9a-fA-F]{6})$/; var hex8 = /^#([0-9a-fA-F]{8})$/; function normalizeColor(color) { let match2; if (typeof color === "number") { return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null; } if (match2 = hex6.exec(color)) return parseInt(match2[1] + "ff", 16) >>> 0; if (colors$1 && colors$1[color] !== void 0) { return colors$1[color]; } if (match2 = rgb.exec(color)) { return (parse255(match2[1]) << 24 | parse255(match2[2]) << 16 | parse255(match2[3]) << 8 | 255) >>> 0; } if (match2 = rgba.exec(color)) { return (parse255(match2[1]) << 24 | parse255(match2[2]) << 16 | parse255(match2[3]) << 8 | parse1(match2[4])) >>> 0; } if (match2 = hex3.exec(color)) { return parseInt(match2[1] + match2[1] + match2[2] + match2[2] + match2[3] + match2[3] + "ff", 16) >>> 0; } if (match2 = hex8.exec(color)) return parseInt(match2[1], 16) >>> 0; if (match2 = hex4.exec(color)) { return parseInt(match2[1] + match2[1] + match2[2] + match2[2] + match2[3] + match2[3] + match2[4] + match2[4], 16) >>> 0; } if (match2 = hsl.exec(color)) { return (hslToRgb(parse360(match2[1]), parsePercentage(match2[2]), parsePercentage(match2[3])) | 255) >>> 0; } if (match2 = hsla.exec(color)) { return (hslToRgb(parse360(match2[1]), parsePercentage(match2[2]), parsePercentage(match2[3])) | parse1(match2[4])) >>> 0; } return null; } function hue2rgb(p2, q, t3) { if (t3 < 0) t3 += 1; if (t3 > 1) t3 -= 1; if (t3 < 1 / 6) return p2 + (q - p2) * 6 * t3; if (t3 < 1 / 2) return q; if (t3 < 2 / 3) return p2 + (q - p2) * (2 / 3 - t3) * 6; return p2; } function hslToRgb(h2, s2, l2) { const q = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2; const p2 = 2 * l2 - q; const r3 = hue2rgb(p2, q, h2 + 1 / 3); const g2 = hue2rgb(p2, q, h2); const b2 = hue2rgb(p2, q, h2 - 1 / 3); return Math.round(r3 * 255) << 24 | Math.round(g2 * 255) << 16 | Math.round(b2 * 255) << 8; } function parse255(str) { const int = parseInt(str, 10); if (int < 0) return 0; if (int > 255) return 255; return int; } function parse360(str) { const int = parseFloat(str); return (int % 360 + 360) % 360 / 360; } function parse1(str) { const num = parseFloat(str); if (num < 0) return 0; if (num > 1) return 255; return Math.round(num * 255); } function parsePercentage(str) { const int = parseFloat(str); if (int < 0) return 0; if (int > 100) return 1; return int / 100; } function colorToRgba(input) { let int32Color = normalizeColor(input); if (int32Color === null) return input; int32Color = int32Color || 0; let r3 = (int32Color & 4278190080) >>> 24; let g2 = (int32Color & 16711680) >>> 16; let b2 = (int32Color & 65280) >>> 8; let a2 = (int32Color & 255) / 255; return `rgba(${r3}, ${g2}, ${b2}, ${a2})`; } var createInterpolator = (range2, output, extrapolate) => { if (is.fun(range2)) { return range2; } if (is.arr(range2)) { return createInterpolator({ range: range2, output, extrapolate }); } if (is.str(range2.output[0])) { return createStringInterpolator$1(range2); } const config2 = range2; const outputRange = config2.output; const inputRange = config2.range || [0, 1]; const extrapolateLeft = config2.extrapolateLeft || config2.extrapolate || "extend"; const extrapolateRight = config2.extrapolateRight || config2.extrapolate || "extend"; const easing = config2.easing || ((t3) => t3); return (input) => { const range3 = findRange(input, inputRange); return interpolate(input, inputRange[range3], inputRange[range3 + 1], outputRange[range3], outputRange[range3 + 1], easing, extrapolateLeft, extrapolateRight, config2.map); }; }; function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) { let result = map ? map(input) : input; if (result < inputMin) { if (extrapolateLeft === "identity") return result; else if (extrapolateLeft === "clamp") result = inputMin; } if (result > inputMax) { if (extrapolateRight === "identity") return result; else if (extrapolateRight === "clamp") result = inputMax; } if (outputMin === outputMax) return outputMin; if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; if (inputMin === -Infinity) result = -result; else if (inputMax === Infinity) result = result - inputMin; else result = (result - inputMin) / (inputMax - inputMin); result = easing(result); if (outputMin === -Infinity) result = -result; else if (outputMax === Infinity) result = result + outputMin; else result = result * (outputMax - outputMin) + outputMin; return result; } function findRange(input, inputRange) { for (var i2 = 1; i2 < inputRange.length - 1; ++i2) if (inputRange[i2] >= input) break; return i2 - 1; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var $get = Symbol.for("FluidValue.get"); var $observers = Symbol.for("FluidValue.observers"); var hasFluidValue = (arg) => Boolean(arg && arg[$get]); var getFluidValue = (arg) => arg && arg[$get] ? arg[$get]() : arg; var getFluidObservers = (target) => target[$observers] || null; function callFluidObserver(observer, event) { if (observer.eventObserved) { observer.eventObserved(event); } else { observer(event); } } function callFluidObservers(target, event) { let observers = target[$observers]; if (observers) { observers.forEach((observer) => { callFluidObserver(observer, event); }); } } var FluidValue = class { constructor(get) { this[$get] = void 0; this[$observers] = void 0; if (!get && !(get = this.get)) { throw Error("Unknown getter"); } setFluidGetter(this, get); } }; var setFluidGetter = (target, get) => setHidden(target, $get, get); function addFluidObserver(target, observer) { if (target[$get]) { let observers = target[$observers]; if (!observers) { setHidden(target, $observers, observers = /* @__PURE__ */ new Set()); } if (!observers.has(observer)) { observers.add(observer); if (target.observerAdded) { target.observerAdded(observers.size, observer); } } } return observer; } function removeFluidObserver(target, observer) { let observers = target[$observers]; if (observers && observers.has(observer)) { const count = observers.size - 1; if (count) { observers.delete(observer); } else { target[$observers] = null; } if (target.observerRemoved) { target.observerRemoved(count, observer); } } } var setHidden = (target, key, value) => Object.defineProperty(target, key, { value, writable: true, configurable: true }); var numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; var unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, "i"); var rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi; var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; var variableToRgba = (input) => { const [token, fallback] = parseCSSVariable(input); if (!token || isSSR()) { return input; } const value = window.getComputedStyle(document.documentElement).getPropertyValue(token); if (value) { return value.trim(); } else if (fallback && fallback.startsWith("--")) { const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback); if (_value) { return _value; } else { return input; } } else if (fallback && cssVariableRegex.test(fallback)) { return variableToRgba(fallback); } else if (fallback) { return fallback; } return input; }; var parseCSSVariable = (current) => { const match2 = cssVariableRegex.exec(current); if (!match2) return [,]; const [, token, fallback] = match2; return [token, fallback]; }; var namedColorRegex; var rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`; var createStringInterpolator = (config2) => { if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join("|")})(?!\\w)`, "g") : /^\b$/; const output = config2.output.map((value) => { return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba); }); const keyframes = output.map((value) => value.match(numberRegex).map(Number)); const outputRanges = keyframes[0].map((_, i2) => keyframes.map((values) => { if (!(i2 in values)) { throw Error('The arity of each "output" value must be equal'); } return values[i2]; })); const interpolators = outputRanges.map((output2) => createInterpolator(_extends({}, config2, { output: output2 }))); return (input) => { var _output$find; const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find((value) => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, "")); let i2 = 0; return output[0].replace(numberRegex, () => `${interpolators[i2++](input)}${missingUnit || ""}`).replace(rgbaRegex, rgbaRound); }; }; var prefix = "react-spring: "; var once = (fn) => { const func = fn; let called = false; if (typeof func != "function") { throw new TypeError(`${prefix}once requires a function parameter`); } return (...args) => { if (!called) { func(...args); called = true; } }; }; var warnInterpolate = once(console.warn); function deprecateInterpolate() { warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`); } var warnDirectCall = once(console.warn); function isAnimatedString(value) { return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {})); } var useIsomorphicLayoutEffect = isSSR() ? import_react.useEffect : import_react.useLayoutEffect; var useIsMounted = () => { const isMounted = (0, import_react.useRef)(false); useIsomorphicLayoutEffect(() => { isMounted.current = true; return () => { isMounted.current = false; }; }, []); return isMounted; }; function useForceUpdate() { const update3 = (0, import_react.useState)()[1]; const isMounted = useIsMounted(); return () => { if (isMounted.current) { update3(Math.random()); } }; } function useMemoOne(getResult, inputs) { const [initial] = (0, import_react.useState)(() => ({ inputs, result: getResult() })); const committed = (0, import_react.useRef)(); const prevCache = committed.current; let cache = prevCache; if (cache) { const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs)); if (!useCache) { cache = { inputs, result: getResult() }; } } else { cache = initial; } (0, import_react.useEffect)(() => { committed.current = cache; if (prevCache == initial) { initial.inputs = initial.result = void 0; } }, [cache]); return cache.result; } function areInputsEqual(next, prev) { if (next.length !== prev.length) { return false; } for (let i2 = 0; i2 < next.length; i2++) { if (next[i2] !== prev[i2]) { return false; } } return true; } var useOnce = (effect) => (0, import_react.useEffect)(effect, emptyDeps); var emptyDeps = []; // node_modules/@react-spring/core/dist/react-spring-core.esm.js var React2 = __toESM(require_react()); var import_react3 = __toESM(require_react()); // node_modules/@react-spring/animated/dist/react-spring-animated.esm.js var React = __toESM(require_react()); var import_react2 = __toESM(require_react()); var $node = Symbol.for("Animated:node"); var isAnimated = (value) => !!value && value[$node] === value; var getAnimated = (owner) => owner && owner[$node]; var setAnimated = (owner, node) => defineHidden(owner, $node, node); var getPayload = (owner) => owner && owner[$node] && owner[$node].getPayload(); var Animated = class { constructor() { this.payload = void 0; setAnimated(this, this); } getPayload() { return this.payload || []; } }; var AnimatedValue = class _AnimatedValue extends Animated { constructor(_value) { super(); this.done = true; this.elapsedTime = void 0; this.lastPosition = void 0; this.lastVelocity = void 0; this.v0 = void 0; this.durationProgress = 0; this._value = _value; if (is.num(this._value)) { this.lastPosition = this._value; } } static create(value) { return new _AnimatedValue(value); } getPayload() { return [this]; } getValue() { return this._value; } setValue(value, step) { if (is.num(value)) { this.lastPosition = value; if (step) { value = Math.round(value / step) * step; if (this.done) { this.lastPosition = value; } } } if (this._value === value) { return false; } this._value = value; return true; } reset() { const { done } = this; this.done = false; if (is.num(this._value)) { this.elapsedTime = 0; this.durationProgress = 0; this.lastPosition = this._value; if (done) this.lastVelocity = null; this.v0 = null; } } }; var AnimatedString = class _AnimatedString extends AnimatedValue { constructor(value) { super(0); this._string = null; this._toString = void 0; this._toString = createInterpolator({ output: [value, value] }); } static create(value) { return new _AnimatedString(value); } getValue() { let value = this._string; return value == null ? this._string = this._toString(this._value) : value; } setValue(value) { if (is.str(value)) { if (value == this._string) { return false; } this._string = value; this._value = 1; } else if (super.setValue(value)) { this._string = null; } else { return false; } return true; } reset(goal) { if (goal) { this._toString = createInterpolator({ output: [this.getValue(), goal] }); } this._value = 0; super.reset(); } }; var TreeContext = { dependencies: null }; var AnimatedObject = class extends Animated { constructor(source) { super(); this.source = source; this.setValue(source); } getValue(animated2) { const values = {}; eachProp(this.source, (source, key) => { if (isAnimated(source)) { values[key] = source.getValue(animated2); } else if (hasFluidValue(source)) { values[key] = getFluidValue(source); } else if (!animated2) { values[key] = source; } }); return values; } setValue(source) { this.source = source; this.payload = this._makePayload(source); } reset() { if (this.payload) { each(this.payload, (node) => node.reset()); } } _makePayload(source) { if (source) { const payload = /* @__PURE__ */ new Set(); eachProp(source, this._addToPayload, payload); return Array.from(payload); } } _addToPayload(source) { if (TreeContext.dependencies && hasFluidValue(source)) { TreeContext.dependencies.add(source); } const payload = getPayload(source); if (payload) { each(payload, (node) => this.add(node)); } } }; var AnimatedArray = class _AnimatedArray extends AnimatedObject { constructor(source) { super(source); } static create(source) { return new _AnimatedArray(source); } getValue() { return this.source.map((node) => node.getValue()); } setValue(source) { const payload = this.getPayload(); if (source.length == payload.length) { return payload.map((node, i2) => node.setValue(source[i2])).some(Boolean); } super.setValue(source.map(makeAnimated)); return true; } }; function makeAnimated(value) { const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue; return nodeType.create(value); } function getAnimatedType(value) { const parentNode = getAnimated(value); return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue; } function _extends2() { _extends2 = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends2.apply(this, arguments); } var withAnimated = (Component7, host2) => { const hasInstance = !is.fun(Component7) || Component7.prototype && Component7.prototype.isReactComponent; return (0, import_react2.forwardRef)((givenProps, givenRef) => { const instanceRef = (0, import_react2.useRef)(null); const ref = hasInstance && (0, import_react2.useCallback)((value) => { instanceRef.current = updateRef(givenRef, value); }, [givenRef]); const [props, deps] = getAnimatedState(givenProps, host2); const forceUpdate = useForceUpdate(); const callback = () => { const instance = instanceRef.current; if (hasInstance && !instance) { return; } const didUpdate = instance ? host2.applyAnimatedValues(instance, props.getValue(true)) : false; if (didUpdate === false) { forceUpdate(); } }; const observer = new PropsObserver(callback, deps); const observerRef = (0, import_react2.useRef)(); useIsomorphicLayoutEffect(() => { observerRef.current = observer; each(deps, (dep) => addFluidObserver(dep, observer)); return () => { if (observerRef.current) { each(observerRef.current.deps, (dep) => removeFluidObserver(dep, observerRef.current)); raf.cancel(observerRef.current.update); } }; }); (0, import_react2.useEffect)(callback, []); useOnce(() => () => { const observer2 = observerRef.current; each(observer2.deps, (dep) => removeFluidObserver(dep, observer2)); }); const usedProps = host2.getComponentProps(props.getValue()); return React.createElement(Component7, _extends2({}, usedProps, { ref })); }); }; var PropsObserver = class { constructor(update3, deps) { this.update = update3; this.deps = deps; } eventObserved(event) { if (event.type == "change") { raf.write(this.update); } } }; function getAnimatedState(props, host2) { const dependencies = /* @__PURE__ */ new Set(); TreeContext.dependencies = dependencies; if (props.style) props = _extends2({}, props, { style: host2.createAnimatedStyle(props.style) }); props = new AnimatedObject(props); TreeContext.dependencies = null; return [props, dependencies]; } function updateRef(ref, value) { if (ref) { if (is.fun(ref)) ref(value); else ref.current = value; } return value; } var cacheKey = Symbol.for("AnimatedComponent"); var createHost = (components, { applyAnimatedValues: _applyAnimatedValues = () => false, createAnimatedStyle: _createAnimatedStyle = (style) => new AnimatedObject(style), getComponentProps: _getComponentProps = (props) => props } = {}) => { const hostConfig = { applyAnimatedValues: _applyAnimatedValues, createAnimatedStyle: _createAnimatedStyle, getComponentProps: _getComponentProps }; const animated2 = (Component7) => { const displayName = getDisplayName(Component7) || "Anonymous"; if (is.str(Component7)) { Component7 = animated2[Component7] || (animated2[Component7] = withAnimated(Component7, hostConfig)); } else { Component7 = Component7[cacheKey] || (Component7[cacheKey] = withAnimated(Component7, hostConfig)); } Component7.displayName = `Animated(${displayName})`; return Component7; }; eachProp(components, (Component7, key) => { if (is.arr(components)) { key = getDisplayName(Component7); } animated2[key] = animated2(Component7); }); return { animated: animated2 }; }; var getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null; // node_modules/@react-spring/core/dist/react-spring-core.esm.js function _extends3() { _extends3 = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends3.apply(this, arguments); } function callProp(value, ...args) { return is.fun(value) ? value(...args) : value; } var matchProp = (value, key) => value === true || !!(key && value && (is.fun(value) ? value(key) : toArray(value).includes(key))); var resolveProp = (prop, key) => is.obj(prop) ? key && prop[key] : prop; var getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : void 0; var noopTransform = (value) => value; var getDefaultProps = (props, transform = noopTransform) => { let keys = DEFAULT_PROPS; if (props.default && props.default !== true) { props = props.default; keys = Object.keys(props); } const defaults2 = {}; for (const key of keys) { const value = transform(props[key], key); if (!is.und(value)) { defaults2[key] = value; } } return defaults2; }; var DEFAULT_PROPS = ["config", "onProps", "onStart", "onChange", "onPause", "onResume", "onRest"]; var RESERVED_PROPS = { config: 1, from: 1, to: 1, ref: 1, loop: 1, reset: 1, pause: 1, cancel: 1, reverse: 1, immediate: 1, default: 1, delay: 1, onProps: 1, onStart: 1, onChange: 1, onPause: 1, onResume: 1, onRest: 1, onResolve: 1, items: 1, trail: 1, sort: 1, expires: 1, initial: 1, enter: 1, update: 1, leave: 1, children: 1, onDestroyed: 1, keys: 1, callId: 1, parentId: 1 }; function getForwardProps(props) { const forward = {}; let count = 0; eachProp(props, (value, prop) => { if (!RESERVED_PROPS[prop]) { forward[prop] = value; count++; } }); if (count) { return forward; } } function inferTo(props) { const to2 = getForwardProps(props); if (to2) { const out = { to: to2 }; eachProp(props, (val, key) => key in to2 || (out[key] = val)); return out; } return _extends3({}, props); } function computeGoal(value) { value = getFluidValue(value); return is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) ? globals.createStringInterpolator({ range: [0, 1], output: [value, value] })(1) : value; } function isAsyncTo(to2) { return is.fun(to2) || is.arr(to2) && is.obj(to2[0]); } var config = { default: { tension: 170, friction: 26 }, gentle: { tension: 120, friction: 14 }, wobbly: { tension: 180, friction: 12 }, stiff: { tension: 210, friction: 20 }, slow: { tension: 280, friction: 60 }, molasses: { tension: 280, friction: 120 } }; var c1 = 1.70158; var c2 = c1 * 1.525; var c3 = c1 + 1; var c4 = 2 * Math.PI / 3; var c5 = 2 * Math.PI / 4.5; var bounceOut = (x2) => { const n1 = 7.5625; const d1 = 2.75; if (x2 < 1 / d1) { return n1 * x2 * x2; } else if (x2 < 2 / d1) { return n1 * (x2 -= 1.5 / d1) * x2 + 0.75; } else if (x2 < 2.5 / d1) { return n1 * (x2 -= 2.25 / d1) * x2 + 0.9375; } else { return n1 * (x2 -= 2.625 / d1) * x2 + 0.984375; } }; var easings = { linear: (x2) => x2, easeInQuad: (x2) => x2 * x2, easeOutQuad: (x2) => 1 - (1 - x2) * (1 - x2), easeInOutQuad: (x2) => x2 < 0.5 ? 2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 2) / 2, easeInCubic: (x2) => x2 * x2 * x2, easeOutCubic: (x2) => 1 - Math.pow(1 - x2, 3), easeInOutCubic: (x2) => x2 < 0.5 ? 4 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 3) / 2, easeInQuart: (x2) => x2 * x2 * x2 * x2, easeOutQuart: (x2) => 1 - Math.pow(1 - x2, 4), easeInOutQuart: (x2) => x2 < 0.5 ? 8 * x2 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 4) / 2, easeInQuint: (x2) => x2 * x2 * x2 * x2 * x2, easeOutQuint: (x2) => 1 - Math.pow(1 - x2, 5), easeInOutQuint: (x2) => x2 < 0.5 ? 16 * x2 * x2 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 5) / 2, easeInSine: (x2) => 1 - Math.cos(x2 * Math.PI / 2), easeOutSine: (x2) => Math.sin(x2 * Math.PI / 2), easeInOutSine: (x2) => -(Math.cos(Math.PI * x2) - 1) / 2, easeInExpo: (x2) => x2 === 0 ? 0 : Math.pow(2, 10 * x2 - 10), easeOutExpo: (x2) => x2 === 1 ? 1 : 1 - Math.pow(2, -10 * x2), easeInOutExpo: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : x2 < 0.5 ? Math.pow(2, 20 * x2 - 10) / 2 : (2 - Math.pow(2, -20 * x2 + 10)) / 2, easeInCirc: (x2) => 1 - Math.sqrt(1 - Math.pow(x2, 2)), easeOutCirc: (x2) => Math.sqrt(1 - Math.pow(x2 - 1, 2)), easeInOutCirc: (x2) => x2 < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x2, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x2 + 2, 2)) + 1) / 2, easeInBack: (x2) => c3 * x2 * x2 * x2 - c1 * x2 * x2, easeOutBack: (x2) => 1 + c3 * Math.pow(x2 - 1, 3) + c1 * Math.pow(x2 - 1, 2), easeInOutBack: (x2) => x2 < 0.5 ? Math.pow(2 * x2, 2) * ((c2 + 1) * 2 * x2 - c2) / 2 : (Math.pow(2 * x2 - 2, 2) * ((c2 + 1) * (x2 * 2 - 2) + c2) + 2) / 2, easeInElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : -Math.pow(2, 10 * x2 - 10) * Math.sin((x2 * 10 - 10.75) * c4), easeOutElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : Math.pow(2, -10 * x2) * Math.sin((x2 * 10 - 0.75) * c4) + 1, easeInOutElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : x2 < 0.5 ? -(Math.pow(2, 20 * x2 - 10) * Math.sin((20 * x2 - 11.125) * c5)) / 2 : Math.pow(2, -20 * x2 + 10) * Math.sin((20 * x2 - 11.125) * c5) / 2 + 1, easeInBounce: (x2) => 1 - bounceOut(1 - x2), easeOutBounce: bounceOut, easeInOutBounce: (x2) => x2 < 0.5 ? (1 - bounceOut(1 - 2 * x2)) / 2 : (1 + bounceOut(2 * x2 - 1)) / 2 }; var defaults = _extends3({}, config.default, { mass: 1, damping: 1, easing: easings.linear, clamp: false }); var AnimationConfig = class { constructor() { this.tension = void 0; this.friction = void 0; this.frequency = void 0; this.damping = void 0; this.mass = void 0; this.velocity = 0; this.restVelocity = void 0; this.precision = void 0; this.progress = void 0; this.duration = void 0; this.easing = void 0; this.clamp = void 0; this.bounce = void 0; this.decay = void 0; this.round = void 0; Object.assign(this, defaults); } }; function mergeConfig(config2, newConfig, defaultConfig) { if (defaultConfig) { defaultConfig = _extends3({}, defaultConfig); sanitizeConfig(defaultConfig, newConfig); newConfig = _extends3({}, defaultConfig, newConfig); } sanitizeConfig(config2, newConfig); Object.assign(config2, newConfig); for (const key in defaults) { if (config2[key] == null) { config2[key] = defaults[key]; } } let { mass, frequency, damping } = config2; if (!is.und(frequency)) { if (frequency < 0.01) frequency = 0.01; if (damping < 0) damping = 0; config2.tension = Math.pow(2 * Math.PI / frequency, 2) * mass; config2.friction = 4 * Math.PI * damping * mass / frequency; } return config2; } function sanitizeConfig(config2, props) { if (!is.und(props.decay)) { config2.duration = void 0; } else { const isTensionConfig = !is.und(props.tension) || !is.und(props.friction); if (isTensionConfig || !is.und(props.frequency) || !is.und(props.damping) || !is.und(props.mass)) { config2.duration = void 0; config2.decay = void 0; } if (isTensionConfig) { config2.frequency = void 0; } } } var emptyArray = []; var Animation = class { constructor() { this.changed = false; this.values = emptyArray; this.toValues = null; this.fromValues = emptyArray; this.to = void 0; this.from = void 0; this.config = new AnimationConfig(); this.immediate = false; } }; function scheduleProps(callId, { key, props, defaultProps, state, actions }) { return new Promise((resolve, reject) => { var _props$cancel; let delay; let timeout; let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key); if (cancel) { onStart(); } else { if (!is.und(props.pause)) { state.paused = matchProp(props.pause, key); } let pause = defaultProps == null ? void 0 : defaultProps.pause; if (pause !== true) { pause = state.paused || matchProp(pause, key); } delay = callProp(props.delay || 0, key); if (pause) { state.resumeQueue.add(onResume); actions.pause(); } else { actions.resume(); onResume(); } } function onPause() { state.resumeQueue.add(onResume); state.timeouts.delete(timeout); timeout.cancel(); delay = timeout.time - raf.now(); } function onResume() { if (delay > 0 && !globals.skipAnimation) { state.delayed = true; timeout = raf.setTimeout(onStart, delay); state.pauseQueue.add(onPause); state.timeouts.add(timeout); } else { onStart(); } } function onStart() { if (state.delayed) { state.delayed = false; } state.pauseQueue.delete(onPause); state.timeouts.delete(timeout); if (callId <= (state.cancelId || 0)) { cancel = true; } try { actions.start(_extends3({}, props, { callId, cancel }), resolve); } catch (err) { reject(err); } } }); } var getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some((result) => result.cancelled) ? getCancelledResult(target.get()) : results.every((result) => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every((result) => result.finished)); var getNoopResult = (value) => ({ value, noop: true, finished: true, cancelled: false }); var getFinishedResult = (value, finished, cancelled = false) => ({ value, finished, cancelled }); var getCancelledResult = (value) => ({ value, cancelled: true, finished: false }); function runAsync(to2, props, state, target) { const { callId, parentId, onRest } = props; const { asyncTo: prevTo, promise: prevPromise } = state; if (!parentId && to2 === prevTo && !props.reset) { return prevPromise; } return state.promise = (async () => { state.asyncId = callId; state.asyncTo = to2; const defaultProps = getDefaultProps(props, (value, key) => key === "onRest" ? void 0 : value); let preventBail; let bail; const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject)); const bailIfEnded = (bailSignal) => { const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false); if (bailResult) { bailSignal.result = bailResult; bail(bailSignal); throw bailSignal; } }; const animate = (arg1, arg2) => { const bailSignal = new BailSignal(); const skipAnimationSignal = new SkipAniamtionSignal(); return (async () => { if (globals.skipAnimation) { stopAsync(state); skipAnimationSignal.result = getFinishedResult(target, false); bail(skipAnimationSignal); throw skipAnimationSignal; } bailIfEnded(bailSignal); const props2 = is.obj(arg1) ? _extends3({}, arg1) : _extends3({}, arg2, { to: arg1 }); props2.parentId = callId; eachProp(defaultProps, (value, key) => { if (is.und(props2[key])) { props2[key] = value; } }); const result2 = await target.start(props2); bailIfEnded(bailSignal); if (state.paused) { await new Promise((resume) => { state.resumeQueue.add(resume); }); } return result2; })(); }; let result; if (globals.skipAnimation) { stopAsync(state); return getFinishedResult(target, false); } try { let animating; if (is.arr(to2)) { animating = (async (queue) => { for (const props2 of queue) { await animate(props2); } })(to2); } else { animating = Promise.resolve(to2(animate, target.stop.bind(target))); } await Promise.all([animating.then(preventBail), bailPromise]); result = getFinishedResult(target.get(), true, false); } catch (err) { if (err instanceof BailSignal) { result = err.result; } else if (err instanceof SkipAniamtionSignal) { result = err.result; } else { throw err; } } finally { if (callId == state.asyncId) { state.asyncId = parentId; state.asyncTo = parentId ? prevTo : void 0; state.promise = parentId ? prevPromise : void 0; } } if (is.fun(onRest)) { raf.batchedUpdates(() => { onRest(result, target, target.item); }); } return result; })(); } function stopAsync(state, cancelId) { flush(state.timeouts, (t3) => t3.cancel()); state.pauseQueue.clear(); state.resumeQueue.clear(); state.asyncId = state.asyncTo = state.promise = void 0; if (cancelId) state.cancelId = cancelId; } var BailSignal = class extends Error { constructor() { super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."); this.result = void 0; } }; var SkipAniamtionSignal = class extends Error { constructor() { super("SkipAnimationSignal"); this.result = void 0; } }; var isFrameValue = (value) => value instanceof FrameValue; var nextId$1 = 1; var FrameValue = class extends FluidValue { constructor(...args) { super(...args); this.id = nextId$1++; this.key = void 0; this._priority = 0; } get priority() { return this._priority; } set priority(priority2) { if (this._priority != priority2) { this._priority = priority2; this._onPriorityChange(priority2); } } get() { const node = getAnimated(this); return node && node.getValue(); } to(...args) { return globals.to(this, args); } interpolate(...args) { deprecateInterpolate(); return globals.to(this, args); } toJSON() { return this.get(); } observerAdded(count) { if (count == 1) this._attach(); } observerRemoved(count) { if (count == 0) this._detach(); } _attach() { } _detach() { } _onChange(value, idle = false) { callFluidObservers(this, { type: "change", parent: this, value, idle }); } _onPriorityChange(priority2) { if (!this.idle) { frameLoop.sort(this); } callFluidObservers(this, { type: "priority", parent: this, priority: priority2 }); } }; var $P = Symbol.for("SpringPhase"); var HAS_ANIMATED = 1; var IS_ANIMATING = 2; var IS_PAUSED = 4; var hasAnimated = (target) => (target[$P] & HAS_ANIMATED) > 0; var isAnimating = (target) => (target[$P] & IS_ANIMATING) > 0; var isPaused = (target) => (target[$P] & IS_PAUSED) > 0; var setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING; var setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED; var SpringValue = class extends FrameValue { constructor(arg1, arg2) { super(); this.key = void 0; this.animation = new Animation(); this.queue = void 0; this.defaultProps = {}; this._state = { paused: false, delayed: false, pauseQueue: /* @__PURE__ */ new Set(), resumeQueue: /* @__PURE__ */ new Set(), timeouts: /* @__PURE__ */ new Set() }; this._pendingCalls = /* @__PURE__ */ new Set(); this._lastCallId = 0; this._lastToId = 0; this._memoizedDuration = 0; if (!is.und(arg1) || !is.und(arg2)) { const props = is.obj(arg1) ? _extends3({}, arg1) : _extends3({}, arg2, { from: arg1 }); if (is.und(props.default)) { props.default = true; } this.start(props); } } get idle() { return !(isAnimating(this) || this._state.asyncTo) || isPaused(this); } get goal() { return getFluidValue(this.animation.to); } get velocity() { const node = getAnimated(this); return node instanceof AnimatedValue ? node.lastVelocity || 0 : node.getPayload().map((node2) => node2.lastVelocity || 0); } get hasAnimated() { return hasAnimated(this); } get isAnimating() { return isAnimating(this); } get isPaused() { return isPaused(this); } get isDelayed() { return this._state.delayed; } advance(dt) { let idle = true; let changed = false; const anim = this.animation; let { config: config2, toValues } = anim; const payload = getPayload(anim.to); if (!payload && hasFluidValue(anim.to)) { toValues = toArray(getFluidValue(anim.to)); } anim.values.forEach((node2, i2) => { if (node2.done) return; const to2 = node2.constructor == AnimatedString ? 1 : payload ? payload[i2].lastPosition : toValues[i2]; let finished = anim.immediate; let position = to2; if (!finished) { position = node2.lastPosition; if (config2.tension <= 0) { node2.done = true; return; } let elapsed = node2.elapsedTime += dt; const from = anim.fromValues[i2]; const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is.arr(config2.velocity) ? config2.velocity[i2] : config2.velocity; let velocity; const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3)); if (!is.und(config2.duration)) { let p2 = 1; if (config2.duration > 0) { if (this._memoizedDuration !== config2.duration) { this._memoizedDuration = config2.duration; if (node2.durationProgress > 0) { node2.elapsedTime = config2.duration * node2.durationProgress; elapsed = node2.elapsedTime += dt; } } p2 = (config2.progress || 0) + elapsed / this._memoizedDuration; p2 = p2 > 1 ? 1 : p2 < 0 ? 0 : p2; node2.durationProgress = p2; } position = from + config2.easing(p2) * (to2 - from); velocity = (position - node2.lastPosition) / dt; finished = p2 == 1; } else if (config2.decay) { const decay = config2.decay === true ? 0.998 : config2.decay; const e2 = Math.exp(-(1 - decay) * elapsed); position = from + v0 / (1 - decay) * (1 - e2); finished = Math.abs(node2.lastPosition - position) <= precision; velocity = v0 * e2; } else { velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity; const restVelocity = config2.restVelocity || precision / 10; const bounceFactor = config2.clamp ? 0 : config2.bounce; const canBounce = !is.und(bounceFactor); const isGrowing = from == to2 ? node2.v0 > 0 : from < to2; let isMoving; let isBouncing = false; const step = 1; const numSteps = Math.ceil(dt / step); for (let n2 = 0; n2 < numSteps; ++n2) { isMoving = Math.abs(velocity) > restVelocity; if (!isMoving) { finished = Math.abs(to2 - position) <= precision; if (finished) { break; } } if (canBounce) { isBouncing = position == to2 || position > to2 == isGrowing; if (isBouncing) { velocity = -velocity * bounceFactor; position = to2; } } const springForce = -config2.tension * 1e-6 * (position - to2); const dampingForce = -config2.friction * 1e-3 * velocity; const acceleration = (springForce + dampingForce) / config2.mass; velocity = velocity + acceleration * step; position = position + velocity * step; } } node2.lastVelocity = velocity; if (Number.isNaN(position)) { console.warn(`Got NaN while animating:`, this); finished = true; } } if (payload && !payload[i2].done) { finished = false; } if (finished) { node2.done = true; } else { idle = false; } if (node2.setValue(position, config2.round)) { changed = true; } }); const node = getAnimated(this); const currVal = node.getValue(); if (idle) { const finalVal = getFluidValue(anim.to); if ((currVal !== finalVal || changed) && !config2.decay) { node.setValue(finalVal); this._onChange(finalVal); } else if (changed && config2.decay) { this._onChange(currVal); } this._stop(); } else if (changed) { this._onChange(currVal); } } set(value) { raf.batchedUpdates(() => { this._stop(); this._focus(value); this._set(value); }); return this; } pause() { this._update({ pause: true }); } resume() { this._update({ pause: false }); } finish() { if (isAnimating(this)) { const { to: to2, config: config2 } = this.animation; raf.batchedUpdates(() => { this._onStart(); if (!config2.decay) { this._set(to2, false); } this._stop(); }); } return this; } update(props) { const queue = this.queue || (this.queue = []); queue.push(props); return this; } start(to2, arg2) { let queue; if (!is.und(to2)) { queue = [is.obj(to2) ? to2 : _extends3({}, arg2, { to: to2 })]; } else { queue = this.queue || []; this.queue = []; } return Promise.all(queue.map((props) => { const up = this._update(props); return up; })).then((results) => getCombinedResult(this, results)); } stop(cancel) { const { to: to2 } = this.animation; this._focus(this.get()); stopAsync(this._state, cancel && this._lastCallId); raf.batchedUpdates(() => this._stop(to2, cancel)); return this; } reset() { this._update({ reset: true }); } eventObserved(event) { if (event.type == "change") { this._start(); } else if (event.type == "priority") { this.priority = event.priority + 1; } } _prepareNode(props) { const key = this.key || ""; let { to: to2, from } = props; to2 = is.obj(to2) ? to2[key] : to2; if (to2 == null || isAsyncTo(to2)) { to2 = void 0; } from = is.obj(from) ? from[key] : from; if (from == null) { from = void 0; } const range2 = { to: to2, from }; if (!hasAnimated(this)) { if (props.reverse) [to2, from] = [from, to2]; from = getFluidValue(from); if (!is.und(from)) { this._set(from); } else if (!getAnimated(this)) { this._set(to2); } } return range2; } _update(_ref, isLoop) { let props = _extends3({}, _ref); const { key, defaultProps } = this; if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value)); mergeActiveFn(this, props, "onProps"); sendEvent(this, "onProps", props, this); const range2 = this._prepareNode(props); if (Object.isFrozen(this)) { throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"); } const state = this._state; return scheduleProps(++this._lastCallId, { key, props, defaultProps, state, actions: { pause: () => { if (!isPaused(this)) { setPausedBit(this, true); flushCalls(state.pauseQueue); sendEvent(this, "onPause", getFinishedResult(this, checkFinished(this, this.animation.to)), this); } }, resume: () => { if (isPaused(this)) { setPausedBit(this, false); if (isAnimating(this)) { this._resume(); } flushCalls(state.resumeQueue); sendEvent(this, "onResume", getFinishedResult(this, checkFinished(this, this.animation.to)), this); } }, start: this._merge.bind(this, range2) } }).then((result) => { if (props.loop && result.finished && !(isLoop && result.noop)) { const nextProps = createLoopUpdate(props); if (nextProps) { return this._update(nextProps, true); } } return result; }); } _merge(range2, props, resolve) { if (props.cancel) { this.stop(true); return resolve(getCancelledResult(this)); } const hasToProp = !is.und(range2.to); const hasFromProp = !is.und(range2.from); if (hasToProp || hasFromProp) { if (props.callId > this._lastToId) { this._lastToId = props.callId; } else { return resolve(getCancelledResult(this)); } } const { key, defaultProps, animation: anim } = this; const { to: prevTo, from: prevFrom } = anim; let { to: to2 = prevTo, from = prevFrom } = range2; if (hasFromProp && !hasToProp && (!props.default || is.und(to2))) { to2 = from; } if (props.reverse) [to2, from] = [from, to2]; const hasFromChanged = !isEqual(from, prevFrom); if (hasFromChanged) { anim.from = from; } from = getFluidValue(from); const hasToChanged = !isEqual(to2, prevTo); if (hasToChanged) { this._focus(to2); } const hasAsyncTo = isAsyncTo(props.to); const { config: config2 } = anim; const { decay, velocity } = config2; if (hasToProp || hasFromProp) { config2.velocity = 0; } if (props.config && !hasAsyncTo) { mergeConfig(config2, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0); } let node = getAnimated(this); if (!node || is.und(to2)) { return resolve(getFinishedResult(this, true)); } const reset = is.und(props.reset) ? hasFromProp && !props.default : !is.und(from) && matchProp(props.reset, key); const value = reset ? from : this.get(); const goal = computeGoal(to2); const isAnimatable = is.num(goal) || is.arr(goal) || isAnimatedString(goal); const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key)); if (hasToChanged) { const nodeType = getAnimatedType(to2); if (nodeType !== node.constructor) { if (immediate) { node = this._set(goal); } else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`); } } const goalType = node.constructor; let started = hasFluidValue(to2); let finished = false; if (!started) { const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged; if (hasToChanged || hasValueChanged) { finished = isEqual(computeGoal(value), goal); started = !finished; } if (!isEqual(anim.immediate, immediate) && !immediate || !isEqual(config2.decay, decay) || !isEqual(config2.velocity, velocity)) { started = true; } } if (finished && isAnimating(this)) { if (anim.changed && !reset) { started = true; } else if (!started) { this._stop(prevTo); } } if (!hasAsyncTo) { if (started || hasFluidValue(prevTo)) { anim.values = node.getPayload(); anim.toValues = hasFluidValue(to2) ? null : goalType == AnimatedString ? [1] : toArray(goal); } if (anim.immediate != immediate) { anim.immediate = immediate; if (!immediate && !reset) { this._set(prevTo); } } if (started) { const { onRest } = anim; each(ACTIVE_EVENTS, (type) => mergeActiveFn(this, props, type)); const result = getFinishedResult(this, checkFinished(this, prevTo)); flushCalls(this._pendingCalls, result); this._pendingCalls.add(resolve); if (anim.changed) raf.batchedUpdates(() => { anim.changed = !reset; onRest == null ? void 0 : onRest(result, this); if (reset) { callProp(defaultProps.onRest, result); } else { anim.onStart == null ? void 0 : anim.onStart(result, this); } }); } } if (reset) { this._set(value); } if (hasAsyncTo) { resolve(runAsync(props.to, props, this._state, this)); } else if (started) { this._start(); } else if (isAnimating(this) && !hasToChanged) { this._pendingCalls.add(resolve); } else { resolve(getNoopResult(value)); } } _focus(value) { const anim = this.animation; if (value !== anim.to) { if (getFluidObservers(this)) { this._detach(); } anim.to = value; if (getFluidObservers(this)) { this._attach(); } } } _attach() { let priority2 = 0; const { to: to2 } = this.animation; if (hasFluidValue(to2)) { addFluidObserver(to2, this); if (isFrameValue(to2)) { priority2 = to2.priority + 1; } } this.priority = priority2; } _detach() { const { to: to2 } = this.animation; if (hasFluidValue(to2)) { removeFluidObserver(to2, this); } } _set(arg, idle = true) { const value = getFluidValue(arg); if (!is.und(value)) { const oldNode = getAnimated(this); if (!oldNode || !isEqual(value, oldNode.getValue())) { const nodeType = getAnimatedType(value); if (!oldNode || oldNode.constructor != nodeType) { setAnimated(this, nodeType.create(value)); } else { oldNode.setValue(value); } if (oldNode) { raf.batchedUpdates(() => { this._onChange(value, idle); }); } } } return getAnimated(this); } _onStart() { const anim = this.animation; if (!anim.changed) { anim.changed = true; sendEvent(this, "onStart", getFinishedResult(this, checkFinished(this, anim.to)), this); } } _onChange(value, idle) { if (!idle) { this._onStart(); callProp(this.animation.onChange, value, this); } callProp(this.defaultProps.onChange, value, this); super._onChange(value, idle); } _start() { const anim = this.animation; getAnimated(this).reset(getFluidValue(anim.to)); if (!anim.immediate) { anim.fromValues = anim.values.map((node) => node.lastPosition); } if (!isAnimating(this)) { setActiveBit(this, true); if (!isPaused(this)) { this._resume(); } } } _resume() { if (globals.skipAnimation) { this.finish(); } else { frameLoop.start(this); } } _stop(goal, cancel) { if (isAnimating(this)) { setActiveBit(this, false); const anim = this.animation; each(anim.values, (node) => { node.done = true; }); if (anim.toValues) { anim.onChange = anim.onPause = anim.onResume = void 0; } callFluidObservers(this, { type: "idle", parent: this }); const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to)); flushCalls(this._pendingCalls, result); if (anim.changed) { anim.changed = false; sendEvent(this, "onRest", result, this); } } } }; function checkFinished(target, to2) { const goal = computeGoal(to2); const value = computeGoal(target.get()); return isEqual(value, goal); } function createLoopUpdate(props, loop2 = props.loop, to2 = props.to) { let loopRet = callProp(loop2); if (loopRet) { const overrides = loopRet !== true && inferTo(loopRet); const reverse = (overrides || props).reverse; const reset = !overrides || overrides.reset; return createUpdate(_extends3({}, props, { loop: loop2, default: false, pause: void 0, to: !reverse || isAsyncTo(to2) ? to2 : void 0, from: reset ? props.from : void 0, reset }, overrides)); } } function createUpdate(props) { const { to: to2, from } = props = inferTo(props); const keys = /* @__PURE__ */ new Set(); if (is.obj(to2)) findDefined(to2, keys); if (is.obj(from)) findDefined(from, keys); props.keys = keys.size ? Array.from(keys) : null; return props; } function findDefined(values, keys) { eachProp(values, (value, key) => value != null && keys.add(key)); } var ACTIVE_EVENTS = ["onStart", "onRest", "onChange", "onPause", "onResume"]; function mergeActiveFn(target, props, type) { target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : void 0; } function sendEvent(target, type, ...args) { var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps; (_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args); (_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args); } var BATCHED_EVENTS = ["onStart", "onChange", "onRest"]; var nextId = 1; var Controller = class { constructor(props, flush2) { this.id = nextId++; this.springs = {}; this.queue = []; this.ref = void 0; this._flush = void 0; this._initialProps = void 0; this._lastAsyncId = 0; this._active = /* @__PURE__ */ new Set(); this._changed = /* @__PURE__ */ new Set(); this._started = false; this._item = void 0; this._state = { paused: false, pauseQueue: /* @__PURE__ */ new Set(), resumeQueue: /* @__PURE__ */ new Set(), timeouts: /* @__PURE__ */ new Set() }; this._events = { onStart: /* @__PURE__ */ new Map(), onChange: /* @__PURE__ */ new Map(), onRest: /* @__PURE__ */ new Map() }; this._onFrame = this._onFrame.bind(this); if (flush2) { this._flush = flush2; } if (props) { this.start(_extends3({ default: true }, props)); } } get idle() { return !this._state.asyncTo && Object.values(this.springs).every((spring) => { return spring.idle && !spring.isDelayed && !spring.isPaused; }); } get item() { return this._item; } set item(item) { this._item = item; } get() { const values = {}; this.each((spring, key) => values[key] = spring.get()); return values; } set(values) { for (const key in values) { const value = values[key]; if (!is.und(value)) { this.springs[key].set(value); } } } update(props) { if (props) { this.queue.push(createUpdate(props)); } return this; } start(props) { let { queue } = this; if (props) { queue = toArray(props).map(createUpdate); } else { this.queue = []; } if (this._flush) { return this._flush(this, queue); } prepareKeys(this, queue); return flushUpdateQueue(this, queue); } stop(arg, keys) { if (arg !== !!arg) { keys = arg; } if (keys) { const springs = this.springs; each(toArray(keys), (key) => springs[key].stop(!!arg)); } else { stopAsync(this._state, this._lastAsyncId); this.each((spring) => spring.stop(!!arg)); } return this; } pause(keys) { if (is.und(keys)) { this.start({ pause: true }); } else { const springs = this.springs; each(toArray(keys), (key) => springs[key].pause()); } return this; } resume(keys) { if (is.und(keys)) { this.start({ pause: false }); } else { const springs = this.springs; each(toArray(keys), (key) => springs[key].resume()); } return this; } each(iterator) { eachProp(this.springs, iterator); } _onFrame() { const { onStart, onChange, onRest } = this._events; const active = this._active.size > 0; const changed = this._changed.size > 0; if (active && !this._started || changed && !this._started) { this._started = true; flush(onStart, ([onStart2, result]) => { result.value = this.get(); onStart2(result, this, this._item); }); } const idle = !active && this._started; const values = changed || idle && onRest.size ? this.get() : null; if (changed && onChange.size) { flush(onChange, ([onChange2, result]) => { result.value = values; onChange2(result, this, this._item); }); } if (idle) { this._started = false; flush(onRest, ([onRest2, result]) => { result.value = values; onRest2(result, this, this._item); }); } } eventObserved(event) { if (event.type == "change") { this._changed.add(event.parent); if (!event.idle) { this._active.add(event.parent); } } else if (event.type == "idle") { this._active.delete(event.parent); } else return; raf.onFrame(this._onFrame); } }; function flushUpdateQueue(ctrl, queue) { return Promise.all(queue.map((props) => flushUpdate(ctrl, props))).then((results) => getCombinedResult(ctrl, results)); } async function flushUpdate(ctrl, props, isLoop) { const { keys, to: to2, from, loop: loop2, onRest, onResolve } = props; const defaults2 = is.obj(props.default) && props.default; if (loop2) { props.loop = false; } if (to2 === false) props.to = null; if (from === false) props.from = null; const asyncTo = is.arr(to2) || is.fun(to2) ? to2 : void 0; if (asyncTo) { props.to = void 0; props.onRest = void 0; if (defaults2) { defaults2.onRest = void 0; } } else { each(BATCHED_EVENTS, (key) => { const handler = props[key]; if (is.fun(handler)) { const queue = ctrl["_events"][key]; props[key] = ({ finished, cancelled }) => { const result2 = queue.get(handler); if (result2) { if (!finished) result2.finished = false; if (cancelled) result2.cancelled = true; } else { queue.set(handler, { value: null, finished: finished || false, cancelled: cancelled || false }); } }; if (defaults2) { defaults2[key] = props[key]; } } }); } const state = ctrl["_state"]; if (props.pause === !state.paused) { state.paused = props.pause; flushCalls(props.pause ? state.pauseQueue : state.resumeQueue); } else if (state.paused) { props.pause = true; } const promises = (keys || Object.keys(ctrl.springs)).map((key) => ctrl.springs[key].start(props)); const cancel = props.cancel === true || getDefaultProp(props, "cancel") === true; if (asyncTo || cancel && state.asyncId) { promises.push(scheduleProps(++ctrl["_lastAsyncId"], { props, state, actions: { pause: noop3, resume: noop3, start(props2, resolve) { if (cancel) { stopAsync(state, ctrl["_lastAsyncId"]); resolve(getCancelledResult(ctrl)); } else { props2.onRest = onRest; resolve(runAsync(asyncTo, props2, state, ctrl)); } } } })); } if (state.paused) { await new Promise((resume) => { state.resumeQueue.add(resume); }); } const result = getCombinedResult(ctrl, await Promise.all(promises)); if (loop2 && result.finished && !(isLoop && result.noop)) { const nextProps = createLoopUpdate(props, loop2, to2); if (nextProps) { prepareKeys(ctrl, [nextProps]); return flushUpdate(ctrl, nextProps, true); } } if (onResolve) { raf.batchedUpdates(() => onResolve(result, ctrl, ctrl.item)); } return result; } function createSpring(key, observer) { const spring = new SpringValue(); spring.key = key; if (observer) { addFluidObserver(spring, observer); } return spring; } function prepareSprings(springs, props, create6) { if (props.keys) { each(props.keys, (key) => { const spring = springs[key] || (springs[key] = create6(key)); spring["_prepareNode"](props); }); } } function prepareKeys(ctrl, queue) { each(queue, (props) => { prepareSprings(ctrl.springs, props, (key) => { return createSpring(key, ctrl); }); }); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i2; for (i2 = 0; i2 < sourceKeys.length; i2++) { key = sourceKeys[i2]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var _excluded$3 = ["children"]; var SpringContext = (_ref) => { let { children } = _ref, props = _objectWithoutPropertiesLoose(_ref, _excluded$3); const inherited = (0, import_react3.useContext)(ctx); const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate; props = useMemoOne(() => ({ pause, immediate }), [pause, immediate]); const { Provider: Provider2 } = ctx; return React2.createElement(Provider2, { value: props }, children); }; var ctx = makeContext(SpringContext, {}); SpringContext.Provider = ctx.Provider; SpringContext.Consumer = ctx.Consumer; function makeContext(target, init) { Object.assign(target, React2.createContext(init)); target.Provider._context = target; target.Consumer._context = target; return target; } var TransitionPhase; (function(TransitionPhase2) { TransitionPhase2["MOUNT"] = "mount"; TransitionPhase2["ENTER"] = "enter"; TransitionPhase2["UPDATE"] = "update"; TransitionPhase2["LEAVE"] = "leave"; })(TransitionPhase || (TransitionPhase = {})); var Interpolation = class extends FrameValue { constructor(source, args) { super(); this.key = void 0; this.idle = true; this.calc = void 0; this._active = /* @__PURE__ */ new Set(); this.source = source; this.calc = createInterpolator(...args); const value = this._get(); const nodeType = getAnimatedType(value); setAnimated(this, nodeType.create(value)); } advance(_dt) { const value = this._get(); const oldValue = this.get(); if (!isEqual(value, oldValue)) { getAnimated(this).setValue(value); this._onChange(value, this.idle); } if (!this.idle && checkIdle(this._active)) { becomeIdle(this); } } _get() { const inputs = is.arr(this.source) ? this.source.map(getFluidValue) : toArray(getFluidValue(this.source)); return this.calc(...inputs); } _start() { if (this.idle && !checkIdle(this._active)) { this.idle = false; each(getPayload(this), (node) => { node.done = false; }); if (globals.skipAnimation) { raf.batchedUpdates(() => this.advance()); becomeIdle(this); } else { frameLoop.start(this); } } } _attach() { let priority2 = 1; each(toArray(this.source), (source) => { if (hasFluidValue(source)) { addFluidObserver(source, this); } if (isFrameValue(source)) { if (!source.idle) { this._active.add(source); } priority2 = Math.max(priority2, source.priority + 1); } }); this.priority = priority2; this._start(); } _detach() { each(toArray(this.source), (source) => { if (hasFluidValue(source)) { removeFluidObserver(source, this); } }); this._active.clear(); becomeIdle(this); } eventObserved(event) { if (event.type == "change") { if (event.idle) { this.advance(); } else { this._active.add(event.parent); this._start(); } } else if (event.type == "idle") { this._active.delete(event.parent); } else if (event.type == "priority") { this.priority = toArray(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0); } } }; function isIdle(source) { return source.idle !== false; } function checkIdle(active) { return !active.size || Array.from(active).every(isIdle); } function becomeIdle(self) { if (!self.idle) { self.idle = true; each(getPayload(self), (node) => { node.done = true; }); callFluidObservers(self, { type: "idle", parent: self }); } } globals.assign({ createStringInterpolator, to: (source, args) => new Interpolation(source, args) }); var update2 = frameLoop.advance; // node_modules/@react-spring/web/dist/react-spring-web.esm.js var import_react_dom = __toESM(require_react_dom()); function _objectWithoutPropertiesLoose2(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i2; for (i2 = 0; i2 < sourceKeys.length; i2++) { key = sourceKeys[i2]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var _excluded$2 = ["style", "children", "scrollTop", "scrollLeft"]; var isCustomPropRE = /^--/; function dangerousStyleValue(name, value) { if (value == null || typeof value === "boolean" || value === "") return ""; if (typeof value === "number" && value !== 0 && !isCustomPropRE.test(name) && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + "px"; return ("" + value).trim(); } var attributeCache = {}; function applyAnimatedValues(instance, props) { if (!instance.nodeType || !instance.setAttribute) { return false; } const isFilterElement = instance.nodeName === "filter" || instance.parentNode && instance.parentNode.nodeName === "filter"; const _ref = props, { style, children, scrollTop, scrollLeft } = _ref, attributes = _objectWithoutPropertiesLoose2(_ref, _excluded$2); const values = Object.values(attributes); const names = Object.keys(attributes).map((name) => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, (n2) => "-" + n2.toLowerCase()))); if (children !== void 0) { instance.textContent = children; } for (let name in style) { if (style.hasOwnProperty(name)) { const value = dangerousStyleValue(name, style[name]); if (isCustomPropRE.test(name)) { instance.style.setProperty(name, value); } else { instance.style[name] = value; } } } names.forEach((name, i2) => { instance.setAttribute(name, values[i2]); }); if (scrollTop !== void 0) { instance.scrollTop = scrollTop; } if (scrollLeft !== void 0) { instance.scrollLeft = scrollLeft; } } var isUnitlessNumber = { animationIterationCount: true, borderImageOutset: true, borderImageSlice: true, borderImageWidth: true, boxFlex: true, boxFlexGroup: true, boxOrdinalGroup: true, columnCount: true, columns: true, flex: true, flexGrow: true, flexPositive: true, flexShrink: true, flexNegative: true, flexOrder: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, gridRowStart: true, gridColumn: true, gridColumnEnd: true, gridColumnSpan: true, gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, opacity: true, order: true, orphans: true, tabSize: true, widows: true, zIndex: true, zoom: true, fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeDasharray: true, strokeDashoffset: true, strokeMiterlimit: true, strokeOpacity: true, strokeWidth: true }; var prefixKey = (prefix2, key) => prefix2 + key.charAt(0).toUpperCase() + key.substring(1); var prefixes = ["Webkit", "Ms", "Moz", "O"]; isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => { prefixes.forEach((prefix2) => acc[prefixKey(prefix2, prop)] = acc[prop]); return acc; }, isUnitlessNumber); var _excluded$1 = ["x", "y", "z"]; var domTransforms = /^(matrix|translate|scale|rotate|skew)/; var pxTransforms = /^(translate)/; var degTransforms = /^(rotate|skew)/; var addUnit = (value, unit) => is.num(value) && value !== 0 ? value + unit : value; var isValueIdentity = (value, id) => is.arr(value) ? value.every((v2) => isValueIdentity(v2, id)) : is.num(value) ? value === id : parseFloat(value) === id; var AnimatedStyle = class extends AnimatedObject { constructor(_ref) { let { x: x2, y: y2, z } = _ref, style = _objectWithoutPropertiesLoose2(_ref, _excluded$1); const inputs = []; const transforms = []; if (x2 || y2 || z) { inputs.push([x2 || 0, y2 || 0, z || 0]); transforms.push((xyz) => [`translate3d(${xyz.map((v2) => addUnit(v2, "px")).join(",")})`, isValueIdentity(xyz, 0)]); } eachProp(style, (value, key) => { if (key === "transform") { inputs.push([value || ""]); transforms.push((transform) => [transform, transform === ""]); } else if (domTransforms.test(key)) { delete style[key]; if (is.und(value)) return; const unit = pxTransforms.test(key) ? "px" : degTransforms.test(key) ? "deg" : ""; inputs.push(toArray(value)); transforms.push(key === "rotate3d" ? ([x3, y3, z2, deg]) => [`rotate3d(${x3},${y3},${z2},${addUnit(deg, unit)})`, isValueIdentity(deg, 0)] : (input) => [`${key}(${input.map((v2) => addUnit(v2, unit)).join(",")})`, isValueIdentity(input, key.startsWith("scale") ? 1 : 0)]); } }); if (inputs.length) { style.transform = new FluidTransform(inputs, transforms); } super(style); } }; var FluidTransform = class extends FluidValue { constructor(inputs, transforms) { super(); this._value = null; this.inputs = inputs; this.transforms = transforms; } get() { return this._value || (this._value = this._get()); } _get() { let transform = ""; let identity2 = true; each(this.inputs, (input, i2) => { const arg1 = getFluidValue(input[0]); const [t3, id] = this.transforms[i2](is.arr(arg1) ? arg1 : input.map(getFluidValue)); transform += " " + t3; identity2 = identity2 && id; }); return identity2 ? "none" : transform; } observerAdded(count) { if (count == 1) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && addFluidObserver(value, this))); } observerRemoved(count) { if (count == 0) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && removeFluidObserver(value, this))); } eventObserved(event) { if (event.type == "change") { this._value = null; } callFluidObservers(this, event); } }; var primitives = ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]; var _excluded = ["scrollTop", "scrollLeft"]; globals.assign({ batchedUpdates: import_react_dom.unstable_batchedUpdates, createStringInterpolator, colors }); var host = createHost(primitives, { applyAnimatedValues, createAnimatedStyle: (style) => new AnimatedStyle(style), getComponentProps: (_ref) => { let props = _objectWithoutPropertiesLoose2(_ref, _excluded); return props; } }); var animated = host.animated; // packages/block-editor/build-module/components/use-moving-animation/index.js var import_element27 = __toESM(require_element()); var import_dom2 = __toESM(require_dom()); var import_data20 = __toESM(require_data()); var BLOCK_ANIMATION_THRESHOLD = 200; function getAbsolutePosition(element) { return { top: element.offsetTop, left: element.offsetLeft }; } function useMovingAnimation({ triggerAnimationOnChange, clientId }) { const ref = (0, import_element27.useRef)(); const { isTyping: isTyping3, getGlobalBlockCount: getGlobalBlockCount2, isBlockSelected: isBlockSelected2, isFirstMultiSelectedBlock: isFirstMultiSelectedBlock2, isBlockMultiSelected: isBlockMultiSelected2, isAncestorMultiSelected: isAncestorMultiSelected2, isDraggingBlocks: isDraggingBlocks2 } = (0, import_data20.useSelect)(store); const { previous, prevRect } = (0, import_element27.useMemo)( () => ({ previous: ref.current && getAbsolutePosition(ref.current), prevRect: ref.current && ref.current.getBoundingClientRect() }), [triggerAnimationOnChange] ); (0, import_element27.useLayoutEffect)(() => { if (!previous || !ref.current) { return; } const scrollContainer = (0, import_dom2.getScrollContainer)(ref.current); const isSelected = isBlockSelected2(clientId); const adjustScrolling = isSelected || isFirstMultiSelectedBlock2(clientId); const isDragging3 = isDraggingBlocks2(); function preserveScrollPosition() { if (isDragging3) { return; } if (adjustScrolling && prevRect) { const blockRect = ref.current.getBoundingClientRect(); const diff = blockRect.top - prevRect.top; if (diff) { scrollContainer.scrollTop += diff; } } } const disableAnimation = window.matchMedia("(prefers-reduced-motion: reduce)").matches || isTyping3() || getGlobalBlockCount2() > BLOCK_ANIMATION_THRESHOLD; if (disableAnimation) { preserveScrollPosition(); return; } const isPartOfSelection = isSelected || isBlockMultiSelected2(clientId) || isAncestorMultiSelected2(clientId); if (isPartOfSelection && isDragging3) { return; } const zIndex = isPartOfSelection ? "1" : ""; const controller = new Controller({ x: 0, y: 0, config: { mass: 5, tension: 2e3, friction: 200 }, onChange({ value }) { if (!ref.current) { return; } let { x: x22, y: y22 } = value; x22 = Math.round(x22); y22 = Math.round(y22); const finishedMoving = x22 === 0 && y22 === 0; ref.current.style.transformOrigin = "center center"; ref.current.style.transform = finishedMoving ? null : `translate3d(${x22}px,${y22}px,0)`; ref.current.style.zIndex = zIndex; preserveScrollPosition(); } }); ref.current.style.transform = void 0; const destination = getAbsolutePosition(ref.current); const x2 = Math.round(previous.left - destination.left); const y2 = Math.round(previous.top - destination.top); controller.start({ x: 0, y: 0, from: { x: x2, y: y2 } }); return () => { controller.stop(); controller.set({ x: 0, y: 0 }); }; }, [ previous, prevRect, clientId, isTyping3, getGlobalBlockCount2, isBlockSelected2, isFirstMultiSelectedBlock2, isBlockMultiSelected2, isAncestorMultiSelected2, isDraggingBlocks2 ]); return ref; } var use_moving_animation_default = useMovingAnimation; // packages/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js var import_element28 = __toESM(require_element()); var import_dom3 = __toESM(require_dom()); var import_data21 = __toESM(require_data()); // packages/block-editor/build-module/utils/dom.js var BLOCK_SELECTOR = ".block-editor-block-list__block"; var APPENDER_SELECTOR = ".block-list-appender"; var BLOCK_APPENDER_CLASS = ".block-editor-button-block-appender"; function isInSameBlock(a2, b2) { return a2.closest(BLOCK_SELECTOR) === b2.closest(BLOCK_SELECTOR); } function isInsideRootBlock(blockElement, element) { const parentBlock = element.closest( [BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS].join(",") ); return parentBlock === blockElement; } function getBlockClientId(node) { while (node && node.nodeType !== node.ELEMENT_NODE) { node = node.parentNode; } if (!node) { return; } const elementNode = ( /** @type {Element} */ node ); const blockNode = elementNode.closest(BLOCK_SELECTOR); if (!blockNode) { return; } return blockNode.id.slice("block-".length); } function rectUnion(rect1, rect2) { const left = Math.min(rect1.left, rect2.left); const right = Math.max(rect1.right, rect2.right); const bottom = Math.max(rect1.bottom, rect2.bottom); const top = Math.min(rect1.top, rect2.top); return new window.DOMRectReadOnly(left, top, right - left, bottom - top); } function isElementVisible(element) { const viewport = element.ownerDocument.defaultView; if (!viewport) { return false; } if (element.classList.contains("components-visually-hidden")) { return false; } const bounds = element.getBoundingClientRect(); if (bounds.width === 0 || bounds.height === 0) { return false; } if (element.checkVisibility) { return element.checkVisibility?.({ opacityProperty: true, contentVisibilityAuto: true, visibilityProperty: true }); } const style = viewport.getComputedStyle(element); if (style.display === "none" || style.visibility === "hidden" || style.opacity === "0") { return false; } return true; } function isScrollable(element) { const style = window.getComputedStyle(element); return style.overflowX === "auto" || style.overflowX === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll"; } var WITH_OVERFLOW_ELEMENT_BLOCKS = ["core/navigation"]; function getElementBounds(element) { const viewport = element.ownerDocument.defaultView; if (!viewport) { return new window.DOMRectReadOnly(); } let bounds = element.getBoundingClientRect(); const dataType = element.getAttribute("data-type"); if (dataType && WITH_OVERFLOW_ELEMENT_BLOCKS.includes(dataType)) { const stack = [element]; let currentElement; while (currentElement = stack.pop()) { if (!isScrollable(currentElement)) { for (const child of currentElement.children) { if (isElementVisible(child)) { const childBounds = child.getBoundingClientRect(); bounds = rectUnion(bounds, childBounds); stack.push(child); } } } } } const left = Math.max(bounds.left, 0); const right = Math.min(bounds.right, viewport.innerWidth); bounds = new window.DOMRectReadOnly( left, bounds.top, right - left, bounds.height ); return bounds; } // packages/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js function useFocusFirstElement({ clientId, initialPosition: initialPosition2 }) { const ref = (0, import_element28.useRef)(); const { isBlockSelected: isBlockSelected2, isMultiSelecting: isMultiSelecting3, isZoomOut: isZoomOut2 } = unlock( (0, import_data21.useSelect)(store) ); (0, import_element28.useEffect)(() => { if (!isBlockSelected2(clientId) || isMultiSelecting3() || isZoomOut2()) { return; } if (initialPosition2 === void 0 || initialPosition2 === null) { return; } if (!ref.current) { return; } const { ownerDocument } = ref.current; if (isInsideRootBlock(ref.current, ownerDocument.activeElement)) { return; } const textInputs = import_dom3.focus.tabbable.find(ref.current).filter((node) => (0, import_dom3.isTextField)(node)); const isReverse = -1 === initialPosition2; const target = textInputs[isReverse ? textInputs.length - 1 : 0] || ref.current; if (!isInsideRootBlock(ref.current, target)) { ref.current.focus(); return; } if (!ref.current.getAttribute("contenteditable")) { const focusElement = import_dom3.focus.tabbable.findNext(ref.current); if (focusElement && isInsideRootBlock(ref.current, focusElement) && (0, import_dom3.isFormElement)(focusElement)) { focusElement.focus(); return; } } (0, import_dom3.placeCaretAtHorizontalEdge)(target, isReverse); }, [initialPosition2, clientId]); return ref; } // packages/block-editor/build-module/components/block-list/use-block-props/use-is-hovered.js var import_compose8 = __toESM(require_compose()); function listener(event) { if (event.defaultPrevented) { return; } event.preventDefault(); event.currentTarget.classList.toggle( "is-hovered", event.type === "mouseover" ); } function useIsHovered({ isEnabled = true } = {}) { return (0, import_compose8.useRefEffect)( (node) => { if (!isEnabled) { return; } node.addEventListener("mouseout", listener); node.addEventListener("mouseover", listener); return () => { node.removeEventListener("mouseout", listener); node.removeEventListener("mouseover", listener); node.classList.remove("is-hovered"); }; }, [isEnabled] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-focus-handler.js var import_data22 = __toESM(require_data()); var import_compose9 = __toESM(require_compose()); function useFocusHandler(clientId) { const { isBlockSelected: isBlockSelected2 } = (0, import_data22.useSelect)(store); const { selectBlock: selectBlock2, selectionChange: selectionChange2 } = (0, import_data22.useDispatch)(store); return (0, import_compose9.useRefEffect)( (node) => { function onFocus(event) { if (node.parentElement.closest('[contenteditable="true"]')) { return; } if (isBlockSelected2(clientId)) { if (!event.target.isContentEditable) { selectionChange2(clientId); } return; } if (!isInsideRootBlock(node, event.target)) { return; } selectBlock2(clientId); } node.addEventListener("focusin", onFocus); return () => { node.removeEventListener("focusin", onFocus); }; }, [isBlockSelected2, selectBlock2] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js var import_dom6 = __toESM(require_dom()); var import_keycodes2 = __toESM(require_keycodes()); var import_data23 = __toESM(require_data()); var import_compose10 = __toESM(require_compose()); function isColorTransparent(color) { return !color || color === "transparent" || color === "rgba(0, 0, 0, 0)"; } function useEventHandlers({ clientId, isSelected }) { const { getBlockRootClientId: getBlockRootClientId2, isZoomOut: isZoomOut2, hasMultiSelection: hasMultiSelection2, isSectionBlock: isSectionBlock2, editedContentOnlySection: editedContentOnlySection2 } = unlock((0, import_data23.useSelect)(store)); const { insertAfterBlock: insertAfterBlock2, removeBlock: removeBlock2, resetZoomLevel: resetZoomLevel2, startDraggingBlocks: startDraggingBlocks2, stopDraggingBlocks: stopDraggingBlocks2, editContentOnlySection: editContentOnlySection2 } = unlock((0, import_data23.useDispatch)(store)); return (0, import_compose10.useRefEffect)( (node) => { if (!isSelected) { return; } function onKeyDown(event) { const { keyCode, target } = event; if (keyCode !== import_keycodes2.ENTER && keyCode !== import_keycodes2.BACKSPACE && keyCode !== import_keycodes2.DELETE) { return; } if (target !== node || (0, import_dom6.isTextField)(target)) { return; } event.preventDefault(); if (keyCode === import_keycodes2.ENTER && isZoomOut2()) { resetZoomLevel2(); } else if (keyCode === import_keycodes2.ENTER) { insertAfterBlock2(clientId); } else { removeBlock2(clientId); } } function onDragStart(event) { if (node !== event.target || node.isContentEditable || node.ownerDocument.activeElement !== node || hasMultiSelection2()) { event.preventDefault(); return; } const data = JSON.stringify({ type: "block", srcClientIds: [clientId], srcRootClientId: getBlockRootClientId2(clientId) }); event.dataTransfer.effectAllowed = "move"; event.dataTransfer.clearData(); event.dataTransfer.setData("wp-blocks", data); const { ownerDocument } = node; const { defaultView } = ownerDocument; const selection2 = defaultView.getSelection(); selection2.removeAllRanges(); const dragElement = ownerDocument.createElement("div"); dragElement.style.width = "1px"; dragElement.style.height = "1px"; dragElement.style.position = "fixed"; dragElement.style.visibility = "hidden"; ownerDocument.body.appendChild(dragElement); event.dataTransfer.setDragImage(dragElement, 0, 0); const rect = node.getBoundingClientRect(); const clone = node.cloneNode(true); clone.style.visibility = "hidden"; clone.style.display = "none"; const id = node.id; node.id = null; let _scale = 1; { let parentElement = node; while (parentElement = parentElement.parentElement) { const { scale } = defaultView.getComputedStyle(parentElement); if (scale && scale !== "none") { _scale = parseFloat(scale); break; } } } const inverted = 1 / _scale; node.after(clone); const originalNodeProperties = {}; for (const property of [ "transform", "transformOrigin", "transition", "zIndex", "position", "top", "left", "pointerEvents", "opacity", "backgroundColor" ]) { originalNodeProperties[property] = node.style[property]; } const originScrollTop = defaultView.scrollY; const originScrollLeft = defaultView.scrollX; const originClientX = event.clientX; const originClientY = event.clientY; node.style.position = "relative"; node.style.top = `${0}px`; node.style.left = `${0}px`; const originX = event.clientX - rect.left; const originY = event.clientY - rect.top; const dragScale = rect.height > 200 ? 200 / rect.height : 1; node.style.zIndex = "1000"; node.style.transformOrigin = `${originX * inverted}px ${originY * inverted}px`; node.style.transition = "transform 0.2s ease-out"; node.style.transform = `scale(${dragScale})`; node.style.opacity = "0.9"; if (isColorTransparent( defaultView.getComputedStyle(node).backgroundColor )) { let bgColor = "transparent"; let parentElement = node; while (parentElement = parentElement.parentElement) { const { backgroundColor } = defaultView.getComputedStyle(parentElement); if (!isColorTransparent(backgroundColor)) { bgColor = backgroundColor; break; } } node.style.backgroundColor = bgColor; } let hasStarted = false; function over(e2) { if (!hasStarted) { hasStarted = true; node.style.pointerEvents = "none"; } const scrollTop = defaultView.scrollY; const scrollLeft = defaultView.scrollX; node.style.top = `${(e2.clientY - originClientY + scrollTop - originScrollTop) * inverted}px`; node.style.left = `${(e2.clientX - originClientX + scrollLeft - originScrollLeft) * inverted}px`; } function end() { ownerDocument.removeEventListener("dragover", over); ownerDocument.removeEventListener("dragend", end); ownerDocument.removeEventListener("drop", end); ownerDocument.removeEventListener("scroll", over); for (const [property, value] of Object.entries( originalNodeProperties )) { node.style[property] = value; } clone.remove(); node.id = id; dragElement.remove(); stopDraggingBlocks2(); document.body.classList.remove( "is-dragging-components-draggable" ); ownerDocument.documentElement.classList.remove( "is-dragging" ); } ownerDocument.addEventListener("dragover", over); ownerDocument.addEventListener("dragend", end); ownerDocument.addEventListener("drop", end); ownerDocument.addEventListener("scroll", over); startDraggingBlocks2([clientId]); document.body.classList.add( "is-dragging-components-draggable" ); ownerDocument.documentElement.classList.add("is-dragging"); } node.addEventListener("keydown", onKeyDown); node.addEventListener("dragstart", onDragStart); function onDoubleClick(event) { const isSection = isSectionBlock2(clientId); const isAlreadyEditing = editedContentOnlySection2 === clientId; if (isSection && !isAlreadyEditing) { event.preventDefault(); editContentOnlySection2(clientId); } } if (window?.__experimentalContentOnlyPatternInsertion) { node.addEventListener("dblclick", onDoubleClick); } return () => { node.removeEventListener("keydown", onKeyDown); node.removeEventListener("dragstart", onDragStart); if (window?.__experimentalContentOnlyPatternInsertion) { node.removeEventListener("dblclick", onDoubleClick); } }; }, [ clientId, isSelected, getBlockRootClientId2, insertAfterBlock2, removeBlock2, isZoomOut2, resetZoomLevel2, hasMultiSelection2, startDraggingBlocks2, stopDraggingBlocks2, isSectionBlock2, editedContentOnlySection2, editContentOnlySection2 ] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js var import_compose11 = __toESM(require_compose()); var import_element29 = __toESM(require_element()); function useIntersectionObserver() { const observer = (0, import_element29.useContext)(IntersectionObserver); return (0, import_compose11.useRefEffect)( (node) => { if (observer) { observer.observe(node); return () => { observer.unobserve(node); }; } }, [observer] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-scroll-into-view.js var import_compose12 = __toESM(require_compose()); function useScrollIntoView({ isSelected }) { const prefersReducedMotion = (0, import_compose12.useReducedMotion)(); return (0, import_compose12.useRefEffect)( (node) => { if (isSelected) { const { ownerDocument } = node; const { defaultView } = ownerDocument; if (!defaultView.IntersectionObserver) { return; } const observer = new defaultView.IntersectionObserver( (entries) => { if (!entries[0].isIntersecting) { node.scrollIntoView({ behavior: prefersReducedMotion ? "instant" : "smooth" }); } observer.disconnect(); } ); observer.observe(node); return () => { observer.disconnect(); }; } }, [isSelected] ); } // packages/block-editor/build-module/components/use-flash-editable-blocks/index.js var import_compose13 = __toESM(require_compose()); var import_data24 = __toESM(require_data()); function useFlashEditableBlocks({ clientId = "", isEnabled = true } = {}) { const { getEnabledClientIdsTree: getEnabledClientIdsTree2 } = unlock((0, import_data24.useSelect)(store)); return (0, import_compose13.useRefEffect)( (element) => { if (!isEnabled) { return; } const flashEditableBlocks = () => { getEnabledClientIdsTree2(clientId).forEach( ({ clientId: id }) => { const block = element.querySelector( `[data-block="${id}"]` ); if (!block) { return; } block.classList.remove("has-editable-outline"); block.offsetWidth; block.classList.add("has-editable-outline"); } ); }; const handleClick = (event) => { const shouldFlash = event.target === element || event.target.classList.contains("is-root-container"); if (!shouldFlash) { return; } if (event.defaultPrevented) { return; } event.preventDefault(); flashEditableBlocks(); }; element.addEventListener("click", handleClick); return () => element.removeEventListener("click", handleClick); }, [isEnabled] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js var import_compose14 = __toESM(require_compose()); var nodesByDocument = /* @__PURE__ */ new Map(); function add(doc, node) { let set = nodesByDocument.get(doc); if (!set) { set = /* @__PURE__ */ new Set(); nodesByDocument.set(doc, set); doc.addEventListener("pointerdown", down); } set.add(node); } function remove3(doc, node) { const set = nodesByDocument.get(doc); if (set) { set.delete(node); restore(node); if (set.size === 0) { nodesByDocument.delete(doc); doc.removeEventListener("pointerdown", down); } } } function restore(node) { const prevDraggable = node.getAttribute("data-draggable"); if (prevDraggable) { node.removeAttribute("data-draggable"); if (prevDraggable === "true" && !node.getAttribute("draggable")) { node.setAttribute("draggable", "true"); } } } function down(event) { const { target } = event; const { ownerDocument, isContentEditable, tagName } = target; const isInputOrTextArea = ["INPUT", "TEXTAREA"].includes(tagName); const nodes = nodesByDocument.get(ownerDocument); if (isContentEditable || isInputOrTextArea) { for (const node of nodes) { if (node.getAttribute("draggable") === "true" && node.contains(target)) { node.removeAttribute("draggable"); node.setAttribute("data-draggable", "true"); } } } else { for (const node of nodes) { restore(node); } } } function useFirefoxDraggableCompatibility() { return (0, import_compose14.useRefEffect)((node) => { add(node.ownerDocument, node); return () => { remove3(node.ownerDocument, node); }; }, []); } // packages/block-editor/build-module/components/block-list/use-block-props/index.js function useBlockProps(props = {}, { __unstableIsHtml } = {}) { const { clientId, className, wrapperProps = {}, isAligned, index, mode: mode2, name, blockApiVersion, blockTitle, isSelected, isSubtreeDisabled, hasOverlay, initialPosition: initialPosition2, blockEditingMode, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging: isDragging3, hasChildSelected, isEditingDisabled, hasEditableOutline, isEditingContentOnlySection, defaultClassName, isSectionBlock: isSectionBlock2, isWithinSectionBlock, canMove, isBlockHidden: isBlockHidden2 } = (0, import_element30.useContext)(PrivateBlockContext); const blockLabel = (0, import_i18n24.sprintf)((0, import_i18n24.__)("Block: %s"), blockTitle); const htmlSuffix = mode2 === "html" && !__unstableIsHtml ? "-visual" : ""; const ffDragRef = useFirefoxDraggableCompatibility(); const isHoverEnabled = !isWithinSectionBlock; const mergedRefs = (0, import_compose15.useMergeRefs)([ props.ref, useFocusFirstElement({ clientId, initialPosition: initialPosition2 }), useBlockRefProvider(clientId), useFocusHandler(clientId), useEventHandlers({ clientId, isSelected }), useIsHovered({ isEnabled: isHoverEnabled }), useIntersectionObserver(), use_moving_animation_default({ triggerAnimationOnChange: index, clientId }), (0, import_compose15.useDisabled)({ isDisabled: !hasOverlay }), useFlashEditableBlocks({ clientId, isEnabled: isSectionBlock2 }), useScrollIntoView({ isSelected }), canMove ? ffDragRef : void 0 ]); const blockEditContext = useBlockEditContext(); const hasBlockBindings = !!blockEditContext[blockBindingsKey]; const bindingsStyle = hasBlockBindings ? { "--wp-admin-theme-color": "var(--wp-block-synced-color)", "--wp-admin-theme-color--rgb": "var(--wp-block-synced-color--rgb)" } : {}; if (blockApiVersion < 2 && clientId === blockEditContext.clientId) { (0, import_warning4.default)( `Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.` ); } let hasNegativeMargin = false; if (wrapperProps?.style?.marginTop?.charAt(0) === "-" || wrapperProps?.style?.marginBottom?.charAt(0) === "-" || wrapperProps?.style?.marginLeft?.charAt(0) === "-" || wrapperProps?.style?.marginRight?.charAt(0) === "-") { hasNegativeMargin = true; } return { tabIndex: blockEditingMode === "disabled" ? -1 : 0, draggable: canMove && !hasChildSelected ? true : void 0, ...wrapperProps, ...props, ref: mergedRefs, id: `block-${clientId}${htmlSuffix}`, role: "document", "aria-label": blockLabel, "data-block": clientId, "data-type": name, "data-title": blockTitle, inert: isSubtreeDisabled ? "true" : void 0, className: clsx_default( "block-editor-block-list__block", { // The wp-block className is important for editor styles. "wp-block": !isAligned, "has-block-overlay": hasOverlay, "is-selected": isSelected, "is-highlighted": isHighlighted, "is-multi-selected": isMultiSelected, "is-partially-selected": isPartiallySelected, "is-reusable": isReusable, "is-dragging": isDragging3, "has-child-selected": hasChildSelected, "is-editing-disabled": isEditingDisabled, "has-editable-outline": hasEditableOutline, "has-negative-margin": hasNegativeMargin, "is-editing-content-only-section": isEditingContentOnlySection, "is-block-hidden": isBlockHidden2 }, className, props.className, wrapperProps.className, defaultClassName ), style: { ...wrapperProps.style, ...props.style, ...bindingsStyle } }; } useBlockProps.save = import_blocks19.__unstableGetBlockProps; // packages/block-editor/build-module/components/block-list/block.js var import_jsx_runtime145 = __toESM(require_jsx_runtime()); function mergeWrapperProps(propsA, propsB) { const newProps = { ...propsA, ...propsB }; if (propsA?.hasOwnProperty("className") && propsB?.hasOwnProperty("className")) { newProps.className = clsx_default(propsA.className, propsB.className); } if (propsA?.hasOwnProperty("style") && propsB?.hasOwnProperty("style")) { newProps.style = { ...propsA.style, ...propsB.style }; } return newProps; } function Block({ children, isHtml, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { ...useBlockProps(props, { __unstableIsHtml: isHtml }), children }); } function BlockListBlock({ block: { __unstableBlockSource }, mode: mode2, isLocked, canRemove, clientId, isSelected, isSelectionEnabled: isSelectionEnabled3, className, __unstableLayoutClassNames: layoutClassNames, name, isValid: isValid2, attributes, wrapperProps, setAttributes, onReplace, onRemove, onInsertBlocksAfter, onMerge, toggleSelection: toggleSelection2 }) { const { mayDisplayControls, mayDisplayParentControls, themeSupportsLayout, ...context } = (0, import_element31.useContext)(PrivateBlockContext); const parentLayout = useLayout() || {}; let blockEdit = /* @__PURE__ */ (0, import_jsx_runtime145.jsx)( BlockEdit, { name, isSelected, attributes, setAttributes, insertBlocksAfter: isLocked ? void 0 : onInsertBlocksAfter, onReplace: canRemove ? onReplace : void 0, onRemove: canRemove ? onRemove : void 0, mergeBlocks: canRemove ? onMerge : void 0, clientId, isSelectionEnabled: isSelectionEnabled3, toggleSelection: toggleSelection2, __unstableLayoutClassNames: layoutClassNames, __unstableParentLayout: Object.keys(parentLayout).length ? parentLayout : void 0, mayDisplayControls, mayDisplayParentControls, blockEditingMode: context.blockEditingMode, isPreviewMode: context.isPreviewMode } ); const blockType = (0, import_blocks20.getBlockType)(name); if (blockType?.getEditWrapperProps) { wrapperProps = mergeWrapperProps( wrapperProps, blockType.getEditWrapperProps(attributes) ); } const isAligned = wrapperProps && !!wrapperProps["data-align"] && !themeSupportsLayout; const isSticky = className?.includes("is-position-sticky"); if (isAligned) { blockEdit = /* @__PURE__ */ (0, import_jsx_runtime145.jsx)( "div", { className: clsx_default("wp-block", isSticky && className), "data-align": wrapperProps["data-align"], children: blockEdit } ); } let block; if (!isValid2) { const saveContent = __unstableBlockSource ? (0, import_blocks20.serializeRawBlock)(__unstableBlockSource) : (0, import_blocks20.getSaveContent)(blockType, attributes); block = /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(Block, { className: "has-warning", children: [ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(BlockInvalidWarning, { clientId }), /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_element31.RawHTML, { children: (0, import_dom7.safeHTML)(saveContent) }) ] }); } else if (mode2 === "html") { block = /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { style: { display: "none" }, children: blockEdit }), /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Block, { isHtml: true, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(block_html_default, { clientId }) }) ] }); } else if (blockType?.apiVersion > 1) { block = blockEdit; } else { block = /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Block, { children: blockEdit }); } const { "data-align": dataAlign, ...restWrapperProps } = wrapperProps ?? {}; const updatedWrapperProps = { ...restWrapperProps, className: clsx_default( restWrapperProps.className, dataAlign && themeSupportsLayout && `align${dataAlign}`, !(dataAlign && isSticky) && className ) }; return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)( PrivateBlockContext.Provider, { value: { wrapperProps: updatedWrapperProps, isAligned, ...context }, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)( block_crash_boundary_default, { fallback: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Block, { className: "has-warning", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(block_crash_warning_default, {}) }), children: block } ) } ); } var applyWithDispatch = (0, import_data25.withDispatch)((dispatch, ownProps, registry) => { const { updateBlockAttributes: updateBlockAttributes2, insertBlocks: insertBlocks2, mergeBlocks: mergeBlocks2, replaceBlocks: replaceBlocks2, toggleSelection: toggleSelection2, __unstableMarkLastChangeAsPersistent: __unstableMarkLastChangeAsPersistent2, moveBlocksToPosition: moveBlocksToPosition2, removeBlock: removeBlock2, selectBlock: selectBlock2 } = dispatch(store); return { setAttributes(nextAttributes) { const { getMultiSelectedBlockClientIds: getMultiSelectedBlockClientIds2 } = registry.select(store); const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds2(); const { clientId, attributes } = ownProps; const clientIds = multiSelectedBlockClientIds.length ? multiSelectedBlockClientIds : [clientId]; const newAttributes = typeof nextAttributes === "function" ? nextAttributes(attributes) : nextAttributes; updateBlockAttributes2(clientIds, newAttributes); }, onInsertBlocks(blocks2, index) { const { rootClientId } = ownProps; insertBlocks2(blocks2, index, rootClientId); }, onInsertBlocksAfter(blocks2) { const { clientId, rootClientId } = ownProps; const { getBlockIndex: getBlockIndex2 } = registry.select(store); const index = getBlockIndex2(clientId); insertBlocks2(blocks2, index + 1, rootClientId); }, onMerge(forward) { const { clientId, rootClientId } = ownProps; const { getPreviousBlockClientId: getPreviousBlockClientId2, getNextBlockClientId: getNextBlockClientId2, getBlock: getBlock2, getBlockAttributes: getBlockAttributes3, getBlockName: getBlockName2, getBlockOrder: getBlockOrder2, getBlockIndex: getBlockIndex2, getBlockRootClientId: getBlockRootClientId2, canInsertBlockType: canInsertBlockType2 } = registry.select(store); function switchToDefaultOrRemove() { const block = getBlock2(clientId); const defaultBlockName = (0, import_blocks20.getDefaultBlockName)(); const defaultBlockType = (0, import_blocks20.getBlockType)(defaultBlockName); if (getBlockName2(clientId) !== defaultBlockName) { const replacement = (0, import_blocks20.switchToBlockType)( block, defaultBlockName ); if (replacement && replacement.length) { replaceBlocks2(clientId, replacement); } } else if ((0, import_blocks20.isUnmodifiedDefaultBlock)(block)) { const nextBlockClientId = getNextBlockClientId2(clientId); if (nextBlockClientId) { registry.batch(() => { removeBlock2(clientId); selectBlock2(nextBlockClientId); }); } } else if (defaultBlockType.merge) { const attributes = defaultBlockType.merge( {}, block.attributes ); replaceBlocks2( [clientId], [(0, import_blocks20.createBlock)(defaultBlockName, attributes)] ); } } function moveFirstItemUp(_clientId, changeSelection = true) { const wrapperBlockName = getBlockName2(_clientId); const wrapperBlockType = (0, import_blocks20.getBlockType)(wrapperBlockName); const isTextualWrapper = wrapperBlockType.category === "text"; const targetRootClientId = getBlockRootClientId2(_clientId); const blockOrder = getBlockOrder2(_clientId); const [firstClientId] = blockOrder; if (blockOrder.length === 1 && (0, import_blocks20.isUnmodifiedBlock)(getBlock2(firstClientId))) { removeBlock2(_clientId); } else if (isTextualWrapper) { registry.batch(() => { if (canInsertBlockType2( getBlockName2(firstClientId), targetRootClientId )) { moveBlocksToPosition2( [firstClientId], _clientId, targetRootClientId, getBlockIndex2(_clientId) ); } else { const replacement = (0, import_blocks20.switchToBlockType)( getBlock2(firstClientId), (0, import_blocks20.getDefaultBlockName)() ); if (replacement && replacement.length && replacement.every( (block) => canInsertBlockType2( block.name, targetRootClientId ) )) { insertBlocks2( replacement, getBlockIndex2(_clientId), targetRootClientId, changeSelection ); removeBlock2(firstClientId, false); } else { switchToDefaultOrRemove(); } } if (!getBlockOrder2(_clientId).length && (0, import_blocks20.isUnmodifiedBlock)(getBlock2(_clientId))) { removeBlock2(_clientId, false); } }); } else { switchToDefaultOrRemove(); } } if (forward) { if (rootClientId) { const nextRootClientId = getNextBlockClientId2(rootClientId); if (nextRootClientId) { if (getBlockName2(rootClientId) === getBlockName2(nextRootClientId)) { const rootAttributes = getBlockAttributes3(rootClientId); const previousRootAttributes = getBlockAttributes3(nextRootClientId); if (Object.keys(rootAttributes).every( (key) => rootAttributes[key] === previousRootAttributes[key] )) { registry.batch(() => { moveBlocksToPosition2( getBlockOrder2(nextRootClientId), nextRootClientId, rootClientId ); removeBlock2(nextRootClientId, false); }); return; } } else { mergeBlocks2(rootClientId, nextRootClientId); return; } } } const nextBlockClientId = getNextBlockClientId2(clientId); if (!nextBlockClientId) { return; } if (getBlockOrder2(nextBlockClientId).length) { moveFirstItemUp(nextBlockClientId, false); } else { mergeBlocks2(clientId, nextBlockClientId); } } else { const previousBlockClientId = getPreviousBlockClientId2(clientId); if (previousBlockClientId) { mergeBlocks2(previousBlockClientId, clientId); } else if (rootClientId) { const previousRootClientId = getPreviousBlockClientId2(rootClientId); if (previousRootClientId && getBlockName2(rootClientId) === getBlockName2(previousRootClientId)) { const rootAttributes = getBlockAttributes3(rootClientId); const previousRootAttributes = getBlockAttributes3(previousRootClientId); if (Object.keys(rootAttributes).every( (key) => rootAttributes[key] === previousRootAttributes[key] )) { registry.batch(() => { moveBlocksToPosition2( getBlockOrder2(rootClientId), rootClientId, previousRootClientId ); removeBlock2(rootClientId, false); }); return; } } moveFirstItemUp(rootClientId); } else { switchToDefaultOrRemove(); } } }, onReplace(blocks2, indexToSelect, initialPosition2) { if (blocks2.length && !(0, import_blocks20.isUnmodifiedDefaultBlock)(blocks2[blocks2.length - 1])) { __unstableMarkLastChangeAsPersistent2(); } const replacementBlocks = blocks2?.length === 1 && Array.isArray(blocks2[0]) ? blocks2[0] : blocks2; replaceBlocks2( [ownProps.clientId], replacementBlocks, indexToSelect, initialPosition2 ); }, onRemove() { removeBlock2(ownProps.clientId); }, toggleSelection(selectionEnabled) { toggleSelection2(selectionEnabled); } }; }); BlockListBlock = (0, import_compose16.compose)( applyWithDispatch, (0, import_components24.withFilters)("editor.BlockListBlock") )(BlockListBlock); function BlockListBlockProvider(props) { const { clientId, rootClientId } = props; const selectedProps = (0, import_data25.useSelect)( (select3) => { const { isBlockSelected: isBlockSelected2, getBlockMode: getBlockMode2, isSelectionEnabled: isSelectionEnabled22, getTemplateLock: getTemplateLock2, isSectionBlock: _isSectionBlock, getParentSectionBlock: getParentSectionBlock2, getBlockWithoutAttributes: getBlockWithoutAttributes2, getBlockAttributes: getBlockAttributes3, canRemoveBlock: canRemoveBlock2, canMoveBlock: canMoveBlock2, getSettings: getSettings8, getEditedContentOnlySection: getEditedContentOnlySection2, getBlockEditingMode: getBlockEditingMode2, getBlockName: getBlockName2, isFirstMultiSelectedBlock: isFirstMultiSelectedBlock2, getMultiSelectedBlockClientIds: getMultiSelectedBlockClientIds2, hasSelectedInnerBlock: hasSelectedInnerBlock2, getBlocksByName: getBlocksByName2, getBlockIndex: getBlockIndex2, isBlockMultiSelected: isBlockMultiSelected2, isBlockSubtreeDisabled: isBlockSubtreeDisabled2, isBlockHighlighted: isBlockHighlighted2, __unstableIsFullySelected: __unstableIsFullySelected2, __unstableSelectionHasUnmergeableBlock: __unstableSelectionHasUnmergeableBlock2, isBlockBeingDragged: isBlockBeingDragged2, isDragging: isDragging22, __unstableHasActiveBlockOverlayActive: __unstableHasActiveBlockOverlayActive2, getSelectedBlocksInitialCaretPosition: getSelectedBlocksInitialCaretPosition2 } = unlock(select3(store)); const blockWithoutAttributes2 = getBlockWithoutAttributes2(clientId); if (!blockWithoutAttributes2) { return; } const { hasBlockSupport: _hasBlockSupport, getActiveBlockVariation } = select3(import_blocks20.store); const attributes2 = getBlockAttributes3(clientId); const { name: blockName, isValid: isValid22 } = blockWithoutAttributes2; const blockType = (0, import_blocks20.getBlockType)(blockName); const { supportsLayout, isPreviewMode: isPreviewMode2, __experimentalBlockBindingsSupportedAttributes } = getSettings8(); const bindableAttributes2 = __experimentalBlockBindingsSupportedAttributes?.[blockName]; const hasLightBlockWrapper = blockType?.apiVersion > 1; const previewContext = { isPreviewMode: isPreviewMode2, blockWithoutAttributes: blockWithoutAttributes2, name: blockName, attributes: attributes2, isValid: isValid22, themeSupportsLayout: supportsLayout, index: getBlockIndex2(clientId), isReusable: (0, import_blocks20.isReusableBlock)(blockType), className: hasLightBlockWrapper ? attributes2.className : void 0, defaultClassName: hasLightBlockWrapper ? (0, import_blocks20.getBlockDefaultClassName)(blockName) : void 0, blockTitle: blockType?.title, isBlockHidden: attributes2?.metadata?.blockVisibility === false, bindableAttributes: bindableAttributes2 }; if (isPreviewMode2) { return previewContext; } const { isBlockHidden: _isBlockHidden } = unlock( select3(store) ); const _isSelected = isBlockSelected2(clientId); const canRemove2 = canRemoveBlock2(clientId); const canMove2 = canMoveBlock2(clientId); const match2 = getActiveBlockVariation(blockName, attributes2); const isMultiSelected2 = isBlockMultiSelected2(clientId); const checkDeep = true; const isAncestorOfSelectedBlock = hasSelectedInnerBlock2( clientId, checkDeep ); const blockEditingMode2 = getBlockEditingMode2(clientId); const multiple = (0, import_blocks20.hasBlockSupport)(blockName, "multiple", true); const blocksWithSameName = multiple ? [] : getBlocksByName2(blockName); const isInvalid = blocksWithSameName.length && blocksWithSameName[0] !== clientId; return { ...previewContext, mode: getBlockMode2(clientId), isSelectionEnabled: isSelectionEnabled22(), isLocked: !!getTemplateLock2(rootClientId), isSectionBlock: _isSectionBlock(clientId), isWithinSectionBlock: _isSectionBlock(clientId) || !!getParentSectionBlock2(clientId), canRemove: canRemove2, canMove: canMove2, isSelected: _isSelected, isEditingContentOnlySection: getEditedContentOnlySection2() === clientId, blockEditingMode: blockEditingMode2, mayDisplayControls: _isSelected || isFirstMultiSelectedBlock2(clientId) && getMultiSelectedBlockClientIds2().every( (id) => getBlockName2(id) === blockName ), mayDisplayParentControls: _hasBlockSupport( getBlockName2(clientId), "__experimentalExposeControlsToChildren", false ) && hasSelectedInnerBlock2(clientId), blockApiVersion: blockType?.apiVersion || 1, blockTitle: match2?.title || blockType?.title, isSubtreeDisabled: blockEditingMode2 === "disabled" && isBlockSubtreeDisabled2(clientId), hasOverlay: __unstableHasActiveBlockOverlayActive2(clientId) && !isDragging22(), initialPosition: _isSelected ? getSelectedBlocksInitialCaretPosition2() : void 0, isHighlighted: isBlockHighlighted2(clientId), isMultiSelected: isMultiSelected2, isPartiallySelected: isMultiSelected2 && !__unstableIsFullySelected2() && !__unstableSelectionHasUnmergeableBlock2(), isDragging: isBlockBeingDragged2(clientId), hasChildSelected: isAncestorOfSelectedBlock, isEditingDisabled: blockEditingMode2 === "disabled", hasEditableOutline: blockEditingMode2 !== "disabled" && getBlockEditingMode2(rootClientId) === "disabled", originalBlockClientId: isInvalid ? blocksWithSameName[0] : false, isBlockHidden: _isBlockHidden(clientId) }; }, [clientId, rootClientId] ); const { isPreviewMode, // Fill values that end up as a public API and may not be defined in // preview mode. mode: mode2 = "visual", isSelectionEnabled: isSelectionEnabled3 = false, isLocked = false, canRemove = false, canMove = false, blockWithoutAttributes, name, attributes, isValid: isValid2, isSelected = false, themeSupportsLayout, isEditingContentOnlySection, blockEditingMode, mayDisplayControls, mayDisplayParentControls, index, blockApiVersion, blockTitle, isSubtreeDisabled, hasOverlay, initialPosition: initialPosition2, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging: isDragging3, hasChildSelected, isSectionBlock: isSectionBlock2, isWithinSectionBlock, isEditingDisabled, hasEditableOutline, className, defaultClassName, originalBlockClientId, isBlockHidden: isBlockHidden2, bindableAttributes } = selectedProps; const block = (0, import_element31.useMemo)( () => ({ ...blockWithoutAttributes, attributes }), [blockWithoutAttributes, attributes] ); if (!selectedProps) { return null; } const privateContext = { isPreviewMode, clientId, className, index, mode: mode2, name, blockApiVersion, blockTitle, isSelected, isSubtreeDisabled, hasOverlay, initialPosition: initialPosition2, blockEditingMode, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging: isDragging3, hasChildSelected, isSectionBlock: isSectionBlock2, isWithinSectionBlock, isEditingDisabled, hasEditableOutline, isEditingContentOnlySection, defaultClassName, mayDisplayControls, mayDisplayParentControls, originalBlockClientId, themeSupportsLayout, canMove, isBlockHidden: isBlockHidden2, bindableAttributes }; if (isBlockHidden2 && !isSelected && !isMultiSelected && !hasChildSelected) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(PrivateBlockContext.Provider, { value: privateContext, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)( BlockListBlock, { ...props, ...{ mode: mode2, isSelectionEnabled: isSelectionEnabled3, isLocked, canRemove, canMove, // Users of the editor.BlockListBlock filter used to be able // to access the block prop. Ideally these blocks would rely // on the clientId prop only. This is kept for backward // compatibility reasons. block, name, attributes, isValid: isValid2, isSelected } } ) }); } var block_default2 = (0, import_element31.memo)(BlockListBlockProvider); // packages/block-editor/build-module/components/block-list-appender/index.js var import_data61 = __toESM(require_data()); var import_blocks36 = __toESM(require_blocks()); // packages/block-editor/build-module/components/default-block-appender/index.js var import_i18n60 = __toESM(require_i18n()); var import_html_entities2 = __toESM(require_html_entities()); var import_data60 = __toESM(require_data()); var import_keycodes7 = __toESM(require_keycodes()); // packages/block-editor/build-module/components/inserter/index.js var import_a11y10 = __toESM(require_a11y()); var import_i18n59 = __toESM(require_i18n()); var import_components58 = __toESM(require_components()); var import_element76 = __toESM(require_element()); var import_data59 = __toESM(require_data()); var import_compose44 = __toESM(require_compose()); var import_blocks35 = __toESM(require_blocks()); // packages/block-editor/build-module/components/inserter/menu.js var import_element74 = __toESM(require_element()); var import_components56 = __toESM(require_components()); var import_i18n57 = __toESM(require_i18n()); var import_compose43 = __toESM(require_compose()); var import_data57 = __toESM(require_data()); // packages/block-editor/build-module/components/inserter/tips.js var import_i18n25 = __toESM(require_i18n()); var import_element32 = __toESM(require_element()); var import_components25 = __toESM(require_components()); var import_jsx_runtime146 = __toESM(require_jsx_runtime()); var globalTips = [ (0, import_element32.createInterpolateElement)( (0, import_i18n25.__)( "While writing, you can press / to quickly insert new blocks." ), { kbd: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("kbd", {}) } ), (0, import_element32.createInterpolateElement)( (0, import_i18n25.__)( "Indent a list by pressing space at the beginning of a line." ), { kbd: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("kbd", {}) } ), (0, import_element32.createInterpolateElement)( (0, import_i18n25.__)( "Outdent a list by pressing backspace at the beginning of a line." ), { kbd: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("kbd", {}) } ), (0, import_i18n25.__)("Drag files into the editor to automatically insert media blocks."), (0, import_i18n25.__)("Change a block's type by pressing the block icon on the toolbar.") ]; function Tips() { const [randomIndex] = (0, import_element32.useState)( Math.floor(Math.random() * globalTips.length) ); return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_components25.Tip, { children: globalTips[randomIndex] }); } var tips_default = Tips; // packages/block-editor/build-module/components/inserter/preview-panel.js var import_blocks26 = __toESM(require_blocks()); var import_element49 = __toESM(require_element()); var import_i18n35 = __toESM(require_i18n()); // packages/block-editor/build-module/components/block-card/index.js var import_components26 = __toESM(require_components()); var import_data26 = __toESM(require_data()); var import_deprecated6 = __toESM(require_deprecated()); var import_i18n26 = __toESM(require_i18n()); var import_jsx_runtime147 = __toESM(require_jsx_runtime()); var { Badge } = unlock(import_components26.privateApis); function OptionalParentSelectButton({ children, onClick }) { if (!onClick) { return children; } return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components26.Button, { __next40pxDefaultSize: true, className: "block-editor-block-card__parent-select-button", onClick, children } ); } function BlockCard({ title, icon, description, blockType, className, name, allowParentNavigation, parentClientId, isChild, children, clientId }) { if (blockType) { (0, import_deprecated6.default)("`blockType` property in `BlockCard component`", { since: "5.7", alternative: "`title, icon and description` properties" }); ({ title, icon, description } = blockType); } const parentNavBlockClientId = (0, import_data26.useSelect)( (select3) => { if (parentClientId || isChild || !allowParentNavigation) { return; } const { getBlockParentsByBlockName: getBlockParentsByBlockName2 } = select3(store); return getBlockParentsByBlockName2( clientId, "core/navigation", true )[0]; }, [clientId, allowParentNavigation, isChild, parentClientId] ); const { selectBlock: selectBlock2 } = (0, import_data26.useDispatch)(store); const TitleElement = parentClientId ? "div" : "h2"; return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)( "div", { className: clsx_default( "block-editor-block-card", { "is-parent": parentClientId, "is-child": isChild }, className ), children: [ parentNavBlockClientId && // This is only used by the Navigation block for now. It's not ideal having Navigation block specific code here. /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components26.Button, { onClick: () => selectBlock2(parentNavBlockClientId), label: parentNavBlockClientId ? (0, import_i18n26.__)("Go to parent Navigation block") : ( // TODO - improve copy, not sure that we should use the term 'section' (0, import_i18n26.__)("Go to parent section") ), style: ( // TODO: This style override is also used in ToolsPanelHeader. // It should be supported out-of-the-box by Button. { minWidth: 24, padding: 0 } ), icon: (0, import_i18n26.isRTL)() ? chevron_right_default : chevron_left_default, size: "small" } ), isChild && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "block-editor-block-card__child-indicator-icon", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_components26.Icon, { icon: (0, import_i18n26.isRTL)() ? arrow_left_default : arrow_right_default }) }), /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)( OptionalParentSelectButton, { onClick: parentClientId ? () => { selectBlock2(parentClientId); } : void 0, children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(block_icon_default, { icon, showColors: true }), /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_components26.__experimentalVStack, { spacing: 1, children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(TitleElement, { className: "block-editor-block-card__title", children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "block-editor-block-card__name", children: !!name?.length ? name : title }), !parentClientId && !isChild && !!name?.length && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Badge, { children: title }) ] }), !parentClientId && !isChild && description && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_components26.__experimentalText, { className: "block-editor-block-card__description", children: description }), children ] }) ] } ) ] } ); } var block_card_default = BlockCard; // packages/block-editor/build-module/components/block-preview/index.js var import_compose32 = __toESM(require_compose()); var import_data48 = __toESM(require_data()); var import_element48 = __toESM(require_element()); var import_deprecated7 = __toESM(require_deprecated()); // packages/block-editor/build-module/components/provider/index.js var import_data33 = __toESM(require_data()); var import_element39 = __toESM(require_element()); var import_components27 = __toESM(require_components()); // packages/upload-media/build-module/store/index.js var import_data27 = __toESM(require_data()); // packages/upload-media/build-module/store/types.js var Type = /* @__PURE__ */ ((Type2) => { Type2["Unknown"] = "REDUX_UNKNOWN"; Type2["Add"] = "ADD_ITEM"; Type2["Prepare"] = "PREPARE_ITEM"; Type2["Cancel"] = "CANCEL_ITEM"; Type2["Remove"] = "REMOVE_ITEM"; Type2["PauseItem"] = "PAUSE_ITEM"; Type2["ResumeItem"] = "RESUME_ITEM"; Type2["PauseQueue"] = "PAUSE_QUEUE"; Type2["ResumeQueue"] = "RESUME_QUEUE"; Type2["OperationStart"] = "OPERATION_START"; Type2["OperationFinish"] = "OPERATION_FINISH"; Type2["AddOperations"] = "ADD_OPERATIONS"; Type2["CacheBlobUrl"] = "CACHE_BLOB_URL"; Type2["RevokeBlobUrls"] = "REVOKE_BLOB_URLS"; Type2["UpdateSettings"] = "UPDATE_SETTINGS"; return Type2; })(Type || {}); var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => { ItemStatus2["Processing"] = "PROCESSING"; ItemStatus2["Paused"] = "PAUSED"; return ItemStatus2; })(ItemStatus || {}); var OperationType = /* @__PURE__ */ ((OperationType2) => { OperationType2["Prepare"] = "PREPARE"; OperationType2["Upload"] = "UPLOAD"; return OperationType2; })(OperationType || {}); // packages/upload-media/build-module/store/reducer.js var noop4 = () => { }; var DEFAULT_STATE = { queue: [], queueStatus: "active", blobUrls: {}, settings: { mediaUpload: noop4 } }; function reducer(state = DEFAULT_STATE, action = { type: Type.Unknown }) { switch (action.type) { case Type.PauseQueue: { return { ...state, queueStatus: "paused" }; } case Type.ResumeQueue: { return { ...state, queueStatus: "active" }; } case Type.Add: return { ...state, queue: [...state.queue, action.item] }; case Type.Cancel: return { ...state, queue: state.queue.map( (item) => item.id === action.id ? { ...item, error: action.error } : item ) }; case Type.Remove: return { ...state, queue: state.queue.filter((item) => item.id !== action.id) }; case Type.OperationStart: { return { ...state, queue: state.queue.map( (item) => item.id === action.id ? { ...item, currentOperation: action.operation } : item ) }; } case Type.AddOperations: return { ...state, queue: state.queue.map((item) => { if (item.id !== action.id) { return item; } return { ...item, operations: [ ...item.operations || [], ...action.operations ] }; }) }; case Type.OperationFinish: return { ...state, queue: state.queue.map((item) => { if (item.id !== action.id) { return item; } const operations = item.operations ? item.operations.slice(1) : []; const attachment = item.attachment || action.item.attachment ? { ...item.attachment, ...action.item.attachment } : void 0; return { ...item, currentOperation: void 0, operations, ...action.item, attachment, additionalData: { ...item.additionalData, ...action.item.additionalData } }; }) }; case Type.CacheBlobUrl: { const blobUrls = state.blobUrls[action.id] || []; return { ...state, blobUrls: { ...state.blobUrls, [action.id]: [...blobUrls, action.blobUrl] } }; } case Type.RevokeBlobUrls: { const newBlobUrls = { ...state.blobUrls }; delete newBlobUrls[action.id]; return { ...state, blobUrls: newBlobUrls }; } case Type.UpdateSettings: { return { ...state, settings: { ...state.settings, ...action.settings } }; } } return state; } var reducer_default2 = reducer; // packages/upload-media/build-module/store/selectors.js var selectors_exports2 = {}; __export(selectors_exports2, { getItems: () => getItems, getSettings: () => getSettings2, isUploading: () => isUploading, isUploadingById: () => isUploadingById, isUploadingByUrl: () => isUploadingByUrl }); function getItems(state) { return state.queue; } function isUploading(state) { return state.queue.length >= 1; } function isUploadingByUrl(state, url) { return state.queue.some( (item) => item.attachment?.url === url || item.sourceUrl === url ); } function isUploadingById(state, attachmentId) { return state.queue.some( (item) => item.attachment?.id === attachmentId || item.sourceAttachmentId === attachmentId ); } function getSettings2(state) { return state.settings; } // packages/upload-media/build-module/store/private-selectors.js var private_selectors_exports2 = {}; __export(private_selectors_exports2, { getAllItems: () => getAllItems, getBlobUrls: () => getBlobUrls, getItem: () => getItem, getPausedUploadForPost: () => getPausedUploadForPost, isBatchUploaded: () => isBatchUploaded, isPaused: () => isPaused2, isUploadingToPost: () => isUploadingToPost }); function getAllItems(state) { return state.queue; } function getItem(state, id) { return state.queue.find((item) => item.id === id); } function isBatchUploaded(state, batchId) { const batchItems = state.queue.filter( (item) => batchId === item.batchId ); return batchItems.length === 0; } function isUploadingToPost(state, postOrAttachmentId) { return state.queue.some( (item) => item.currentOperation === OperationType.Upload && item.additionalData.post === postOrAttachmentId ); } function getPausedUploadForPost(state, postOrAttachmentId) { return state.queue.find( (item) => item.status === ItemStatus.Paused && item.additionalData.post === postOrAttachmentId ); } function isPaused2(state) { return state.queueStatus === "paused"; } function getBlobUrls(state, id) { return state.blobUrls[id] || []; } // packages/upload-media/build-module/store/actions.js var actions_exports2 = {}; __export(actions_exports2, { addItems: () => addItems, cancelItem: () => cancelItem }); // node_modules/uuid/dist/esm-browser/rng.js var getRandomValues; var rnds8 = new Uint8Array(16); function rng() { if (!getRandomValues) { getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues) { throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); } } return getRandomValues(rnds8); } // node_modules/uuid/dist/esm-browser/stringify.js var byteToHex = []; for (let i2 = 0; i2 < 256; ++i2) { byteToHex.push((i2 + 256).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } // node_modules/uuid/dist/esm-browser/native.js var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); var native_default = { randomUUID }; // node_modules/uuid/dist/esm-browser/v4.js function v4(options, buf, offset) { if (native_default.randomUUID && !buf && !options) { return native_default.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); rnds[6] = rnds[6] & 15 | 64; rnds[8] = rnds[8] & 63 | 128; if (buf) { offset = offset || 0; for (let i2 = 0; i2 < 16; ++i2) { buf[offset + i2] = rnds[i2]; } return buf; } return unsafeStringify(rnds); } var v4_default = v4; // packages/upload-media/build-module/validate-mime-type.js var import_i18n27 = __toESM(require_i18n()); // packages/upload-media/build-module/upload-error.js var UploadError = class extends Error { code; file; constructor({ code, message: message2, file, cause }) { super(message2, { cause }); Object.setPrototypeOf(this, new.target.prototype); this.code = code; this.file = file; } }; // packages/upload-media/build-module/validate-mime-type.js function validateMimeType(file, allowedTypes) { if (!allowedTypes) { return; } const isAllowedType = allowedTypes.some((allowedType) => { if (allowedType.includes("/")) { return allowedType === file.type; } return file.type.startsWith(`${allowedType}/`); }); if (file.type && !isAllowedType) { throw new UploadError({ code: "MIME_TYPE_NOT_SUPPORTED", message: (0, import_i18n27.sprintf)( // translators: %s: file name. (0, import_i18n27.__)("%s: Sorry, this file type is not supported here."), file.name ), file }); } } // packages/upload-media/build-module/validate-mime-type-for-user.js var import_i18n28 = __toESM(require_i18n()); // packages/upload-media/build-module/get-mime-types-array.js function getMimeTypesArray(wpMimeTypesObject) { if (!wpMimeTypesObject) { return null; } return Object.entries(wpMimeTypesObject).flatMap( ([extensionsString, mime]) => { const [type] = mime.split("/"); const extensions = extensionsString.split("|"); return [ mime, ...extensions.map( (extension) => `${type}/${extension}` ) ]; } ); } // packages/upload-media/build-module/validate-mime-type-for-user.js function validateMimeTypeForUser(file, wpAllowedMimeTypes) { const allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes); if (!allowedMimeTypesForUser) { return; } const isAllowedMimeTypeForUser = allowedMimeTypesForUser.includes( file.type ); if (file.type && !isAllowedMimeTypeForUser) { throw new UploadError({ code: "MIME_TYPE_NOT_ALLOWED_FOR_USER", message: (0, import_i18n28.sprintf)( // translators: %s: file name. (0, import_i18n28.__)( "%s: Sorry, you are not allowed to upload this file type." ), file.name ), file }); } } // packages/upload-media/build-module/validate-file-size.js var import_i18n29 = __toESM(require_i18n()); function validateFileSize(file, maxUploadFileSize) { if (file.size <= 0) { throw new UploadError({ code: "EMPTY_FILE", message: (0, import_i18n29.sprintf)( // translators: %s: file name. (0, import_i18n29.__)("%s: This file is empty."), file.name ), file }); } if (maxUploadFileSize && file.size > maxUploadFileSize) { throw new UploadError({ code: "SIZE_ABOVE_LIMIT", message: (0, import_i18n29.sprintf)( // translators: %s: file name. (0, import_i18n29.__)( "%s: This file exceeds the maximum upload size for this site." ), file.name ), file }); } } // packages/upload-media/build-module/store/actions.js function addItems({ files, onChange, onSuccess, onError, onBatchSuccess, additionalData, allowedTypes }) { return async ({ select: select3, dispatch }) => { const batchId = v4_default(); for (const file of files) { try { validateMimeType(file, allowedTypes); validateMimeTypeForUser( file, select3.getSettings().allowedMimeTypes ); } catch (error) { onError?.(error); continue; } try { validateFileSize( file, select3.getSettings().maxUploadFileSize ); } catch (error) { onError?.(error); continue; } dispatch.addItem({ file, batchId, onChange, onSuccess, onBatchSuccess, onError, additionalData }); } }; } function cancelItem(id, error, silent = false) { return async ({ select: select3, dispatch }) => { const item = select3.getItem(id); if (!item) { return; } item.abortController?.abort(); if (!silent) { const { onError } = item; onError?.(error ?? new Error("Upload cancelled")); if (!onError && error) { console.error("Upload cancelled", error); } } dispatch({ type: Type.Cancel, id, error }); dispatch.removeItem(id); dispatch.revokeBlobUrls(id); if (item.batchId && select3.isBatchUploaded(item.batchId)) { item.onBatchSuccess?.(); } }; } // packages/upload-media/build-module/store/private-actions.js var private_actions_exports2 = {}; __export(private_actions_exports2, { addItem: () => addItem, finishOperation: () => finishOperation, pauseQueue: () => pauseQueue, prepareItem: () => prepareItem, processItem: () => processItem, removeItem: () => removeItem, resumeQueue: () => resumeQueue, revokeBlobUrls: () => revokeBlobUrls, updateSettings: () => updateSettings2, uploadItem: () => uploadItem }); var import_blob = __toESM(require_blob()); // packages/upload-media/build-module/utils.js var import_url3 = __toESM(require_url()); var import_i18n30 = __toESM(require_i18n()); function convertBlobToFile(fileOrBlob) { if (fileOrBlob instanceof File) { return fileOrBlob; } const ext = fileOrBlob.type.split("/")[1]; const mediaType = "application/pdf" === fileOrBlob.type ? "document" : fileOrBlob.type.split("/")[0]; return new File([fileOrBlob], `${mediaType}.${ext}`, { type: fileOrBlob.type }); } function renameFile(file, name) { return new File([file], name, { type: file.type, lastModified: file.lastModified }); } function cloneFile(file) { return renameFile(file, file.name); } // packages/upload-media/build-module/stub-file.js var StubFile = class extends File { constructor(fileName = "stub-file") { super([], fileName); } }; // packages/upload-media/build-module/store/private-actions.js function addItem({ file: fileOrBlob, batchId, onChange, onSuccess, onBatchSuccess, onError, additionalData = {}, sourceUrl, sourceAttachmentId, abortController, operations }) { return async ({ dispatch }) => { const itemId = v4_default(); const file = convertBlobToFile(fileOrBlob); let blobUrl; if (!(file instanceof StubFile)) { blobUrl = (0, import_blob.createBlobURL)(file); dispatch({ type: Type.CacheBlobUrl, id: itemId, blobUrl }); } dispatch({ type: Type.Add, item: { id: itemId, batchId, status: ItemStatus.Processing, sourceFile: cloneFile(file), file, attachment: { url: blobUrl }, additionalData: { convert_format: false, ...additionalData }, onChange, onSuccess, onBatchSuccess, onError, sourceUrl, sourceAttachmentId, abortController: abortController || new AbortController(), operations: Array.isArray(operations) ? operations : [OperationType.Prepare] } }); dispatch.processItem(itemId); }; } function processItem(id) { return async ({ select: select3, dispatch }) => { if (select3.isPaused()) { return; } const item = select3.getItem(id); const { attachment, onChange, onSuccess, onBatchSuccess, batchId } = item; const operation = Array.isArray(item.operations?.[0]) ? item.operations[0][0] : item.operations?.[0]; if (attachment) { onChange?.([attachment]); } if (!operation) { if (attachment) { onSuccess?.([attachment]); } dispatch.revokeBlobUrls(id); if (batchId && select3.isBatchUploaded(batchId)) { onBatchSuccess?.(); } return; } if (!operation) { return; } dispatch({ type: Type.OperationStart, id, operation }); switch (operation) { case OperationType.Prepare: dispatch.prepareItem(item.id); break; case OperationType.Upload: dispatch.uploadItem(id); break; } }; } function pauseQueue() { return { type: Type.PauseQueue }; } function resumeQueue() { return async ({ select: select3, dispatch }) => { dispatch({ type: Type.ResumeQueue }); for (const item of select3.getAllItems()) { dispatch.processItem(item.id); } }; } function removeItem(id) { return async ({ select: select3, dispatch }) => { const item = select3.getItem(id); if (!item) { return; } dispatch({ type: Type.Remove, id }); }; } function finishOperation(id, updates) { return async ({ dispatch }) => { dispatch({ type: Type.OperationFinish, id, item: updates }); dispatch.processItem(id); }; } function prepareItem(id) { return async ({ dispatch }) => { const operations = [OperationType.Upload]; dispatch({ type: Type.AddOperations, id, operations }); dispatch.finishOperation(id, {}); }; } function uploadItem(id) { return async ({ select: select3, dispatch }) => { const item = select3.getItem(id); select3.getSettings().mediaUpload({ filesList: [item.file], additionalData: item.additionalData, signal: item.abortController?.signal, onFileChange: ([attachment]) => { if (!(0, import_blob.isBlobURL)(attachment.url)) { dispatch.finishOperation(id, { attachment }); } }, onSuccess: ([attachment]) => { dispatch.finishOperation(id, { attachment }); }, onError: (error) => { dispatch.cancelItem(id, error); } }); }; } function revokeBlobUrls(id) { return async ({ select: select3, dispatch }) => { const blobUrls = select3.getBlobUrls(id); for (const blobUrl of blobUrls) { (0, import_blob.revokeBlobURL)(blobUrl); } dispatch({ type: Type.RevokeBlobUrls, id }); }; } function updateSettings2(settings2) { return { type: Type.UpdateSettings, settings: settings2 }; } // packages/upload-media/build-module/lock-unlock.js var import_private_apis2 = __toESM(require_private_apis()); var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__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/upload-media" ); // packages/upload-media/build-module/store/constants.js var STORE_NAME2 = "core/upload-media"; // packages/upload-media/build-module/store/index.js var storeConfig2 = { reducer: reducer_default2, selectors: selectors_exports2, actions: actions_exports2 }; var store2 = (0, import_data27.createReduxStore)(STORE_NAME2, { reducer: reducer_default2, selectors: selectors_exports2, actions: actions_exports2 }); (0, import_data27.register)(store2); unlock2(store2).registerPrivateActions(private_actions_exports2); unlock2(store2).registerPrivateSelectors(private_selectors_exports2); // packages/upload-media/build-module/components/provider/index.js var import_element34 = __toESM(require_element()); var import_data29 = __toESM(require_data()); // packages/upload-media/build-module/components/provider/with-registry-provider.js var import_element33 = __toESM(require_element()); var import_data28 = __toESM(require_data()); var import_compose17 = __toESM(require_compose()); var import_jsx_runtime148 = __toESM(require_jsx_runtime()); function getSubRegistry(subRegistries, registry, useSubRegistry) { if (!useSubRegistry) { return registry; } let subRegistry = subRegistries.get(registry); if (!subRegistry) { subRegistry = (0, import_data28.createRegistry)({}, registry); subRegistry.registerStore(STORE_NAME2, storeConfig2); subRegistries.set(registry, subRegistry); } return subRegistry; } var withRegistryProvider = (0, import_compose17.createHigherOrderComponent)( (WrappedComponent) => ({ useSubRegistry = true, ...props }) => { const registry = (0, import_data28.useRegistry)(); const [subRegistries] = (0, import_element33.useState)(() => /* @__PURE__ */ new WeakMap()); const subRegistry = getSubRegistry( subRegistries, registry, useSubRegistry ); if (subRegistry === registry) { return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(WrappedComponent, { registry, ...props }); } return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_data28.RegistryProvider, { value: subRegistry, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(WrappedComponent, { registry: subRegistry, ...props }) }); }, "withRegistryProvider" ); var with_registry_provider_default = withRegistryProvider; // packages/upload-media/build-module/components/provider/index.js var import_jsx_runtime149 = __toESM(require_jsx_runtime()); var MediaUploadProvider = with_registry_provider_default((props) => { const { children, settings: settings2 } = props; const { updateSettings: updateSettings3 } = unlock2((0, import_data29.useDispatch)(store2)); (0, import_element34.useEffect)(() => { updateSettings3(settings2); }, [settings2, updateSettings3]); return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_jsx_runtime149.Fragment, { children }); }); var provider_default = MediaUploadProvider; // packages/block-editor/build-module/components/provider/with-registry-provider.js var import_element35 = __toESM(require_element()); var import_data30 = __toESM(require_data()); var import_compose18 = __toESM(require_compose()); var import_jsx_runtime150 = __toESM(require_jsx_runtime()); function getSubRegistry2(subRegistries, registry, useSubRegistry) { if (!useSubRegistry) { return registry; } let subRegistry = subRegistries.get(registry); if (!subRegistry) { subRegistry = (0, import_data30.createRegistry)({}, registry); subRegistry.registerStore(STORE_NAME, storeConfig); subRegistries.set(registry, subRegistry); } return subRegistry; } var withRegistryProvider2 = (0, import_compose18.createHigherOrderComponent)( (WrappedComponent) => ({ useSubRegistry = true, ...props }) => { const registry = (0, import_data30.useRegistry)(); const [subRegistries] = (0, import_element35.useState)(() => /* @__PURE__ */ new WeakMap()); const subRegistry = getSubRegistry2( subRegistries, registry, useSubRegistry ); if (subRegistry === registry) { return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(WrappedComponent, { registry, ...props }); } return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_data30.RegistryProvider, { value: subRegistry, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(WrappedComponent, { registry: subRegistry, ...props }) }); }, "withRegistryProvider" ); var with_registry_provider_default2 = withRegistryProvider2; // packages/block-editor/build-module/components/provider/use-block-sync.js var import_element36 = __toESM(require_element()); var import_data31 = __toESM(require_data()); var import_blocks21 = __toESM(require_blocks()); var noop5 = () => { }; function useBlockSync({ clientId = null, value: controlledBlocks, selection: controlledSelection, onChange = noop5, onInput = noop5 }) { const registry = (0, import_data31.useRegistry)(); const { resetBlocks: resetBlocks2, resetSelection: resetSelection2, replaceInnerBlocks: replaceInnerBlocks2, setHasControlledInnerBlocks: setHasControlledInnerBlocks2, __unstableMarkNextChangeAsNotPersistent: __unstableMarkNextChangeAsNotPersistent2 } = registry.dispatch(store); const { getBlockName: getBlockName2, getBlocks: getBlocks2, getSelectionStart: getSelectionStart2, getSelectionEnd: getSelectionEnd2 } = registry.select(store); const isControlled = (0, import_data31.useSelect)( (select3) => { return !clientId || select3(store).areInnerBlocksControlled(clientId); }, [clientId] ); const pendingChangesRef = (0, import_element36.useRef)({ incoming: null, outgoing: [] }); const subscribedRef = (0, import_element36.useRef)(false); const setControlledBlocks = () => { if (!controlledBlocks) { return; } __unstableMarkNextChangeAsNotPersistent2(); if (clientId) { registry.batch(() => { setHasControlledInnerBlocks2(clientId, true); const storeBlocks = controlledBlocks.map( (block) => (0, import_blocks21.cloneBlock)(block) ); if (subscribedRef.current) { pendingChangesRef.current.incoming = storeBlocks; } __unstableMarkNextChangeAsNotPersistent2(); replaceInnerBlocks2(clientId, storeBlocks); }); } else { if (subscribedRef.current) { pendingChangesRef.current.incoming = controlledBlocks; } resetBlocks2(controlledBlocks); } }; const unsetControlledBlocks = () => { __unstableMarkNextChangeAsNotPersistent2(); if (clientId) { setHasControlledInnerBlocks2(clientId, false); __unstableMarkNextChangeAsNotPersistent2(); replaceInnerBlocks2(clientId, []); } else { resetBlocks2([]); } }; const onInputRef = (0, import_element36.useRef)(onInput); const onChangeRef = (0, import_element36.useRef)(onChange); (0, import_element36.useEffect)(() => { onInputRef.current = onInput; onChangeRef.current = onChange; }, [onInput, onChange]); (0, import_element36.useEffect)(() => { if (pendingChangesRef.current.outgoing.includes(controlledBlocks)) { if (pendingChangesRef.current.outgoing[pendingChangesRef.current.outgoing.length - 1] === controlledBlocks) { pendingChangesRef.current.outgoing = []; } } else if (getBlocks2(clientId) !== controlledBlocks) { pendingChangesRef.current.outgoing = []; setControlledBlocks(); if (controlledSelection) { resetSelection2( controlledSelection.selectionStart, controlledSelection.selectionEnd, controlledSelection.initialPosition ); } } }, [controlledBlocks, clientId]); const isMountedRef = (0, import_element36.useRef)(false); (0, import_element36.useEffect)(() => { if (!isMountedRef.current) { isMountedRef.current = true; return; } if (!isControlled) { pendingChangesRef.current.outgoing = []; setControlledBlocks(); } }, [isControlled]); (0, import_element36.useEffect)(() => { const { getSelectedBlocksInitialCaretPosition: getSelectedBlocksInitialCaretPosition2, isLastBlockChangePersistent: isLastBlockChangePersistent2, __unstableIsLastBlockChangeIgnored: __unstableIsLastBlockChangeIgnored2, areInnerBlocksControlled: areInnerBlocksControlled2 } = registry.select(store); let blocks2 = getBlocks2(clientId); let isPersistent = isLastBlockChangePersistent2(); let previousAreBlocksDifferent = false; subscribedRef.current = true; const unsubscribe = registry.subscribe(() => { if (clientId !== null && getBlockName2(clientId) === null) { return; } const isStillControlled = !clientId || areInnerBlocksControlled2(clientId); if (!isStillControlled) { return; } const newIsPersistent = isLastBlockChangePersistent2(); const newBlocks = getBlocks2(clientId); const areBlocksDifferent = newBlocks !== blocks2; blocks2 = newBlocks; if (areBlocksDifferent && (pendingChangesRef.current.incoming || __unstableIsLastBlockChangeIgnored2())) { pendingChangesRef.current.incoming = null; isPersistent = newIsPersistent; return; } const didPersistenceChange = previousAreBlocksDifferent && !areBlocksDifferent && newIsPersistent && !isPersistent; if (areBlocksDifferent || didPersistenceChange) { isPersistent = newIsPersistent; pendingChangesRef.current.outgoing.push(blocks2); const updateParent = isPersistent ? onChangeRef.current : onInputRef.current; updateParent(blocks2, { selection: { selectionStart: getSelectionStart2(), selectionEnd: getSelectionEnd2(), initialPosition: getSelectedBlocksInitialCaretPosition2() } }); } previousAreBlocksDifferent = areBlocksDifferent; }, store); return () => { subscribedRef.current = false; unsubscribe(); }; }, [registry, clientId]); (0, import_element36.useEffect)(() => { return () => { unsetControlledBlocks(); }; }, []); } // packages/block-editor/build-module/components/keyboard-shortcuts/index.js var import_element37 = __toESM(require_element()); var import_data32 = __toESM(require_data()); var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts()); var import_i18n31 = __toESM(require_i18n()); function KeyboardShortcuts() { return null; } function KeyboardShortcutsRegister() { const { registerShortcut } = (0, import_data32.useDispatch)(import_keyboard_shortcuts.store); (0, import_element37.useEffect)(() => { registerShortcut({ name: "core/block-editor/copy", category: "block", description: (0, import_i18n31.__)("Copy the selected block(s)."), keyCombination: { modifier: "primary", character: "c" } }); registerShortcut({ name: "core/block-editor/cut", category: "block", description: (0, import_i18n31.__)("Cut the selected block(s)."), keyCombination: { modifier: "primary", character: "x" } }); registerShortcut({ name: "core/block-editor/paste", category: "block", description: (0, import_i18n31.__)("Paste the selected block(s)."), keyCombination: { modifier: "primary", character: "v" } }); registerShortcut({ name: "core/block-editor/duplicate", category: "block", description: (0, import_i18n31.__)("Duplicate the selected block(s)."), keyCombination: { modifier: "primaryShift", character: "d" } }); registerShortcut({ name: "core/block-editor/remove", category: "block", description: (0, import_i18n31.__)("Remove the selected block(s)."), keyCombination: { modifier: "access", character: "z" } }); registerShortcut({ name: "core/block-editor/paste-styles", category: "block", description: (0, import_i18n31.__)( "Paste the copied style to the selected block(s)." ), keyCombination: { modifier: "primaryAlt", character: "v" } }); registerShortcut({ name: "core/block-editor/insert-before", category: "block", description: (0, import_i18n31.__)( "Insert a new block before the selected block(s)." ), keyCombination: { modifier: "primaryAlt", character: "t" } }); registerShortcut({ name: "core/block-editor/insert-after", category: "block", description: (0, import_i18n31.__)( "Insert a new block after the selected block(s)." ), keyCombination: { modifier: "primaryAlt", character: "y" } }); registerShortcut({ name: "core/block-editor/delete-multi-selection", category: "block", description: (0, import_i18n31.__)("Delete selection."), keyCombination: { character: "del" }, aliases: [ { character: "backspace" } ] }); registerShortcut({ name: "core/block-editor/stop-editing-as-blocks", category: "block", description: (0, import_i18n31.__)("Finish editing a design."), keyCombination: { character: "escape" } }); registerShortcut({ name: "core/block-editor/select-all", category: "selection", description: (0, import_i18n31.__)( "Select all text when typing. Press again to select all blocks." ), keyCombination: { modifier: "primary", character: "a" } }); registerShortcut({ name: "core/block-editor/unselect", category: "selection", description: (0, import_i18n31.__)("Clear selection."), keyCombination: { character: "escape" } }); registerShortcut({ name: "core/block-editor/multi-text-selection", category: "selection", description: (0, import_i18n31.__)("Select text across multiple blocks."), keyCombination: { modifier: "shift", character: "arrow" } }); registerShortcut({ name: "core/block-editor/focus-toolbar", category: "global", description: (0, import_i18n31.__)("Navigate to the nearest toolbar."), keyCombination: { modifier: "alt", character: "F10" } }); registerShortcut({ name: "core/block-editor/move-up", category: "block", description: (0, import_i18n31.__)("Move the selected block(s) up."), keyCombination: { modifier: "secondary", character: "t" } }); registerShortcut({ name: "core/block-editor/move-down", category: "block", description: (0, import_i18n31.__)("Move the selected block(s) down."), keyCombination: { modifier: "secondary", character: "y" } }); registerShortcut({ name: "core/block-editor/collapse-list-view", category: "list-view", description: (0, import_i18n31.__)("Collapse all other items."), keyCombination: { modifier: "alt", character: "l" } }); registerShortcut({ name: "core/block-editor/group", category: "block", description: (0, import_i18n31.__)( "Create a group block from the selected multiple blocks." ), keyCombination: { modifier: "primary", character: "g" } }); registerShortcut({ name: "core/block-editor/toggle-block-visibility", category: "block", description: (0, import_i18n31.__)("Show or hide the selected block(s)."), keyCombination: { modifier: "primaryShift", character: "h" } }); }, [registerShortcut]); return null; } KeyboardShortcuts.Register = KeyboardShortcutsRegister; var keyboard_shortcuts_default = KeyboardShortcuts; // packages/block-editor/build-module/components/provider/use-media-upload-settings.js var import_element38 = __toESM(require_element()); function useMediaUploadSettings(settings2 = {}) { return (0, import_element38.useMemo)( () => ({ mediaUpload: settings2.mediaUpload, mediaSideload: settings2.mediaSideload, maxUploadFileSize: settings2.maxUploadFileSize, allowedMimeTypes: settings2.allowedMimeTypes }), [settings2] ); } var use_media_upload_settings_default = useMediaUploadSettings; // packages/block-editor/build-module/components/provider/index.js var import_jsx_runtime151 = __toESM(require_jsx_runtime()); var noop6 = () => { }; function mediaUpload(registry, { allowedTypes, additionalData = {}, filesList, onError = noop6, onFileChange, onSuccess, onBatchSuccess }) { void registry.dispatch(store2).addItems({ files: filesList, onChange: onFileChange, onSuccess, onBatchSuccess, onError: ({ message: message2 }) => onError(message2), additionalData, allowedTypes }); } var ExperimentalBlockEditorProvider = with_registry_provider_default2( (props) => { const { settings: _settings, registry, stripExperimentalSettings = false } = props; const mediaUploadSettings = use_media_upload_settings_default(_settings); let settings2 = _settings; if (window.__experimentalMediaProcessing && _settings.mediaUpload) { settings2 = (0, import_element39.useMemo)( () => ({ ..._settings, mediaUpload: mediaUpload.bind(null, registry) }), [_settings, registry] ); } const { __experimentalUpdateSettings: __experimentalUpdateSettings2 } = unlock( (0, import_data33.useDispatch)(store) ); (0, import_element39.useEffect)(() => { __experimentalUpdateSettings2( { ...settings2, __internalIsInitialized: true }, { stripExperimentalSettings, reset: true } ); }, [ settings2, stripExperimentalSettings, __experimentalUpdateSettings2 ]); useBlockSync(props); const children = /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_components27.SlotFillProvider, { passthrough: true, children: [ !settings2?.isPreviewMode && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(keyboard_shortcuts_default.Register, {}), /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(BlockRefsProvider, { children: props.children }) ] }); if (window.__experimentalMediaProcessing) { return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)( provider_default, { settings: mediaUploadSettings, useSubRegistry: false, children } ); } return children; } ); var BlockEditorProvider = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(ExperimentalBlockEditorProvider, { ...props, stripExperimentalSettings: true, children: props.children }); }; var provider_default2 = BlockEditorProvider; // packages/block-editor/build-module/components/block-preview/auto.js var import_compose31 = __toESM(require_compose()); var import_data47 = __toESM(require_data()); var import_element46 = __toESM(require_element()); var import_components30 = __toESM(require_components()); // packages/block-editor/build-module/components/iframe/index.js var import_element44 = __toESM(require_element()); var import_i18n34 = __toESM(require_i18n()); var import_compose30 = __toESM(require_compose()); var import_components28 = __toESM(require_components()); var import_data45 = __toESM(require_data()); // packages/block-editor/build-module/components/writing-flow/index.js var import_data44 = __toESM(require_data()); var import_i18n33 = __toESM(require_i18n()); var import_compose28 = __toESM(require_compose()); var import_element42 = __toESM(require_element()); // packages/block-editor/build-module/components/writing-flow/use-multi-selection.js var import_compose19 = __toESM(require_compose()); var import_data34 = __toESM(require_data()); function selector(select3) { const { isMultiSelecting: isMultiSelecting3, getMultiSelectedBlockClientIds: getMultiSelectedBlockClientIds2, hasMultiSelection: hasMultiSelection2, getSelectedBlockClientId: getSelectedBlockClientId2, getSelectedBlocksInitialCaretPosition: getSelectedBlocksInitialCaretPosition2, __unstableIsFullySelected: __unstableIsFullySelected2 } = select3(store); return { isMultiSelecting: isMultiSelecting3(), multiSelectedBlockClientIds: getMultiSelectedBlockClientIds2(), hasMultiSelection: hasMultiSelection2(), selectedBlockClientId: getSelectedBlockClientId2(), initialPosition: getSelectedBlocksInitialCaretPosition2(), isFullSelection: __unstableIsFullySelected2() }; } function useMultiSelection() { const { initialPosition: initialPosition2, isMultiSelecting: isMultiSelecting3, multiSelectedBlockClientIds, hasMultiSelection: hasMultiSelection2, selectedBlockClientId, isFullSelection } = (0, import_data34.useSelect)(selector, []); return (0, import_compose19.useRefEffect)( (node) => { const { ownerDocument } = node; const { defaultView } = ownerDocument; if (initialPosition2 === void 0 || initialPosition2 === null) { return; } if (!hasMultiSelection2 || isMultiSelecting3) { return; } const { length } = multiSelectedBlockClientIds; if (length < 2) { return; } if (!isFullSelection) { return; } node.contentEditable = true; node.focus(); defaultView.getSelection().removeAllRanges(); }, [ hasMultiSelection2, isMultiSelecting3, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition2, isFullSelection ] ); } // packages/block-editor/build-module/components/writing-flow/use-tab-nav.js var import_dom8 = __toESM(require_dom()); var import_keycodes3 = __toESM(require_keycodes()); var import_data35 = __toESM(require_data()); var import_compose20 = __toESM(require_compose()); var import_element40 = __toESM(require_element()); var import_jsx_runtime152 = __toESM(require_jsx_runtime()); function useTabNav() { const containerRef = ( /** @type {typeof useRef} */ (0, import_element40.useRef)() ); const focusCaptureBeforeRef = (0, import_element40.useRef)(); const focusCaptureAfterRef = (0, import_element40.useRef)(); const { hasMultiSelection: hasMultiSelection2, getSelectedBlockClientId: getSelectedBlockClientId2, getBlockCount: getBlockCount2, getBlockOrder: getBlockOrder2, getLastFocus: getLastFocus2, getSectionRootClientId: getSectionRootClientId2, isZoomOut: isZoomOut2 } = unlock((0, import_data35.useSelect)(store)); const { setLastFocus: setLastFocus2 } = unlock((0, import_data35.useDispatch)(store)); const noCaptureRef = (0, import_element40.useRef)(); function onFocusCapture(event) { const canvasElement = containerRef.current.ownerDocument === event.target.ownerDocument ? containerRef.current : containerRef.current.ownerDocument.defaultView.frameElement; if (noCaptureRef.current) { noCaptureRef.current = null; } else if (hasMultiSelection2()) { containerRef.current.focus(); } else if (getSelectedBlockClientId2()) { if (getLastFocus2()?.current) { getLastFocus2().current.focus(); } else { containerRef.current.querySelector( `[data-block="${getSelectedBlockClientId2()}"]` ).focus(); } } else if (isZoomOut2()) { const sectionRootClientId = getSectionRootClientId2(); const sectionBlocks = getBlockOrder2(sectionRootClientId); if (sectionBlocks.length) { containerRef.current.querySelector(`[data-block="${sectionBlocks[0]}"]`).focus(); } else if (sectionRootClientId) { containerRef.current.querySelector(`[data-block="${sectionRootClientId}"]`).focus(); } else { canvasElement.focus(); } } else { const isBefore = ( // eslint-disable-next-line no-bitwise event.target.compareDocumentPosition(canvasElement) & event.target.DOCUMENT_POSITION_FOLLOWING ); const tabbables = import_dom8.focus.tabbable.find(containerRef.current); if (tabbables.length) { const next = isBefore ? tabbables[0] : tabbables[tabbables.length - 1]; next.focus(); } } } const before = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)( "div", { ref: focusCaptureBeforeRef, tabIndex: "0", onFocus: onFocusCapture } ); const after = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)( "div", { ref: focusCaptureAfterRef, tabIndex: "0", onFocus: onFocusCapture } ); const ref = (0, import_compose20.useRefEffect)((node) => { function onKeyDown(event) { if (event.defaultPrevented) { return; } if (event.keyCode !== import_keycodes3.TAB) { return; } if ( // Bails in case the focus capture elements aren’t present. They // may be omitted to avoid silent tab stops in preview mode. // See: https://github.com/WordPress/gutenberg/pull/59317 !focusCaptureAfterRef.current || !focusCaptureBeforeRef.current ) { return; } const { target, shiftKey: isShift } = event; const direction = isShift ? "findPrevious" : "findNext"; const nextTabbable = import_dom8.focus.tabbable[direction](target); const currentBlock = target.closest("[data-block]"); const isElementPartOfSelectedBlock = currentBlock && nextTabbable && (isInSameBlock(currentBlock, nextTabbable) || isInsideRootBlock(currentBlock, nextTabbable)); if ((0, import_dom8.isFormElement)(nextTabbable) && isElementPartOfSelectedBlock) { return; } const next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef; noCaptureRef.current = true; next.current.focus({ preventScroll: true }); } function onFocusOut(event) { setLastFocus2({ ...getLastFocus2(), current: event.target }); const { ownerDocument: ownerDocument2 } = node; if (!event.relatedTarget && event.target.hasAttribute("data-block") && ownerDocument2.activeElement === ownerDocument2.body && getBlockCount2() === 0) { node.focus(); } } function preventScrollOnTab(event) { if (event.keyCode !== import_keycodes3.TAB) { return; } if (event.target?.getAttribute("role") === "region") { return; } if (containerRef.current === event.target) { return; } const isShift = event.shiftKey; const direction = isShift ? "findPrevious" : "findNext"; const target = import_dom8.focus.tabbable[direction](event.target); if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) { event.preventDefault(); target.focus({ preventScroll: true }); } } const { ownerDocument } = node; const { defaultView } = ownerDocument; defaultView.addEventListener("keydown", preventScrollOnTab); node.addEventListener("keydown", onKeyDown); node.addEventListener("focusout", onFocusOut); return () => { defaultView.removeEventListener("keydown", preventScrollOnTab); node.removeEventListener("keydown", onKeyDown); node.removeEventListener("focusout", onFocusOut); }; }, []); const mergedRefs = (0, import_compose20.useMergeRefs)([containerRef, ref]); return [before, mergedRefs, after]; } // packages/block-editor/build-module/components/writing-flow/use-arrow-nav.js var import_dom10 = __toESM(require_dom()); var import_keycodes4 = __toESM(require_keycodes()); var import_data36 = __toESM(require_data()); var import_compose21 = __toESM(require_compose()); function isNavigationCandidate(element, keyCode, hasModifier) { const isVertical = keyCode === import_keycodes4.UP || keyCode === import_keycodes4.DOWN; const { tagName } = element; const elementType = element.getAttribute("type"); if (isVertical && !hasModifier) { if (tagName === "INPUT") { const verticalInputTypes = [ "date", "datetime-local", "month", "number", "range", "time", "week" ]; return !verticalInputTypes.includes(elementType); } return true; } if (tagName === "INPUT") { const simpleInputTypes = [ "button", "checkbox", "number", "color", "file", "image", "radio", "reset", "submit" ]; return simpleInputTypes.includes(elementType); } return tagName !== "TEXTAREA"; } function getClosestTabbable(target, isReverse, containerElement, onlyVertical) { let focusableNodes = import_dom10.focus.focusable.find(containerElement); if (isReverse) { focusableNodes.reverse(); } focusableNodes = focusableNodes.slice( focusableNodes.indexOf(target) + 1 ); let targetRect; if (onlyVertical) { targetRect = target.getBoundingClientRect(); } function isTabCandidate(node) { if (node.closest("[inert]")) { return; } if (node.children.length === 1 && isInSameBlock(node, node.firstElementChild) && node.firstElementChild.getAttribute("contenteditable") === "true") { return; } if (!import_dom10.focus.tabbable.isTabbableIndex(node)) { return false; } if (node.isContentEditable && node.contentEditable !== "true") { return false; } if (onlyVertical) { const nodeRect = node.getBoundingClientRect(); if (nodeRect.left >= targetRect.right || nodeRect.right <= targetRect.left) { return false; } } return true; } return focusableNodes.find(isTabCandidate); } function useArrowNav() { const { getMultiSelectedBlocksStartClientId: getMultiSelectedBlocksStartClientId2, getMultiSelectedBlocksEndClientId: getMultiSelectedBlocksEndClientId2, getSettings: getSettings8, hasMultiSelection: hasMultiSelection2, __unstableIsFullySelected: __unstableIsFullySelected2 } = (0, import_data36.useSelect)(store); const { selectBlock: selectBlock2 } = (0, import_data36.useDispatch)(store); return (0, import_compose21.useRefEffect)((node) => { let verticalRect; function onMouseDown() { verticalRect = null; } function isClosestTabbableABlock(target, isReverse) { const closestTabbable = getClosestTabbable( target, isReverse, node ); return closestTabbable && getBlockClientId(closestTabbable); } function onKeyDown(event) { if (event.defaultPrevented) { return; } const { keyCode, target, shiftKey, ctrlKey, altKey, metaKey } = event; const isUp = keyCode === import_keycodes4.UP; const isDown = keyCode === import_keycodes4.DOWN; const isLeft = keyCode === import_keycodes4.LEFT; const isRight = keyCode === import_keycodes4.RIGHT; const isReverse = isUp || isLeft; const isHorizontal = isLeft || isRight; const isVertical = isUp || isDown; const isNav = isHorizontal || isVertical; const hasModifier = shiftKey || ctrlKey || altKey || metaKey; const isNavEdge = isVertical ? import_dom10.isVerticalEdge : import_dom10.isHorizontalEdge; const { ownerDocument } = node; const { defaultView } = ownerDocument; if (!isNav) { return; } if (hasMultiSelection2()) { if (shiftKey) { return; } if (!__unstableIsFullySelected2()) { return; } event.preventDefault(); if (isReverse) { selectBlock2(getMultiSelectedBlocksStartClientId2()); } else { selectBlock2(getMultiSelectedBlocksEndClientId2(), -1); } return; } if (!isNavigationCandidate(target, keyCode, hasModifier)) { return; } if (!isVertical) { verticalRect = null; } else if (!verticalRect) { verticalRect = (0, import_dom10.computeCaretRect)(defaultView); } const isReverseDir = (0, import_dom10.isRTL)(target) ? !isReverse : isReverse; const { keepCaretInsideBlock } = getSettings8(); if (shiftKey) { if (isClosestTabbableABlock(target, isReverse) && isNavEdge(target, isReverse)) { node.contentEditable = true; node.focus(); } } else if (isVertical && (0, import_dom10.isVerticalEdge)(target, isReverse) && // When Alt is pressed, only intercept if the caret is also at // the horizontal edge. (altKey ? (0, import_dom10.isHorizontalEdge)(target, isReverseDir) : true) && !keepCaretInsideBlock) { const closestTabbable = getClosestTabbable( target, isReverse, node, true ); if (closestTabbable) { (0, import_dom10.placeCaretAtVerticalEdge)( closestTabbable, // When Alt is pressed, place the caret at the furthest // horizontal edge and the furthest vertical edge. altKey ? !isReverse : isReverse, altKey ? void 0 : verticalRect ); event.preventDefault(); } } else if (isHorizontal && defaultView.getSelection().isCollapsed && (0, import_dom10.isHorizontalEdge)(target, isReverseDir) && !keepCaretInsideBlock) { const closestTabbable = getClosestTabbable( target, isReverseDir, node ); (0, import_dom10.placeCaretAtHorizontalEdge)(closestTabbable, isReverse); event.preventDefault(); } } node.addEventListener("mousedown", onMouseDown); node.addEventListener("keydown", onKeyDown); return () => { node.removeEventListener("mousedown", onMouseDown); node.removeEventListener("keydown", onKeyDown); }; }, []); } // packages/block-editor/build-module/components/writing-flow/use-select-all.js var import_dom12 = __toESM(require_dom()); var import_data37 = __toESM(require_data()); var import_keyboard_shortcuts3 = __toESM(require_keyboard_shortcuts()); var import_compose22 = __toESM(require_compose()); function useSelectAll() { const { getBlockOrder: getBlockOrder2, getSelectedBlockClientIds: getSelectedBlockClientIds2, getBlockRootClientId: getBlockRootClientId2 } = (0, import_data37.useSelect)(store); const { multiSelect: multiSelect2, selectBlock: selectBlock2 } = (0, import_data37.useDispatch)(store); const isMatch = (0, import_keyboard_shortcuts3.__unstableUseShortcutEventMatch)(); return (0, import_compose22.useRefEffect)((node) => { function onKeyDown(event) { if (!isMatch("core/block-editor/select-all", event)) { return; } const selectedClientIds = getSelectedBlockClientIds2(); if (selectedClientIds.length < 2 && !(0, import_dom12.isEntirelySelected)(event.target)) { return; } event.preventDefault(); const [firstSelectedClientId] = selectedClientIds; const rootClientId = getBlockRootClientId2(firstSelectedClientId); const blockClientIds = getBlockOrder2(rootClientId); if (selectedClientIds.length === blockClientIds.length) { if (rootClientId) { node.ownerDocument.defaultView.getSelection().removeAllRanges(); selectBlock2(rootClientId); } return; } multiSelect2( blockClientIds[0], blockClientIds[blockClientIds.length - 1] ); } node.addEventListener("keydown", onKeyDown); return () => { node.removeEventListener("keydown", onKeyDown); }; }, []); } // packages/block-editor/build-module/components/writing-flow/use-drag-selection.js var import_data38 = __toESM(require_data()); var import_compose23 = __toESM(require_compose()); function setContentEditableWrapper(node, value) { node.contentEditable = value; if (value) { node.focus(); } } function useDragSelection() { const { startMultiSelect: startMultiSelect2, stopMultiSelect: stopMultiSelect2 } = (0, import_data38.useDispatch)(store); const { isSelectionEnabled: isSelectionEnabled3, hasSelectedBlock: hasSelectedBlock2, isDraggingBlocks: isDraggingBlocks2, isMultiSelecting: isMultiSelecting3 } = (0, import_data38.useSelect)(store); return (0, import_compose23.useRefEffect)( (node) => { const { ownerDocument } = node; const { defaultView } = ownerDocument; let anchorElement; let rafId; function onMouseUp() { stopMultiSelect2(); defaultView.removeEventListener("mouseup", onMouseUp); rafId = defaultView.requestAnimationFrame(() => { if (!hasSelectedBlock2()) { return; } setContentEditableWrapper(node, false); const selection2 = defaultView.getSelection(); if (selection2.rangeCount) { const range2 = selection2.getRangeAt(0); const { commonAncestorContainer } = range2; const clonedRange = range2.cloneRange(); if (anchorElement.contains(commonAncestorContainer)) { anchorElement.focus(); selection2.removeAllRanges(); selection2.addRange(clonedRange); } } }); } let lastMouseDownTarget; function onMouseDown({ target }) { lastMouseDownTarget = target; } function onMouseLeave({ buttons, target, relatedTarget }) { if (!target.contains(lastMouseDownTarget)) { return; } if (target.contains(relatedTarget)) { return; } if (isDraggingBlocks2()) { return; } if (buttons !== 1) { return; } if (isMultiSelecting3()) { return; } if (node === target) { return; } if (target.getAttribute("contenteditable") !== "true") { return; } if (!isSelectionEnabled3()) { return; } anchorElement = target; startMultiSelect2(); defaultView.addEventListener("mouseup", onMouseUp); setContentEditableWrapper(node, true); } node.addEventListener("mouseout", onMouseLeave); node.addEventListener("mousedown", onMouseDown); return () => { node.removeEventListener("mouseout", onMouseLeave); defaultView.removeEventListener("mouseup", onMouseUp); defaultView.cancelAnimationFrame(rafId); }; }, [ startMultiSelect2, stopMultiSelect2, isSelectionEnabled3, hasSelectedBlock2 ] ); } // packages/block-editor/build-module/components/writing-flow/use-selection-observer.js var import_data39 = __toESM(require_data()); var import_compose24 = __toESM(require_compose()); var import_rich_text4 = __toESM(require_rich_text()); var import_dom13 = __toESM(require_dom()); function extractSelectionStartNode(selection2) { const { anchorNode, anchorOffset } = selection2; if (anchorNode.nodeType === anchorNode.TEXT_NODE) { return anchorNode; } if (anchorOffset === 0) { return anchorNode; } return anchorNode.childNodes[anchorOffset - 1]; } function extractSelectionEndNode(selection2) { const { focusNode, focusOffset } = selection2; if (focusNode.nodeType === focusNode.TEXT_NODE) { return focusNode; } if (focusOffset === focusNode.childNodes.length) { return focusNode; } if (focusOffset === 0 && (0, import_dom13.isSelectionForward)(selection2)) { return focusNode.previousSibling ?? focusNode.parentElement; } return focusNode.childNodes[focusOffset]; } function findDepth(a2, b2) { let depth = 0; while (a2[depth] === b2[depth]) { depth++; } return depth; } function setContentEditableWrapper2(node, value) { if (node.contentEditable !== String(value)) { node.contentEditable = value; if (value) { node.focus(); } } } function getRichTextElement(node) { const element = node.nodeType === node.ELEMENT_NODE ? node : node.parentElement; return element?.closest("[data-wp-block-attribute-key]"); } function useSelectionObserver() { const { multiSelect: multiSelect2, selectBlock: selectBlock2, selectionChange: selectionChange2 } = (0, import_data39.useDispatch)(store); const { getBlockParents: getBlockParents2, getBlockSelectionStart: getBlockSelectionStart2, isMultiSelecting: isMultiSelecting3 } = (0, import_data39.useSelect)(store); return (0, import_compose24.useRefEffect)( (node) => { const { ownerDocument } = node; const { defaultView } = ownerDocument; function onSelectionChange(event) { const selection2 = defaultView.getSelection(); if (!selection2.rangeCount) { return; } const startNode = extractSelectionStartNode(selection2); const endNode = extractSelectionEndNode(selection2); if (!node.contains(startNode) || !node.contains(endNode)) { return; } const isClickShift = event.shiftKey && event.type === "mouseup"; if (selection2.isCollapsed && !isClickShift) { if (node.contentEditable === "true" && !isMultiSelecting3()) { setContentEditableWrapper2(node, false); let element = startNode.nodeType === startNode.ELEMENT_NODE ? startNode : startNode.parentElement; element = element?.closest("[contenteditable]"); element?.focus(); } return; } let startClientId = getBlockClientId(startNode); let endClientId = getBlockClientId(endNode); if (isClickShift) { const selectedClientId = getBlockSelectionStart2(); const clickedClientId = getBlockClientId(event.target); const focusNodeIsNonSelectable = clickedClientId !== endClientId; if (startClientId === endClientId && selection2.isCollapsed || !endClientId || focusNodeIsNonSelectable) { endClientId = clickedClientId; } if (startClientId !== selectedClientId) { startClientId = selectedClientId; } } if (startClientId === void 0 && endClientId === void 0) { setContentEditableWrapper2(node, false); return; } const isSingularSelection = startClientId === endClientId; if (isSingularSelection) { if (!isMultiSelecting3()) { selectBlock2(startClientId); } else { multiSelect2(startClientId, startClientId); } } else { const startPath = [ ...getBlockParents2(startClientId), startClientId ]; const endPath = [ ...getBlockParents2(endClientId), endClientId ]; const depth = findDepth(startPath, endPath); if (startPath[depth] !== startClientId || endPath[depth] !== endClientId) { multiSelect2(startPath[depth], endPath[depth]); return; } const richTextElementStart = getRichTextElement(startNode); const richTextElementEnd = getRichTextElement(endNode); if (richTextElementStart && richTextElementEnd) { const range2 = selection2.getRangeAt(0); const richTextDataStart = (0, import_rich_text4.create)({ element: richTextElementStart, range: range2, __unstableIsEditableTree: true }); const richTextDataEnd = (0, import_rich_text4.create)({ element: richTextElementEnd, range: range2, __unstableIsEditableTree: true }); const startOffset = richTextDataStart.start ?? richTextDataStart.end; const endOffset = richTextDataEnd.start ?? richTextDataEnd.end; selectionChange2({ start: { clientId: startClientId, attributeKey: richTextElementStart.dataset.wpBlockAttributeKey, offset: startOffset }, end: { clientId: endClientId, attributeKey: richTextElementEnd.dataset.wpBlockAttributeKey, offset: endOffset } }); } else { multiSelect2(startClientId, endClientId); } } } ownerDocument.addEventListener( "selectionchange", onSelectionChange ); defaultView.addEventListener("mouseup", onSelectionChange); return () => { ownerDocument.removeEventListener( "selectionchange", onSelectionChange ); defaultView.removeEventListener("mouseup", onSelectionChange); }; }, [multiSelect2, selectBlock2, selectionChange2, getBlockParents2] ); } // packages/block-editor/build-module/components/writing-flow/use-click-selection.js var import_data40 = __toESM(require_data()); var import_compose25 = __toESM(require_compose()); function useClickSelection() { const { selectBlock: selectBlock2 } = (0, import_data40.useDispatch)(store); const { isSelectionEnabled: isSelectionEnabled3, getBlockSelectionStart: getBlockSelectionStart2, hasMultiSelection: hasMultiSelection2 } = (0, import_data40.useSelect)(store); return (0, import_compose25.useRefEffect)( (node) => { function onMouseDown(event) { if (!isSelectionEnabled3() || event.button !== 0) { return; } const startClientId = getBlockSelectionStart2(); const clickedClientId = getBlockClientId(event.target); if (event.shiftKey) { if (startClientId && startClientId !== clickedClientId) { node.contentEditable = true; node.focus(); } } else if (hasMultiSelection2()) { selectBlock2(clickedClientId); } } node.addEventListener("mousedown", onMouseDown); return () => { node.removeEventListener("mousedown", onMouseDown); }; }, [ selectBlock2, isSelectionEnabled3, getBlockSelectionStart2, hasMultiSelection2 ] ); } // packages/block-editor/build-module/components/writing-flow/use-input.js var import_data41 = __toESM(require_data()); var import_compose26 = __toESM(require_compose()); var import_keycodes5 = __toESM(require_keycodes()); var import_blocks22 = __toESM(require_blocks()); function useInput() { const { __unstableIsFullySelected: __unstableIsFullySelected2, getSelectedBlockClientIds: getSelectedBlockClientIds2, getSelectedBlockClientId: getSelectedBlockClientId2, __unstableIsSelectionMergeable: __unstableIsSelectionMergeable2, hasMultiSelection: hasMultiSelection2, getBlockName: getBlockName2, canInsertBlockType: canInsertBlockType2, getBlockRootClientId: getBlockRootClientId2, getSelectionStart: getSelectionStart2, getSelectionEnd: getSelectionEnd2, getBlockAttributes: getBlockAttributes3 } = (0, import_data41.useSelect)(store); const { replaceBlocks: replaceBlocks2, __unstableSplitSelection: __unstableSplitSelection2, removeBlocks: removeBlocks2, __unstableDeleteSelection: __unstableDeleteSelection2, __unstableExpandSelection: __unstableExpandSelection2, __unstableMarkAutomaticChange: __unstableMarkAutomaticChange2 } = (0, import_data41.useDispatch)(store); return (0, import_compose26.useRefEffect)((node) => { function onBeforeInput(event) { if (node.contentEditable === "true") { event.preventDefault(); } } function onKeyDown(event) { if (event.defaultPrevented) { return; } if (!hasMultiSelection2()) { if (event.keyCode === import_keycodes5.ENTER) { if (event.shiftKey || __unstableIsFullySelected2()) { return; } const clientId = getSelectedBlockClientId2(); const blockName = getBlockName2(clientId); const selectionStart = getSelectionStart2(); const selectionEnd = getSelectionEnd2(); if (selectionStart.attributeKey === selectionEnd.attributeKey) { const selectedAttributeValue = getBlockAttributes3(clientId)[selectionStart.attributeKey]; const transforms = (0, import_blocks22.getBlockTransforms)("from").filter( ({ type }) => type === "enter" ); const transformation = (0, import_blocks22.findTransform)( transforms, (item) => { return item.regExp.test( selectedAttributeValue ); } ); if (transformation) { replaceBlocks2( clientId, transformation.transform({ content: selectedAttributeValue }) ); __unstableMarkAutomaticChange2(); return; } } if (!(0, import_blocks22.hasBlockSupport)(blockName, "splitting", false) && !event.__deprecatedOnSplit) { return; } if (canInsertBlockType2( blockName, getBlockRootClientId2(clientId) )) { __unstableSplitSelection2(); event.preventDefault(); } } return; } if (event.keyCode === import_keycodes5.ENTER) { node.contentEditable = false; event.preventDefault(); if (__unstableIsFullySelected2()) { replaceBlocks2( getSelectedBlockClientIds2(), (0, import_blocks22.createBlock)((0, import_blocks22.getDefaultBlockName)()) ); } else { __unstableSplitSelection2(); } } else if (event.keyCode === import_keycodes5.BACKSPACE || event.keyCode === import_keycodes5.DELETE) { node.contentEditable = false; event.preventDefault(); if (__unstableIsFullySelected2()) { removeBlocks2(getSelectedBlockClientIds2()); } else if (__unstableIsSelectionMergeable2()) { __unstableDeleteSelection2(event.keyCode === import_keycodes5.DELETE); } else { __unstableExpandSelection2(); } } else if ( // If key.length is longer than 1, it's a control key that doesn't // input anything. event.key.length === 1 && !(event.metaKey || event.ctrlKey) ) { node.contentEditable = false; if (__unstableIsSelectionMergeable2()) { __unstableDeleteSelection2(event.keyCode === import_keycodes5.DELETE); } else { event.preventDefault(); node.ownerDocument.defaultView.getSelection().removeAllRanges(); } } } function onCompositionStart(event) { if (!hasMultiSelection2()) { return; } node.contentEditable = false; if (__unstableIsSelectionMergeable2()) { __unstableDeleteSelection2(); } else { event.preventDefault(); node.ownerDocument.defaultView.getSelection().removeAllRanges(); } } node.addEventListener("beforeinput", onBeforeInput); node.addEventListener("keydown", onKeyDown); node.addEventListener("compositionstart", onCompositionStart); return () => { node.removeEventListener("beforeinput", onBeforeInput); node.removeEventListener("keydown", onKeyDown); node.removeEventListener("compositionstart", onCompositionStart); }; }, []); } // packages/block-editor/build-module/components/writing-flow/use-clipboard-handler.js var import_blocks25 = __toESM(require_blocks()); var import_dom18 = __toESM(require_dom()); var import_data43 = __toESM(require_data()); var import_compose27 = __toESM(require_compose()); // packages/block-editor/build-module/utils/use-notify-copy.js var import_element41 = __toESM(require_element()); var import_blocks23 = __toESM(require_blocks()); var import_data42 = __toESM(require_data()); var import_i18n32 = __toESM(require_i18n()); var import_notices3 = __toESM(require_notices()); function useNotifyCopy() { const { getBlockName: getBlockName2 } = (0, import_data42.useSelect)(store); const { getBlockType: getBlockType21 } = (0, import_data42.useSelect)(import_blocks23.store); const { createSuccessNotice } = (0, import_data42.useDispatch)(import_notices3.store); return (0, import_element41.useCallback)( (eventType, selectedBlockClientIds) => { let notice = ""; if (eventType === "copyStyles") { notice = (0, import_i18n32.__)("Styles copied to clipboard."); } else if (selectedBlockClientIds.length === 1) { const clientId = selectedBlockClientIds[0]; const title = getBlockType21(getBlockName2(clientId))?.title; if (eventType === "copy") { notice = (0, import_i18n32.sprintf)( // Translators: %s: Name of the block being copied, e.g. "Paragraph". (0, import_i18n32.__)('Copied "%s" to clipboard.'), title ); } else { notice = (0, import_i18n32.sprintf)( // Translators: %s: Name of the block being cut, e.g. "Paragraph". (0, import_i18n32.__)('Moved "%s" to clipboard.'), title ); } } else if (eventType === "copy") { notice = (0, import_i18n32.sprintf)( // Translators: %d: Number of blocks being copied. (0, import_i18n32._n)( "Copied %d block to clipboard.", "Copied %d blocks to clipboard.", selectedBlockClientIds.length ), selectedBlockClientIds.length ); } else { notice = (0, import_i18n32.sprintf)( // Translators: %d: Number of blocks being moved. (0, import_i18n32._n)( "Moved %d block to clipboard.", "Moved %d blocks to clipboard.", selectedBlockClientIds.length ), selectedBlockClientIds.length ); } createSuccessNotice(notice, { type: "snackbar" }); }, [createSuccessNotice, getBlockName2, getBlockType21] ); } // packages/block-editor/build-module/components/writing-flow/utils.js var import_dom17 = __toESM(require_dom()); var import_blocks24 = __toESM(require_blocks()); // packages/block-editor/build-module/utils/pasting.js var import_dom16 = __toESM(require_dom()); function removeWindowsFragments(html) { const startStr = ""; const startIdx = html.indexOf(startStr); if (startIdx > -1) { html = html.substring(startIdx + startStr.length); } else { return html; } const endStr = ""; const endIdx = html.indexOf(endStr); if (endIdx > -1) { html = html.substring(0, endIdx); } return html; } function removeCharsetMetaTag(html) { const metaTag = ``; if (html.startsWith(metaTag)) { return html.slice(metaTag.length); } return html; } function getPasteEventData({ clipboardData }) { let plainText = ""; let html = ""; try { plainText = clipboardData.getData("text/plain"); html = clipboardData.getData("text/html"); } catch (error) { return; } html = removeWindowsFragments(html); html = removeCharsetMetaTag(html); const files = (0, import_dom16.getFilesFromDataTransfer)(clipboardData); if (files.length && !shouldDismissPastedFiles(files, html)) { return { files }; } return { html, plainText, files: [] }; } function shouldDismissPastedFiles(files, html) { if (html && files?.length === 1 && files[0].type.indexOf("image/") === 0) { const IMAGE_TAG = /<\s*img\b/gi; if (html.match(IMAGE_TAG)?.length !== 1) { return true; } const IMG_WITH_LOCAL_SRC = /<\s*img\b[^>]*\bsrc="file:\/\//i; if (html.match(IMG_WITH_LOCAL_SRC)) { return true; } } return false; } // packages/block-editor/build-module/components/writing-flow/utils.js var requiresWrapperOnCopy = Symbol("requiresWrapperOnCopy"); function setClipboardBlocks(event, blocks2, registry) { let _blocks = blocks2; const [firstBlock] = blocks2; if (firstBlock) { const firstBlockType = registry.select(import_blocks24.store).getBlockType(firstBlock.name); if (firstBlockType[requiresWrapperOnCopy]) { const { getBlockRootClientId: getBlockRootClientId2, getBlockName: getBlockName2, getBlockAttributes: getBlockAttributes3 } = registry.select(store); const wrapperBlockClientId = getBlockRootClientId2( firstBlock.clientId ); const wrapperBlockName = getBlockName2(wrapperBlockClientId); if (wrapperBlockName) { _blocks = (0, import_blocks24.createBlock)( wrapperBlockName, getBlockAttributes3(wrapperBlockClientId), _blocks ); } } } const serialized = (0, import_blocks24.serialize)(_blocks); event.clipboardData.setData("text/plain", toPlainText(serialized)); event.clipboardData.setData("text/html", serialized); } function getPasteBlocks(event, canUserUseUnfilteredHTML) { const { plainText, html, files } = getPasteEventData(event); let blocks2 = []; if (files.length) { const fromTransforms = (0, import_blocks24.getBlockTransforms)("from"); blocks2 = files.reduce((accumulator, file) => { const transformation = (0, import_blocks24.findTransform)( fromTransforms, (transform) => transform.type === "files" && transform.isMatch([file]) ); if (transformation) { accumulator.push(transformation.transform([file])); } return accumulator; }, []).flat(); } else { blocks2 = (0, import_blocks24.pasteHandler)({ HTML: html, plainText, mode: "BLOCKS", canUserUseUnfilteredHTML }); } return blocks2; } function toPlainText(html) { html = html.replace(/
/g, "\n"); const plainText = (0, import_dom17.__unstableStripHTML)(html).trim(); return plainText.replace(/\n\n+/g, "\n\n"); } // packages/block-editor/build-module/components/writing-flow/use-clipboard-handler.js function useClipboardHandler() { const registry = (0, import_data43.useRegistry)(); const { getBlocksByClientId: getBlocksByClientId2, getSelectedBlockClientIds: getSelectedBlockClientIds2, hasMultiSelection: hasMultiSelection2, getSettings: getSettings8, getBlockName: getBlockName2, __unstableIsFullySelected: __unstableIsFullySelected2, __unstableIsSelectionCollapsed: __unstableIsSelectionCollapsed2, __unstableIsSelectionMergeable: __unstableIsSelectionMergeable2, __unstableGetSelectedBlocksWithPartialSelection: __unstableGetSelectedBlocksWithPartialSelection2, canInsertBlockType: canInsertBlockType2, getBlockRootClientId: getBlockRootClientId2 } = (0, import_data43.useSelect)(store); const { flashBlock: flashBlock2, removeBlocks: removeBlocks2, replaceBlocks: replaceBlocks2, __unstableDeleteSelection: __unstableDeleteSelection2, __unstableExpandSelection: __unstableExpandSelection2, __unstableSplitSelection: __unstableSplitSelection2 } = (0, import_data43.useDispatch)(store); const notifyCopy = useNotifyCopy(); return (0, import_compose27.useRefEffect)((node) => { function handler(event) { if (event.defaultPrevented) { return; } const selectedBlockClientIds = getSelectedBlockClientIds2(); if (selectedBlockClientIds.length === 0) { return; } if (!hasMultiSelection2()) { const { target } = event; const { ownerDocument } = target; const hasSelection = event.type === "copy" || event.type === "cut" ? (0, import_dom18.documentHasUncollapsedSelection)(ownerDocument) : (0, import_dom18.documentHasSelection)(ownerDocument) && !ownerDocument.activeElement.isContentEditable; if (hasSelection) { return; } } const { activeElement } = event.target.ownerDocument; if (!node.contains(activeElement)) { return; } const isSelectionMergeable = __unstableIsSelectionMergeable2(); const shouldHandleWholeBlocks = __unstableIsSelectionCollapsed2() || __unstableIsFullySelected2(); const expandSelectionIsNeeded = !shouldHandleWholeBlocks && !isSelectionMergeable; if (event.type === "copy" || event.type === "cut") { event.preventDefault(); if (selectedBlockClientIds.length === 1) { flashBlock2(selectedBlockClientIds[0]); } if (expandSelectionIsNeeded) { __unstableExpandSelection2(); } else { notifyCopy(event.type, selectedBlockClientIds); let blocks2; if (shouldHandleWholeBlocks) { blocks2 = getBlocksByClientId2(selectedBlockClientIds); } else { const [head, tail] = __unstableGetSelectedBlocksWithPartialSelection2(); const inBetweenBlocks = getBlocksByClientId2( selectedBlockClientIds.slice( 1, selectedBlockClientIds.length - 1 ) ); blocks2 = [head, ...inBetweenBlocks, tail]; } setClipboardBlocks(event, blocks2, registry); } } if (event.type === "cut") { if (shouldHandleWholeBlocks && !expandSelectionIsNeeded) { removeBlocks2(selectedBlockClientIds); } else { event.target.ownerDocument.activeElement.contentEditable = false; __unstableDeleteSelection2(); } } else if (event.type === "paste") { const { __experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML, mediaUpload: mediaUpload2 } = getSettings8(); const isInternal = event.clipboardData.getData("rich-text") === "true"; if (isInternal) { return; } const { plainText, html, files } = getPasteEventData(event); const isFullySelected = __unstableIsFullySelected2(); let blocks2 = []; if (files.length) { if (!mediaUpload2) { event.preventDefault(); return; } const fromTransforms = (0, import_blocks25.getBlockTransforms)("from"); blocks2 = files.reduce((accumulator, file) => { const transformation = (0, import_blocks25.findTransform)( fromTransforms, (transform) => transform.type === "files" && transform.isMatch([file]) ); if (transformation) { accumulator.push( transformation.transform([file]) ); } return accumulator; }, []).flat(); } else { blocks2 = (0, import_blocks25.pasteHandler)({ HTML: html, plainText, mode: isFullySelected ? "BLOCKS" : "AUTO", canUserUseUnfilteredHTML }); } if (typeof blocks2 === "string") { return; } if (isFullySelected) { replaceBlocks2( selectedBlockClientIds, blocks2, blocks2.length - 1, -1 ); event.preventDefault(); return; } if (!hasMultiSelection2() && !(0, import_blocks25.hasBlockSupport)( getBlockName2(selectedBlockClientIds[0]), "splitting", false ) && !event.__deprecatedOnSplit) { return; } const [firstSelectedClientId] = selectedBlockClientIds; const rootClientId = getBlockRootClientId2( firstSelectedClientId ); const newBlocks = []; for (const block of blocks2) { if (canInsertBlockType2(block.name, rootClientId)) { newBlocks.push(block); } else { const rootBlockName = getBlockName2(rootClientId); const switchedBlocks = block.name !== rootBlockName ? (0, import_blocks25.switchToBlockType)(block, rootBlockName) : [block]; if (!switchedBlocks) { return; } for (const switchedBlock of switchedBlocks) { for (const innerBlock of switchedBlock.innerBlocks) { newBlocks.push(innerBlock); } } } } __unstableSplitSelection2(newBlocks); event.preventDefault(); } } node.ownerDocument.addEventListener("copy", handler); node.ownerDocument.addEventListener("cut", handler); node.ownerDocument.addEventListener("paste", handler); return () => { node.ownerDocument.removeEventListener("copy", handler); node.ownerDocument.removeEventListener("cut", handler); node.ownerDocument.removeEventListener("paste", handler); }; }, []); } // packages/block-editor/build-module/components/writing-flow/index.js var import_jsx_runtime153 = __toESM(require_jsx_runtime()); function useWritingFlow() { const [before, ref, after] = useTabNav(); const hasMultiSelection2 = (0, import_data44.useSelect)( (select3) => select3(store).hasMultiSelection(), [] ); return [ before, (0, import_compose28.useMergeRefs)([ ref, useClipboardHandler(), useInput(), useDragSelection(), useSelectionObserver(), useClickSelection(), useMultiSelection(), useSelectAll(), useArrowNav(), (0, import_compose28.useRefEffect)( (node) => { node.tabIndex = 0; node.dataset.hasMultiSelection = hasMultiSelection2; if (!hasMultiSelection2) { return () => { delete node.dataset.hasMultiSelection; }; } node.setAttribute( "aria-label", (0, import_i18n33.__)("Multiple selected blocks") ); return () => { delete node.dataset.hasMultiSelection; node.removeAttribute("aria-label"); }; }, [hasMultiSelection2] ) ]), after ]; } function WritingFlow({ children, ...props }, forwardedRef) { const [before, ref, after] = useWritingFlow(); return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(import_jsx_runtime153.Fragment, { children: [ before, /* @__PURE__ */ (0, import_jsx_runtime153.jsx)( "div", { ...props, ref: (0, import_compose28.useMergeRefs)([ref, forwardedRef]), className: clsx_default( props.className, "block-editor-writing-flow" ), children } ), after ] }); } var writing_flow_default = (0, import_element42.forwardRef)(WritingFlow); // packages/block-editor/build-module/components/iframe/get-compatibility-styles.js var compatibilityStyles = null; function getCompatibilityStyles() { if (compatibilityStyles) { return compatibilityStyles; } compatibilityStyles = Array.from(document.styleSheets).reduce( (accumulator, styleSheet) => { try { styleSheet.cssRules; } catch (e2) { return accumulator; } const { ownerNode, cssRules } = styleSheet; if (ownerNode === null) { return accumulator; } if (!cssRules) { return accumulator; } if (ownerNode.id.startsWith("wp-")) { return accumulator; } if (!ownerNode.id) { return accumulator; } function matchFromRules(_cssRules) { return Array.from(_cssRules).find( ({ selectorText, conditionText, cssRules: __cssRules }) => { if (conditionText) { return matchFromRules(__cssRules); } return selectorText && (selectorText.includes( ".editor-styles-wrapper" ) || selectorText.includes(".wp-block")); } ); } if (matchFromRules(cssRules)) { const isInline = ownerNode.tagName === "STYLE"; if (isInline) { const mainStylesCssId = ownerNode.id.replace( "-inline-css", "-css" ); const mainStylesElement = document.getElementById(mainStylesCssId); if (mainStylesElement) { accumulator.push(mainStylesElement.cloneNode(true)); } } accumulator.push(ownerNode.cloneNode(true)); if (!isInline) { const inlineStylesCssId = ownerNode.id.replace( "-css", "-inline-css" ); const inlineStylesElement = document.getElementById(inlineStylesCssId); if (inlineStylesElement) { accumulator.push( inlineStylesElement.cloneNode(true) ); } } } return accumulator; }, [] ); return compatibilityStyles; } // packages/block-editor/build-module/components/iframe/use-scale-canvas.js var import_element43 = __toESM(require_element()); var import_compose29 = __toESM(require_compose()); function calculateScale({ frameSize, containerWidth, maxContainerWidth, scaleContainerWidth }) { return (Math.min(containerWidth, maxContainerWidth) - frameSize * 2) / scaleContainerWidth; } function computeScrollHeightNext(transitionFrom, transitionTo) { const { scaleValue: prevScale, scrollHeight: prevScrollHeight } = transitionFrom; const { frameSize, scaleValue } = transitionTo; return prevScrollHeight * (scaleValue / prevScale) + frameSize * 2; } function computeScrollTopNext(transitionFrom, transitionTo) { const { containerHeight: prevContainerHeight, frameSize: prevFrameSize, scaleValue: prevScale, scrollTop: prevScrollTop } = transitionFrom; const { containerHeight, frameSize, scaleValue, scrollHeight } = transitionTo; let scrollTopNext = prevScrollTop; scrollTopNext = (scrollTopNext + prevContainerHeight / 2 - prevFrameSize) / prevScale - prevContainerHeight / 2; scrollTopNext = (scrollTopNext + containerHeight / 2) * scaleValue + frameSize - containerHeight / 2; scrollTopNext = prevScrollTop <= prevFrameSize ? 0 : scrollTopNext; const maxScrollTop = scrollHeight - containerHeight; return Math.round( Math.min(Math.max(0, scrollTopNext), Math.max(0, maxScrollTop)) ); } function getAnimationKeyframes(transitionFrom, transitionTo) { const { scaleValue: prevScale, frameSize: prevFrameSize, scrollTop } = transitionFrom; const { scaleValue, frameSize, scrollTop: scrollTopNext } = transitionTo; return [ { translate: `0 0`, scale: prevScale, paddingTop: `${prevFrameSize / prevScale}px`, paddingBottom: `${prevFrameSize / prevScale}px` }, { translate: `0 ${scrollTop - scrollTopNext}px`, scale: scaleValue, paddingTop: `${frameSize / scaleValue}px`, paddingBottom: `${frameSize / scaleValue}px` } ]; } function useScaleCanvas({ frameSize, iframeDocument, maxContainerWidth = 750, scale }) { const [contentResizeListener, { height: contentHeight }] = (0, import_compose29.useResizeObserver)(); const [ containerResizeListener, { width: containerWidth, height: containerHeight } ] = (0, import_compose29.useResizeObserver)(); const initialContainerWidthRef = (0, import_element43.useRef)(0); const isZoomedOut = scale !== 1; const prefersReducedMotion = (0, import_compose29.useReducedMotion)(); const isAutoScaled = scale === "auto-scaled"; const startAnimationRef = (0, import_element43.useRef)(false); const animationRef = (0, import_element43.useRef)(null); (0, import_element43.useEffect)(() => { if (!isZoomedOut) { initialContainerWidthRef.current = containerWidth; } }, [containerWidth, isZoomedOut]); const scaleContainerWidth = Math.max( initialContainerWidthRef.current, containerWidth ); const scaleValue = isAutoScaled ? calculateScale({ frameSize, containerWidth, maxContainerWidth, scaleContainerWidth }) : scale; const transitionFromRef = (0, import_element43.useRef)({ scaleValue, frameSize, containerHeight: 0, scrollTop: 0, scrollHeight: 0 }); const transitionToRef = (0, import_element43.useRef)({ scaleValue, frameSize, containerHeight: 0, scrollTop: 0, scrollHeight: 0 }); const startZoomOutAnimation = (0, import_element43.useCallback)(() => { const { scrollTop } = transitionFromRef.current; const { scrollTop: scrollTopNext } = transitionToRef.current; iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-scroll-top", `${scrollTop}px` ); iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-scroll-top-next", `${scrollTopNext}px` ); iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-overflow-behavior", transitionFromRef.current.scrollHeight === transitionFromRef.current.containerHeight ? "auto" : "scroll" ); iframeDocument.documentElement.classList.add("zoom-out-animation"); return iframeDocument.documentElement.animate( getAnimationKeyframes( transitionFromRef.current, transitionToRef.current ), { easing: "cubic-bezier(0.46, 0.03, 0.52, 0.96)", duration: 400 } ); }, [iframeDocument]); const finishZoomOutAnimation = (0, import_element43.useCallback)(() => { startAnimationRef.current = false; animationRef.current = null; iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-scale", transitionToRef.current.scaleValue ); iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-frame-size", `${transitionToRef.current.frameSize}px` ); iframeDocument.documentElement.classList.remove("zoom-out-animation"); iframeDocument.documentElement.scrollTop = transitionToRef.current.scrollTop; iframeDocument.documentElement.style.removeProperty( "--wp-block-editor-iframe-zoom-out-scroll-top" ); iframeDocument.documentElement.style.removeProperty( "--wp-block-editor-iframe-zoom-out-scroll-top-next" ); iframeDocument.documentElement.style.removeProperty( "--wp-block-editor-iframe-zoom-out-overflow-behavior" ); transitionFromRef.current = transitionToRef.current; }, [iframeDocument]); const previousIsZoomedOut = (0, import_element43.useRef)(false); (0, import_element43.useEffect)(() => { const trigger = iframeDocument && previousIsZoomedOut.current !== isZoomedOut; previousIsZoomedOut.current = isZoomedOut; if (!trigger) { return; } startAnimationRef.current = true; if (!isZoomedOut) { return; } iframeDocument.documentElement.classList.add("is-zoomed-out"); return () => { iframeDocument.documentElement.classList.remove("is-zoomed-out"); }; }, [iframeDocument, isZoomedOut]); (0, import_element43.useEffect)(() => { if (!iframeDocument) { return; } if (isAutoScaled && transitionFromRef.current.scaleValue !== 1) { transitionFromRef.current.scaleValue = calculateScale({ frameSize: transitionFromRef.current.frameSize, containerWidth, maxContainerWidth, scaleContainerWidth: containerWidth }); } if (scaleValue < 1) { if (!startAnimationRef.current) { iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-scale", scaleValue ); iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-frame-size", `${frameSize}px` ); } iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-content-height", `${contentHeight}px` ); iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-inner-height", `${containerHeight}px` ); iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-container-width", `${containerWidth}px` ); iframeDocument.documentElement.style.setProperty( "--wp-block-editor-iframe-zoom-out-scale-container-width", `${scaleContainerWidth}px` ); } if (startAnimationRef.current) { startAnimationRef.current = false; if (animationRef.current) { animationRef.current.reverse(); const tempTransitionFrom = transitionFromRef.current; const tempTransitionTo = transitionToRef.current; transitionFromRef.current = tempTransitionTo; transitionToRef.current = tempTransitionFrom; } else { transitionFromRef.current.scrollTop = iframeDocument.documentElement.scrollTop; transitionFromRef.current.scrollHeight = iframeDocument.documentElement.scrollHeight; transitionFromRef.current.containerHeight = containerHeight; transitionToRef.current = { scaleValue, frameSize, containerHeight: iframeDocument.documentElement.clientHeight // use clientHeight to get the actual height of the new container after zoom state changes have rendered, as it will be the most up-to-date. }; transitionToRef.current.scrollHeight = computeScrollHeightNext( transitionFromRef.current, transitionToRef.current ); transitionToRef.current.scrollTop = computeScrollTopNext( transitionFromRef.current, transitionToRef.current ); animationRef.current = startZoomOutAnimation(); if (prefersReducedMotion) { finishZoomOutAnimation(); } else { animationRef.current.onfinish = finishZoomOutAnimation; } } } }, [ startZoomOutAnimation, finishZoomOutAnimation, prefersReducedMotion, isAutoScaled, scaleValue, frameSize, iframeDocument, contentHeight, containerWidth, containerHeight, maxContainerWidth, scaleContainerWidth ]); return { isZoomedOut, scaleContainerWidth, contentResizeListener, containerResizeListener }; } // packages/block-editor/build-module/components/iframe/index.js var import_jsx_runtime154 = __toESM(require_jsx_runtime()); function bubbleEvent(event, Constructor, frame) { const init = {}; for (const key in event) { init[key] = event[key]; } if (event instanceof frame.contentDocument.defaultView.MouseEvent) { const rect = frame.getBoundingClientRect(); init.clientX += rect.left; init.clientY += rect.top; } const newEvent = new Constructor(event.type, init); if (init.defaultPrevented) { newEvent.preventDefault(); } const cancelled = !frame.dispatchEvent(newEvent); if (cancelled) { event.preventDefault(); } } function useBubbleEvents(iframeDocument) { return (0, import_compose30.useRefEffect)(() => { const { defaultView } = iframeDocument; if (!defaultView) { return; } const { frameElement } = defaultView; const html = iframeDocument.documentElement; const eventTypes = ["dragover", "mousemove"]; const handlers = {}; for (const name of eventTypes) { handlers[name] = (event) => { const prototype = Object.getPrototypeOf(event); const constructorName = prototype.constructor.name; const Constructor = window[constructorName]; bubbleEvent(event, Constructor, frameElement); }; html.addEventListener(name, handlers[name]); } return () => { for (const name of eventTypes) { html.removeEventListener(name, handlers[name]); } }; }); } function Iframe({ contentRef, children, tabIndex = 0, scale = 1, frameSize = 0, readonly, forwardedRef: ref, title = (0, import_i18n34.__)("Editor canvas"), ...props }) { const { resolvedAssets, isPreviewMode } = (0, import_data45.useSelect)((select3) => { const { getSettings: getSettings8 } = select3(store); const settings2 = getSettings8(); return { resolvedAssets: settings2.__unstableResolvedAssets, isPreviewMode: settings2.isPreviewMode }; }, []); const { styles = "", scripts = "" } = resolvedAssets; const [iframeDocument, setIframeDocument] = (0, import_element44.useState)(); const [bodyClasses, setBodyClasses] = (0, import_element44.useState)([]); const [before, writingFlowRef, after] = useWritingFlow(); const setRef = (0, import_compose30.useRefEffect)((node) => { node._load = () => { setIframeDocument(node.contentDocument); }; let iFrameDocument; function preventFileDropDefault(event) { event.preventDefault(); } function interceptLinkClicks(event) { if (event.target.tagName === "A" && event.target.getAttribute("href")?.startsWith("#")) { event.preventDefault(); iFrameDocument.defaultView.location.hash = event.target.getAttribute("href").slice(1); } } const { ownerDocument } = node; setBodyClasses( Array.from(ownerDocument.body.classList).filter( (name) => name.startsWith("admin-color-") || name.startsWith("post-type-") || name === "wp-embed-responsive" ) ); function onLoad() { const { contentDocument } = node; const { documentElement } = contentDocument; iFrameDocument = contentDocument; documentElement.classList.add("block-editor-iframe__html"); contentDocument.dir = ownerDocument.dir; for (const compatStyle of getCompatibilityStyles()) { if (contentDocument.getElementById(compatStyle.id)) { continue; } contentDocument.head.appendChild( compatStyle.cloneNode(true) ); if (!isPreviewMode) { console.warn( `${compatStyle.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`, compatStyle ); } } iFrameDocument.addEventListener( "dragover", preventFileDropDefault, false ); iFrameDocument.addEventListener( "drop", preventFileDropDefault, false ); iFrameDocument.addEventListener("click", interceptLinkClicks); } node.addEventListener("load", onLoad); return () => { delete node._load; node.removeEventListener("load", onLoad); iFrameDocument?.removeEventListener( "dragover", preventFileDropDefault ); iFrameDocument?.removeEventListener( "drop", preventFileDropDefault ); iFrameDocument?.removeEventListener("click", interceptLinkClicks); }; }, []); const { contentResizeListener, containerResizeListener, isZoomedOut, scaleContainerWidth } = useScaleCanvas({ scale, frameSize: parseInt(frameSize), iframeDocument }); const disabledRef = (0, import_compose30.useDisabled)({ isDisabled: !readonly }); const bodyRef = (0, import_compose30.useMergeRefs)([ useBubbleEvents(iframeDocument), contentRef, writingFlowRef, disabledRef ]); const html = `