=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
@@ -6434,16 +5975,19 @@ const __EXPERIMENTAL_STYLE_PROPERTY = {
},
background: {
value: ['color', 'gradient'],
- support: ['color', 'gradients']
+ support: ['color', 'gradients'],
+ useEngine: true
},
backgroundColor: {
value: ['color', 'background'],
support: ['color', 'background'],
- requiresOptOut: true
+ requiresOptOut: true,
+ useEngine: true
},
borderColor: {
value: ['border', 'color'],
- support: ['__experimentalBorder', 'color']
+ support: ['__experimentalBorder', 'color'],
+ useEngine: true
},
borderRadius: {
value: ['border', 'radius'],
@@ -6453,20 +5997,84 @@ const __EXPERIMENTAL_STYLE_PROPERTY = {
borderTopRightRadius: 'topRight',
borderBottomLeftRadius: 'bottomLeft',
borderBottomRightRadius: 'bottomRight'
- }
+ },
+ useEngine: true
},
borderStyle: {
value: ['border', 'style'],
- support: ['__experimentalBorder', 'style']
+ support: ['__experimentalBorder', 'style'],
+ useEngine: true
},
borderWidth: {
value: ['border', 'width'],
- support: ['__experimentalBorder', 'width']
+ support: ['__experimentalBorder', 'width'],
+ useEngine: true
+ },
+ borderTopColor: {
+ value: ['border', 'top', 'color'],
+ support: ['__experimentalBorder', 'color'],
+ useEngine: true
+ },
+ borderTopStyle: {
+ value: ['border', 'top', 'style'],
+ support: ['__experimentalBorder', 'style'],
+ useEngine: true
+ },
+ borderTopWidth: {
+ value: ['border', 'top', 'width'],
+ support: ['__experimentalBorder', 'width'],
+ useEngine: true
+ },
+ borderRightColor: {
+ value: ['border', 'right', 'color'],
+ support: ['__experimentalBorder', 'color'],
+ useEngine: true
+ },
+ borderRightStyle: {
+ value: ['border', 'right', 'style'],
+ support: ['__experimentalBorder', 'style'],
+ useEngine: true
+ },
+ borderRightWidth: {
+ value: ['border', 'right', 'width'],
+ support: ['__experimentalBorder', 'width'],
+ useEngine: true
+ },
+ borderBottomColor: {
+ value: ['border', 'bottom', 'color'],
+ support: ['__experimentalBorder', 'color'],
+ useEngine: true
+ },
+ borderBottomStyle: {
+ value: ['border', 'bottom', 'style'],
+ support: ['__experimentalBorder', 'style'],
+ useEngine: true
+ },
+ borderBottomWidth: {
+ value: ['border', 'bottom', 'width'],
+ support: ['__experimentalBorder', 'width'],
+ useEngine: true
+ },
+ borderLeftColor: {
+ value: ['border', 'left', 'color'],
+ support: ['__experimentalBorder', 'color'],
+ useEngine: true
+ },
+ borderLeftStyle: {
+ value: ['border', 'left', 'style'],
+ support: ['__experimentalBorder', 'style'],
+ useEngine: true
+ },
+ borderLeftWidth: {
+ value: ['border', 'left', 'width'],
+ support: ['__experimentalBorder', 'width'],
+ useEngine: true
},
color: {
value: ['color', 'text'],
support: ['color', 'text'],
- requiresOptOut: true
+ requiresOptOut: true,
+ useEngine: true
},
filter: {
value: ['filter', 'duotone'],
@@ -6476,25 +6084,38 @@ const __EXPERIMENTAL_STYLE_PROPERTY = {
value: ['elements', 'link', 'color', 'text'],
support: ['color', 'link']
},
+ buttonColor: {
+ value: ['elements', 'button', 'color', 'text'],
+ support: ['color', 'button']
+ },
+ buttonBackgroundColor: {
+ value: ['elements', 'button', 'color', 'background'],
+ support: ['color', 'button']
+ },
fontFamily: {
value: ['typography', 'fontFamily'],
- support: ['typography', '__experimentalFontFamily']
+ support: ['typography', '__experimentalFontFamily'],
+ useEngine: true
},
fontSize: {
value: ['typography', 'fontSize'],
- support: ['typography', 'fontSize']
+ support: ['typography', 'fontSize'],
+ useEngine: true
},
fontStyle: {
value: ['typography', 'fontStyle'],
- support: ['typography', '__experimentalFontStyle']
+ support: ['typography', '__experimentalFontStyle'],
+ useEngine: true
},
fontWeight: {
value: ['typography', 'fontWeight'],
- support: ['typography', '__experimentalFontWeight']
+ support: ['typography', '__experimentalFontWeight'],
+ useEngine: true
},
lineHeight: {
value: ['typography', 'lineHeight'],
- support: ['typography', 'lineHeight']
+ support: ['typography', 'lineHeight'],
+ useEngine: true
},
margin: {
value: ['spacing', 'margin'],
@@ -6520,38 +6141,412 @@ const __EXPERIMENTAL_STYLE_PROPERTY = {
},
textDecoration: {
value: ['typography', 'textDecoration'],
- support: ['typography', '__experimentalTextDecoration']
+ support: ['typography', '__experimentalTextDecoration'],
+ useEngine: true
},
textTransform: {
value: ['typography', 'textTransform'],
- support: ['typography', '__experimentalTextTransform']
+ support: ['typography', '__experimentalTextTransform'],
+ useEngine: true
},
letterSpacing: {
value: ['typography', 'letterSpacing'],
- support: ['typography', '__experimentalLetterSpacing']
+ support: ['typography', '__experimentalLetterSpacing'],
+ useEngine: true
},
- '--wp--style--block-gap': {
- value: ['spacing', 'blockGap'],
- support: ['spacing', 'blockGap']
+ '--wp--style--root--padding': {
+ value: ['spacing', 'padding'],
+ support: ['spacing', 'padding'],
+ properties: {
+ '--wp--style--root--padding-top': 'top',
+ '--wp--style--root--padding-right': 'right',
+ '--wp--style--root--padding-bottom': 'bottom',
+ '--wp--style--root--padding-left': 'left'
+ },
+ rootOnly: true
}
};
const __EXPERIMENTAL_ELEMENTS = {
link: 'a',
+ heading: 'h1, h2, h3, h4, h5, h6',
h1: 'h1',
h2: 'h2',
h3: 'h3',
h4: 'h4',
h5: 'h5',
- h6: 'h6'
+ h6: 'h6',
+ button: '.wp-element-button, .wp-block-button__link',
+ caption: '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption',
+ cite: 'cite'
};
const __EXPERIMENTAL_PATHS_WITH_MERGE = {
'color.duotone': true,
'color.gradients': true,
'color.palette': true,
'typography.fontFamilies': true,
- 'typography.fontSizes': true
+ 'typography.fontSizes': true,
+ 'spacing.spacingSizes': true
};
+;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.js
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+/* global Reflect, Promise */
+
+var extendStatics = function(d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+};
+
+function __extends(d, b) {
+ if (typeof b !== "function" && b !== null)
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+}
+
+var __assign = function() {
+ __assign = Object.assign || function __assign(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ }
+ return __assign.apply(this, arguments);
+}
+
+function __rest(s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+}
+
+function __decorate(decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+}
+
+function __param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); }
+}
+
+function __metadata(metadataKey, metadataValue) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
+}
+
+function __awaiter(thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+}
+
+function __generator(thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+}
+
+var __createBinding = Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+});
+
+function __exportStar(m, o) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
+}
+
+function __values(o) {
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+ if (m) return m.call(o);
+ if (o && typeof o.length === "number") return {
+ next: function () {
+ if (o && i >= o.length) o = void 0;
+ return { value: o && o[i++], done: !o };
+ }
+ };
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+}
+
+function __read(o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m) return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ }
+ catch (error) { e = { error: error }; }
+ finally {
+ try {
+ if (r && !r.done && (m = i["return"])) m.call(i);
+ }
+ finally { if (e) throw e.error; }
+ }
+ return ar;
+}
+
+/** @deprecated */
+function __spread() {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read(arguments[i]));
+ return ar;
+}
+
+/** @deprecated */
+function __spreadArrays() {
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+ r[k] = a[j];
+ return r;
+}
+
+function __spreadArray(to, from, pack) {
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
+ if (ar || !(i in from)) {
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
+ ar[i] = from[i];
+ }
+ }
+ return to.concat(ar || Array.prototype.slice.call(from));
+}
+
+function __await(v) {
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
+}
+
+function __asyncGenerator(thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
+ function fulfill(value) { resume("next", value); }
+ function reject(value) { resume("throw", value); }
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
+}
+
+function __asyncDelegator(o) {
+ var i, p;
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
+}
+
+function __asyncValues(o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator], i;
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
+}
+
+function __makeTemplateObject(cooked, raw) {
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
+ return cooked;
+};
+
+var __setModuleDefault = Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+};
+
+function __importStar(mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+}
+
+function __importDefault(mod) {
+ return (mod && mod.__esModule) ? mod : { default: mod };
+}
+
+function __classPrivateFieldGet(receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+}
+
+function __classPrivateFieldSet(receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+}
+
+;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
+/**
+ * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
+ */
+var SUPPORTED_LOCALE = {
+ tr: {
+ regexp: /\u0130|\u0049|\u0049\u0307/g,
+ map: {
+ İ: "\u0069",
+ I: "\u0131",
+ İ: "\u0069",
+ },
+ },
+ az: {
+ regexp: /\u0130/g,
+ map: {
+ İ: "\u0069",
+ I: "\u0131",
+ İ: "\u0069",
+ },
+ },
+ lt: {
+ regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
+ map: {
+ I: "\u0069\u0307",
+ J: "\u006A\u0307",
+ Į: "\u012F\u0307",
+ Ì: "\u0069\u0307\u0300",
+ Í: "\u0069\u0307\u0301",
+ Ĩ: "\u0069\u0307\u0303",
+ },
+ },
+};
+/**
+ * Localized lower case.
+ */
+function localeLowerCase(str, locale) {
+ var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
+ if (lang)
+ return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
+ return lowerCase(str);
+}
+/**
+ * Lower case as a function.
+ */
+function lowerCase(str) {
+ return str.toLowerCase();
+}
+
+;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
+
+// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
+var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
+// Remove all non-word characters.
+var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
+/**
+ * Normalize the string into something other libraries can manipulate easier.
+ */
+function noCase(input, options) {
+ if (options === void 0) { options = {}; }
+ var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _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, splitRegexp, "$1\0$2"), stripRegexp, "\0");
+ var start = 0;
+ var end = result.length;
+ // Trim the delimiter from around the output string.
+ while (result.charAt(start) === "\0")
+ start++;
+ while (result.charAt(end - 1) === "\0")
+ end--;
+ // Transform each token independently.
+ return result.slice(start, end).split("\0").map(transform).join(delimiter);
+}
+/**
+ * Replace `re` in the input string with the replacement value.
+ */
+function replace(input, re, value) {
+ if (re instanceof RegExp)
+ return input.replace(re, value);
+ return re.reduce(function (input, re) { return input.replace(re, value); }, input);
+}
+
+;// CONCATENATED MODULE: ./node_modules/pascal-case/dist.es2015/index.js
+
+
+function pascalCaseTransform(input, index) {
+ var firstChar = input.charAt(0);
+ var lowerChars = input.substr(1).toLowerCase();
+ if (index > 0 && firstChar >= "0" && firstChar <= "9") {
+ return "_" + firstChar + lowerChars;
+ }
+ return "" + firstChar.toUpperCase() + lowerChars;
+}
+function dist_es2015_pascalCaseTransformMerge(input) {
+ return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
+}
+function pascalCase(input, options) {
+ if (options === void 0) { options = {}; }
+ return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
+}
+
+;// CONCATENATED MODULE: ./node_modules/camel-case/dist.es2015/index.js
+
+
+function camelCaseTransform(input, index) {
+ if (index === 0)
+ return input.toLowerCase();
+ return pascalCaseTransform(input, index);
+}
+function camelCaseTransformMerge(input, index) {
+ if (index === 0)
+ return input.toLowerCase();
+ return pascalCaseTransformMerge(input);
+}
+function camelCase(input, options) {
+ if (options === void 0) { options = {}; }
+ return pascalCase(input, __assign({ transform: camelCaseTransform }, options));
+}
+
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/registration.js
/* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */
@@ -6696,6 +6691,10 @@ const i18nBlockSchema = {
*/
const serverSideBlockDefinitions = {};
+
+function isObject(object) {
+ return object !== null && typeof object === 'object';
+}
/**
* Sets the server side block definition of blocks.
*
@@ -6703,6 +6702,7 @@ const serverSideBlockDefinitions = {};
*/
// eslint-disable-next-line camelcase
+
function unstable__bootstrapServerSideBlockDefinitions(definitions) {
for (const blockName of Object.keys(definitions)) {
// Don't overwrite if already set. It covers the case when metadata
@@ -6726,7 +6726,13 @@ function unstable__bootstrapServerSideBlockDefinitions(definitions) {
continue;
}
- serverSideBlockDefinitions[blockName] = (0,external_lodash_namespaceObject.mapKeys)((0,external_lodash_namespaceObject.pickBy)(definitions[blockName], value => !(0,external_lodash_namespaceObject.isNil)(value)), (value, key) => (0,external_lodash_namespaceObject.camelCase)(key));
+ serverSideBlockDefinitions[blockName] = Object.fromEntries(Object.entries(definitions[blockName]).filter(_ref => {
+ let [, value] = _ref;
+ return value !== null && value !== undefined;
+ }).map(_ref2 => {
+ let [key, value] = _ref2;
+ return [camelCase(key), value];
+ }));
}
}
/**
@@ -6738,13 +6744,16 @@ function unstable__bootstrapServerSideBlockDefinitions(definitions) {
* @return {Object} Block settings.
*/
-function getBlockSettingsFromMetadata(_ref) {
+function getBlockSettingsFromMetadata(_ref3) {
let {
textdomain,
...metadata
- } = _ref;
+ } = _ref3;
const allowedFields = ['apiVersion', 'title', 'category', 'parent', 'ancestor', 'icon', 'description', 'keywords', 'attributes', 'providesContext', 'usesContext', 'supports', 'styles', 'example', 'variations'];
- const settings = (0,external_lodash_namespaceObject.pick)(metadata, allowedFields);
+ const settings = Object.fromEntries(Object.entries(metadata).filter(_ref4 => {
+ let [key] = _ref4;
+ return allowedFields.includes(key);
+ }));
if (textdomain) {
Object.keys(i18nBlockSchema).forEach(key => {
@@ -6763,16 +6772,30 @@ function getBlockSettingsFromMetadata(_ref) {
* behavior. Once registered, the block is made available as an option to any
* editor interface where blocks are implemented.
*
+ * For more in-depth information on registering a custom block see the [Create a block tutorial](docs/how-to-guides/block-tutorial/README.md)
+ *
* @param {string|Object} blockNameOrMetadata Block type name or its metadata.
* @param {Object} settings Block settings.
*
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { registerBlockType } from '@wordpress/blocks'
+ *
+ * registerBlockType( 'namespace/block-name', {
+ * title: __( 'My First Block' ),
+ * edit: () => { __( 'Hello from the editor!' ) }
,
+ * save: () => Hello from the saved content!
,
+ * } );
+ * ```
+ *
* @return {?WPBlockType} The block, if it has been successfully registered;
* otherwise `undefined`.
*/
function registerBlockType(blockNameOrMetadata, settings) {
- const name = (0,external_lodash_namespaceObject.isObject)(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata;
+ const name = isObject(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata;
if (typeof name !== 'string') {
console.error('Block names must be strings.');
@@ -6789,7 +6812,7 @@ function registerBlockType(blockNameOrMetadata, settings) {
return;
}
- if ((0,external_lodash_namespaceObject.isObject)(blockNameOrMetadata)) {
+ if (isObject(blockNameOrMetadata)) {
unstable__bootstrapServerSideBlockDefinitions({
[name]: getBlockSettingsFromMetadata(blockNameOrMetadata)
});
@@ -6825,16 +6848,16 @@ function registerBlockType(blockNameOrMetadata, settings) {
*/
function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain) {
- if ((0,external_lodash_namespaceObject.isString)(i18nSchema) && (0,external_lodash_namespaceObject.isString)(settingValue)) {
+ if (typeof i18nSchema === 'string' && typeof settingValue === 'string') {
// eslint-disable-next-line @wordpress/i18n-no-variables, @wordpress/i18n-text-domain
return (0,external_wp_i18n_namespaceObject._x)(settingValue, i18nSchema, textdomain);
}
- if ((0,external_lodash_namespaceObject.isArray)(i18nSchema) && !(0,external_lodash_namespaceObject.isEmpty)(i18nSchema) && (0,external_lodash_namespaceObject.isArray)(settingValue)) {
+ if (Array.isArray(i18nSchema) && i18nSchema.length && Array.isArray(settingValue)) {
return settingValue.map(value => translateBlockSettingUsingI18nSchema(i18nSchema[0], value, textdomain));
}
- if ((0,external_lodash_namespaceObject.isObject)(i18nSchema) && !(0,external_lodash_namespaceObject.isEmpty)(i18nSchema) && (0,external_lodash_namespaceObject.isObject)(settingValue)) {
+ if (isObject(i18nSchema) && Object.entries(i18nSchema).length && isObject(settingValue)) {
return Object.keys(settingValue).reduce((accumulator, key) => {
if (!i18nSchema[key]) {
accumulator[key] = settingValue[key];
@@ -6855,14 +6878,32 @@ function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdoma
* @param {Object} settings The block collection settings.
* @param {string} settings.title The title to display in the block inserter.
* @param {Object} [settings.icon] The icon to display in the block inserter.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { registerBlockCollection, registerBlockType } from '@wordpress/blocks';
+ *
+ * // Register the collection.
+ * registerBlockCollection( 'my-collection', {
+ * title: __( 'Custom Collection' ),
+ * } );
+ *
+ * // Register a block in the same namespace to add it to the collection.
+ * registerBlockType( 'my-collection/block-name', {
+ * title: __( 'My First Block' ),
+ * edit: () => { __( 'Hello from the editor!' ) }
,
+ * save: () => 'Hello from the saved content!
,
+ * } );
+ * ```
*/
-function registerBlockCollection(namespace, _ref2) {
+function registerBlockCollection(namespace, _ref5) {
let {
title,
icon
- } = _ref2;
+ } = _ref5;
(0,external_wp_data_namespaceObject.dispatch)(store).addBlockCollection(namespace, title, icon);
}
/**
@@ -6870,6 +6911,12 @@ function registerBlockCollection(namespace, _ref2) {
*
* @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace
*
+ * @example
+ * ```js
+ * import { unregisterBlockCollection } from '@wordpress/blocks';
+ *
+ * unregisterBlockCollection( 'my-collection' );
+ * ```
*/
function unregisterBlockCollection(namespace) {
@@ -6880,6 +6927,24 @@ function unregisterBlockCollection(namespace) {
*
* @param {string} name Block name.
*
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { unregisterBlockType } from '@wordpress/blocks';
+ *
+ * const ExampleComponent = () => {
+ * return (
+ *
+ * );
+ * };
+ * ```
+ *
* @return {?WPBlockType} The previous block value, if it has been successfully
* unregistered; otherwise `undefined`.
*/
@@ -6920,7 +6985,7 @@ function getFreeformContentHandlerName() {
* @return {?string} Block name.
*/
-function registration_getGroupingBlockName() {
+function getGroupingBlockName() {
return (0,external_wp_data_namespaceObject.select)(store).getGroupingBlockName();
}
/**
@@ -6946,6 +7011,20 @@ function getUnregisteredTypeHandlerName() {
* Assigns the default block name.
*
* @param {string} name Block name.
+ *
+ * @example
+ * ```js
+ * import { setDefaultBlockName } from '@wordpress/blocks';
+ *
+ * const ExampleComponent = () => {
+ *
+ * return (
+ *
+ * );
+ * };
+ * ```
*/
function setDefaultBlockName(name) {
@@ -6955,6 +7034,20 @@ function setDefaultBlockName(name) {
* Assigns name of block for handling block grouping interactions.
*
* @param {string} name Block name.
+ *
+ * @example
+ * ```js
+ * import { setGroupingBlockName } from '@wordpress/blocks';
+ *
+ * const ExampleComponent = () => {
+ *
+ * return (
+ *
+ * );
+ * };
+ * ```
*/
function setGroupingBlockName(name) {
@@ -6966,7 +7059,7 @@ function setGroupingBlockName(name) {
* @return {?string} Block name.
*/
-function registration_getDefaultBlockName() {
+function getDefaultBlockName() {
return (0,external_wp_data_namespaceObject.select)(store).getDefaultBlockName();
}
/**
@@ -6977,7 +7070,7 @@ function registration_getDefaultBlockName() {
* @return {?Object} Block type.
*/
-function registration_getBlockType(name) {
+function getBlockType(name) {
var _select;
return (_select = (0,external_wp_data_namespaceObject.select)(store)) === null || _select === void 0 ? void 0 : _select.getBlockType(name);
@@ -6988,7 +7081,7 @@ function registration_getBlockType(name) {
* @return {Array} Block settings.
*/
-function registration_getBlockTypes() {
+function getBlockTypes() {
return (0,external_wp_data_namespaceObject.select)(store).getBlockTypes();
}
/**
@@ -7002,7 +7095,7 @@ function registration_getBlockTypes() {
* @return {?*} Block support value
*/
-function registration_getBlockSupport(nameOrType, feature, defaultSupports) {
+function getBlockSupport(nameOrType, feature, defaultSupports) {
return (0,external_wp_data_namespaceObject.select)(store).getBlockSupport(nameOrType, feature, defaultSupports);
}
/**
@@ -7016,7 +7109,7 @@ function registration_getBlockSupport(nameOrType, feature, defaultSupports) {
* @return {boolean} Whether block supports feature.
*/
-function registration_hasBlockSupport(nameOrType, feature, defaultSupports) {
+function hasBlockSupport(nameOrType, feature, defaultSupports) {
return (0,external_wp_data_namespaceObject.select)(store).hasBlockSupport(nameOrType, feature, defaultSupports);
}
/**
@@ -7053,7 +7146,7 @@ function isTemplatePart(blockOrType) {
* @return {Array} Array of child block names.
*/
-const registration_getChildBlockNames = blockName => {
+const getChildBlockNames = blockName => {
return (0,external_wp_data_namespaceObject.select)(store).getChildBlockNames(blockName);
};
/**
@@ -7064,7 +7157,7 @@ const registration_getChildBlockNames = blockName => {
* @return {boolean} True if a block contains child blocks and false otherwise.
*/
-const registration_hasChildBlocks = blockName => {
+const hasChildBlocks = blockName => {
return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocks(blockName);
};
/**
@@ -7076,14 +7169,39 @@ const registration_hasChildBlocks = blockName => {
* and false otherwise.
*/
-const registration_hasChildBlocksWithInserterSupport = blockName => {
+const hasChildBlocksWithInserterSupport = blockName => {
return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocksWithInserterSupport(blockName);
};
/**
* Registers a new block style variation for the given block.
*
+ * For more information on connecting the styles with CSS [the official documentation](/docs/reference-guides/block-api/block-styles.md#styles)
+ *
* @param {string} blockName Name of block (example: “core/latest-posts”).
* @param {Object} styleVariation Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { registerBlockStyle } from '@wordpress/blocks';
+ * import { Button } from '@wordpress/components';
+ *
+ *
+ * const ExampleComponent = () => {
+ * return (
+ *
+ * );
+ * };
+ * ```
*/
const registerBlockStyle = (blockName, styleVariation) => {
@@ -7094,6 +7212,25 @@ const registerBlockStyle = (blockName, styleVariation) => {
*
* @param {string} blockName Name of block (example: “core/latest-posts”).
* @param {string} styleVariationName Name of class applied to the block.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { unregisterBlockStyle } from '@wordpress/blocks';
+ * import { Button } from '@wordpress/components';
+ *
+ * const ExampleComponent = () => {
+ * return (
+ *
+ * );
+ * };
+ * ```
*/
const unregisterBlockStyle = (blockName, styleVariationName) => {
@@ -7101,6 +7238,9 @@ const unregisterBlockStyle = (blockName, styleVariationName) => {
};
/**
* Returns an array with the variations of a given block type.
+ * Ignored from documentation as the recommended usage is via useSelect from @wordpress/data.
+ *
+ * @ignore
*
* @param {string} blockName Name of block (example: “core/columns”).
* @param {WPBlockVariationScope} [scope] Block variation scope name.
@@ -7108,14 +7248,39 @@ const unregisterBlockStyle = (blockName, styleVariationName) => {
* @return {(WPBlockVariation[]|void)} Block variations.
*/
-const registration_getBlockVariations = (blockName, scope) => {
+const getBlockVariations = (blockName, scope) => {
return (0,external_wp_data_namespaceObject.select)(store).getBlockVariations(blockName, scope);
};
/**
* Registers a new block variation for the given block type.
*
+ * For more information on block variations see [the official documentation ](/docs/reference-guides/block-api/block-variations.md)
+ *
* @param {string} blockName Name of the block (example: “core/columns”).
* @param {WPBlockVariation} variation Object describing a block variation.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { registerBlockVariation } from '@wordpress/blocks';
+ * import { Button } from '@wordpress/components';
+ *
+ * const ExampleComponent = () => {
+ * return (
+ *
+ * );
+ * };
+ * ```
*/
const registerBlockVariation = (blockName, variation) => {
@@ -7126,6 +7291,25 @@ const registerBlockVariation = (blockName, variation) => {
*
* @param {string} blockName Name of the block (example: “core/columns”).
* @param {string} variationName Name of the variation defined for the block.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { unregisterBlockVariation } from '@wordpress/blocks';
+ * import { Button } from '@wordpress/components';
+ *
+ * const ExampleComponent = () => {
+ * return (
+ *
+ * );
+ * };
+ * ```
*/
const unregisterBlockVariation = (blockName, variationName) => {
@@ -7218,12 +7402,13 @@ function v4(options, buf, offset) {
}
/* harmony default export */ var esm_browser_v4 = (v4);
+;// CONCATENATED MODULE: external ["wp","hooks"]
+var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/factory.js
/**
* External dependencies
*/
-
/**
* WordPress dependencies
*/
@@ -7342,14 +7527,14 @@ function cloneBlock(block) {
*/
const isPossibleTransformForSource = (transform, direction, blocks) => {
- if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ if (!blocks.length) {
return false;
} // If multiple blocks are selected, only multi block transforms
// or wildcard transforms are allowed.
const isMultiBlock = blocks.length > 1;
- const firstBlockName = (0,external_lodash_namespaceObject.first)(blocks).name;
+ const firstBlockName = blocks[0].name;
const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
if (!isValidForMultiBlocks) {
@@ -7358,9 +7543,7 @@ const isPossibleTransformForSource = (transform, direction, blocks) => {
// for a block selection of multiple blocks of different types.
- if (!isWildcardBlockTransform(transform) && !(0,external_lodash_namespaceObject.every)(blocks, {
- name: firstBlockName
- })) {
+ if (!isWildcardBlockTransform(transform) && !blocks.every(block => block.name === firstBlockName)) {
return false;
} // Only consider 'block' type transforms as valid.
@@ -7373,7 +7556,7 @@ const isPossibleTransformForSource = (transform, direction, blocks) => {
// only if this is a transform 'from'.
- const sourceBlock = (0,external_lodash_namespaceObject.first)(blocks);
+ const sourceBlock = blocks[0];
const hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
if (!hasMatchingName) {
@@ -7382,18 +7565,13 @@ const isPossibleTransformForSource = (transform, direction, blocks) => {
// a Grouping block.
- if (!isMultiBlock && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) {
+ if (!isMultiBlock && direction === 'from' && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) {
return false;
} // If the transform has a `isMatch` function specified, check that it returns true.
- if ((0,external_lodash_namespaceObject.isFunction)(transform.isMatch)) {
- const attributes = transform.isMultiBlock ? blocks.map(block => block.attributes) : sourceBlock.attributes;
- const block = transform.isMultiBlock ? blocks : sourceBlock;
-
- if (!transform.isMatch(attributes, block)) {
- return false;
- }
+ if (!maybeCheckTransformIsMatch(transform, blocks)) {
+ return false;
}
if (transform.usingMobileTransformations && isWildcardBlockTransform(transform) && !isContainerGroupBlock(sourceBlock.name)) {
@@ -7413,13 +7591,13 @@ const isPossibleTransformForSource = (transform, direction, blocks) => {
const getBlockTypesForPossibleFromTransforms = blocks => {
- if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ if (!blocks.length) {
return [];
}
- const allBlockTypes = registration_getBlockTypes(); // filter all blocks to find those with a 'from' transform.
+ const allBlockTypes = getBlockTypes(); // filter all blocks to find those with a 'from' transform.
- const blockTypesWithPossibleFromTransforms = (0,external_lodash_namespaceObject.filter)(allBlockTypes, blockType => {
+ const blockTypesWithPossibleFromTransforms = allBlockTypes.filter(blockType => {
const fromTransforms = getBlockTransforms('from', blockType.name);
return !!findTransform(fromTransforms, transform => {
return isPossibleTransformForSource(transform, 'from', blocks);
@@ -7438,21 +7616,21 @@ const getBlockTypesForPossibleFromTransforms = blocks => {
const getBlockTypesForPossibleToTransforms = blocks => {
- if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ if (!blocks.length) {
return [];
}
- const sourceBlock = (0,external_lodash_namespaceObject.first)(blocks);
- const blockType = registration_getBlockType(sourceBlock.name);
+ const sourceBlock = blocks[0];
+ const blockType = getBlockType(sourceBlock.name);
const transformsTo = blockType ? getBlockTransforms('to', blockType.name) : []; // filter all 'to' transforms to find those that are possible.
- const possibleTransforms = (0,external_lodash_namespaceObject.filter)(transformsTo, transform => {
+ const possibleTransforms = transformsTo.filter(transform => {
return transform && isPossibleTransformForSource(transform, 'to', blocks);
}); // Build a list of block names using the possible 'to' transforms.
- const blockNames = (0,external_lodash_namespaceObject.flatMap)(possibleTransforms, transformation => transformation.blocks); // Map block names to block types.
+ const blockNames = possibleTransforms.map(transformation => transformation.blocks).flat(); // Map block names to block types.
- return blockNames.map(name => name === '*' ? name : registration_getBlockType(name));
+ return blockNames.map(name => name === '*' ? name : getBlockType(name));
};
/**
* Determines whether transform is a "block" type
@@ -7476,7 +7654,7 @@ const isWildcardBlockTransform = t => t && t.type === 'block' && Array.isArray(t
* @return {boolean} whether or not the Block is the container Block type
*/
-const isContainerGroupBlock = name => name === registration_getGroupingBlockName();
+const isContainerGroupBlock = name => name === getGroupingBlockName();
/**
* Returns an array of block types that the set of blocks received as argument
* can be transformed into.
@@ -7487,13 +7665,13 @@ const isContainerGroupBlock = name => name === registration_getGroupingBlockName
*/
function getPossibleBlockTransformations(blocks) {
- if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ if (!blocks.length) {
return [];
}
const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks);
const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks);
- return (0,external_lodash_namespaceObject.uniq)([...blockTypesForFromTransforms, ...blockTypesForToTransforms]);
+ return [...new Set([...blockTypesForFromTransforms, ...blockTypesForToTransforms])];
}
/**
* Given an array of transforms, returns the highest-priority transform where
@@ -7539,12 +7717,12 @@ function findTransform(transforms, predicate) {
function getBlockTransforms(direction, blockTypeOrName) {
// When retrieving transforms for all block types, recurse into self.
if (blockTypeOrName === undefined) {
- return (0,external_lodash_namespaceObject.flatMap)(registration_getBlockTypes(), _ref => {
+ return getBlockTypes().map(_ref => {
let {
name
} = _ref;
return getBlockTransforms(direction, name);
- });
+ }).flat();
} // Validate that block type exists and has array of direction.
@@ -7559,7 +7737,7 @@ function getBlockTransforms(direction, blockTypeOrName) {
}
const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms);
- const filteredTransforms = usingMobileTransformations ? (0,external_lodash_namespaceObject.filter)(transforms[direction], t => {
+ const filteredTransforms = usingMobileTransformations ? transforms[direction].filter(t => {
if (t.type === 'raw') {
return true;
}
@@ -7572,7 +7750,7 @@ function getBlockTransforms(direction, blockTypeOrName) {
return true;
}
- return (0,external_lodash_namespaceObject.every)(t.blocks, transformBlockName => transforms.supportedMobileTransforms.includes(transformBlockName));
+ return t.blocks.every(transformBlockName => transforms.supportedMobileTransforms.includes(transformBlockName));
}) : transforms[direction]; // Map transforms to normal form.
return filteredTransforms.map(transform => ({ ...transform,
@@ -7580,6 +7758,25 @@ function getBlockTransforms(direction, blockTypeOrName) {
usingMobileTransformations
}));
}
+/**
+ * Checks that a given transforms isMatch method passes for given source blocks.
+ *
+ * @param {Object} transform A transform object.
+ * @param {Array} blocks Blocks array.
+ *
+ * @return {boolean} True if given blocks are a match for the transform.
+ */
+
+function maybeCheckTransformIsMatch(transform, blocks) {
+ if (typeof transform.isMatch !== 'function') {
+ return true;
+ }
+
+ const sourceBlock = blocks[0];
+ const attributes = transform.isMultiBlock ? blocks.map(block => block.attributes) : sourceBlock.attributes;
+ const block = transform.isMultiBlock ? blocks : sourceBlock;
+ return transform.isMatch(attributes, block);
+}
/**
* Switch one or more blocks into one or more blocks of the new block type.
*
@@ -7589,8 +7786,9 @@ function getBlockTransforms(direction, blockTypeOrName) {
* @return {?Array} Array of blocks or null.
*/
+
function switchToBlockType(blocks, name) {
- const blocksArray = (0,external_lodash_namespaceObject.castArray)(blocks);
+ const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
const isMultiBlock = blocksArray.length > 1;
const firstBlock = blocksArray[0];
const sourceName = firstBlock.name; // Find the right transformation by giving priority to the "to"
@@ -7598,7 +7796,7 @@ function switchToBlockType(blocks, name) {
const transformationsFrom = getBlockTransforms('from', name);
const transformationsTo = getBlockTransforms('to', sourceName);
- const transformation = findTransform(transformationsTo, t => t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock)) || findTransform(transformationsFrom, t => t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock)); // Stop if there is no valid transformation.
+ const transformation = findTransform(transformationsTo, t => t.type === 'block' && t.blocks.indexOf(name) !== -1 && (!isMultiBlock || t.isMultiBlock) && maybeCheckTransformIsMatch(t, blocksArray)) || findTransform(transformationsFrom, t => t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock) && maybeCheckTransformIsMatch(t, blocksArray)); // Stop if there is no valid transformation.
if (!transformation) {
return null;
@@ -7607,12 +7805,12 @@ function switchToBlockType(blocks, name) {
let transformationResults;
if (transformation.isMultiBlock) {
- if ((0,external_lodash_namespaceObject.has)(transformation, '__experimentalConvert')) {
+ if ('__experimentalConvert' in transformation) {
transformationResults = transformation.__experimentalConvert(blocksArray);
} else {
transformationResults = transformation.transform(blocksArray.map(currentBlock => currentBlock.attributes), blocksArray.map(currentBlock => currentBlock.innerBlocks));
}
- } else if ((0,external_lodash_namespaceObject.has)(transformation, '__experimentalConvert')) {
+ } else if ('__experimentalConvert' in transformation) {
transformationResults = transformation.__experimentalConvert(firstBlock);
} else {
transformationResults = transformation.transform(firstBlock.attributes, firstBlock.innerBlocks);
@@ -7620,20 +7818,26 @@ function switchToBlockType(blocks, name) {
// of objects.
- if (!(0,external_lodash_namespaceObject.isObjectLike)(transformationResults)) {
+ if (transformationResults === null || typeof transformationResults !== 'object') {
return null;
} // If the transformation function returned a single object, we want to work
// with an array instead.
- transformationResults = (0,external_lodash_namespaceObject.castArray)(transformationResults); // Ensure that every block object returned by the transformation has a
+ transformationResults = Array.isArray(transformationResults) ? transformationResults : [transformationResults]; // Ensure that every block object returned by the transformation has a
// valid block type.
- if (transformationResults.some(result => !registration_getBlockType(result.name))) {
+ if (transformationResults.some(result => !getBlockType(result.name))) {
return null;
+ } // When unwrapping blocks (`switchToBlockType( wrapperblocks, '*' )`), do
+ // not run filters on the unwrapped blocks. They shoud remain as they are.
+
+
+ if (name === '*') {
+ return transformationResults;
}
- const hasSwitchedBlock = name === '*' || (0,external_lodash_namespaceObject.some)(transformationResults, result => result.name === name); // Ensure that at least one block object returned by the transformation has
+ const hasSwitchedBlock = transformationResults.some(result => result.name === name); // Ensure that at least one block object returned by the transformation has
// the expected "destination" block type.
if (!hasSwitchedBlock) {
@@ -7665,7 +7869,9 @@ function switchToBlockType(blocks, name) {
*/
const getBlockFromExample = (name, example) => {
- return createBlock(name, example.attributes, (0,external_lodash_namespaceObject.map)(example.innerBlocks, innerBlock => getBlockFromExample(innerBlock.name, innerBlock)));
+ var _example$innerBlocks;
+
+ return createBlock(name, example.attributes, ((_example$innerBlocks = example.innerBlocks) !== null && _example$innerBlocks !== void 0 ? _example$innerBlocks : []).map(innerBlock => getBlockFromExample(innerBlock.name, innerBlock)));
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/utils.js
@@ -7710,7 +7916,7 @@ const ICON_COLORS = ['#191e23', '#f8f9f9'];
*/
function isUnmodifiedDefaultBlock(block) {
- const defaultBlockName = registration_getDefaultBlockName();
+ const defaultBlockName = getDefaultBlockName();
if (block.name !== defaultBlockName) {
return false;
@@ -7723,7 +7929,7 @@ function isUnmodifiedDefaultBlock(block) {
}
const newDefaultBlock = isUnmodifiedDefaultBlock.block;
- const blockType = registration_getBlockType(defaultBlockName);
+ const blockType = getBlockType(defaultBlockName);
return (0,external_lodash_namespaceObject.every)(blockType === null || blockType === void 0 ? void 0 : blockType.attributes, (value, key) => newDefaultBlock.attributes[key] === block.attributes[key]);
}
/**
@@ -7735,7 +7941,7 @@ function isUnmodifiedDefaultBlock(block) {
*/
function isValidIcon(icon) {
- return !!icon && ((0,external_lodash_namespaceObject.isString)(icon) || (0,external_wp_element_namespaceObject.isValidElement)(icon) || (0,external_lodash_namespaceObject.isFunction)(icon) || icon instanceof external_wp_element_namespaceObject.Component);
+ return !!icon && (typeof icon === 'string' || (0,external_wp_element_namespaceObject.isValidElement)(icon) || typeof icon === 'function' || icon instanceof external_wp_element_namespaceObject.Component);
}
/**
* Function that receives an icon as set by the blocks during the registration
@@ -7758,10 +7964,14 @@ function normalizeIconObject(icon) {
};
}
- if ((0,external_lodash_namespaceObject.has)(icon, ['background'])) {
+ if ('background' in icon) {
const colordBgColor = w(icon.background);
+
+ const getColorContrast = iconColor => colordBgColor.contrast(iconColor);
+
+ const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast));
return { ...icon,
- foreground: icon.foreground ? icon.foreground : (0,external_lodash_namespaceObject.maxBy)(ICON_COLORS, iconColor => colordBgColor.contrast(iconColor)),
+ foreground: icon.foreground ? icon.foreground : ICON_COLORS.find(iconColor => getColorContrast(iconColor) === maxContrast),
shadowColor: colordBgColor.alpha(0.3).toRgbString()
};
}
@@ -7779,8 +7989,8 @@ function normalizeIconObject(icon) {
*/
function normalizeBlockType(blockTypeOrName) {
- if ((0,external_lodash_namespaceObject.isString)(blockTypeOrName)) {
- return registration_getBlockType(blockTypeOrName);
+ if (typeof blockTypeOrName === 'string') {
+ return getBlockType(blockTypeOrName);
}
return blockTypeOrName;
@@ -7818,7 +8028,7 @@ function getBlockLabel(blockType, attributes) {
* than the visual label and includes the block title and the value of the
* `getLabel` function if it's specified.
*
- * @param {Object} blockType The block type.
+ * @param {?Object} blockType The block type.
* @param {Object} attributes The values of the block's attributes.
* @param {?number} position The position of the block in the block list.
* @param {string} [direction='vertical'] The direction of the block layout.
@@ -7881,7 +8091,7 @@ function getAccessibleBlockLabel(blockType, attributes, position) {
function __experimentalSanitizeBlockAttributes(name, attributes) {
// Get the type definition associated with a registered block.
- const blockType = registration_getBlockType(name);
+ const blockType = getBlockType(name);
if (undefined === blockType) {
throw new Error(`Block type '${name}' is not registered.`);
@@ -7921,7 +8131,7 @@ function __experimentalSanitizeBlockAttributes(name, attributes) {
function __experimentalGetBlockAttributesNamesByRole(name, role) {
var _getBlockType;
- const attributes = (_getBlockType = registration_getBlockType(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.attributes;
+ const attributes = (_getBlockType = getBlockType(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.attributes;
if (!attributes) return [];
const attributesNames = Object.keys(attributes);
if (!role) return attributesNames;
@@ -7931,12 +8141,1451 @@ function __experimentalGetBlockAttributesNamesByRole(name, role) {
return ((_attributes$attribute = attributes[attributeName]) === null || _attributes$attribute === void 0 ? void 0 : _attributes$attribute.__experimentalRole) === role;
});
}
+/**
+ * Return a new object with the specified keys omitted.
+ *
+ * @param {Object} object Original object.
+ * @param {Array} keys Keys to be omitted.
+ *
+ * @return {Object} Object with omitted keys.
+ */
+
+function omit(object, keys) {
+ return Object.fromEntries(Object.entries(object).filter(_ref => {
+ let [key] = _ref;
+ return !keys.includes(key);
+ }));
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/reducer.js
+/**
+ * External dependencies
+ */
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+/**
+ * @typedef {Object} WPBlockCategory
+ *
+ * @property {string} slug Unique category slug.
+ * @property {string} title Category label, for display in user interface.
+ */
+
+/**
+ * Default set of categories.
+ *
+ * @type {WPBlockCategory[]}
+ */
+
+const DEFAULT_CATEGORIES = [{
+ slug: 'text',
+ title: (0,external_wp_i18n_namespaceObject.__)('Text')
+}, {
+ slug: 'media',
+ title: (0,external_wp_i18n_namespaceObject.__)('Media')
+}, {
+ slug: 'design',
+ title: (0,external_wp_i18n_namespaceObject.__)('Design')
+}, {
+ slug: 'widgets',
+ title: (0,external_wp_i18n_namespaceObject.__)('Widgets')
+}, {
+ slug: 'theme',
+ title: (0,external_wp_i18n_namespaceObject.__)('Theme')
+}, {
+ slug: 'embed',
+ title: (0,external_wp_i18n_namespaceObject.__)('Embeds')
+}, {
+ slug: 'reusable',
+ title: (0,external_wp_i18n_namespaceObject.__)('Reusable blocks')
+}]; // Key block types by their name.
+
+function keyBlockTypesByName(types) {
+ return types.reduce((newBlockTypes, block) => ({ ...newBlockTypes,
+ [block.name]: block
+ }), {});
+} // Filter items to ensure they're unique by their name.
+
+
+function getUniqueItemsByName(items) {
+ return items.reduce((acc, currentItem) => {
+ if (!acc.some(item => item.name === currentItem.name)) {
+ acc.push(currentItem);
+ }
+
+ return acc;
+ }, []);
+}
+/**
+ * Reducer managing the unprocessed block types in a form passed when registering the by block.
+ * It's for internal use only. It allows recomputing the processed block types on-demand after block type filters
+ * get added or removed.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+
+function unprocessedBlockTypes() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_UNPROCESSED_BLOCK_TYPE':
+ return { ...state,
+ [action.blockType.name]: action.blockType
+ };
+
+ case 'REMOVE_BLOCK_TYPES':
+ return omit(state, action.names);
+ }
+
+ return state;
+}
+/**
+ * Reducer managing the processed block types with all filters applied.
+ * The state is derived from the `unprocessedBlockTypes` reducer.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function blockTypes() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_TYPES':
+ return { ...state,
+ ...keyBlockTypesByName(action.blockTypes)
+ };
+
+ case 'REMOVE_BLOCK_TYPES':
+ return omit(state, action.names);
+ }
+
+ return state;
+}
+/**
+ * Reducer managing the block style variations.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function blockStyles() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_TYPES':
+ return { ...state,
+ ...(0,external_lodash_namespaceObject.mapValues)(keyBlockTypesByName(action.blockTypes), blockType => getUniqueItemsByName([...(0,external_lodash_namespaceObject.get)(blockType, ['styles'], []).map(style => ({ ...style,
+ source: 'block'
+ })), ...(0,external_lodash_namespaceObject.get)(state, [blockType.name], []).filter(_ref => {
+ let {
+ source
+ } = _ref;
+ return 'block' !== source;
+ })]))
+ };
+
+ case 'ADD_BLOCK_STYLES':
+ return { ...state,
+ [action.blockName]: getUniqueItemsByName([...(0,external_lodash_namespaceObject.get)(state, [action.blockName], []), ...action.styles])
+ };
+
+ case 'REMOVE_BLOCK_STYLES':
+ return { ...state,
+ [action.blockName]: (0,external_lodash_namespaceObject.filter)((0,external_lodash_namespaceObject.get)(state, [action.blockName], []), style => action.styleNames.indexOf(style.name) === -1)
+ };
+ }
+
+ return state;
+}
+/**
+ * Reducer managing the block variations.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function blockVariations() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_TYPES':
+ return { ...state,
+ ...(0,external_lodash_namespaceObject.mapValues)(keyBlockTypesByName(action.blockTypes), blockType => {
+ return getUniqueItemsByName([...(0,external_lodash_namespaceObject.get)(blockType, ['variations'], []).map(variation => ({ ...variation,
+ source: 'block'
+ })), ...(0,external_lodash_namespaceObject.get)(state, [blockType.name], []).filter(_ref2 => {
+ let {
+ source
+ } = _ref2;
+ return 'block' !== source;
+ })]);
+ })
+ };
+
+ case 'ADD_BLOCK_VARIATIONS':
+ return { ...state,
+ [action.blockName]: getUniqueItemsByName([...(0,external_lodash_namespaceObject.get)(state, [action.blockName], []), ...action.variations])
+ };
+
+ case 'REMOVE_BLOCK_VARIATIONS':
+ return { ...state,
+ [action.blockName]: (0,external_lodash_namespaceObject.filter)((0,external_lodash_namespaceObject.get)(state, [action.blockName], []), variation => action.variationNames.indexOf(variation.name) === -1)
+ };
+ }
+
+ return state;
+}
+/**
+ * Higher-order Reducer creating a reducer keeping track of given block name.
+ *
+ * @param {string} setActionType Action type.
+ *
+ * @return {Function} Reducer.
+ */
+
+function createBlockNameSetterReducer(setActionType) {
+ return function () {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'REMOVE_BLOCK_TYPES':
+ if (action.names.indexOf(state) !== -1) {
+ return null;
+ }
+
+ return state;
+
+ case setActionType:
+ return action.name || null;
+ }
+
+ return state;
+ };
+}
+const defaultBlockName = createBlockNameSetterReducer('SET_DEFAULT_BLOCK_NAME');
+const freeformFallbackBlockName = createBlockNameSetterReducer('SET_FREEFORM_FALLBACK_BLOCK_NAME');
+const unregisteredFallbackBlockName = createBlockNameSetterReducer('SET_UNREGISTERED_FALLBACK_BLOCK_NAME');
+const groupingBlockName = createBlockNameSetterReducer('SET_GROUPING_BLOCK_NAME');
+/**
+ * Reducer managing the categories
+ *
+ * @param {WPBlockCategory[]} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {WPBlockCategory[]} Updated state.
+ */
+
+function categories() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CATEGORIES;
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'SET_CATEGORIES':
+ return action.categories || [];
+
+ case 'UPDATE_CATEGORY':
+ {
+ if (!action.category || (0,external_lodash_namespaceObject.isEmpty)(action.category)) {
+ return state;
+ }
+
+ const categoryToChange = (0,external_lodash_namespaceObject.find)(state, ['slug', action.slug]);
+
+ if (categoryToChange) {
+ return (0,external_lodash_namespaceObject.map)(state, category => {
+ if (category.slug === action.slug) {
+ return { ...category,
+ ...action.category
+ };
+ }
+
+ return category;
+ });
+ }
+ }
+ }
+
+ return state;
+}
+function collections() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_COLLECTION':
+ return { ...state,
+ [action.namespace]: {
+ title: action.title,
+ icon: action.icon
+ }
+ };
+
+ case 'REMOVE_BLOCK_COLLECTION':
+ return omit(state, action.namespace);
+ }
+
+ return state;
+}
+/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
+ unprocessedBlockTypes,
+ blockTypes,
+ blockStyles,
+ blockVariations,
+ defaultBlockName,
+ freeformFallbackBlockName,
+ unregisteredFallbackBlockName,
+ groupingBlockName,
+ categories,
+ collections
+}));
+
+;// CONCATENATED MODULE: ./node_modules/rememo/rememo.js
+
+
+/** @typedef {(...args: any[]) => *[]} GetDependants */
+
+/** @typedef {() => void} Clear */
+
+/**
+ * @typedef {{
+ * getDependants: GetDependants,
+ * clear: Clear
+ * }} EnhancedSelector
+ */
+
+/**
+ * Internal cache entry.
+ *
+ * @typedef CacheNode
+ *
+ * @property {?CacheNode|undefined} [prev] Previous node.
+ * @property {?CacheNode|undefined} [next] Next node.
+ * @property {*[]} args Function arguments for cache entry.
+ * @property {*} val Function result.
+ */
+
+/**
+ * @typedef Cache
+ *
+ * @property {Clear} clear Function to clear cache.
+ * @property {boolean} [isUniqueByDependants] Whether dependants are valid in
+ * considering cache uniqueness. A cache is unique if dependents are all arrays
+ * or objects.
+ * @property {CacheNode?} [head] Cache head.
+ * @property {*[]} [lastDependants] Dependants from previous invocation.
+ */
+
+/**
+ * Arbitrary value used as key for referencing cache object in WeakMap tree.
+ *
+ * @type {{}}
+ */
+var LEAF_KEY = {};
+
+/**
+ * Returns the first argument as the sole entry in an array.
+ *
+ * @template T
+ *
+ * @param {T} value Value to return.
+ *
+ * @return {[T]} Value returned as entry in array.
+ */
+function arrayOf(value) {
+ return [value];
+}
+
+/**
+ * Returns true if the value passed is object-like, or false otherwise. A value
+ * is object-like if it can support property assignment, e.g. object or array.
+ *
+ * @param {*} value Value to test.
+ *
+ * @return {boolean} Whether value is object-like.
+ */
+function isObjectLike(value) {
+ return !!value && 'object' === typeof value;
+}
+
+/**
+ * Creates and returns a new cache object.
+ *
+ * @return {Cache} Cache object.
+ */
+function createCache() {
+ /** @type {Cache} */
+ var cache = {
+ clear: function () {
+ cache.head = null;
+ },
+ };
+
+ return cache;
+}
+
+/**
+ * Returns true if entries within the two arrays are strictly equal by
+ * reference from a starting index.
+ *
+ * @param {*[]} a First array.
+ * @param {*[]} b Second array.
+ * @param {number} fromIndex Index from which to start comparison.
+ *
+ * @return {boolean} Whether arrays are shallowly equal.
+ */
+function isShallowEqual(a, b, fromIndex) {
+ var i;
+
+ if (a.length !== b.length) {
+ return false;
+ }
+
+ for (i = fromIndex; i < a.length; i++) {
+ if (a[i] !== b[i]) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Returns a memoized selector function. The getDependants function argument is
+ * called before the memoized selector and is expected to return an immutable
+ * reference or array of references on which the selector depends for computing
+ * its own return value. The memoize cache is preserved only as long as those
+ * dependant references remain the same. If getDependants returns a different
+ * reference(s), the cache is cleared and the selector value regenerated.
+ *
+ * @template {(...args: *[]) => *} S
+ *
+ * @param {S} selector Selector function.
+ * @param {GetDependants=} getDependants Dependant getter returning an array of
+ * references used in cache bust consideration.
+ */
+/* harmony default export */ function rememo(selector, getDependants) {
+ /** @type {WeakMap<*,*>} */
+ var rootCache;
+
+ /** @type {GetDependants} */
+ var normalizedGetDependants = getDependants ? getDependants : arrayOf;
+
+ /**
+ * Returns the cache for a given dependants array. When possible, a WeakMap
+ * will be used to create a unique cache for each set of dependants. This
+ * is feasible due to the nature of WeakMap in allowing garbage collection
+ * to occur on entries where the key object is no longer referenced. Since
+ * WeakMap requires the key to be an object, this is only possible when the
+ * dependant is object-like. The root cache is created as a hierarchy where
+ * each top-level key is the first entry in a dependants set, the value a
+ * WeakMap where each key is the next dependant, and so on. This continues
+ * so long as the dependants are object-like. If no dependants are object-
+ * like, then the cache is shared across all invocations.
+ *
+ * @see isObjectLike
+ *
+ * @param {*[]} dependants Selector dependants.
+ *
+ * @return {Cache} Cache object.
+ */
+ function getCache(dependants) {
+ var caches = rootCache,
+ isUniqueByDependants = true,
+ i,
+ dependant,
+ map,
+ cache;
+
+ for (i = 0; i < dependants.length; i++) {
+ dependant = dependants[i];
+
+ // Can only compose WeakMap from object-like key.
+ if (!isObjectLike(dependant)) {
+ isUniqueByDependants = false;
+ break;
+ }
+
+ // Does current segment of cache already have a WeakMap?
+ if (caches.has(dependant)) {
+ // Traverse into nested WeakMap.
+ caches = caches.get(dependant);
+ } else {
+ // Create, set, and traverse into a new one.
+ map = new WeakMap();
+ caches.set(dependant, map);
+ caches = map;
+ }
+ }
+
+ // We use an arbitrary (but consistent) object as key for the last item
+ // in the WeakMap to serve as our running cache.
+ if (!caches.has(LEAF_KEY)) {
+ cache = createCache();
+ cache.isUniqueByDependants = isUniqueByDependants;
+ caches.set(LEAF_KEY, cache);
+ }
+
+ return caches.get(LEAF_KEY);
+ }
+
+ /**
+ * Resets root memoization cache.
+ */
+ function clear() {
+ rootCache = new WeakMap();
+ }
+
+ /* eslint-disable jsdoc/check-param-names */
+ /**
+ * The augmented selector call, considering first whether dependants have
+ * changed before passing it to underlying memoize function.
+ *
+ * @param {*} source Source object for derivation.
+ * @param {...*} extraArgs Additional arguments to pass to selector.
+ *
+ * @return {*} Selector result.
+ */
+ /* eslint-enable jsdoc/check-param-names */
+ function callSelector(/* source, ...extraArgs */) {
+ var len = arguments.length,
+ cache,
+ node,
+ i,
+ args,
+ dependants;
+
+ // Create copy of arguments (avoid leaking deoptimization).
+ args = new Array(len);
+ for (i = 0; i < len; i++) {
+ args[i] = arguments[i];
+ }
+
+ dependants = normalizedGetDependants.apply(null, args);
+ cache = getCache(dependants);
+
+ // If not guaranteed uniqueness by dependants (primitive type), shallow
+ // compare against last dependants and, if references have changed,
+ // destroy cache to recalculate result.
+ if (!cache.isUniqueByDependants) {
+ if (
+ cache.lastDependants &&
+ !isShallowEqual(dependants, cache.lastDependants, 0)
+ ) {
+ cache.clear();
+ }
+
+ cache.lastDependants = dependants;
+ }
+
+ node = cache.head;
+ while (node) {
+ // Check whether node arguments match arguments
+ if (!isShallowEqual(node.args, args, 1)) {
+ node = node.next;
+ continue;
+ }
+
+ // At this point we can assume we've found a match
+
+ // Surface matched node to head if not already
+ if (node !== cache.head) {
+ // Adjust siblings to point to each other.
+ /** @type {CacheNode} */ (node.prev).next = node.next;
+ if (node.next) {
+ node.next.prev = node.prev;
+ }
+
+ node.next = cache.head;
+ node.prev = null;
+ /** @type {CacheNode} */ (cache.head).prev = node;
+ cache.head = node;
+ }
+
+ // Return immediately
+ return node.val;
+ }
+
+ // No cached value found. Continue to insertion phase:
+
+ node = /** @type {CacheNode} */ ({
+ // Generate the result from original function
+ val: selector.apply(null, args),
+ });
+
+ // Avoid including the source object in the cache.
+ args[0] = null;
+ node.args = args;
+
+ // Don't need to check whether node is already head, since it would
+ // have been returned above already if it was
+
+ // Shift existing head down list
+ if (cache.head) {
+ cache.head.prev = node;
+ node.next = cache.head;
+ }
+
+ cache.head = node;
+
+ return node.val;
+ }
+
+ callSelector.getDependants = normalizedGetDependants;
+ callSelector.clear = clear;
+ clear();
+
+ return /** @type {S & EnhancedSelector} */ (callSelector);
+}
+
+// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
+var remove_accents = __webpack_require__(4793);
+var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
+/**
+ * External dependencies
+ */
+
+
+
+/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
+
+/** @typedef {import('../api/registration').WPBlockVariationScope} WPBlockVariationScope */
+
+/** @typedef {import('./reducer').WPBlockCategory} WPBlockCategory */
+
+/**
+ * Given a block name or block type object, returns the corresponding
+ * normalized block type object.
+ *
+ * @param {Object} state Blocks state.
+ * @param {(string|Object)} nameOrType Block name or type object
+ *
+ * @return {Object} Block type object.
+ */
+
+const getNormalizedBlockType = (state, nameOrType) => 'string' === typeof nameOrType ? selectors_getBlockType(state, nameOrType) : nameOrType;
+/**
+ * Returns all the unprocessed block types as passed during the registration.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {Array} Unprocessed block types.
+ */
+
+
+function __experimentalGetUnprocessedBlockTypes(state) {
+ return state.unprocessedBlockTypes;
+}
+/**
+ * Returns all the available block types.
+ *
+ * @param {Object} state Data state.
+ *
+ * @example
+ * ```js
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const blockTypes = useSelect(
+ * ( select ) => select( blocksStore ).getBlockTypes(),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { blockTypes.map( ( block ) => (
+ * - { block.title }
+ * ) ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {Array} Block Types.
+ */
+
+const selectors_getBlockTypes = rememo(state => Object.values(state.blockTypes), state => [state.blockTypes]);
+/**
+ * Returns a block type by name.
+ *
+ * @param {Object} state Data state.
+ * @param {string} name Block type name.
+ *
+ * @example
+ * ```js
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const paragraphBlock = useSelect( ( select ) =>
+ * ( select ) => select( blocksStore ).getBlockType( 'core/paragraph' ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { paragraphBlock &&
+ * Object.entries( paragraphBlock.supports ).map(
+ * ( blockSupportsEntry ) => {
+ * const [ propertyName, value ] = blockSupportsEntry;
+ * return (
+ * - { `${ propertyName } : ${ value }` }
+ * );
+ * }
+ * ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {Object?} Block Type.
+ */
+
+function selectors_getBlockType(state, name) {
+ return state.blockTypes[name];
+}
+/**
+ * Returns block styles by block name.
+ *
+ * @param {Object} state Data state.
+ * @param {string} name Block type name.
+ *
+ * @example
+ * ```js
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const buttonBlockStyles = useSelect( ( select ) =>
+ * select( blocksStore ).getBlockStyles( 'core/button' ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { buttonBlockStyles &&
+ * buttonBlockStyles.map( ( style ) => (
+ * - { style.label }
+ * ) ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {Array?} Block Styles.
+ */
+
+function getBlockStyles(state, name) {
+ return state.blockStyles[name];
+}
+/**
+ * Returns block variations by block name.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ * @param {WPBlockVariationScope} [scope] Block variation scope name.
+ *
+ * @example
+ * ```js
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const socialLinkVariations = useSelect( ( select ) =>
+ * select( blocksStore ).getBlockVariations( 'core/social-link' ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { socialLinkVariations &&
+ * socialLinkVariations.map( ( variation ) => (
+ * - { variation.title }
+ * ) ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {(WPBlockVariation[]|void)} Block variations.
+ */
+
+const selectors_getBlockVariations = rememo((state, blockName, scope) => {
+ const variations = state.blockVariations[blockName];
+
+ if (!variations || !scope) {
+ return variations;
+ }
+
+ return variations.filter(variation => {
+ // For backward compatibility reasons, variation's scope defaults to
+ // `block` and `inserter` when not set.
+ return (variation.scope || ['block', 'inserter']).includes(scope);
+ });
+}, (state, blockName) => [state.blockVariations[blockName]]);
+/**
+ * Returns the active block variation for a given block based on its attributes.
+ * Variations are determined by their `isActive` property.
+ * Which is either an array of block attribute keys or a function.
+ *
+ * In case of an array of block attribute keys, the `attributes` are compared
+ * to the variation's attributes using strict equality check.
+ *
+ * In case of function type, the function should accept a block's attributes
+ * and the variation's attributes and determines if a variation is active.
+ * A function that accepts a block's attributes and the variation's attributes and determines if a variation is active.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Name of block (example: “core/columns”).
+ * @param {Object} attributes Block attributes used to determine active variation.
+ * @param {WPBlockVariationScope} [scope] Block variation scope name.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { store as blockEditorStore } from '@wordpress/block-editor';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * // This example assumes that a core/embed block is the first block in the Block Editor.
+ * const activeBlockVariation = useSelect( ( select ) => {
+ * // Retrieve the list of blocks.
+ * const [ firstBlock ] = select( blockEditorStore ).getBlocks()
+ *
+ * // Return the active block variation for the first block.
+ * return select( blocksStore ).getActiveBlockVariation(
+ * firstBlock.name,
+ * firstBlock.attributes
+ * );
+ * }, [] );
+ *
+ * return activeBlockVariation && activeBlockVariation.name === 'spotify' ? (
+ * { __( 'Spotify variation' ) }
+ * ) : (
+ * { __( 'Other variation' ) }
+ * );
+ * };
+ * ```
+ *
+ * @return {(WPBlockVariation|undefined)} Active block variation.
+ */
+
+function getActiveBlockVariation(state, blockName, attributes, scope) {
+ const variations = selectors_getBlockVariations(state, blockName, scope);
+ const match = variations === null || variations === void 0 ? void 0 : variations.find(variation => {
+ var _variation$isActive;
+
+ if (Array.isArray(variation.isActive)) {
+ const blockType = selectors_getBlockType(state, blockName);
+ const attributeKeys = Object.keys((blockType === null || blockType === void 0 ? void 0 : blockType.attributes) || {});
+ const definedAttributes = variation.isActive.filter(attribute => attributeKeys.includes(attribute));
+
+ if (definedAttributes.length === 0) {
+ return false;
+ }
+
+ return definedAttributes.every(attribute => attributes[attribute] === variation.attributes[attribute]);
+ }
+
+ return (_variation$isActive = variation.isActive) === null || _variation$isActive === void 0 ? void 0 : _variation$isActive.call(variation, attributes, variation.attributes);
+ });
+ return match;
+}
+/**
+ * Returns the default block variation for the given block type.
+ * When there are multiple variations annotated as the default one,
+ * the last added item is picked. This simplifies registering overrides.
+ * When there is no default variation set, it returns the first item.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ * @param {WPBlockVariationScope} [scope] Block variation scope name.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const defaultEmbedBlockVariation = useSelect( ( select ) =>
+ * select( blocksStore ).getDefaultBlockVariation( 'core/embed' ),
+ * []
+ * );
+ *
+ * return (
+ * defaultEmbedBlockVariation && (
+ *
+ * { sprintf(
+ * __( 'core/embed default variation: %s' ),
+ * defaultEmbedBlockVariation.title
+ * ) }
+ *
+ * )
+ * );
+ * };
+ * ```
+ *
+ * @return {?WPBlockVariation} The default block variation.
+ */
+
+function getDefaultBlockVariation(state, blockName, scope) {
+ const variations = selectors_getBlockVariations(state, blockName, scope);
+ const defaultVariation = [...variations].reverse().find(_ref => {
+ let {
+ isDefault
+ } = _ref;
+ return !!isDefault;
+ });
+ return defaultVariation || variations[0];
+}
+/**
+ * Returns all the available block categories.
+ *
+ * @param {Object} state Data state.
+ *
+ * @example
+ * ```js
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect, } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const blockCategories = useSelect( ( select ) =>
+ * select( blocksStore ).getCategories(),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { blockCategories.map( ( category ) => (
+ * - { category.title }
+ * ) ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {WPBlockCategory[]} Categories list.
+ */
+
+function getCategories(state) {
+ return state.categories;
+}
+/**
+ * Returns all the available collections.
+ *
+ * @param {Object} state Data state.
+ *
+ * @example
+ * ```js
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const blockCollections = useSelect( ( select ) =>
+ * select( blocksStore ).getCollections(),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { Object.values( blockCollections ).length > 0 &&
+ * Object.values( blockCollections ).map( ( collection ) => (
+ * - { collection.title }
+ * ) ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {Object} Collections list.
+ */
+
+function getCollections(state) {
+ return state.collections;
+}
+/**
+ * Returns the name of the default block name.
+ *
+ * @param {Object} state Data state.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const defaultBlockName = useSelect( ( select ) =>
+ * select( blocksStore ).getDefaultBlockName(),
+ * []
+ * );
+ *
+ * return (
+ * defaultBlockName && (
+ *
+ * { sprintf( __( 'Default block name: %s' ), defaultBlockName ) }
+ *
+ * )
+ * );
+ * };
+ * ```
+ *
+ * @return {string?} Default block name.
+ */
+
+function selectors_getDefaultBlockName(state) {
+ return state.defaultBlockName;
+}
+/**
+ * Returns the name of the block for handling non-block content.
+ *
+ * @param {Object} state Data state.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const freeformFallbackBlockName = useSelect( ( select ) =>
+ * select( blocksStore ).getFreeformFallbackBlockName(),
+ * []
+ * );
+ *
+ * return (
+ * freeformFallbackBlockName && (
+ *
+ * { sprintf( __(
+ * 'Freeform fallback block name: %s' ),
+ * freeformFallbackBlockName
+ * ) }
+ *
+ * )
+ * );
+ * };
+ * ```
+ *
+ * @return {string?} Name of the block for handling non-block content.
+ */
+
+function getFreeformFallbackBlockName(state) {
+ return state.freeformFallbackBlockName;
+}
+/**
+ * Returns the name of the block for handling unregistered blocks.
+ *
+ * @param {Object} state Data state.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const unregisteredFallbackBlockName = useSelect( ( select ) =>
+ * select( blocksStore ).getUnregisteredFallbackBlockName(),
+ * []
+ * );
+ *
+ * return (
+ * unregisteredFallbackBlockName && (
+ *
+ * { sprintf( __(
+ * 'Unregistered fallback block name: %s' ),
+ * unregisteredFallbackBlockName
+ * ) }
+ *
+ * )
+ * );
+ * };
+ * ```
+ *
+ * @return {string?} Name of the block for handling unregistered blocks.
+ */
+
+function getUnregisteredFallbackBlockName(state) {
+ return state.unregisteredFallbackBlockName;
+}
+/**
+ * Returns the name of the block for handling the grouping of blocks.
+ *
+ * @param {Object} state Data state.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const groupingBlockName = useSelect( ( select ) =>
+ * select( blocksStore ).getGroupingBlockName(),
+ * []
+ * );
+ *
+ * return (
+ * groupingBlockName && (
+ *
+ * { sprintf(
+ * __( 'Default grouping block name: %s' ),
+ * groupingBlockName
+ * ) }
+ *
+ * )
+ * );
+ * };
+ * ```
+ *
+ * @return {string?} Name of the block for handling the grouping of blocks.
+ */
+
+function selectors_getGroupingBlockName(state) {
+ return state.groupingBlockName;
+}
+/**
+ * Returns an array with the child blocks of a given block.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ *
+ * @example
+ * ```js
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const childBlockNames = useSelect( ( select ) =>
+ * select( blocksStore ).getChildBlockNames( 'core/navigation' ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { childBlockNames &&
+ * childBlockNames.map( ( child ) => (
+ * - { child }
+ * ) ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {Array} Array of child block names.
+ */
+
+const selectors_getChildBlockNames = rememo((state, blockName) => {
+ return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(state.blockTypes, blockType => {
+ return (0,external_lodash_namespaceObject.includes)(blockType.parent, blockName);
+ }), _ref2 => {
+ let {
+ name
+ } = _ref2;
+ return name;
+ });
+}, state => [state.blockTypes]);
+/**
+ * Returns the block support value for a feature, if defined.
+ *
+ * @param {Object} state Data state.
+ * @param {(string|Object)} nameOrType Block name or type object
+ * @param {Array|string} feature Feature to retrieve
+ * @param {*} defaultSupports Default value to return if not
+ * explicitly defined
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const paragraphBlockSupportValue = useSelect( ( select ) =>
+ * select( blocksStore ).getBlockSupport( 'core/paragraph', 'anchor' ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { sprintf(
+ * __( 'core/paragraph supports.anchor value: %s' ),
+ * paragraphBlockSupportValue
+ * ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {?*} Block support value
+ */
+
+const selectors_getBlockSupport = (state, nameOrType, feature, defaultSupports) => {
+ const blockType = getNormalizedBlockType(state, nameOrType);
+
+ if (!(blockType !== null && blockType !== void 0 && blockType.supports)) {
+ return defaultSupports;
+ }
+
+ return (0,external_lodash_namespaceObject.get)(blockType.supports, feature, defaultSupports);
+};
+/**
+ * Returns true if the block defines support for a feature, or false otherwise.
+ *
+ * @param {Object} state Data state.
+ * @param {(string|Object)} nameOrType Block name or type object.
+ * @param {string} feature Feature to test.
+ * @param {boolean} defaultSupports Whether feature is supported by
+ * default if not explicitly defined.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const paragraphBlockSupportClassName = useSelect( ( select ) =>
+ * select( blocksStore ).hasBlockSupport( 'core/paragraph', 'className' ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { sprintf(
+ * __( 'core/paragraph supports custom class name?: %s' ),
+ * paragraphBlockSupportClassName
+ * ) }
+ * /p>
+ * );
+ * };
+ * ```
+ *
+ * @return {boolean} Whether block supports feature.
+ */
+
+function selectors_hasBlockSupport(state, nameOrType, feature, defaultSupports) {
+ return !!selectors_getBlockSupport(state, nameOrType, feature, defaultSupports);
+}
+/**
+ * Returns true if the block type by the given name or object value matches a
+ * search term, or false otherwise.
+ *
+ * @param {Object} state Blocks state.
+ * @param {(string|Object)} nameOrType Block name or type object.
+ * @param {string} searchTerm Search term by which to filter.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const termFound = useSelect(
+ * ( select ) =>
+ * select( blocksStore ).isMatchingSearchTerm(
+ * 'core/navigation',
+ * 'theme'
+ * ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { sprintf(
+ * __(
+ * 'Search term was found in the title, keywords, category or description in block.json: %s'
+ * ),
+ * termFound
+ * ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {Object[]} Whether block type matches search term.
+ */
+
+function isMatchingSearchTerm(state, nameOrType, searchTerm) {
+ const blockType = getNormalizedBlockType(state, nameOrType);
+ const getNormalizedSearchTerm = (0,external_lodash_namespaceObject.flow)([// Disregard diacritics.
+ // Input: "média"
+ term => remove_accents_default()(term !== null && term !== void 0 ? term : ''), // Lowercase.
+ // Input: "MEDIA"
+ term => term.toLowerCase(), // Strip leading and trailing whitespace.
+ // Input: " media "
+ term => term.trim()]);
+ const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
+ const isSearchMatch = (0,external_lodash_namespaceObject.flow)([getNormalizedSearchTerm, normalizedCandidate => (0,external_lodash_namespaceObject.includes)(normalizedCandidate, normalizedSearchTerm)]);
+ return isSearchMatch(blockType.title) || (0,external_lodash_namespaceObject.some)(blockType.keywords, isSearchMatch) || isSearchMatch(blockType.category) || isSearchMatch(blockType.description);
+}
+/**
+ * Returns a boolean indicating if a block has child blocks or not.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const navigationBlockHasChildBlocks = useSelect( ( select ) =>
+ * select( blocksStore ).hasChildBlocks( 'core/navigation' ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { sprintf(
+ * __( 'core/navigation has child blocks: %s' ),
+ * navigationBlockHasChildBlocks
+ * ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {boolean} True if a block contains child blocks and false otherwise.
+ */
+
+const selectors_hasChildBlocks = (state, blockName) => {
+ return selectors_getChildBlockNames(state, blockName).length > 0;
+};
+/**
+ * Returns a boolean indicating if a block has at least one child block with inserter support.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ *
+ * @example
+ * ```js
+ * import { __, sprintf } from '@wordpress/i18n';
+ * import { store as blocksStore } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ *
+ * const ExampleComponent = () => {
+ * const navigationBlockHasChildBlocksWithInserterSupport = useSelect( ( select ) =>
+ * select( blocksStore ).hasChildBlocksWithInserterSupport(
+ * 'core/navigation'
+ * ),
+ * []
+ * );
+ *
+ * return (
+ *
+ * { sprintf(
+ * __( 'core/navigation has child blocks with inserter support: %s' ),
+ * navigationBlockHasChildBlocksWithInserterSupport
+ * ) }
+ *
+ * );
+ * };
+ * ```
+ *
+ * @return {boolean} True if a block contains at least one child blocks with inserter support
+ * and false otherwise.
+ */
+
+const selectors_hasChildBlocksWithInserterSupport = (state, blockName) => {
+ return (0,external_lodash_namespaceObject.some)(selectors_getChildBlockNames(state, blockName), childBlockName => {
+ return selectors_hasBlockSupport(state, childBlockName, 'inserter', true);
+ });
+};
+const __experimentalHasContentRoleAttribute = rememo((state, blockTypeName) => {
+ const blockType = selectors_getBlockType(state, blockTypeName);
+
+ if (!blockType) {
+ return false;
+ }
+
+ return Object.entries(blockType.attributes).some(_ref3 => {
+ let [, {
+ __experimentalRole
+ }] = _ref3;
+ return __experimentalRole === 'content';
+ });
+}, (state, blockTypeName) => {
+ var _state$blockTypes$blo;
+
+ return [(_state$blockTypes$blo = state.blockTypes[blockTypeName]) === null || _state$blockTypes$blo === void 0 ? void 0 : _state$blockTypes$blo.attributes];
+});
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/node_modules/is-plain-object/dist/is-plain-object.mjs
+/*!
+ * is-plain-object
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+function is_plain_object_isObject(o) {
+ return Object.prototype.toString.call(o) === '[object Object]';
+}
+
+function isPlainObject(o) {
+ var ctor,prot;
+
+ if (is_plain_object_isObject(o) === false) return false;
+
+ // If has modified constructor
+ ctor = o.constructor;
+ if (ctor === undefined) return true;
+
+ // If has modified prototype
+ prot = ctor.prototype;
+ if (is_plain_object_isObject(prot) === false) return false;
+
+ // If constructor does not have an Object-specific method
+ if (prot.hasOwnProperty('isPrototypeOf') === false) {
+ return false;
+ }
+
+ // Most likely a plain Object
+ return true;
+}
+
+
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/actions.js
/**
* External dependencies
*/
+
/**
* WordPress dependencies
*/
@@ -7950,6 +9599,10 @@ function __experimentalGetBlockAttributesNamesByRole(name, role) {
/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
+/** @typedef {import('../api/registration').WPBlockType} WPBlockType */
+
+/** @typedef {import('./reducer').WPBlockCategory} WPBlockCategory */
+
const {
error,
warn
@@ -7966,6 +9619,16 @@ const LEGACY_CATEGORY_MAPPING = {
formatting: 'text',
layout: 'design'
};
+/**
+ * Whether the argument is a function.
+ *
+ * @param {*} maybeFunc The argument to check.
+ * @return {boolean} True if the argument is a function, false otherwise.
+ */
+
+function isFunction(maybeFunc) {
+ return typeof maybeFunc === 'function';
+}
/**
* Takes the unprocessed block type data and applies all the existing filters for the registered block type.
* Next, it validates all the settings and performs additional processing to the block type definition.
@@ -7977,6 +9640,7 @@ const LEGACY_CATEGORY_MAPPING = {
* @return {?WPBlockType} The block, if it has been successfully registered; otherwise `undefined`.
*/
+
const processBlockType = (blockType, _ref) => {
let {
select
@@ -7985,7 +9649,7 @@ const processBlockType = (blockType, _ref) => {
name
} = blockType;
const settings = (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.registerBlockType', { ...blockType
- }, name);
+ }, name, null);
if (settings.deprecated) {
settings.deprecated = settings.deprecated.map(deprecation => (0,external_lodash_namespaceObject.pick)( // Only keep valid deprecation keys.
@@ -7994,22 +9658,22 @@ const processBlockType = (blockType, _ref) => {
// present don't fail.
{ // Omit deprecation keys here so that deprecations
// can opt out of specific keys like "supports".
- ...(0,external_lodash_namespaceObject.omit)(blockType, DEPRECATED_ENTRY_KEYS),
+ ...omit(blockType, DEPRECATED_ENTRY_KEYS),
...deprecation
- }, name), DEPRECATED_ENTRY_KEYS));
+ }, name, deprecation), DEPRECATED_ENTRY_KEYS));
}
- if (!(0,external_lodash_namespaceObject.isPlainObject)(settings)) {
+ if (!isPlainObject(settings)) {
error('Block settings must be a valid object.');
return;
}
- if (!(0,external_lodash_namespaceObject.isFunction)(settings.save)) {
+ if (!isFunction(settings.save)) {
error('The "save" property must be a valid function.');
return;
}
- if ('edit' in settings && !(0,external_lodash_namespaceObject.isFunction)(settings.edit)) {
+ if ('edit' in settings && !isFunction(settings.edit)) {
error('The "edit" property must be a valid function.');
return;
} // Canonicalize legacy categories to equivalent fallback.
@@ -8047,8 +9711,12 @@ const processBlockType = (blockType, _ref) => {
};
/**
* Returns an action object used in signalling that block types have been added.
+ * Ignored from documentation as the recommended usage for this action through registerBlockType from @wordpress/blocks.
+ *
+ * @ignore
+ *
+ * @param {WPBlockType|WPBlockType[]} blockTypes Object or array of objects representing blocks to added.
*
- * @param {Array|Object} blockTypes Block types received.
*
* @return {Object} Action object.
*/
@@ -8128,8 +9796,12 @@ const __experimentalReapplyBlockTypeFilters = () => _ref3 => {
};
/**
* Returns an action object used to remove a registered block type.
+ * Ignored from documentation as the recommended usage for this action through unregisterBlockType from @wordpress/blocks.
+ *
+ * @ignore
+ *
+ * @param {string|string[]} names Block name or array of block names to be removed.
*
- * @param {string|Array} names Block name.
*
* @return {Object} Action object.
*/
@@ -8142,9 +9814,12 @@ function removeBlockTypes(names) {
}
/**
* Returns an action object used in signalling that new block styles have been added.
+ * Ignored from documentation as the recommended usage for this action through registerBlockStyle from @wordpress/blocks.
*
* @param {string} blockName Block name.
- * @param {Array|Object} styles Block styles.
+ * @param {Array|Object} styles Block style object or array of block style objects.
+ *
+ * @ignore
*
* @return {Object} Action object.
*/
@@ -8158,9 +9833,12 @@ function addBlockStyles(blockName, styles) {
}
/**
* Returns an action object used in signalling that block styles have been removed.
+ * Ignored from documentation as the recommended usage for this action through unregisterBlockStyle from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} blockName Block name.
- * @param {Array|string} styleNames Block style names.
+ * @param {Array|string} styleNames Block style names or array of block style names.
*
* @return {Object} Action object.
*/
@@ -8174,6 +9852,9 @@ function removeBlockStyles(blockName, styleNames) {
}
/**
* Returns an action object used in signalling that new block variations have been added.
+ * Ignored from documentation as the recommended usage for this action through registerBlockVariation from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} blockName Block name.
* @param {WPBlockVariation|WPBlockVariation[]} variations Block variations.
@@ -8190,6 +9871,9 @@ function addBlockVariations(blockName, variations) {
}
/**
* Returns an action object used in signalling that block variations have been removed.
+ * Ignored from documentation as the recommended usage for this action through unregisterBlockVariation from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} blockName Block name.
* @param {string|string[]} variationNames Block variation names.
@@ -8206,6 +9890,9 @@ function removeBlockVariations(blockName, variationNames) {
}
/**
* Returns an action object used to set the default block name.
+ * Ignored from documentation as the recommended usage for this action through setDefaultBlockName from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} name Block name.
*
@@ -8221,6 +9908,9 @@ function actions_setDefaultBlockName(name) {
/**
* Returns an action object used to set the name of the block used as a fallback
* for non-block content.
+ * Ignored from documentation as the recommended usage for this action through setFreeformContentHandlerName from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} name Block name.
*
@@ -8236,6 +9926,9 @@ function setFreeformFallbackBlockName(name) {
/**
* Returns an action object used to set the name of the block used as a fallback
* for unregistered blocks.
+ * Ignored from documentation as the recommended usage for this action through setUnregisteredTypeHandlerName from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} name Block name.
*
@@ -8252,6 +9945,9 @@ function setUnregisteredFallbackBlockName(name) {
* Returns an action object used to set the name of the block used
* when grouping other blocks
* eg: in "Group/Ungroup" interactions
+ * Ignored from documentation as the recommended usage for this action through setGroupingBlockName from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} name Block name.
*
@@ -8266,8 +9962,11 @@ function actions_setGroupingBlockName(name) {
}
/**
* Returns an action object used to set block categories.
+ * Ignored from documentation as the recommended usage for this action through setCategories from @wordpress/blocks.
*
- * @param {Object[]} categories Block categories.
+ * @ignore
+ *
+ * @param {WPBlockCategory[]} categories Block categories.
*
* @return {Object} Action object.
*/
@@ -8280,6 +9979,9 @@ function setCategories(categories) {
}
/**
* Returns an action object used to update a category.
+ * Ignored from documentation as the recommended usage for this action through updateCategory from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} slug Block category slug.
* @param {Object} category Object containing the category properties that should be updated.
@@ -8296,6 +9998,9 @@ function updateCategory(slug, category) {
}
/**
* Returns an action object used to add block collections
+ * Ignored from documentation as the recommended usage for this action through registerBlockCollection from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} namespace The namespace of the blocks to put in the collection
* @param {string} title The title to display in the block inserter
@@ -8314,6 +10019,9 @@ function addBlockCollection(namespace, title, icon) {
}
/**
* Returns an action object used to remove block collections
+ * Ignored from documentation as the recommended usage for this action through unregisterBlockCollection from @wordpress/blocks.
+ *
+ * @ignore
*
* @param {string} namespace The namespace of the blocks to put in the collection
*
@@ -8418,10 +10126,6 @@ function serializeRawBlock(rawBlock) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/serializer.js
-/**
- * External dependencies
- */
-
/**
* WordPress dependencies
*/
@@ -8429,7 +10133,6 @@ function serializeRawBlock(rawBlock) {
-
/**
* Internal dependencies
*/
@@ -8502,7 +10205,7 @@ function getInnerBlocksProps() {
innerBlocks
} = innerBlocksPropsProvider; // Value is an array of blocks, so defer to block serializer.
- const html = serializer_serialize(innerBlocks, {
+ const html = serialize(innerBlocks, {
isInnerBlocks: true
}); // Use special-cased raw HTML tag to avoid default escaping.
@@ -8546,7 +10249,7 @@ function getSaveElement(blockTypeOrName, attributes) {
innerBlocks
});
- if ((0,external_lodash_namespaceObject.isObject)(element) && (0,external_wp_hooks_namespaceObject.hasFilter)('blocks.getSaveContent.extraProps') && !(blockType.apiVersion > 1)) {
+ if (element !== null && typeof element === 'object' && (0,external_wp_hooks_namespaceObject.hasFilter)('blocks.getSaveContent.extraProps') && !(blockType.apiVersion > 1)) {
/**
* Filters the props applied to the block save result element.
*
@@ -8605,7 +10308,10 @@ function getSaveContent(blockTypeOrName, attributes, innerBlocks) {
*/
function getCommentAttributes(blockType, attributes) {
- return (0,external_lodash_namespaceObject.reduce)(blockType.attributes, (accumulator, attributeSchema, key) => {
+ var _blockType$attributes;
+
+ return Object.entries((_blockType$attributes = blockType.attributes) !== null && _blockType$attributes !== void 0 ? _blockType$attributes : {}).reduce((accumulator, _ref) => {
+ let [key, attributeSchema] = _ref;
const value = attributes[key]; // Ignore undefined values.
if (undefined === value) {
@@ -8681,9 +10387,9 @@ function getBlockInnerHTML(block) {
*/
function getCommentDelimitedContent(rawBlockName, attributes, content) {
- const serializedAttributes = !(0,external_lodash_namespaceObject.isEmpty)(attributes) ? serializeAttributes(attributes) + ' ' : ''; // Strip core blocks of their namespace prefix.
+ const serializedAttributes = attributes && Object.entries(attributes).length ? serializeAttributes(attributes) + ' ' : ''; // Strip core blocks of their namespace prefix.
- const blockName = (0,external_lodash_namespaceObject.startsWith)(rawBlockName, 'core/') ? rawBlockName.slice(5) : rawBlockName; // @todo make the `wp:` prefix potentially configurable.
+ const blockName = rawBlockName !== null && rawBlockName !== void 0 && rawBlockName.startsWith('core/') ? rawBlockName.slice(5) : rawBlockName; // @todo make the `wp:` prefix potentially configurable.
if (!content) {
return ``;
@@ -8695,8 +10401,8 @@ function getCommentDelimitedContent(rawBlockName, attributes, content) {
* Returns the content of a block, including comment delimiters, determining
* serialized attributes and content form from the current state of the block.
*
- * @param {WPBlock} block Block instance.
- * @param {WPBlockSerializationOptions} options Serialization options.
+ * @param {WPBlock} block Block instance.
+ * @param {WPBlockSerializationOptions} options Serialization options.
*
* @return {string} Serialized block.
*/
@@ -8717,7 +10423,12 @@ function serializeBlock(block) {
return saveContent;
}
- const blockType = registration_getBlockType(blockName);
+ const blockType = getBlockType(blockName);
+
+ if (!blockType) {
+ return saveContent;
+ }
+
const saveAttributes = getCommentAttributes(blockType, block.attributes);
return getCommentDelimitedContent(blockName, saveAttributes, saveContent);
}
@@ -8728,7 +10439,7 @@ function __unstableSerializeAndClean(blocks) {
blocks = [];
}
- let content = serializer_serialize(blocks); // For compatibility, treat a post consisting of a
+ let content = serialize(blocks); // For compatibility, treat a post consisting of a
// single freeform block as legacy content and apply
// pre-block-editor removep'd content formatting.
@@ -8747,8 +10458,9 @@ function __unstableSerializeAndClean(blocks) {
* @return {string} The post content.
*/
-function serializer_serialize(blocks, options) {
- return (0,external_lodash_namespaceObject.castArray)(blocks).map(block => serializeBlock(block, options)).join('\n\n');
+function serialize(blocks, options) {
+ const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
+ return blocksArray.map(block => serializeBlock(block, options)).join('\n\n');
}
;// CONCATENATED MODULE: ./node_modules/simple-html-tokenizer/dist/es6/index.js
@@ -9765,12 +11477,14 @@ function createQueuedLogger() {
/** @typedef {import('./logger').LoggerItem} LoggerItem */
+const identity = x => x;
/**
* Globally matches any consecutive whitespace
*
* @type {RegExp}
*/
+
const REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g;
/**
* Matches a string containing only whitespace
@@ -9837,7 +11551,7 @@ const MEANINGFUL_ATTRIBUTES = [...BOOLEAN_ATTRIBUTES, ...ENUMERATED_ATTRIBUTES];
* @type {Array}
*/
-const TEXT_NORMALIZATIONS = [external_lodash_namespaceObject.identity, getTextWithCollapsedWhitespace];
+const TEXT_NORMALIZATIONS = [identity, getTextWithCollapsedWhitespace];
/**
* Regular expression matching a named character reference. In lieu of bundling
* a full set of references, the pattern covers the minimal necessary to test
@@ -10058,7 +11772,7 @@ function getStyleProperties(text) {
const value = valueParts.join(':');
return [key.trim(), getNormalizedStyleValue(value.trim())];
});
- return (0,external_lodash_namespaceObject.fromPairs)(pairs);
+ return Object.fromEntries(pairs);
}
/**
* Attribute-specific equality handlers
@@ -10070,14 +11784,17 @@ const isEqualAttributesOfName = {
class: (actual, expected) => {
// Class matches if members are the same, even if out of order or
// superfluous whitespace between.
- return !(0,external_lodash_namespaceObject.xor)(...[actual, expected].map(getTextPiecesSplitOnWhitespace)).length;
+ const [actualPieces, expectedPieces] = [actual, expected].map(getTextPiecesSplitOnWhitespace);
+ const actualDiff = actualPieces.filter(c => !expectedPieces.includes(c));
+ const expectedDiff = expectedPieces.filter(c => !actualPieces.includes(c));
+ return actualDiff.length === 0 && expectedDiff.length === 0;
},
style: (actual, expected) => {
return (0,external_lodash_namespaceObject.isEqual)(...[actual, expected].map(getStyleProperties));
},
// For each boolean attribute, mere presence of attribute in both is enough
// to assume equivalence.
- ...(0,external_lodash_namespaceObject.fromPairs)(BOOLEAN_ATTRIBUTES.map(attribute => [attribute, external_lodash_namespaceObject.stubTrue]))
+ ...Object.fromEntries(BOOLEAN_ATTRIBUTES.map(attribute => [attribute, () => true]))
};
/**
* Given two sets of attribute tuples, returns true if the attribute sets are
@@ -10436,12 +12153,6 @@ function convertLegacyBlockNameAndAttributes(name, attributes) {
}
name = 'core/embed';
- } // Convert 'core/query-loop' blocks in existing content to 'core/post-template'.
- // TODO: Remove this check when WordPress 5.9 is released.
-
-
- if (name === 'core/query-loop') {
- name = 'core/post-template';
} // Convert Post Comment blocks in existing content to Comment blocks.
// TODO: Remove these checks when WordPress 6.0 is released.
@@ -10458,6 +12169,24 @@ function convertLegacyBlockNameAndAttributes(name, attributes) {
name = 'core/comment-date';
}
+ if (name === 'core/comments-query-loop') {
+ name = 'core/comments';
+ const {
+ className = ''
+ } = newAttributes;
+
+ if (!className.includes('wp-block-comments-query-loop')) {
+ newAttributes.className = ['wp-block-comments-query-loop', className].join(' ');
+ } // Note that we also had to add a deprecation to the block in order
+ // for the ID change to work.
+
+ }
+
+ if (name === 'core/post-comments') {
+ name = 'core/comments';
+ newAttributes.legacy = true;
+ }
+
return [name, newAttributes];
}
@@ -11239,17 +12968,12 @@ function getBlockAttributes(blockTypeOrName, innerHTML) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/fix-custom-classname.js
-/**
- * External dependencies
- */
-
/**
* Internal dependencies
*/
-
const CLASS_ATTR_SCHEMA = {
type: 'string',
source: 'attribute',
@@ -11283,16 +13007,19 @@ function getHTMLRootElementClasses(innerHTML) {
*/
function fixCustomClassname(blockAttributes, blockType, innerHTML) {
- if (registration_hasBlockSupport(blockType, 'customClassName', true)) {
+ if (hasBlockSupport(blockType, 'customClassName', true)) {
// To determine difference, serialize block given the known set of
// attributes, with the exception of `className`. This will determine
// the default set of classes. From there, any difference in innerHTML
// can be considered as custom classes.
- const attributesSansClassName = (0,external_lodash_namespaceObject.omit)(blockAttributes, ['className']);
+ const {
+ className: omittedClassName,
+ ...attributesSansClassName
+ } = blockAttributes;
const serialized = getSaveContent(blockType, attributesSansClassName);
const defaultClasses = getHTMLRootElementClasses(serialized);
const actualClasses = getHTMLRootElementClasses(innerHTML);
- const customClasses = (0,external_lodash_namespaceObject.difference)(actualClasses, defaultClasses);
+ const customClasses = actualClasses.filter(className => !defaultClasses.includes(className));
if (customClasses.length) {
blockAttributes.className = customClasses.join(' ');
@@ -11341,6 +13068,16 @@ function applyBuiltInValidationFixes(block, blockType) {
+
+/**
+ * Function that takes no arguments and always returns false.
+ *
+ * @return {boolean} Always returns false.
+ */
+
+function stubFalse() {
+ return false;
+}
/**
* Given a block object, returns a new copy of the block with any applicable
* deprecated migrations applied, or the original block if it was both valid
@@ -11355,6 +13092,7 @@ function applyBuiltInValidationFixes(block, blockType) {
* @return {import(".").WPBlock} Migrated block object.
*/
+
function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
const parsedAttributes = rawBlock.attrs;
const {
@@ -11376,7 +13114,7 @@ function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
// defining `isEligible` on its deprecation. If the block is both valid
// and does not opt to migrate, skip.
const {
- isEligible = external_lodash_namespaceObject.stubFalse
+ isEligible = stubFalse
} = deprecatedDefinitions[i];
if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks)) {
@@ -11386,7 +13124,7 @@ function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
// and must be explicitly provided.
- const deprecatedBlockType = Object.assign((0,external_lodash_namespaceObject.omit)(blockType, DEPRECATED_ENTRY_KEYS), deprecatedDefinitions[i]);
+ const deprecatedBlockType = Object.assign(omit(blockType, DEPRECATED_ENTRY_KEYS), deprecatedDefinitions[i]);
let migratedBlock = { ...block,
attributes: getBlockAttributes(deprecatedBlockType, block.originalContent, parsedAttributes)
}; // Ignore the deprecation if it produces a block which is not valid.
@@ -11477,7 +13215,8 @@ function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
/**
* @typedef {Object} ParseOptions
- * @property {boolean} __unstableSkipMigrationLogs If a block is migrated from a deprecated version, skip logging the migration details.
+ * @property {boolean?} __unstableSkipMigrationLogs If a block is migrated from a deprecated version, skip logging the migration details.
+ * @property {boolean?} __unstableSkipAutop Whether to skip autop when processing freeform content.
*/
/**
@@ -11501,13 +13240,14 @@ function convertLegacyBlocks(rawBlock) {
* Normalize the raw block by applying the fallback block name if none given,
* sanitize the parsed HTML...
*
- * @param {WPRawBlock} rawBlock The raw block object.
+ * @param {WPRawBlock} rawBlock The raw block object.
+ * @param {ParseOptions?} options Extra options for handling block parsing.
*
* @return {WPRawBlock} The normalized block object.
*/
-function normalizeRawBlock(rawBlock) {
+function normalizeRawBlock(rawBlock, options) {
const fallbackBlockName = getFreeformContentHandlerName(); // If the grammar parsing don't produce any block name, use the freeform block.
const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName();
@@ -11517,7 +13257,7 @@ function normalizeRawBlock(rawBlock) {
// automatic paragraphs, so preserve them. Assumes wpautop is idempotent,
// meaning there are no negative consequences to repeated autop calls.
- if (rawBlockName === fallbackBlockName) {
+ if (rawBlockName === fallbackBlockName && !(options !== null && options !== void 0 && options.__unstableSkipAutop)) {
rawInnerHTML = (0,external_wp_autop_namespaceObject.autop)(rawInnerHTML).trim();
}
@@ -11604,17 +13344,17 @@ function applyBlockValidation(unvalidatedBlock, blockType) {
function parseRawBlock(rawBlock, options) {
- let normalizedBlock = normalizeRawBlock(rawBlock); // During the lifecycle of the project, we renamed some old blocks
+ let normalizedBlock = normalizeRawBlock(rawBlock, options); // During the lifecycle of the project, we renamed some old blocks
// and transformed others to new blocks. To avoid breaking existing content,
// we added this function to properly parse the old content.
normalizedBlock = convertLegacyBlocks(normalizedBlock); // Try finding the type for known block name.
- let blockType = registration_getBlockType(normalizedBlock.blockName); // If not blockType is found for the specified name, fallback to the "unregistedBlockType".
+ let blockType = getBlockType(normalizedBlock.blockName); // If not blockType is found for the specified name, fallback to the "unregistedBlockType".
if (!blockType) {
normalizedBlock = createMissingBlockType(normalizedBlock);
- blockType = registration_getBlockType(normalizedBlock.blockName);
+ blockType = getBlockType(normalizedBlock.blockName);
} // If it's an empty freeform block or there's no blockType (no missing block handler)
// Then, just ignore the block.
// It might be a good idea to throw a warning here.
@@ -11707,18 +13447,16 @@ function parser_parse(content, options) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/get-raw-transforms.js
-/**
- * External dependencies
- */
-
/**
* Internal dependencies
*/
-
function getRawTransforms() {
- return (0,external_lodash_namespaceObject.filter)(getBlockTransforms('from'), {
- type: 'raw'
+ return getBlockTransforms('from').filter(_ref => {
+ let {
+ type
+ } = _ref;
+ return type === 'raw';
}).map(transform => {
return transform.isMatch ? transform : { ...transform,
isMatch: node => transform.selector && node.matches(transform.selector)
@@ -11738,12 +13476,14 @@ function getRawTransforms() {
* top-level tag. The HTML should be filtered to not have any text between
* top-level tags and formatted in a way that blocks can handle the HTML.
*
- * @param {string} html HTML to convert.
+ * @param {string} html HTML to convert.
+ * @param {Function} handler The handler calling htmlToBlocks: either rawHandler
+ * or pasteHandler.
*
* @return {Array} An array of blocks.
*/
-function htmlToBlocks(html) {
+function htmlToBlocks(html, handler) {
const doc = document.implementation.createHTMLDocument('');
doc.body.innerHTML = html;
return Array.from(doc.body.children).flatMap(node => {
@@ -11765,7 +13505,7 @@ function htmlToBlocks(html) {
} = rawTransform;
if (transform) {
- return transform(node);
+ return transform(node, handler);
}
return createBlock(blockName, getBlockAttributes(blockName, node.outerHTML));
@@ -11842,9 +13582,8 @@ function normaliseBlocks(HTML) {
*/
/**
- * Looks for `` and `` comments, as well as the
- * `` variant and its `` companion,
- * and replaces them with a custom element representing a future block.
+ * Looks for `` and `` comments and
+ * replaces them with a custom element representing a future block.
*
* The custom element is a way to bypass the rest of the `raw-handling`
* transforms, which would eliminate other kinds of node with which to carry
@@ -11869,26 +13608,63 @@ function specialCommentConverter(node, doc) {
}
if (node.nodeValue.indexOf('more') === 0) {
- // Grab any custom text in the comment.
- const customText = node.nodeValue.slice(4).trim();
- /*
- * When a `` comment is found, we need to look for any
- * `` sibling, but it may not be a direct sibling
- * (whitespace typically lies in between)
- */
+ moreCommentConverter(node, doc);
+ }
+}
+/**
+ * Convert `` as well as the `` variant
+ * and its `` companion into the custom element
+ * described in `specialCommentConverter()`.
+ *
+ * @param {Node} node The node to be processed.
+ * @param {Document} doc The document of the node.
+ * @return {void}
+ */
- let sibling = node;
- let noTeaser = false;
+function moreCommentConverter(node, doc) {
+ // Grab any custom text in the comment.
+ const customText = node.nodeValue.slice(4).trim();
+ /*
+ * When a `` comment is found, we need to look for any
+ * `` sibling, but it may not be a direct sibling
+ * (whitespace typically lies in between)
+ */
- while (sibling = sibling.nextSibling) {
- if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === 'noteaser') {
- noTeaser = true;
- (0,external_wp_dom_namespaceObject.remove)(sibling);
- break;
- }
+ let sibling = node;
+ let noTeaser = false;
+
+ while (sibling = sibling.nextSibling) {
+ if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === 'noteaser') {
+ noTeaser = true;
+ (0,external_wp_dom_namespaceObject.remove)(sibling);
+ break;
}
+ }
- (0,external_wp_dom_namespaceObject.replace)(node, createMore(customText, noTeaser, doc));
+ const moreBlock = createMore(customText, noTeaser, doc); // If our `` comment is in the middle of a paragraph, we should
+ // split the paragraph in two and insert the more block in between. If not,
+ // the more block will eventually end up being inserted after the paragraph.
+
+ if (!node.parentNode || node.parentNode.nodeName !== 'P' || node.parentNode.childNodes.length === 1) {
+ (0,external_wp_dom_namespaceObject.replace)(node, moreBlock);
+ } else {
+ const childNodes = Array.from(node.parentNode.childNodes);
+ const nodeIndex = childNodes.indexOf(node);
+ const wrapperNode = node.parentNode.parentNode || doc.body;
+
+ const paragraphBuilder = (acc, child) => {
+ if (!acc) {
+ acc = doc.createElement('p');
+ }
+
+ acc.appendChild(child);
+ return acc;
+ }; // Split the original parent node and insert our more block
+
+
+ [childNodes.slice(0, nodeIndex).reduce(paragraphBuilder, null), moreBlock, childNodes.slice(nodeIndex + 1).reduce(paragraphBuilder, null)].forEach(element => element && wrapperNode.insertBefore(element, node.parentNode)); // Remove the old parent paragraph
+
+ (0,external_wp_dom_namespaceObject.remove)(node.parentNode);
}
}
@@ -11994,15 +13770,10 @@ function blockquoteNormaliser(node) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js
-/**
- * External dependencies
- */
-
/**
* WordPress dependencies
*/
-
/**
* Whether or not the given node is figure content.
*
@@ -12013,6 +13784,8 @@ function blockquoteNormaliser(node) {
*/
function isFigureContent(node, schema) {
+ var _schema$figure$childr, _schema$figure;
+
const tag = node.nodeName.toLowerCase(); // We are looking for tags that can be a child of the figure tag, excluding
// `figcaption` and any phrasing content.
@@ -12020,7 +13793,7 @@ function isFigureContent(node, schema) {
return false;
}
- return (0,external_lodash_namespaceObject.has)(schema, ['figure', 'children', tag]);
+ return tag in ((_schema$figure$childr = schema === null || schema === void 0 ? void 0 : (_schema$figure = schema.figure) === null || _schema$figure === void 0 ? void 0 : _schema$figure.children) !== null && _schema$figure$childr !== void 0 ? _schema$figure$childr : {});
}
/**
* Whether or not the given node can have an anchor.
@@ -12033,8 +13806,10 @@ function isFigureContent(node, schema) {
function canHaveAnchor(node, schema) {
+ var _schema$figure$childr2, _schema$figure2, _schema$figure2$child, _schema$figure2$child2;
+
const tag = node.nodeName.toLowerCase();
- return (0,external_lodash_namespaceObject.has)(schema, ['figure', 'children', 'a', 'children', tag]);
+ return tag in ((_schema$figure$childr2 = schema === null || schema === void 0 ? void 0 : (_schema$figure2 = schema.figure) === null || _schema$figure2 === void 0 ? void 0 : (_schema$figure2$child = _schema$figure2.children) === null || _schema$figure2$child === void 0 ? void 0 : (_schema$figure2$child2 = _schema$figure2$child.a) === null || _schema$figure2$child2 === void 0 ? void 0 : _schema$figure2$child2.children) !== null && _schema$figure$childr2 !== void 0 ? _schema$figure$childr2 : {});
}
/**
* Wraps the given element in a figure element.
@@ -12095,15 +13870,10 @@ function figureContentReducer(node, doc, schema) {
;// CONCATENATED MODULE: external ["wp","shortcode"]
var external_wp_shortcode_namespaceObject = window["wp"]["shortcode"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js
-/**
- * External dependencies
- */
-
/**
* WordPress dependencies
*/
-
/**
* Internal dependencies
*/
@@ -12113,23 +13883,27 @@ var external_wp_shortcode_namespaceObject = window["wp"]["shortcode"];
+const castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
+
function segmentHTMLToShortcodeBlock(HTML) {
let lastIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
let excludedBlockNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
// Get all matches.
const transformsFrom = getBlockTransforms('from');
- const transformation = findTransform(transformsFrom, transform => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === 'shortcode' && (0,external_lodash_namespaceObject.some)((0,external_lodash_namespaceObject.castArray)(transform.tag), tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML)));
+ const transformation = findTransform(transformsFrom, transform => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === 'shortcode' && castArray(transform.tag).some(tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML)));
if (!transformation) {
return [HTML];
}
- const transformTags = (0,external_lodash_namespaceObject.castArray)(transformation.tag);
- const transformTag = (0,external_lodash_namespaceObject.find)(transformTags, tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML));
+ const transformTags = castArray(transformation.tag);
+ const transformTag = transformTags.find(tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML));
let match;
const previousIndex = lastIndex;
if (match = (0,external_wp_shortcode_namespaceObject.next)(transformTag, HTML, lastIndex)) {
+ var _match$shortcode$cont;
+
lastIndex = match.index + match.content.length;
const beforeHTML = HTML.substr(0, match.index);
const afterHTML = HTML.substr(lastIndex); // If the shortcode content does not contain HTML and the shortcode is
@@ -12137,7 +13911,7 @@ function segmentHTMLToShortcodeBlock(HTML) {
// consider the shortcode as inline text, and thus skip conversion for
// this segment.
- if (!(0,external_lodash_namespaceObject.includes)(match.shortcode.content || '', '<') && !(/(\n|)\s*$/.test(beforeHTML) && /^\s*(\n|<\/p>)/.test(afterHTML))) {
+ if (!((_match$shortcode$cont = match.shortcode.content) !== null && _match$shortcode$cont !== void 0 && _match$shortcode$cont.includes('<')) && !(/(\n|
)\s*$/.test(beforeHTML) && /^\s*(\n|<\/p>)/.test(afterHTML))) {
return segmentHTMLToShortcodeBlock(HTML, lastIndex);
} // If a transformation's `isMatch` predicate fails for the inbound
// shortcode, try again by excluding the current block type.
@@ -12153,19 +13927,48 @@ function segmentHTMLToShortcodeBlock(HTML) {
return segmentHTMLToShortcodeBlock(HTML, previousIndex, [...excludedBlockNames, transformation.blockName]);
}
- const attributes = (0,external_lodash_namespaceObject.mapValues)((0,external_lodash_namespaceObject.pickBy)(transformation.attributes, schema => schema.shortcode), // Passing all of `match` as second argument is intentionally broad
- // but shouldn't be too relied upon.
- //
- // See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
- schema => schema.shortcode(match.shortcode.attrs, match));
- const transformationBlockType = { ...registration_getBlockType(transformation.blockName),
- attributes: transformation.attributes
- };
- let block = createBlock(transformation.blockName, getBlockAttributes(transformationBlockType, match.shortcode.content, attributes));
- block.originalContent = match.shortcode.content; // Applying the built-in fixes can enhance the attributes with missing content like "className".
+ let blocks = [];
- block = applyBuiltInValidationFixes(block, transformationBlockType);
- return [...segmentHTMLToShortcodeBlock(beforeHTML), block, ...segmentHTMLToShortcodeBlock(afterHTML)];
+ if (typeof transformation.transform === 'function') {
+ // Passing all of `match` as second argument is intentionally broad
+ // but shouldn't be too relied upon.
+ //
+ // See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
+ blocks = [].concat(transformation.transform(match.shortcode.attrs, match)); // Applying the built-in fixes can enhance the attributes with missing content like "className".
+
+ blocks = blocks.map(block => {
+ block.originalContent = match.shortcode.content;
+ return applyBuiltInValidationFixes(block, getBlockType(block.name));
+ });
+ } else {
+ const attributes = Object.fromEntries(Object.entries(transformation.attributes).filter(_ref => {
+ let [, schema] = _ref;
+ return schema.shortcode;
+ }) // Passing all of `match` as second argument is intentionally broad
+ // but shouldn't be too relied upon.
+ //
+ // See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
+ .map(_ref2 => {
+ let [key, schema] = _ref2;
+ return [key, schema.shortcode(match.shortcode.attrs, match)];
+ }));
+ const blockType = getBlockType(transformation.blockName);
+
+ if (!blockType) {
+ return [HTML];
+ }
+
+ const transformationBlockType = { ...blockType,
+ attributes: transformation.attributes
+ };
+ let block = createBlock(transformation.blockName, getBlockAttributes(transformationBlockType, match.shortcode.content, attributes)); // Applying the built-in fixes can enhance the attributes with missing content like "className".
+
+ block.originalContent = match.shortcode.content;
+ block = applyBuiltInValidationFixes(block, transformationBlockType);
+ blocks = [block];
+ }
+
+ return [...segmentHTMLToShortcodeBlock(beforeHTML), ...blocks, ...segmentHTMLToShortcodeBlock(afterHTML)];
}
return [HTML];
@@ -12201,8 +14004,8 @@ function getBlockContentSchemaFromTransforms(transforms, context) {
blockName,
schema
} = _ref;
- const hasAnchorSupport = registration_hasBlockSupport(blockName, 'anchor');
- schema = (0,external_lodash_namespaceObject.isFunction)(schema) ? schema(schemaArgs) : schema; // If the block does not has anchor support and the transform does not
+ const hasAnchorSupport = hasBlockSupport(blockName, 'anchor');
+ schema = typeof schema === 'function' ? schema(schemaArgs) : schema; // If the block does not has anchor support and the transform does not
// provides an isMatch we can return the schema right away.
if (!hasAnchorSupport && !isMatch) {
@@ -12350,16 +14153,11 @@ function getSibling(node, which) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/index.js
-/**
- * External dependencies
- */
-
/**
* WordPress dependencies
*/
-
/**
* Internal dependencies
*/
@@ -12404,7 +14202,7 @@ function rawHandler(_ref) {
const pieces = shortcode_converter(HTML);
const blockContentSchema = getBlockContentSchema();
- return (0,external_lodash_namespaceObject.compact)((0,external_lodash_namespaceObject.flatMap)(pieces, piece => {
+ return pieces.map(piece => {
// Already a block from shortcode.
if (typeof piece !== 'string') {
return piece;
@@ -12421,8 +14219,8 @@ function rawHandler(_ref) {
blockquoteNormaliser];
piece = deepFilterHTML(piece, filters, blockContentSchema);
piece = normaliseBlocks(piece);
- return htmlToBlocks(piece);
- }));
+ return htmlToBlocks(piece, rawHandler);
+ }).flat().filter(Boolean);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js
@@ -12444,15 +14242,10 @@ function commentRemover(node) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js
-/**
- * External dependencies
- */
-
/**
* WordPress dependencies
*/
-
/**
* Checks if the given node should be considered inline content, optionally
* depending on a context tag.
@@ -12474,7 +14267,7 @@ function isInline(node, contextTag) {
const tag = node.nodeName.toLowerCase();
const inlineAllowedTagGroups = [['ul', 'li', 'ol'], ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']];
- return inlineAllowedTagGroups.some(tagGroup => (0,external_lodash_namespaceObject.difference)([tag, contextTag], tagGroup).length === 0);
+ return inlineAllowedTagGroups.some(tagGroup => [tag, contextTag].filter(t => !tagGroup.includes(t)).length === 0);
}
function deepCheck(nodes, contextTag) {
@@ -12493,15 +14286,10 @@ function isInlineContent(HTML, contextTag) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js
-/**
- * External dependencies
- */
-
/**
* WordPress dependencies
*/
-
function phrasingContentReducer(node, doc) {
// In jsdom-jscore, 'node.style' can be null.
// TODO: Explore fixing this by patching jsdom-jscore.
@@ -12525,7 +14313,7 @@ function phrasingContentReducer(node, doc) {
// fallback.
- if (textDecorationLine === 'line-through' || (0,external_lodash_namespaceObject.includes)(textDecoration, 'line-through')) {
+ if (textDecorationLine === 'line-through' || textDecoration.includes('line-through')) {
(0,external_wp_dom_namespaceObject.wrap)(doc.createElement('s'), node);
}
@@ -12911,16 +14699,35 @@ function emptyParagraphRemover(node) {
node.parentNode.removeChild(node);
}
-;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/slack-paragraph-corrector.js
/**
- * External dependencies
+ * Replaces Slack paragraph markup with a double line break (later converted to
+ * a proper paragraph).
+ *
+ * @param {Element} node Node to check.
*/
+function slackParagraphCorrector(node) {
+ if (node.nodeName !== 'SPAN') {
+ return;
+ }
+ if (node.getAttribute('data-stringify-type') !== 'paragraph-break') {
+ return;
+ }
+
+ const {
+ parentNode
+ } = node;
+ parentNode.insertBefore(node.ownerDocument.createElement('br'), node);
+ parentNode.insertBefore(node.ownerDocument.createElement('br'), node);
+ parentNode.removeChild(node);
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js
/**
* WordPress dependencies
*/
-
/**
* Internal dependencies
*/
@@ -12947,6 +14754,7 @@ function emptyParagraphRemover(node) {
+
/**
@@ -13052,10 +14860,12 @@ function pasteHandler(_ref) {
if (mode === 'INLINE') {
return filterInlineHTML(HTML, preserveWhiteSpace);
- } // An array of HTML strings and block objects. The blocks replace matched
- // shortcodes.
+ } // Must be run before checking if it's inline content.
+ HTML = deepFilterHTML(HTML, [slackParagraphCorrector]); // An array of HTML strings and block objects. The blocks replace matched
+ // shortcodes.
+
const pieces = shortcode_converter(HTML); // The call to shortcodeConverter will always return more than one element
// if shortcodes are matched. The reason is when shortcodes are matched
// empty HTML strings are included.
@@ -13068,7 +14878,7 @@ function pasteHandler(_ref) {
const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)('paste');
const blockContentSchema = getBlockContentSchema('paste');
- const blocks = (0,external_lodash_namespaceObject.compact)((0,external_lodash_namespaceObject.flatMap)(pieces, piece => {
+ const blocks = pieces.map(piece => {
// Already a block from shortcode.
if (typeof piece !== 'string') {
return piece;
@@ -13085,17 +14895,18 @@ function pasteHandler(_ref) {
piece = deepFilterHTML(piece, [htmlFormattingRemover, brRemover, emptyParagraphRemover], blockContentSchema); // Allows us to ask for this information when we get a report.
paste_handler_console.log('Processed HTML piece:\n\n', piece);
- return htmlToBlocks(piece);
- })); // If we're allowed to return inline content, and there is only one
+ return htmlToBlocks(piece, pasteHandler);
+ }).flat().filter(Boolean); // If we're allowed to return inline content, and there is only one
// inlineable block, and the original plain text content does not have any
// line breaks, then treat it as inline paste.
- if (mode === 'AUTO' && blocks.length === 1 && registration_hasBlockSupport(blocks[0].name, '__unstablePasteTextInline', false)) {
- // Don't catch line breaks at the start or end.
- const trimmedPlainText = plainText.replace(/^[\n]+|[\n]+$/g, '');
+ if (mode === 'AUTO' && blocks.length === 1 && hasBlockSupport(blocks[0].name, '__unstablePasteTextInline', false)) {
+ const trimRegex = /^[\n]+|[\n]+$/g; // Don't catch line breaks at the start or end.
+
+ const trimmedPlainText = plainText.replace(trimRegex, '');
if (trimmedPlainText !== '' && trimmedPlainText.indexOf('\n') === -1) {
- return (0,external_wp_dom_namespaceObject.removeInvalidHTML)(getBlockInnerHTML(blocks[0]), phrasingContentSchema);
+ return (0,external_wp_dom_namespaceObject.removeInvalidHTML)(getBlockInnerHTML(blocks[0]), phrasingContentSchema).replace(trimRegex, '');
}
}
@@ -13116,6 +14927,9 @@ function pasteHandler(_ref) {
/**
* Returns all the block categories.
+ * Ignored from documentation as the recommended usage is via useSelect from @wordpress/data.
+ *
+ * @ignore
*
* @return {WPBlockCategory[]} Block categories.
*/
@@ -13127,6 +14941,36 @@ function categories_getCategories() {
* Sets the block categories.
*
* @param {WPBlockCategory[]} categories Block categories.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { store as blocksStore, setCategories } from '@wordpress/blocks';
+ * import { useSelect } from '@wordpress/data';
+ * import { Button } from '@wordpress/components';
+ *
+ * const ExampleComponent = () => {
+ * // Retrieve the list of current categories.
+ * const blockCategories = useSelect(
+ * ( select ) => select( blocksStore ).getCategories(),
+ * []
+ * );
+ *
+ * return (
+ *
+ * );
+ * };
+ * ```
*/
function categories_setCategories(categories) {
@@ -13138,6 +14982,25 @@ function categories_setCategories(categories) {
* @param {string} slug Block category slug.
* @param {WPBlockCategory} category Object containing the category properties
* that should be updated.
+ *
+ * @example
+ * ```js
+ * import { __ } from '@wordpress/i18n';
+ * import { updateCategory } from '@wordpress/blocks';
+ * import { Button } from '@wordpress/components';
+ *
+ * const ExampleComponent = () => {
+ * return (
+ *
+ * ) ;
+ * };
+ * ```
*/
function categories_updateCategory(slug, category) {
@@ -13145,15 +15008,10 @@ function categories_updateCategory(slug, category) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/templates.js
-/**
- * External dependencies
- */
-
/**
* WordPress dependencies
*/
-
/**
* Internal dependencies
*/
@@ -13173,7 +15031,7 @@ function categories_updateCategory(slug, category) {
function doBlocksMatchTemplate() {
let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
let template = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- return blocks.length === template.length && (0,external_lodash_namespaceObject.every)(template, (_ref, index) => {
+ return blocks.length === template.length && template.every((_ref, index) => {
let [name,, innerBlocksTemplate] = _ref;
const block = blocks[index];
return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate);
@@ -13202,7 +15060,9 @@ function synchronizeBlocksWithTemplate() {
return blocks;
}
- return (0,external_lodash_namespaceObject.map)(template, (_ref2, index) => {
+ return template.map((_ref2, index) => {
+ var _blockType$attributes;
+
let [name, attributes, innerBlocksTemplate] = _ref2;
const block = blocks[index];
@@ -13216,20 +15076,25 @@ function synchronizeBlocksWithTemplate() {
// before creating the blocks.
- const blockType = registration_getBlockType(name);
+ const blockType = getBlockType(name);
- const isHTMLAttribute = attributeDefinition => (0,external_lodash_namespaceObject.get)(attributeDefinition, ['source']) === 'html';
+ const isHTMLAttribute = attributeDefinition => (attributeDefinition === null || attributeDefinition === void 0 ? void 0 : attributeDefinition.source) === 'html';
- const isQueryAttribute = attributeDefinition => (0,external_lodash_namespaceObject.get)(attributeDefinition, ['source']) === 'query';
+ const isQueryAttribute = attributeDefinition => (attributeDefinition === null || attributeDefinition === void 0 ? void 0 : attributeDefinition.source) === 'query';
const normalizeAttributes = (schema, values) => {
- return (0,external_lodash_namespaceObject.mapValues)(values, (value, key) => {
- return normalizeAttribute(schema[key], value);
- });
+ if (!values) {
+ return {};
+ }
+
+ return Object.fromEntries(Object.entries(values).map(_ref3 => {
+ let [key, value] = _ref3;
+ return [key, normalizeAttribute(schema[key], value)];
+ }));
};
const normalizeAttribute = (definition, value) => {
- if (isHTMLAttribute(definition) && (0,external_lodash_namespaceObject.isArray)(value)) {
+ if (isHTMLAttribute(definition) && Array.isArray(value)) {
// Introduce a deprecated call at this point
// When we're confident that "children" format should be removed from the templates.
return (0,external_wp_element_namespaceObject.renderToString)(value);
@@ -13244,11 +15109,11 @@ function synchronizeBlocksWithTemplate() {
return value;
};
- const normalizedAttributes = normalizeAttributes((0,external_lodash_namespaceObject.get)(blockType, ['attributes'], {}), attributes);
+ const normalizedAttributes = normalizeAttributes((_blockType$attributes = blockType === null || blockType === void 0 ? void 0 : blockType.attributes) !== null && _blockType$attributes !== void 0 ? _blockType$attributes : {}, attributes);
let [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes(name, normalizedAttributes); // If a Block is undefined at this point, use the core/missing block as
// a placeholder for a better user experience.
- if (undefined === registration_getBlockType(blockName)) {
+ if (undefined === getBlockType(blockName)) {
blockAttributes = {
originalName: name,
originalContent: '',
@@ -13353,99 +15218,27 @@ function synchronizeBlocksWithTemplate() {
-;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
-}
-;// CONCATENATED MODULE: external ["wp","compose"]
-var external_wp_compose_namespaceObject = window["wp"]["compose"];
-;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/block-content-provider/index.js
-
-
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/deprecated.js
/**
* WordPress dependencies
*/
-
-/**
- * Internal dependencies
- */
-
-
-const {
- Consumer,
- Provider
-} = (0,external_wp_element_namespaceObject.createContext)(() => {});
-/**
- * An internal block component used in block content serialization to inject
- * nested block content within the `save` implementation of the ancestor
- * component in which it is nested. The component provides a pre-bound
- * `BlockContent` component via context, which is used by the developer-facing
- * `InnerBlocks.Content` component to render block content.
- *
- * @example
- *
- * ```jsx
- *
- * { blockSaveElement }
- *
- * ```
- *
- * @param {Object} props Component props.
- * @param {WPElement} props.children Block save result.
- * @param {Array} props.innerBlocks Block(s) to serialize.
- *
- * @return {WPComponent} Element with BlockContent injected via context.
- */
-
-const BlockContentProvider = _ref => {
- let {
- children,
- innerBlocks
- } = _ref;
-
- const BlockContent = () => {
- // Value is an array of blocks, so defer to block serializer.
- const html = serialize(innerBlocks, {
- isInnerBlocks: true
- }); // Use special-cased raw HTML tag to avoid default escaping
-
- return createElement(RawHTML, null, html);
- };
-
- return createElement(Provider, {
- value: BlockContent
- }, children);
-};
/**
* A Higher Order Component used to inject BlockContent using context to the
* wrapped component.
*
- * @return {WPComponent} Enhanced component with injected BlockContent as prop.
+ * @deprecated
+ *
+ * @param {WPComponent} OriginalComponent The component to enhance.
+ * @return {WPComponent} The same component.
*/
-
-const withBlockContentContext = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => {
- return props => (0,external_wp_element_namespaceObject.createElement)(Consumer, null, context => (0,external_wp_element_namespaceObject.createElement)(OriginalComponent, _extends({}, props, {
- BlockContent: context
- })));
-}, 'withBlockContentContext');
-/* harmony default export */ var block_content_provider = ((/* unused pure expression or super */ null && (BlockContentProvider)));
+function withBlockContentContext(OriginalComponent) {
+ external_wp_deprecated_default()('wp.blocks.withBlockContentContext', {
+ since: '6.1'
+ });
+ return OriginalComponent;
+}
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/index.js
// A "block" is the abstract term used to describe units of markup that,
diff --git a/wp-includes/js/dist/blocks.min.js b/wp-includes/js/dist/blocks.min.js
index 82db9e36f2..8f367db649 100644
--- a/wp-includes/js/dist/blocks.min.js
+++ b/wp-includes/js/dist/blocks.min.js
@@ -1,3 +1,10 @@
/*! This file is auto-generated */
-!function(){var e={9756:function(e){e.exports=function(e,t){var r,n,a=0;function o(){var o,i,s=r,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(i=0;i (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n].defaultValue);return r}var o={},i={},s={},c=a(!0),l="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:a(!0),allOn:function(){"use strict";var e=a(!0),t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=!0);return t}()};function d(e,t){"use strict";var r=t?"Error in "+t+" extension->":"Error in unnamed extension",n={valid:!0,error:""};o.helper.isArray(e)||(e=[e]);for(var a=0;a").replace(/&/g,"&")};var h=function(e,t,r,n){"use strict";var a,o,i,s,c,l=n||"",u=l.indexOf("g")>-1,d=new RegExp(t+"|"+r,"g"+l.replace(/g/g,"")),p=new RegExp(t,l.replace(/g/g,"")),h=[];do{for(a=0;i=d.exec(e);)if(p.test(i[0]))a++||(s=(o=d.lastIndex)-i[0].length);else if(a&&!--a){c=i.index+i[0].length;var f={left:{start:s,end:o},match:{start:o,end:i.index},right:{start:i.index,end:c},wholeMatch:{start:s,end:c}};if(h.push(f),!u)return h}}while(a&&(d.lastIndex=o));return h};o.helper.matchRecursiveRegExp=function(e,t,r,n){"use strict";for(var a=h(e,t,r,n),o=[],i=0;i0){var u=[];0!==s[0].wholeMatch.start&&u.push(e.slice(0,s[0].wholeMatch.start));for(var d=0;d=0?n+(r||0):n},o.helper.splitAtIndex=function(e,t){"use strict";if(!o.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},o.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return""+e.charCodeAt(0)+";"},function(e){return""+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var r=Math.random();e=r>.9?t[2](e):r>.45?t[1](e):t[0](e)}return e}))},o.helper.padEnd=function(e,t,r){"use strict";return t>>=0,r=String(r||" "),e.length>t?String(e):((t-=e.length)>r.length&&(r+=r.repeat(t/r.length)),String(e)+r.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨❤️👨",couple_with_heart_woman_woman:"👩❤️👩",couplekiss_man_man:"👨❤️💋👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩❤️💋👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨👦",family_man_boy_boy:"👨👦👦",family_man_girl:"👨👧",family_man_girl_boy:"👨👧👦",family_man_girl_girl:"👨👧👧",family_man_man_boy:"👨👨👦",family_man_man_boy_boy:"👨👨👦👦",family_man_man_girl:"👨👨👧",family_man_man_girl_boy:"👨👨👧👦",family_man_man_girl_girl:"👨👨👧👧",family_man_woman_boy_boy:"👨👩👦👦",family_man_woman_girl:"👨👩👧",family_man_woman_girl_boy:"👨👩👧👦",family_man_woman_girl_girl:"👨👩👧👧",family_woman_boy:"👩👦",family_woman_boy_boy:"👩👦👦",family_woman_girl:"👩👧",family_woman_girl_boy:"👩👧👦",family_woman_girl_girl:"👩👧👧",family_woman_woman_boy:"👩👩👦",family_woman_woman_boy_boy:"👩👩👦👦",family_woman_woman_girl:"👩👩👧",family_woman_woman_girl_boy:"👩👩👧👦",family_woman_woman_girl_girl:"👩👩👧👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨🎨",man_astronaut:"👨🚀",man_cartwheeling:"🤸♂️",man_cook:"👨🍳",man_dancing:"🕺",man_facepalming:"🤦♂️",man_factory_worker:"👨🏭",man_farmer:"👨🌾",man_firefighter:"👨🚒",man_health_worker:"👨⚕️",man_in_tuxedo:"🤵",man_judge:"👨⚖️",man_juggling:"🤹♂️",man_mechanic:"👨🔧",man_office_worker:"👨💼",man_pilot:"👨✈️",man_playing_handball:"🤾♂️",man_playing_water_polo:"🤽♂️",man_scientist:"👨🔬",man_shrugging:"🤷♂️",man_singer:"👨🎤",man_student:"👨🎓",man_teacher:"👨🏫",man_technologist:"👨💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩🎨",woman_astronaut:"👩🚀",woman_cartwheeling:"🤸♀️",woman_cook:"👩🍳",woman_facepalming:"🤦♀️",woman_factory_worker:"👩🏭",woman_farmer:"👩🌾",woman_firefighter:"👩🚒",woman_health_worker:"👩⚕️",woman_judge:"👩⚖️",woman_juggling:"🤹♀️",woman_mechanic:"👩🔧",woman_office_worker:"👩💼",woman_pilot:"👩✈️",woman_playing_handball:"🤾♀️",woman_playing_water_polo:"🤽♀️",woman_scientist:"👩🔬",woman_shrugging:"🤷♀️",woman_singer:"👩🎤",woman_student:"👩🎓",woman_teacher:"👩🏫",woman_technologist:"👩💻",woman_with_turban:"👳♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'',showdown:"S"},o.Converter=function(e){"use strict";var t={},r=[],n=[],a={},i=l,p={parsed:{},raw:"",format:""};function h(e,t){if(t=t||null,o.helper.isString(e)){if(t=e=o.helper.stdExtName(e),o.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new o.Converter));o.helper.isArray(e)||(e=[e]);var a=d(e,t);if(!a.valid)throw Error(a.error);for(var i=0;i[ \t]+,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var r=t.createElement("div");r.innerHTML=e;var n={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],n=0;n'}else r.push(t[n].innerHTML),t[n].innerHTML="",t[n].setAttribute("prenum",n.toString());return r}(r)};!function e(t){for(var r=0;r? ?(['"].*['"])?\)$/m)>-1)i="";else if(!i){if(a||(a=n.toLowerCase().replace(/ ?\n/g," ")),i="#"+a,o.helper.isUndefined(r.gUrls[a]))return e;i=r.gUrls[a],o.helper.isUndefined(r.gTitles[a])||(l=r.gTitles[a])}var u='"+n+""};return e=(e=(e=(e=(e=r.converter._dispatch("anchors.before",e,t,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[([^\[\]]+)]()()()()()/g,n),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,r,n,a,i){if("\\"===n)return r+a;if(!o.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=t.ghMentionsLink.replace(/\{u}/g,i),c="";return t.openLinksInNewWindow&&(c=' rel="noopener noreferrer" target="¨E95Eblank"'),r+'"+a+""}))),e=r.converter._dispatch("anchors.after",e,t,r)}));var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,g=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,m=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,k=function(e){"use strict";return function(t,r,n,a,i,s,c){var l=n=n.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback),u="",d="",p=r||"",h=c||"";return/^www\./i.test(n)&&(n=n.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(u=s),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'"+l+""+u+h}},y=function(e,t){"use strict";return function(r,n,a){var i="mailto:";return n=n||"",a=o.subParser("unescapeSpecialChars")(a,e,t),e.encodeEmails?(i=o.helper.encodeEmailAddress(i+a),a=o.helper.encodeEmailAddress(a)):i+=a,n+''+a+""}};o.subParser("autoLinks",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("autoLinks.before",e,t,r)).replace(m,k(t))).replace(_,y(t,r)),e=r.converter._dispatch("autoLinks.after",e,t,r)})),o.subParser("simplifiedAutoLinks",(function(e,t,r){"use strict";return t.simplifiedAutoLink?(e=r.converter._dispatch("simplifiedAutoLinks.before",e,t,r),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(g,k(t)):e.replace(f,k(t))).replace(b,y(t,r)),e=r.converter._dispatch("simplifiedAutoLinks.after",e,t,r)):e})),o.subParser("blockGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("blockGamut.before",e,t,r),e=o.subParser("blockQuotes")(e,t,r),e=o.subParser("headers")(e,t,r),e=o.subParser("horizontalRule")(e,t,r),e=o.subParser("lists")(e,t,r),e=o.subParser("codeBlocks")(e,t,r),e=o.subParser("tables")(e,t,r),e=o.subParser("hashHTMLBlocks")(e,t,r),e=o.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)})),o.subParser("blockQuotes",(function(e,t,r){"use strict";e=r.converter._dispatch("blockQuotes.before",e,t,r),e+="\n\n";var n=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(n=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(n,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=o.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=o.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*[^\r]+?<\/pre>)/gm,(function(e,t){var r=t;return r=(r=r.replace(/^ /gm,"¨0")).replace(/¨0/g,"")})),o.subParser("hashBlock")("\n"+e+"\n
",t,r)})),e=r.converter._dispatch("blockQuotes.after",e,t,r)})),o.subParser("codeBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("codeBlocks.before",e,t,r);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,n,a){var i=n,s=a,c="\n";return i=o.subParser("outdent")(i,t,r),i=o.subParser("encodeCode")(i,t,r),i=(i=(i=o.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(c=""),i=""+i+c+"
",o.subParser("hashBlock")(i,t,r)+s}))).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)})),o.subParser("codeSpans",(function(e,t,r){"use strict";return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,n,a,i){var s=i;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=n+""+(s=o.subParser("encodeCode")(s,t,r))+"
",s=o.subParser("hashHTMLSpans")(s,t,r)})),e=r.converter._dispatch("codeSpans.after",e,t,r)})),o.subParser("completeHTMLDocument",(function(e,t,r){"use strict";if(!t.completeHTMLDocument)return e;e=r.converter._dispatch("completeHTMLDocument.before",e,t,r);var n="html",a="\n",o="",i='\n',s="",c="";for(var l in void 0!==r.metadata.parsed.doctype&&(a="\n","html"!==(n=r.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==n||(i='')),r.metadata.parsed)if(r.metadata.parsed.hasOwnProperty(l))switch(l.toLowerCase()){case"doctype":break;case"title":o=""+r.metadata.parsed.title+"\n";break;case"charset":i="html"===n||"html5"===n?'\n':'\n';break;case"language":case"lang":s=' lang="'+r.metadata.parsed[l]+'"',c+='\n';break;default:c+='\n'}return e=a+"\n\n"+o+i+c+"\n\n"+e.trim()+"\n\n",e=r.converter._dispatch("completeHTMLDocument.after",e,t,r)})),o.subParser("detab",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=(e=r.converter._dispatch("detab.before",e,t,r)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var r=t,n=4-r.length%4,a=0;a/g,">"),e=r.converter._dispatch("encodeAmpsAndAngles.after",e,t,r)})),o.subParser("encodeBackslashEscapes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,o.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)})),o.subParser("encodeCode",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)})),o.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}))).replace(/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)})),e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)})),o.subParser("githubCodeBlocks",(function(e,t,r){"use strict";return t.ghCodeBlocks?(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,n,a,i){var s=t.omitExtraWLInCodeBlocks?"":"\n";return i=o.subParser("encodeCode")(i,t,r),i=""+(i=(i=(i=o.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"
",i=o.subParser("hashBlock")(i,t,r),"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:i})-1)+"G\n\n"}))).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e})),o.subParser("hashBlock",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("hashBlock.before",e,t,r)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n",e=r.converter._dispatch("hashBlock.after",e,t,r)})),o.subParser("hashCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashCodeTags.before",e,t,r);return e=o.helper.replaceRecursiveRegExp(e,(function(e,n,a,i){var s=a+o.subParser("encodeCode")(n,t,r)+i;return"¨C"+(r.gHtmlSpans.push(s)-1)+"C"}),"]*>","
","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)})),o.subParser("hashElement",(function(e,t,r){"use strict";return function(e,t){var n=t;return n=(n=(n=n.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),n="\n\n¨K"+(r.gHtmlBlocks.push(n)-1)+"K\n\n"}})),o.subParser("hashHTMLBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var n=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],a=function(e,t,n,a){var o=e;return-1!==n.search(/\bmarkdown\b/)&&(o=n+r.converter.makeHtml(t)+a),"\n\n¨K"+(r.gHtmlBlocks.push(o)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var i=0;i]*>)","im"),l="<"+n[i]+"\\b[^>]*>",u=""+n[i]+">";-1!==(s=o.helper.regexIndexOf(e,c));){var d=o.helper.splitAtIndex(e,s),p=o.helper.replaceRecursiveRegExp(d[1],a,l,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,r)),e=(e=o.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)})),o.subParser("hashHTMLSpans",(function(e,t,r){"use strict";function n(e){return"¨C"+(r.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=r.converter._dispatch("hashHTMLSpans.before",e,t,r)).replace(/<[^>]+?\/>/gi,(function(e){return n(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<[^>]+?>/gi,(function(e){return n(e)})),e=r.converter._dispatch("hashHTMLSpans.after",e,t,r)})),o.subParser("unhashHTMLSpans",(function(e,t,r){"use strict";e=r.converter._dispatch("unhashHTMLSpans.before",e,t,r);for(var n=0;n]*>\\s*]*>","^ {0,3}
\\s*
","gim"),e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)})),o.subParser("headers",(function(e,t,r){"use strict";e=r.converter._dispatch("headers.before",e,t,r);var n=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),a=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,i=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(a,(function(e,a){var i=o.subParser("spanGamut")(a,t,r),s=t.noHeaderId?"":' id="'+c(a)+'"',l=""+i+"";return o.subParser("hashBlock")(l,t,r)}))).replace(i,(function(e,a){var i=o.subParser("spanGamut")(a,t,r),s=t.noHeaderId?"":' id="'+c(a)+'"',l=n+1,u=""+i+"";return o.subParser("hashBlock")(u,t,r)}));var s=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function c(e){var n,a;if(t.customizedHeaderId){var i=e.match(/\{([^{]+?)}\s*$/);i&&i[1]&&(e=i[1])}return n=e,a=o.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(n=a+n),n=t.ghCompatibleHeaderId?n.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?n.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():n.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(n=a+n),r.hashLinkCounts[n]?n=n+"-"+r.hashLinkCounts[n]++:r.hashLinkCounts[n]=1,n}return e=e.replace(s,(function(e,a,i){var s=i;t.customizedHeaderId&&(s=i.replace(/\s?\{([^{]+?)}\s*$/,""));var l=o.subParser("spanGamut")(s,t,r),u=t.noHeaderId?"":' id="'+c(i)+'"',d=n-1+a.length,p=""+l+"";return o.subParser("hashBlock")(p,t,r)})),e=r.converter._dispatch("headers.after",e,t,r)})),o.subParser("horizontalRule",(function(e,t,r){"use strict";e=r.converter._dispatch("horizontalRule.before",e,t,r);var n=o.subParser("hashBlock")("
",t,r);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,n),e=r.converter._dispatch("horizontalRule.after",e,t,r)})),o.subParser("images",(function(e,t,r){"use strict";function n(e,t,n,a,i,s,c,l){var u=r.gUrls,d=r.gTitles,p=r.gDimensions;if(n=n.toLowerCase(),l||(l=""),e.search(/\(\s*>? ?(['"].*['"])?\)$/m)>-1)a="";else if(""===a||null===a){if(""!==n&&null!==n||(n=t.toLowerCase().replace(/ ?\n/g," ")),a="#"+n,o.helper.isUndefined(u[n]))return e;a=u[n],o.helper.isUndefined(d[n])||(l=d[n]),o.helper.isUndefined(p[n])||(i=p[n].width,s=p[n].height)}t=t.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var h='"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,r,a,o,i,s,c){return n(e,t,r,a=a.replace(/\s/g,""),o,i,s,c)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,n)).replace(/!\[([^\[\]]+)]()()()()()/g,n),e=r.converter._dispatch("images.after",e,t,r)})),o.subParser("italicsAndBold",(function(e,t,r){"use strict";function n(e,t,r){return t+e+r}return e=r.converter._dispatch("italicsAndBold.before",e,t,r),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return n(t,"","")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return n(t,"","")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return n(t,"","")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"","")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"","")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"","")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?n(t,"",""):e})),e=r.converter._dispatch("italicsAndBold.after",e,t,r)})),o.subParser("lists",(function(e,t,r){"use strict";function n(e,n){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,i=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(a,(function(e,n,a,s,c,l,u){u=u&&""!==u.trim();var d=o.subParser("outdent")(c,t,r),p="";return l&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='"}))),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),n||d.search(/\n{2,}/)>-1?(d=o.subParser("githubCodeBlocks")(d,t,r),d=o.subParser("blockGamut")(d,t,r)):(d=(d=o.subParser("lists")(d,t,r)).replace(/\n$/,""),d=(d=o.subParser("hashHTMLBlocks")(d,t,r)).replace(/\n\n+/g,"\n\n"),d=i?o.subParser("paragraphs")(d,t,r):o.subParser("spanGamut")(d,t,r)),d=""+(d=d.replace("¨A",""))+"\n"}))).replace(/¨0/g,""),r.gListLevel--,n&&(e=e.replace(/\s+$/,"")),e}function a(e,t){if("ol"===t){var r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function i(e,r,o){var i=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===r?i:s,l="";if(-1!==e.search(c))!function t(u){var d=u.search(c),p=a(e,r);-1!==d?(l+="\n\n<"+r+p+">\n"+n(u.slice(0,d),!!o)+""+r+">\n",c="ul"===(r="ul"===r?"ol":"ul")?i:s,t(u.slice(d))):l+="\n\n<"+r+p+">\n"+n(u,!!o)+""+r+">\n"}(e);else{var u=a(e,r);l="\n\n<"+r+u+">\n"+n(e,!!o)+""+r+">\n"}return l}return e=r.converter._dispatch("lists.before",e,t,r),e+="¨0",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r){return i(t,r.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r,n){return i(r,n.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)})),o.subParser("metadata",(function(e,t,r){"use strict";if(!t.metadata)return e;function n(e){r.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,n){return r.metadata.parsed[t]=n,""}))}return e=(e=(e=(e=r.converter._dispatch("metadata.before",e,t,r)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,r){return n(r),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,a){return t&&(r.metadata.format=t),n(a),"¨M"}))).replace(/¨M/g,""),e=r.converter._dispatch("metadata.after",e,t,r)})),o.subParser("outdent",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("outdent.before",e,t,r)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=r.converter._dispatch("outdent.after",e,t,r)})),o.subParser("paragraphs",(function(e,t,r){"use strict";for(var n=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),a=[],i=n.length,s=0;s=0?a.push(c):c.search(/\S/)>=0&&(c=(c=o.subParser("spanGamut")(c,t,r)).replace(/^([ \t]*)/g,""),c+="
",a.push(c))}for(i=a.length,s=0;s]*>\s*]*>/.test(u)&&(d=!0)}a[s]=u}return e=(e=(e=a.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)})),o.subParser("runExtension",(function(e,t,r,n){"use strict";if(e.filter)t=e.filter(t,n.converter,r);else if(e.regex){var a=e.regex;a instanceof RegExp||(a=new RegExp(a,"g")),t=t.replace(a,e.replace)}return t})),o.subParser("spanGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("spanGamut.before",e,t,r),e=o.subParser("codeSpans")(e,t,r),e=o.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=o.subParser("encodeBackslashEscapes")(e,t,r),e=o.subParser("images")(e,t,r),e=o.subParser("anchors")(e,t,r),e=o.subParser("autoLinks")(e,t,r),e=o.subParser("simplifiedAutoLinks")(e,t,r),e=o.subParser("emoji")(e,t,r),e=o.subParser("underline")(e,t,r),e=o.subParser("italicsAndBold")(e,t,r),e=o.subParser("strikethrough")(e,t,r),e=o.subParser("ellipsis")(e,t,r),e=o.subParser("hashHTMLSpans")(e,t,r),e=o.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
\n")):e=e.replace(/ +\n/g,"
\n"),e=r.converter._dispatch("spanGamut.after",e,t,r)})),o.subParser("strikethrough",(function(e,t,r){"use strict";return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,n){return function(e){return t.simplifiedAutoLink&&(e=o.subParser("simplifiedAutoLinks")(e,t,r)),""+e+""}(n)})),e=r.converter._dispatch("strikethrough.after",e,t,r)),e})),o.subParser("stripLinkDefinitions",(function(e,t,r){"use strict";var n=function(e,n,a,i,s,c,l){return n=n.toLowerCase(),a.match(/^data:.+?\/.+?;base64,/)?r.gUrls[n]=a.replace(/\s/g,""):r.gUrls[n]=o.subParser("encodeAmpsAndAngles")(a,t,r),c?c+l:(l&&(r.gTitles[n]=l.replace(/"|'/g,""")),t.parseImgDimensions&&i&&s&&(r.gDimensions[n]={width:i,height:s}),"")};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,n)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,n)).replace(/¨0/,"")})),o.subParser("tables",(function(e,t,r){"use strict";if(!t.tables)return e;function n(e,n){return""+o.subParser("spanGamut")(e,t,r)+" | \n"}function a(e){var a,i=e.split("\n");for(a=0;a"+(c=o.subParser("spanGamut")(c,t,r))+"\n"));for(a=0;a\n\n\n",a=0;a\n";for(var o=0;o\n"}return r+"\n\n"}(f,m)}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,o.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,a)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,a),e=r.converter._dispatch("tables.after",e,t,r)})),o.subParser("underline",(function(e,t,r){"use strict";return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return""+t+""}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return""+t+""})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/(_)/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e})),o.subParser("unescapeSpecialChars",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("unescapeSpecialChars.before",e,t,r)).replace(/¨E(\d+)E/g,(function(e,t){var r=parseInt(t);return String.fromCharCode(r)})),e=r.converter._dispatch("unescapeSpecialChars.after",e,t,r)})),o.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,a=n.length,i=0;i ")})),o.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var r=e.getAttribute("language"),n=e.getAttribute("precodenum");return"```"+r+"\n"+t.preList[n]+"\n```"})),o.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),o.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var n=e.childNodes,a=n.length,i=0;i",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),o.subParser("makeMarkdown.links",(function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var n=e.childNodes,a=n.length;r="[";for(var i=0;i",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r})),o.subParser("makeMarkdown.list",(function(e,t,r){"use strict";var n="";if(!e.hasChildNodes())return"";for(var a=e.childNodes,i=a.length,s=e.getAttribute("start")||1,c=0;c"+t.preList[r]+""})),o.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var n=e.childNodes,a=n.length,i=0;itr>th"),c=e.querySelectorAll("tbody>tr");for(r=0;rf&&(f=g)}for(r=0;r/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));void 0===(n=function(){"use strict";return o}.call(t,r,t,e))||(e.exports=n)}).call(this)}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";r.r(n),r.d(n,{__EXPERIMENTAL_ELEMENTS:function(){return ve},__EXPERIMENTAL_PATHS_WITH_MERGE:function(){return Te},__EXPERIMENTAL_STYLE_PROPERTY:function(){return we},__experimentalCloneSanitizedBlock:function(){return dt},__experimentalGetAccessibleBlockLabel:function(){return Et},__experimentalGetBlockAttributesNamesByRole:function(){return Nt},__experimentalGetBlockLabel:function(){return St},__experimentalSanitizeBlockAttributes:function(){return Bt},__unstableGetBlockProps:function(){return ir},__unstableGetInnerBlocksProps:function(){return sr},__unstableSerializeAndClean:function(){return hr},children:function(){return mn},cloneBlock:function(){return pt},createBlock:function(){return lt},createBlocksFromInnerBlocksTemplate:function(){return ut},doBlocksMatchTemplate:function(){return ba},findTransform:function(){return bt},getBlockAttributes:function(){return vn},getBlockContent:function(){return dr},getBlockDefaultClassName:function(){return rr},getBlockFromExample:function(){return yt},getBlockMenuDefaultClassName:function(){return nr},getBlockSupport:function(){return $e},getBlockTransforms:function(){return _t},getBlockType:function(){return He},getBlockTypes:function(){return Re},getBlockVariations:function(){return Ze},getCategories:function(){return fa},getChildBlockNames:function(){return Ge},getDefaultBlockName:function(){return Ve},getFreeformContentHandlerName:function(){return Me},getGroupingBlockName:function(){return De},getPhrasingContentSchema:function(){return Fn},getPossibleBlockTransformations:function(){return mt},getSaveContent:function(){return lr},getSaveElement:function(){return cr},getUnregisteredTypeHandlerName:function(){return ze},hasBlockSupport:function(){return Fe},hasChildBlocks:function(){return Ke},hasChildBlocksWithInserterSupport:function(){return We},isReusableBlock:function(){return qe},isTemplatePart:function(){return Ue},isUnmodifiedDefaultBlock:function(){return vt},isValidBlockContent:function(){return en},isValidIcon:function(){return Tt},node:function(){return pn},normalizeIconObject:function(){return Ct},parse:function(){return En},parseWithAttributeSchema:function(){return wn},pasteHandler:function(){return ha},rawHandler:function(){return qn},registerBlockCollection:function(){return Ae},registerBlockStyle:function(){return Ye},registerBlockType:function(){return Be},registerBlockVariation:function(){return Xe},serialize:function(){return fr},serializeRawBlock:function(){return tr},setCategories:function(){return ga},setDefaultBlockName:function(){return Oe},setFreeformContentHandlerName:function(){return Le},setGroupingBlockName:function(){return Ie},setUnregisteredTypeHandlerName:function(){return je},store:function(){return Qt},switchToBlockType:function(){return kt},synchronizeBlocksWithTemplate:function(){return _a},unregisterBlockStyle:function(){return Qe},unregisterBlockType:function(){return Pe},unregisterBlockVariation:function(){return Je},unstable__bootstrapServerSideBlockDefinitions:function(){return Se},updateCategory:function(){return ma},validateBlock:function(){return Jr},withBlockContentContext:function(){return Ta}});var e={};r.r(e),r.d(e,{__experimentalGetUnprocessedBlockTypes:function(){return w},getActiveBlockVariation:function(){return S},getBlockStyles:function(){return C},getBlockSupport:function(){return j},getBlockType:function(){return T},getBlockTypes:function(){return v},getBlockVariations:function(){return x},getCategories:function(){return B},getChildBlockNames:function(){return D},getCollections:function(){return N},getDefaultBlockName:function(){return A},getDefaultBlockVariation:function(){return E},getFreeformFallbackBlockName:function(){return P},getGroupingBlockName:function(){return M},getUnregisteredFallbackBlockName:function(){return L},hasBlockSupport:function(){return z},hasChildBlocks:function(){return I},hasChildBlocksWithInserterSupport:function(){return V},isMatchingSearchTerm:function(){return O}});var t={};r.r(t),r.d(t,{__experimentalReapplyBlockTypeFilters:function(){return zt},__experimentalRegisterBlockType:function(){return jt},addBlockCollection:function(){return Wt},addBlockStyles:function(){return It},addBlockTypes:function(){return Dt},addBlockVariations:function(){return Ht},removeBlockCollection:function(){return Yt},removeBlockStyles:function(){return Vt},removeBlockTypes:function(){return Ot},removeBlockVariations:function(){return Rt},setCategories:function(){return Gt},setDefaultBlockName:function(){return $t},setFreeformFallbackBlockName:function(){return Ft},setGroupingBlockName:function(){return Ut},setUnregisteredFallbackBlockName:function(){return qt},updateCategory:function(){return Kt}});var a=window.wp.data,o=window.lodash,i=window.wp.i18n;const s=[{slug:"text",title:(0,i.__)("Text")},{slug:"media",title:(0,i.__)("Media")},{slug:"design",title:(0,i.__)("Design")},{slug:"widgets",title:(0,i.__)("Widgets")},{slug:"theme",title:(0,i.__)("Theme")},{slug:"embed",title:(0,i.__)("Embeds")},{slug:"reusable",title:(0,i.__)("Reusable blocks")}];function c(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"REMOVE_BLOCK_TYPES":return-1!==r.names.indexOf(t)?null:t;case e:return r.name||null}return t}}const l=c("SET_DEFAULT_BLOCK_NAME"),u=c("SET_FREEFORM_FALLBACK_BLOCK_NAME"),d=c("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),p=c("SET_GROUPING_BLOCK_NAME");var h,f,g=(0,a.combineReducers)({unprocessedBlockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.blockType.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return(0,o.omit)(e,t.names)}return e},blockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,o.keyBy)(t.blockTypes,"name")};case"REMOVE_BLOCK_TYPES":return(0,o.omit)(e,t.names)}return e},blockStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,o.mapValues)((0,o.keyBy)(t.blockTypes,"name"),(t=>(0,o.uniqBy)([...(0,o.get)(t,["styles"],[]).map((e=>({...e,source:"block"}))),...(0,o.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))],(e=>e.name))))};case"ADD_BLOCK_STYLES":return{...e,[t.blockName]:(0,o.uniqBy)([...(0,o.get)(e,[t.blockName],[]),...t.styles],(e=>e.name))};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(0,o.filter)((0,o.get)(e,[t.blockName],[]),(e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,o.mapValues)((0,o.keyBy)(t.blockTypes,"name"),(t=>(0,o.uniqBy)([...(0,o.get)(t,["variations"],[]).map((e=>({...e,source:"block"}))),...(0,o.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))],(e=>e.name))))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,o.uniqBy)([...(0,o.get)(e,[t.blockName],[]),...t.variations],(e=>e.name))};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,o.filter)((0,o.get)(e,[t.blockName],[]),(e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:l,freeformFallbackBlockName:u,unregisteredFallbackBlockName:d,groupingBlockName:p,categories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||(0,o.isEmpty)(t.category))return e;if((0,o.find)(e,["slug",t.slug]))return(0,o.map)(e,(e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return(0,o.omit)(e,t.namespace)}return e}});function m(e){return[e]}function b(){var e={clear:function(){e.head=null}};return e}function _(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n"string"==typeof t?T(e,t):t;function w(e){return e.unprocessedBlockTypes}const v=k((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function T(e,t){return e.blockTypes[t]}function C(e,t){return e.blockStyles[t]}const x=k(((e,t,r)=>{const n=e.blockVariations[t];return n&&r?n.filter((e=>(e.scope||["block","inserter"]).includes(r))):n}),((e,t)=>[e.blockVariations[t]]));function S(e,t,r,n){const a=x(e,t,n);return null==a?void 0:a.find((n=>{var a;if(Array.isArray(n.isActive)){const a=T(e,t),o=Object.keys((null==a?void 0:a.attributes)||{}),i=n.isActive.filter((e=>o.includes(e)));return 0!==i.length&&i.every((e=>r[e]===n.attributes[e]))}return null===(a=n.isActive)||void 0===a?void 0:a.call(n,r,n.attributes)}))}function E(e,t,r){const n=x(e,t,r);return(0,o.findLast)(n,"isDefault")||(0,o.first)(n)}function B(e){return e.categories}function N(e){return e.collections}function A(e){return e.defaultBlockName}function P(e){return e.freeformFallbackBlockName}function L(e){return e.unregisteredFallbackBlockName}function M(e){return e.groupingBlockName}const D=k(((e,t)=>(0,o.map)((0,o.filter)(e.blockTypes,(e=>(0,o.includes)(e.parent,t))),(e=>{let{name:t}=e;return t}))),(e=>[e.blockTypes])),j=(e,t,r,n)=>{const a=y(e,t);return null!=a&&a.supports?(0,o.get)(a.supports,r,n):n};function z(e,t,r,n){return!!j(e,t,r,n)}function O(e,t,r){const n=y(e,t),a=(0,o.flow)([o.deburr,e=>e.toLowerCase(),e=>e.trim()]),i=a(r),s=(0,o.flow)([a,e=>(0,o.includes)(e,i)]);return s(n.title)||(0,o.some)(n.keywords,s)||s(n.category)||s(n.description)}const I=(e,t)=>D(e,t).length>0,V=(e,t)=>(0,o.some)(D(e,t),(t=>z(e,t,"inserter",!0)));var H=window.wp.hooks,R={grad:.9,turn:360,rad:360/(2*Math.PI)},$=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},F=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},q=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},U=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},G=function(e){return{r:q(e.r,0,255),g:q(e.g,0,255),b:q(e.b,0,255),a:q(e.a)}},K=function(e){return{r:F(e.r),g:F(e.g),b:F(e.b),a:F(e.a,3)}},W=/^#([0-9a-f]{3,8})$/i,Y=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Q=function(e){var t=e.r,r=e.g,n=e.b,a=e.a,o=Math.max(t,r,n),i=o-Math.min(t,r,n),s=i?o===t?(r-n)/i:o===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(s<0?s+6:s),s:o?i/o*100:0,v:o/255*100,a:a}},Z=function(e){var t=e.h,r=e.s,n=e.v,a=e.a;t=t/360*6,r/=100,n/=100;var o=Math.floor(t),i=n*(1-r),s=n*(1-(t-o)*r),c=n*(1-(1-t+o)*r),l=o%6;return{r:255*[n,s,i,i,c,n][l],g:255*[c,n,n,s,i,i][l],b:255*[i,i,c,n,n,s][l],a:a}},X=function(e){return{h:U(e.h),s:q(e.s,0,100),l:q(e.l,0,100),a:q(e.a)}},J=function(e){return{h:F(e.h),s:F(e.s),l:F(e.l),a:F(e.a,3)}},ee=function(e){return Z((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},te=function(e){return{h:(t=Q(e)).h,s:(a=(200-(r=t.s))*(n=t.v)/100)>0&&a<200?r*n/100/(a<=100?a:200-a)*100:0,l:a/2,a:t.a};var t,r,n,a},re=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ne=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ae=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ie={string:[[function(e){var t=W.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?F(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?F(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=ae.exec(e)||oe.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:G({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=re.exec(e)||ne.exec(e);if(!t)return null;var r,n,a=X({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(R[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ee(a)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,a=e.a,o=void 0===a?1:a;return $(t)&&$(r)&&$(n)?G({r:Number(t),g:Number(r),b:Number(n),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,a=e.a,o=void 0===a?1:a;if(!$(t)||!$(r)||!$(n))return null;var i=X({h:Number(t),s:Number(r),l:Number(n),a:Number(o)});return ee(i)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,a=e.a,o=void 0===a?1:a;if(!$(t)||!$(r)||!$(n))return null;var i=function(e){return{h:U(e.h),s:q(e.s,0,100),v:q(e.v,0,100),a:q(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(o)});return Z(i)},"hsv"]]},se=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=K(this.rgba)).r,r=e.g,n=e.b,o=(a=e.a)<1?Y(F(255*a)):"","#"+Y(t)+Y(r)+Y(n)+o;var e,t,r,n,a,o},e.prototype.toRgb=function(){return K(this.rgba)},e.prototype.toRgbString=function(){return t=(e=K(this.rgba)).r,r=e.g,n=e.b,(a=e.a)<1?"rgba("+t+", "+r+", "+n+", "+a+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,a},e.prototype.toHsl=function(){return J(te(this.rgba))},e.prototype.toHslString=function(){return t=(e=J(te(this.rgba))).h,r=e.s,n=e.l,(a=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+a+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,a},e.prototype.toHsv=function(){return e=Q(this.rgba),{h:F(e.h),s:F(e.s),v:F(e.v),a:F(e.a,3)};var e},e.prototype.invert=function(){return he({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),he(le(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),he(le(this.rgba,-e))},e.prototype.grayscale=function(){return he(le(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),he(de(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),he(de(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?he({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):F(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=te(this.rgba);return"number"==typeof e?he({h:e,s:t.s,l:t.l,a:t.a}):F(t.h)},e.prototype.isEqual=function(e){return this.toHex()===he(e).toHex()},e}(),he=function(e){return e instanceof pe?e:new pe(e)},fe=[];var ge=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},me=function(e){return.2126*ge(e.r)+.7152*ge(e.g)+.0722*ge(e.b)};var be=window.wp.element,_e=window.wp.dom;const ke="block-default",ye=["attributes","supports","save","migrate","isEligible","apiVersion"],we={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},background:{value:["color","gradient"],support:["color","gradients"]},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"]},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"}},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"]},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"]},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0},filter:{value:["filter","duotone"],support:["color","__experimentalDuotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"]},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"]},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"]},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"]},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"]},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"]},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"]},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"]},"--wp--style--block-gap":{value:["spacing","blockGap"],support:["spacing","blockGap"]}},ve={link:"a",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},Te={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"typography.fontFamilies":!0,"typography.fontSizes":!0},Ce={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]},xe={};function Se(e){for(const t of Object.keys(e))xe[t]?(void 0===xe[t].apiVersion&&e[t].apiVersion&&(xe[t].apiVersion=e[t].apiVersion),void 0===xe[t].ancestor&&e[t].ancestor&&(xe[t].ancestor=e[t].ancestor)):xe[t]=(0,o.mapKeys)((0,o.pickBy)(e[t],(e=>!(0,o.isNil)(e))),((e,t)=>(0,o.camelCase)(t)))}function Ee(e){let{textdomain:t,...r}=e;const n=(0,o.pick)(r,["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","supports","styles","example","variations"]);return t&&Object.keys(Ce).forEach((e=>{n[e]&&(n[e]=Ne(Ce[e],n[e],t))})),n}function Be(e,t){const r=(0,o.isObject)(e)?e.name:e;if("string"!=typeof r)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(r))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,a.select)(Qt).getBlockType(r))return void console.error('Block "'+r+'" is already registered.');(0,o.isObject)(e)&&Se({[r]:Ee(e)});const n={name:r,icon:ke,keywords:[],attributes:{},providesContext:{},usesContext:[],supports:{},styles:[],variations:[],save:()=>null,...null==xe?void 0:xe[r],...t};return(0,a.dispatch)(Qt).__experimentalRegisterBlockType(n),(0,a.select)(Qt).getBlockType(r)}function Ne(e,t,r){return(0,o.isString)(e)&&(0,o.isString)(t)?(0,i._x)(t,e,r):(0,o.isArray)(e)&&!(0,o.isEmpty)(e)&&(0,o.isArray)(t)?t.map((t=>Ne(e[0],t,r))):(0,o.isObject)(e)&&!(0,o.isEmpty)(e)&&(0,o.isObject)(t)?Object.keys(t).reduce(((n,a)=>e[a]?(n[a]=Ne(e[a],t[a],r),n):(n[a]=t[a],n)),{}):t}function Ae(e,t){let{title:r,icon:n}=t;(0,a.dispatch)(Qt).addBlockCollection(e,r,n)}function Pe(e){const t=(0,a.select)(Qt).getBlockType(e);if(t)return(0,a.dispatch)(Qt).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}function Le(e){(0,a.dispatch)(Qt).setFreeformFallbackBlockName(e)}function Me(){return(0,a.select)(Qt).getFreeformFallbackBlockName()}function De(){return(0,a.select)(Qt).getGroupingBlockName()}function je(e){(0,a.dispatch)(Qt).setUnregisteredFallbackBlockName(e)}function ze(){return(0,a.select)(Qt).getUnregisteredFallbackBlockName()}function Oe(e){(0,a.dispatch)(Qt).setDefaultBlockName(e)}function Ie(e){(0,a.dispatch)(Qt).setGroupingBlockName(e)}function Ve(){return(0,a.select)(Qt).getDefaultBlockName()}function He(e){var t;return null===(t=(0,a.select)(Qt))||void 0===t?void 0:t.getBlockType(e)}function Re(){return(0,a.select)(Qt).getBlockTypes()}function $e(e,t,r){return(0,a.select)(Qt).getBlockSupport(e,t,r)}function Fe(e,t,r){return(0,a.select)(Qt).hasBlockSupport(e,t,r)}function qe(e){return"core/block"===(null==e?void 0:e.name)}function Ue(e){return"core/template-part"===e.name}const Ge=e=>(0,a.select)(Qt).getChildBlockNames(e),Ke=e=>(0,a.select)(Qt).hasChildBlocks(e),We=e=>(0,a.select)(Qt).hasChildBlocksWithInserterSupport(e),Ye=(e,t)=>{(0,a.dispatch)(Qt).addBlockStyles(e,t)},Qe=(e,t)=>{(0,a.dispatch)(Qt).removeBlockStyles(e,t)},Ze=(e,t)=>(0,a.select)(Qt).getBlockVariations(e,t),Xe=(e,t)=>{(0,a.dispatch)(Qt).addBlockVariations(e,t)},Je=(e,t)=>{(0,a.dispatch)(Qt).removeBlockVariations(e,t)};var et,tt=new Uint8Array(16);function rt(){if(!et&&!(et="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return et(tt)}var nt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var at=function(e){return"string"==typeof e&&nt.test(e)},ot=[],it=0;it<256;++it)ot.push((it+256).toString(16).substr(1));var st=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(ot[e[t+0]]+ot[e[t+1]]+ot[e[t+2]]+ot[e[t+3]]+"-"+ot[e[t+4]]+ot[e[t+5]]+"-"+ot[e[t+6]]+ot[e[t+7]]+"-"+ot[e[t+8]]+ot[e[t+9]]+"-"+ot[e[t+10]]+ot[e[t+11]]+ot[e[t+12]]+ot[e[t+13]]+ot[e[t+14]]+ot[e[t+15]]).toLowerCase();if(!at(r))throw TypeError("Stringified UUID is invalid");return r};var ct=function(e,t,r){var n=(e=e||{}).random||(e.rng||rt)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return st(n)};function lt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=Bt(e,t),a=ct();return{clientId:a,name:e,isValid:!0,attributes:n,innerBlocks:r}}function ut(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[r,n,a=[]]=t;return lt(r,n,ut(a))}))}function dt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const n=ct(),a=Bt(e.name,{...e.attributes,...t});return{...e,clientId:n,attributes:a,innerBlocks:r||e.innerBlocks.map((e=>dt(e)))}}function pt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const n=ct();return{...e,clientId:n,attributes:{...e.attributes,...t},innerBlocks:r||e.innerBlocks.map((e=>pt(e)))}}const ht=(e,t,r)=>{if((0,o.isEmpty)(r))return!1;const n=r.length>1,a=(0,o.first)(r).name;if(!(ft(e)||!n||e.isMultiBlock))return!1;if(!ft(e)&&!(0,o.every)(r,{name:a}))return!1;if(!("block"===e.type))return!1;const i=(0,o.first)(r);if(!("from"!==t||-1!==e.blocks.indexOf(i.name)||ft(e)))return!1;if(!n&>(i.name)&>(e.blockName))return!1;if((0,o.isFunction)(e.isMatch)){const t=e.isMultiBlock?r.map((e=>e.attributes)):i.attributes,n=e.isMultiBlock?r:i;if(!e.isMatch(t,n))return!1}return!(e.usingMobileTransformations&&ft(e)&&!gt(i.name))},ft=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),gt=e=>e===De();function mt(e){if((0,o.isEmpty)(e))return[];const t=(e=>{if((0,o.isEmpty)(e))return[];const t=Re();return(0,o.filter)(t,(t=>!!bt(_t("from",t.name),(t=>ht(t,"from",e)))))})(e),r=(e=>{if((0,o.isEmpty)(e))return[];const t=He((0,o.first)(e).name),r=t?_t("to",t.name):[],n=(0,o.filter)(r,(t=>t&&ht(t,"to",e)));return(0,o.flatMap)(n,(e=>e.blocks)).map((e=>"*"===e?e:He(e)))})(e);return(0,o.uniq)([...t,...r])}function bt(e,t){const r=(0,H.createHooks)();for(let n=0;ne||a),a.priority)}return r.applyFilters("transform",null)}function _t(e,t){if(void 0===t)return(0,o.flatMap)(Re(),(t=>{let{name:r}=t;return _t(e,r)}));const r=xt(t),{name:n,transforms:a}=r||{};if(!a||!Array.isArray(a[e]))return[];const i=a.supportedMobileTransforms&&Array.isArray(a.supportedMobileTransforms),s=i?(0,o.filter)(a[e],(e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!ft(e)||(0,o.every)(e.blocks,(e=>a.supportedMobileTransforms.includes(e)))))):a[e];return s.map((e=>({...e,blockName:n,usingMobileTransformations:i})))}function kt(e,t){const r=(0,o.castArray)(e),n=r.length>1,a=r[0],i=a.name,s=_t("from",t),c=bt(_t("to",i),(e=>"block"===e.type&&(ft(e)||-1!==e.blocks.indexOf(t))&&(!n||e.isMultiBlock)))||bt(s,(e=>"block"===e.type&&(ft(e)||-1!==e.blocks.indexOf(i))&&(!n||e.isMultiBlock)));if(!c)return null;let l;if(l=c.isMultiBlock?(0,o.has)(c,"__experimentalConvert")?c.__experimentalConvert(r):c.transform(r.map((e=>e.attributes)),r.map((e=>e.innerBlocks))):(0,o.has)(c,"__experimentalConvert")?c.__experimentalConvert(a):c.transform(a.attributes,a.innerBlocks),!(0,o.isObjectLike)(l))return null;if(l=(0,o.castArray)(l),l.some((e=>!He(e.name))))return null;if(!("*"===t||(0,o.some)(l,(e=>e.name===t))))return null;return l.map(((t,r,n)=>(0,H.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,r,n)))}const yt=(e,t)=>lt(e,t.attributes,(0,o.map)(t.innerBlocks,(e=>yt(e.name,e))));!function(e){e.forEach((function(e){fe.indexOf(e)<0&&(e(pe,ie),fe.push(e))}))}([function(e,t){var r={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"},n={};for(var a in r)n[r[a]]=a;var o={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,i,s=n[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var c=this.toRgb(),l=1/0,u="black";if(!o.length)for(var d in r)o[d]=new e(r[d]).toRgb();for(var p in r){var h=(a=c,i=o[p],Math.pow(a.r-i.r,2)+Math.pow(a.g-i.g,2)+Math.pow(a.b-i.b,2));h(c=me(i))?(s+.05)/(c+.05):(c+.05)/(s+.05),void 0===(n=2)&&(n=0),void 0===a&&(a=Math.pow(10,n)),Math.floor(a*r)/a+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(o=(r=t).size)?"normal":o,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===i?7:"AA"===a&&"large"===i?3:4.5);var r,n,a,o,i}}]);const wt=["#191e23","#f8f9f9"];function vt(e){const t=Ve();if(e.name!==t)return!1;vt.block&&vt.block.name===t||(vt.block=lt(t));const r=vt.block,n=He(t);return(0,o.every)(null==n?void 0:n.attributes,((t,n)=>r.attributes[n]===e.attributes[n]))}function Tt(e){return!!e&&((0,o.isString)(e)||(0,be.isValidElement)(e)||(0,o.isFunction)(e)||e instanceof be.Component)}function Ct(e){if(Tt(e=e||ke))return{src:e};if((0,o.has)(e,["background"])){const t=he(e.background);return{...e,foreground:e.foreground?e.foreground:(0,o.maxBy)(wt,(e=>t.contrast(e))),shadowColor:t.alpha(.3).toRgbString()}}return e}function xt(e){return(0,o.isString)(e)?He(e):e}function St(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visual";const{__experimentalLabel:n,title:a}=e,o=n&&n(t,{context:r});return o?(0,_e.__unstableStripHTML)(o):a}function Et(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vertical";const a=null==e?void 0:e.title,o=e?St(e,t,"accessibility"):"",s=void 0!==r,c=o&&o!==a;return s&&"vertical"===n?c?(0,i.sprintf)((0,i.__)("%1$s Block. Row %2$d. %3$s"),a,r,o):(0,i.sprintf)((0,i.__)("%1$s Block. Row %2$d"),a,r):s&&"horizontal"===n?c?(0,i.sprintf)((0,i.__)("%1$s Block. Column %2$d. %3$s"),a,r,o):(0,i.sprintf)((0,i.__)("%1$s Block. Column %2$d"),a,r):c?(0,i.sprintf)((0,i.__)("%1$s Block. %2$s"),a,o):(0,i.sprintf)((0,i.__)("%s Block"),a)}function Bt(e,t){const r=He(e);if(void 0===r)throw new Error(`Block type '${e}' is not registered.`);return(0,o.reduce)(r.attributes,((e,r,n)=>{const a=t[n];return void 0!==a?e[n]=a:r.hasOwnProperty("default")&&(e[n]=r.default),-1!==["node","children"].indexOf(r.source)&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e}),{})}function Nt(e,t){var r;const n=null===(r=He(e))||void 0===r?void 0:r.attributes;if(!n)return[];const a=Object.keys(n);return t?a.filter((e=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.__experimentalRole)===t})):a}const{error:At,warn:Pt}=window.console,Lt={common:"text",formatting:"text",layout:"design"},Mt=(e,t)=>{let{select:r}=t;const{name:n}=e,a=(0,H.applyFilters)("blocks.registerBlockType",{...e},n);if(a.deprecated&&(a.deprecated=a.deprecated.map((t=>(0,o.pick)((0,H.applyFilters)("blocks.registerBlockType",{...(0,o.omit)(e,ye),...t},n),ye)))),(0,o.isPlainObject)(a))if((0,o.isFunction)(a.save))if(!("edit"in a)||(0,o.isFunction)(a.edit))if(Lt.hasOwnProperty(a.category)&&(a.category=Lt[a.category]),"category"in a&&!(0,o.some)(r.getCategories(),{slug:a.category})&&(Pt('The block "'+n+'" is registered with an invalid category "'+a.category+'".'),delete a.category),"title"in a&&""!==a.title)if("string"==typeof a.title){if(a.icon=Ct(a.icon),Tt(a.icon.src))return a;At("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional")}else At("Block titles must be strings.");else At('The block "'+n+'" must have a title.');else At('The "edit" property must be a valid function.');else At('The "save" property must be a valid function.');else At("Block settings must be a valid object.")};function Dt(e){return{type:"ADD_BLOCK_TYPES",blockTypes:(0,o.castArray)(e)}}const jt=e=>t=>{let{dispatch:r,select:n}=t;r({type:"ADD_UNPROCESSED_BLOCK_TYPE",blockType:e});const a=Mt(e,{select:n});a&&r.addBlockTypes(a)},zt=()=>e=>{let{dispatch:t,select:r}=e;const n=r.__experimentalGetUnprocessedBlockTypes(),a=Object.keys(n).reduce(((e,t)=>{const a=Mt(n[t],{select:r});return a&&e.push(a),e}),[]);a.length&&t.addBlockTypes(a)};function Ot(e){return{type:"REMOVE_BLOCK_TYPES",names:(0,o.castArray)(e)}}function It(e,t){return{type:"ADD_BLOCK_STYLES",styles:(0,o.castArray)(t),blockName:e}}function Vt(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:(0,o.castArray)(t),blockName:e}}function Ht(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:(0,o.castArray)(t),blockName:e}}function Rt(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:(0,o.castArray)(t),blockName:e}}function $t(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function Ft(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function qt(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Ut(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Gt(e){return{type:"SET_CATEGORIES",categories:e}}function Kt(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Wt(e,t,r){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:r}}function Yt(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const Qt=(0,a.createReduxStore)("core/blocks",{reducer:g,selectors:e,actions:t});(0,a.register)(Qt);var Zt=window.wp.blockSerializationDefaultParser,Xt=window.wp.autop,Jt=window.wp.isShallowEqual,er=r.n(Jt);function tr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isCommentDelimited:r=!0}=t,{blockName:n,attrs:a={},innerBlocks:o=[],innerContent:i=[]}=e;let s=0;const c=i.map((e=>null!==e?e:tr(o[s++],t))).join("\n").replace(/\n+/g,"\n").trim();return r?pr(n,a,c):c}function rr(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,H.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function nr(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,H.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const ar={},or={};function ir(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blockType:t,attributes:r}=ar;return(0,H.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,r)}function sr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{innerBlocks:t}=or,r=fr(t,{isInnerBlocks:!0}),n=(0,be.createElement)(be.RawHTML,null,r);return{...e,children:n}}function cr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=xt(e);let{save:a}=n;if(a.prototype instanceof be.Component){const e=new a({attributes:t});a=e.render.bind(e)}ar.blockType=n,ar.attributes=t,or.innerBlocks=r;let i=a({attributes:t,innerBlocks:r});if((0,o.isObject)(i)&&(0,H.hasFilter)("blocks.getSaveContent.extraProps")&&!(n.apiVersion>1)){const e=(0,H.applyFilters)("blocks.getSaveContent.extraProps",{...i.props},n,t);er()(e,i.props)||(i=(0,be.cloneElement)(i,e))}return(0,H.applyFilters)("blocks.getSaveElement",i,n,t)}function lr(e,t,r){const n=xt(e);return(0,be.renderToString)(cr(n,t,r))}function ur(e,t){return(0,o.reduce)(e.attributes,((e,r,n)=>{const a=t[n];return void 0===a||void 0!==r.source||"default"in r&&r.default===a||(e[n]=a),e}),{})}function dr(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=lr(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function pr(e,t,r){const n=(0,o.isEmpty)(t)?"":function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ",a=(0,o.startsWith)(e,"core/")?e.slice(5):e;return r?`\x3c!-- wp:${a} ${n}--\x3e\n`+r+`\n\x3c!-- /wp:${a} --\x3e`:`\x3c!-- wp:${a} ${n}/--\x3e`}function hr(e){1===e.length&&vt(e[0])&&(e=[]);let t=fr(e);return 1===e.length&&e[0].name===Me()&&(t=(0,Xt.removep)(t)),t}function fr(e,t){return(0,o.castArray)(e).map((e=>function(e){let{isInnerBlocks:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.isValid&&e.__unstableBlockSource)return tr(e.__unstableBlockSource);const r=e.name,n=dr(e);if(r===ze()||!t&&r===Me())return n;const a=ur(He(r),e.attributes);return pr(r,a,n)}(e,t))).join("\n\n")}var gr=/^#[xX]([A-Fa-f0-9]+)$/,mr=/^#([0-9]+)$/,br=/^([A-Za-z0-9]+)$/,_r=(function(){function e(e){this.named=e}e.prototype.parse=function(e){if(e){var t=e.match(gr);return t?String.fromCharCode(parseInt(t[1],16)):(t=e.match(mr))?String.fromCharCode(parseInt(t[1],10)):(t=e.match(br))?this.named[t[1]]:void 0}}}(),/[\t\n\f ]/),kr=/[A-Za-z]/,yr=/\r\n?/g;function wr(e){return _r.test(e)}function vr(e){return kr.test(e)}var Tr=function(){function e(e,t,r){void 0===r&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||vr(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){wr(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();wr(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();wr(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!wr(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),r="PUBLIC"===t.toUpperCase(),n="SYSTEM"===t.toUpperCase();(r||n)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),r?this.transitionTo("afterDoctypePublicKeyword"):n&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();wr(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();wr(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();wr(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();wr(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();wr(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();wr(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();wr(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();wr(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();wr(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();wr(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();wr(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();wr(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||vr(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(yr,"\n")}(e);this.index"!==this.input.substring(this.index,this.index+8)||"style"===e&&""!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),Cr=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new Tr(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;t1?r-1:0),a=1;a[]}}function Nr(){const e=[],t=Br();return{error(){for(var r=arguments.length,n=new Array(r),a=0;ae}}const Ar=/[\t\n\r\v\f ]+/g,Pr=/^[\t\n\r\v\f ]*$/,Lr=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Mr=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],Dr=[...Mr,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],jr=[o.identity,function(e){return Hr(e).join(" ")}],zr=/^[\da-z]+$/i,Or=/^#\d+$/,Ir=/^#x[\da-f]+$/i;class Vr{parse(e){if(t=e,zr.test(t)||Or.test(t)||Ir.test(t))return(0,Er.decodeEntities)("&"+e+";");var t}}function Hr(e){return e.trim().split(Ar)}function Rr(e){return e.attributes.filter((e=>{const[t,r]=e;return r||0===t.indexOf("data-")||(0,o.includes)(Dr,t)}))}function $r(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Br(),n=e.chars,a=t.chars;for(let e=0;e{const[t,...r]=e.split(":"),n=r.join(":");return[t.trim(),qr(n.trim())]}));return(0,o.fromPairs)(t)}const Gr={class:(e,t)=>!(0,o.xor)(...[e,t].map(Hr)).length,style:(e,t)=>(0,o.isEqual)(...[e,t].map(Ur)),...(0,o.fromPairs)(Mr.map((e=>[e,o.stubTrue])))};function Kr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Br();if(e.length!==t.length)return r.warning("Expected attributes %o, instead saw %o.",t,e),!1;const n={};for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:Br();return e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(r.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):Kr(...[e,t].map(Rr),r)},Chars:$r,Comment:$r};function Yr(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!Pr.test(t.chars))return t}}function Qr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Br();try{return new Cr(new Vr).tokenize(e)}catch(r){t.warning("Malformed HTML detected: %s",e)}return null}function Zr(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function Xr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Br();if(e===t)return!0;const[n,a]=[e,t].map((e=>Qr(e,r)));if(!n||!a)return!1;let o,i;for(;o=Yr(n);){if(i=Yr(a),!i)return r.warning("Expected end of content, instead saw %o.",o),!1;if(o.type!==i.type)return r.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,o.type,o),!1;const e=Wr[o.type];if(e&&!e(o,i,r))return!1;Zr(o,a[0])?Yr(a):Zr(i,n[0])&&Yr(n)}return!(i=Yr(a))||(r.warning("Expected %o, instead saw end of content.",i),!1)}function Jr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.name;const r=e.name===Me()||e.name===ze();if(r)return[!0,[]];const n=Nr(),a=xt(t);let o;try{o=lr(a,e.attributes)}catch(e){return n.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,n.getItems()]}const i=Xr(e.originalContent,o,n);return i||n.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",a.name,a,o,e.originalContent),[i,n.getItems()]}function en(e,t,r){Sr()("isValidBlockContent introduces opportunity for data loss",{since:"12.6",plugin:"Gutenberg",alternative:"validateBlock"});const n=xt(e),a={name:n.name,attributes:t,innerBlocks:[],originalContent:r},[o]=Jr(a,n);return o}function tn(e,t){const r={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(r.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),n={speaker:"speaker-deck",polldaddy:"crowdsignal"};r.providerNameSlug=t in n?n[t]:t,["amazon-kindle","wordpress"].includes(t)||(r.responsive=!0),e="core/embed"}return"core/query-loop"===e&&(e="core/post-template"),"core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),[e,r]}function rn(e,t){for(var r,n=t.split(".");r=n.shift();){if(!(r in e))return;e=e[r]}return e}var nn,an=function(){return nn||(nn=document.implementation.createHTMLDocument("")),nn};function on(e,t){if(t){if("string"==typeof e){var r=an();r.body.innerHTML=e,e=r.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(r,n){return r[n]=on(e,t[n]),r}),{})}}function sn(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=r;if(e&&(n=r.querySelector(e)),n)return rn(n,t)}}var cn=r(9756);function ln(e){const t={};for(let r=0;r{let r=t;e&&(r=t.querySelector(e));try{return un(r)}catch(e){return null}}}var pn={isNodeOfType:function(e,t){return e&&e.type===t},fromDOM:un,toHTML:function(e){return fn([e])},matcher:dn};function hn(e){const t=[];for(let r=0;r{let r=t;return e&&(r=t.querySelector(e)),r?hn(r.childNodes):[]}}var mn={concat:function(){const e=[];for(let t=0;tfunction(e,t){switch(t){case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}function _n(e,t,r,n){let a;switch(t.source){case void 0:a=n?n[e]:void 0;break;case"attribute":case"property":case"html":case"text":case"children":case"node":case"query":case"tag":a=wn(r,t)}return function(e,t){return void 0===t||bn(e,(0,o.castArray)(t))}(a,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(a,t.enum)||(a=void 0),void 0===a&&(a=t.default),a}const kn=r.n(cn)()((e=>{switch(e.source){case"attribute":let n=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=sn(e,"attributes")(r);if(n&&n.hasOwnProperty(t))return n[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(n=(e=>(0,o.flow)([e,e=>void 0!==e]))(n)),n;case"html":return t=e.selector,r=e.multiline,e=>{let n=e;if(t&&(n=e.querySelector(t)),!n)return"";if(r){let e="";const t=n.children.length;for(let a=0;ae?e.toLowerCase():void 0]);default:console.error(`Unknown source type "${e.source}"`)}var t,r}));function yn(e){return on(e,(e=>e))}function wn(e,t){return kn(t)(yn(e))}function vn(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=yn(t),a=xt(e),i=(0,o.mapValues)(a.attributes,((e,t)=>_n(t,e,n,r)));return(0,H.applyFilters)("blocks.getBlockAttributes",i,a,t,r)}const Tn={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Cn(e){const t=wn(`